4.104.114.95
Line | |
---|
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 | * |
---|
9 | * COPYRIGHT (c) 1989-1997. |
---|
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 |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | #include <rtems.h> |
---|
20 | #include <bsp.h> |
---|
21 | #include <shm_driver.h> |
---|
22 | |
---|
23 | typedef volatile unsigned int volint; |
---|
24 | |
---|
25 | /* |
---|
26 | * Shm_Initialize_lock |
---|
27 | * |
---|
28 | * Initialize the lock for the specified locked queue. |
---|
29 | */ |
---|
30 | |
---|
31 | void Shm_Initialize_lock( |
---|
32 | Shm_Locked_queue_Control *lq_cb |
---|
33 | ) |
---|
34 | { |
---|
35 | /* nothing required -- done implicitly by device tree */ |
---|
36 | } |
---|
37 | |
---|
38 | /* void _Shm_Lock( &lq_cb ) |
---|
39 | * |
---|
40 | * This shared memory locked queue support routine locks the |
---|
41 | * specified locked queue. It disables interrupts to prevent |
---|
42 | * a deadlock condition. |
---|
43 | */ |
---|
44 | |
---|
45 | void Shm_Lock( |
---|
46 | Shm_Locked_queue_Control *lq_cb |
---|
47 | ) |
---|
48 | { |
---|
49 | volint *p = (volint *)0xc0010000; |
---|
50 | |
---|
51 | (void) p[1]; |
---|
52 | } |
---|
53 | |
---|
54 | /* |
---|
55 | * Shm_Unlock |
---|
56 | * |
---|
57 | * Unlock the lock for the specified locked queue. |
---|
58 | */ |
---|
59 | |
---|
60 | void Shm_Unlock( |
---|
61 | Shm_Locked_queue_Control *lq_cb |
---|
62 | ) |
---|
63 | { |
---|
64 | volint *p = (volint *)0xc0010000; |
---|
65 | |
---|
66 | (void) p[2]; |
---|
67 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.