5
Last change
on this file since a2dad96 was
1efa1c8,
checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 11:38:33
|
bsps: Move MPCI support to bsps
This patch is a part of the BSP source reorganization.
Update #3285.
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Rev | Line | |
---|
[8961188] | 1 | /* Shared Memory Lock Routines |
---|
| 2 | * |
---|
| 3 | * This shared memory locked queue support routine need to be |
---|
| 4 | * able to lock the specified locked queue. Interrupts are |
---|
| 5 | * disabled while the queue is locked to prevent preemption |
---|
| 6 | * and deadlock when two tasks poll for the same lock. |
---|
| 7 | * previous level. |
---|
| 8 | * |
---|
[39cc10a] | 9 | * COPYRIGHT (c) 1989-2008. |
---|
[8961188] | 10 | * On-Line Applications Research Corporation (OAR). |
---|
| 11 | * |
---|
| 12 | * The license and distribution terms for this file may in |
---|
| 13 | * the file LICENSE in this distribution or at |
---|
[c499856] | 14 | * http://www.rtems.org/license/LICENSE. |
---|
[8961188] | 15 | */ |
---|
| 16 | |
---|
| 17 | #include <rtems.h> |
---|
| 18 | #include <bsp.h> |
---|
[48bfd992] | 19 | #include <shm_driver.h> |
---|
[39cc10a] | 20 | #include <psim.h> |
---|
[8961188] | 21 | |
---|
| 22 | /* |
---|
| 23 | * Shm_Initialize_lock |
---|
| 24 | * |
---|
| 25 | * Initialize the lock for the specified locked queue. |
---|
| 26 | */ |
---|
| 27 | |
---|
| 28 | void Shm_Initialize_lock( |
---|
| 29 | Shm_Locked_queue_Control *lq_cb |
---|
| 30 | ) |
---|
| 31 | { |
---|
| 32 | /* nothing required -- done implicitly by device tree */ |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | /* void _Shm_Lock( &lq_cb ) |
---|
| 36 | * |
---|
| 37 | * This shared memory locked queue support routine locks the |
---|
| 38 | * specified locked queue. It disables interrupts to prevent |
---|
| 39 | * a deadlock condition. |
---|
| 40 | */ |
---|
| 41 | |
---|
[252dea2f] | 42 | static rtems_interrupt_level level; |
---|
| 43 | |
---|
[8961188] | 44 | void Shm_Lock( |
---|
| 45 | Shm_Locked_queue_Control *lq_cb |
---|
| 46 | ) |
---|
| 47 | { |
---|
[252dea2f] | 48 | rtems_interrupt_disable( level ); |
---|
| 49 | (void) PSIM.Semaphore.lock; |
---|
[8961188] | 50 | } |
---|
| 51 | |
---|
| 52 | /* |
---|
| 53 | * Shm_Unlock |
---|
| 54 | * |
---|
| 55 | * Unlock the lock for the specified locked queue. |
---|
| 56 | */ |
---|
| 57 | |
---|
| 58 | void Shm_Unlock( |
---|
| 59 | Shm_Locked_queue_Control *lq_cb |
---|
| 60 | ) |
---|
| 61 | { |
---|
[252dea2f] | 62 | (void) PSIM.Semaphore.unlock; |
---|
| 63 | rtems_interrupt_enable( level ); |
---|
[8961188] | 64 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.