source: rtems/c/src/lib/libcpu/hppa1.1/semaphore/semaphore.h @ 11290355

4.104.114.84.95
Last change on this file since 11290355 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on May 11, 1995 at 5:39:37 PM

Initial revision

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 *  File:       $RCSfile$
3 *  Project:    PixelFlow
4 *  Created:    94/11/29
5 *  RespEngr:   tony e bennett
6 *  Revision:   $Revision$
7 *  Last Mod:   $Date$
8 *
9 *  COPYRIGHT (c) 1994 by Division Incorporated
10 *
11 *  To anyone who acknowledges that this file is provided "AS IS"
12 *  without any express or implied warranty:
13 *      permission to use, copy, modify, and distribute this file
14 *      for any purpose is hereby granted without fee, provided that
15 *      the above copyright notice and this notice appears in all
16 *      copies, and that the name of Division Incorporated not be
17 *      used in advertising or publicity pertaining to distribution
18 *      of the software without specific, written prior permission.
19 *      Division Incorporated makes no representations about the
20 *      suitability of this software for any purpose.
21 *
22 *  Description:
23 *      HPPA fast spinlock semaphores based on LDCWX instruction.
24 *      These semaphores are not known to RTEMS.
25 *
26 *  TODO:
27 *
28 *  $Id$
29 */
30
31#ifndef _INCLUDE_SEMAPHORE_H
32#define _INCLUDE_SEMAPHORE_H
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38/*
39 * This structure has hardware requirements.
40 * LDCWX opcode requires 16byte alignment for the lock
41 * 'lock' must be first member of structure.
42 */
43
44#define SEM_ALIGN  16
45
46typedef volatile struct {
47
48    rtems_unsigned32 lock __attribute__ ((aligned (SEM_ALIGN)));
49
50    rtems_unsigned32 flags;
51
52    void *owner_tcb;            /* for debug/commentary only */
53
54    rtems_unsigned32 user;      /* for use by user */
55
56} hppa_semaphore_t;
57
58/*
59 * Values for flags
60 */
61
62#define HPPA_SEM_IN_USE            0x0001  /* semaphore owned by somebody */
63#define HPPA_SEM_NO_SPIN           0x0002  /* don't spin if unavailable */
64#define HPPA_SEM_INITIALLY_FREE    0x0004  /* init it to be free */
65
66/*
67 * Caller specifiable flags
68 */
69
70#define HPPA_SEM_CALLER_FLAGS (HPPA_SEM_NO_SPIN | HPPA_SEM_INITIALLY_FREE)
71
72void hppa_semaphore_pool_initialize(void *pool_base, int pool_size);
73
74rtems_unsigned32  hppa_semaphore_acquire(hppa_semaphore_t *sp, int flag);
75
76void hppa_semaphore_release(hppa_semaphore_t *sp);
77
78hppa_semaphore_t *hppa_semaphore_allocate(rtems_unsigned32 which, int flag);
79
80#ifdef __cplusplus
81}
82#endif
83
84#endif /* ! _INCLUDE_SEMAPHORE_H */
Note: See TracBrowser for help on using the repository browser.