source: rtems/c/src/lib/libcpu/hppa1.1/include/semaphore.h @ 362ec23e

4.104.114.84.95
Last change on this file since 362ec23e was 9af31a6, checked in by Joel Sherrill <joel.sherrill@…>, on 11/09/99 at 02:32:37

Moved include files to hppa1.1 subdirectory and put their sources
in the include directory.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*
2 *  Description:
3 *      HPPA fast spinlock semaphores based on LDCWX instruction.
4 *      These semaphores are not known to RTEMS.
5 *
6 *  TODO:
7 *
8 *  COPYRIGHT (c) 1994,95 by Division Incorporated
9 *
10 *  The license and distribution terms for this file may be
11 *  found in the file LICENSE in this distribution or at
12 *  http://www.OARcorp.com/rtems/license.html.
13 *
14 *  $Id$
15 */
16
17#ifndef _INCLUDE_HPPA1_1_SEMAPHORE_H
18#define _INCLUDE_HPPA1_1_SEMAPHORE_H
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/*
25 * This structure has hardware requirements.
26 * LDCWX opcode requires 16byte alignment for the lock
27 * 'lock' must be first member of structure.
28 */
29
30#define SEM_ALIGN  16
31
32typedef volatile struct {
33
34    rtems_unsigned32 lock __attribute__ ((aligned (SEM_ALIGN)));
35
36    rtems_unsigned32 flags;
37
38    void *owner_tcb;            /* for debug/commentary only */
39
40    rtems_unsigned32 user;      /* for use by user */
41
42} hppa_semaphore_t;
43
44/*
45 * Values for flags
46 */
47
48#define HPPA_SEM_IN_USE            0x0001  /* semaphore owned by somebody */
49#define HPPA_SEM_NO_SPIN           0x0002  /* don't spin if unavailable */
50#define HPPA_SEM_INITIALLY_FREE    0x0004  /* init it to be free */
51
52/*
53 * Caller specifiable flags
54 */
55
56#define HPPA_SEM_CALLER_FLAGS (HPPA_SEM_NO_SPIN | HPPA_SEM_INITIALLY_FREE)
57
58void hppa_semaphore_pool_initialize(void *pool_base, int pool_size);
59
60rtems_unsigned32  hppa_semaphore_acquire(hppa_semaphore_t *sp, int flag);
61
62void hppa_semaphore_release(hppa_semaphore_t *sp);
63
64hppa_semaphore_t *hppa_semaphore_allocate(rtems_unsigned32 which, int flag);
65
66#ifdef __cplusplus
67}
68#endif
69
70#endif /* ! _INCLUDE_SEMAPHORE_H */
Note: See TracBrowser for help on using the repository browser.