source: rtems/c/src/lib/libbsp/powerpc/psim/shmsupp/lock.c @ f68401e

4.115
Last change on this file since f68401e was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.4 KB
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-2008.
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
17#include <rtems.h>
18#include <bsp.h>
19#include <shm_driver.h>
20#include <psim.h>
21
22/*
23 *  Shm_Initialize_lock
24 *
25 *  Initialize the lock for the specified locked queue.
26 */
27
28void 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
42static rtems_interrupt_level level;
43
44void Shm_Lock(
45  Shm_Locked_queue_Control *lq_cb
46)
47{
48  rtems_interrupt_disable( level );
49    (void) PSIM.Semaphore.lock;
50}
51
52/*
53 *  Shm_Unlock
54 *
55 *  Unlock the lock for the specified locked queue.
56 */
57
58void Shm_Unlock(
59  Shm_Locked_queue_Control *lq_cb
60)
61{
62    (void) PSIM.Semaphore.unlock;
63  rtems_interrupt_enable( level );
64}
Note: See TracBrowser for help on using the repository browser.