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

4.104.114.84.95
Last change on this file since 48bfd992 was 48bfd992, checked in by Joel Sherrill <joel.sherrill@…>, on 11/30/99 at 19:58:02

Renamed shm.h to shm_driver.h to avoid conflicts with POSIX shm.h.

Renamed file shmsupp/intr.c in some BSPs to shmsupp/cause_intr.c to
avoid conflict with rtems/src/intr.c (Classic API Interrupt Manager).

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[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 *
9 *  COPYRIGHT (c) 1989-1997.
10 *  On-Line Applications Research Corporation (OAR).
11 *  Copyright assigned to U.S. Government, 1994.
12 *
13 *  The license and distribution terms for this file may in
14 *  the file LICENSE in this distribution or at
15 *  http://www.OARcorp.com/rtems/license.html.
16 *
17 *  $Id$
18 */
19
20#include <rtems.h>
21#include <bsp.h>
[48bfd992]22#include <shm_driver.h>
[8961188]23
24typedef volatile unsigned int volint;
25
26/*
27 *  Shm_Initialize_lock
28 *
29 *  Initialize the lock for the specified locked queue.
30 */
31
32void Shm_Initialize_lock(
33  Shm_Locked_queue_Control *lq_cb
34)
35{
36  /* nothing required -- done implicitly by device tree */
37}
38
39/*  void _Shm_Lock( &lq_cb )
40 *
41 *  This shared memory locked queue support routine locks the
42 *  specified locked queue.  It disables interrupts to prevent
43 *  a deadlock condition.
44 */
45
46void Shm_Lock(
47  Shm_Locked_queue_Control *lq_cb
48)
49{
50  volint *p = (volint *)0xc0010000;
51
52  (void) p[1];
53}
54
55/*
56 *  Shm_Unlock
57 *
58 *  Unlock the lock for the specified locked queue.
59 */
60
61void Shm_Unlock(
62  Shm_Locked_queue_Control *lq_cb
63)
64{
65  volint *p = (volint *)0xc0010000;
66
67  (void) p[2];
68}
69
Note: See TracBrowser for help on using the repository browser.