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

4.104.114.84.95
Last change on this file since 73b5bd5d was 3239698, checked in by Ralf Corsepius <ralf.corsepius@…>, on 04/15/04 at 13:26:21

Remove stray white spaces.

  • Property mode set to 100644
File size: 1.3 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-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
23typedef volatile unsigned int volint;
24
25/*
26 *  Shm_Initialize_lock
27 *
28 *  Initialize the lock for the specified locked queue.
29 */
30
31void 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
45void 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
60void 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.