comparison src/gpf2/inc/nuc/sm_defs.h @ 1:864b8cc0cf63

src/gpf2: preened GPF goo from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:38:58 +0000
parents
children
comparison
equal deleted inserted replaced
0:945cf7f506b2 1:864b8cc0cf63
1 /*************************************************************************/
2 /* */
3 /* Copyright (c) 1993-1996 Accelerated Technology, Inc. */
4 /* */
5 /* PROPRIETARY RIGHTS of Accelerated Technology are involved in the */
6 /* subject matter of this material. All manufacturing, reproduction, */
7 /* use, and sales rights pertaining to this subject matter are governed */
8 /* by the license agreement. The recipient of this software implicitly */
9 /* accepts the terms of the license. */
10 /* */
11 /*************************************************************************/
12
13 /*************************************************************************/
14 /* */
15 /* FILE NAME VERSION */
16 /* */
17 /* sm_defs.h PLUS 1.2 */
18 /* */
19 /* COMPONENT */
20 /* */
21 /* SM - Semaphore Management */
22 /* */
23 /* DESCRIPTION */
24 /* */
25 /* This file contains data structure definitions and constants for */
26 /* the Semaphore component. */
27 /* */
28 /* AUTHOR */
29 /* */
30 /* William E. Lamie, Accelerated Technology, Inc. */
31 /* */
32 /* DATA STRUCTURES */
33 /* */
34 /* SM_SCB Semaphore control block */
35 /* SM_SUSPEND Semaphore suspension block */
36 /* */
37 /* FUNCTIONS */
38 /* */
39 /* None */
40 /* */
41 /* DEPENDENCIES */
42 /* */
43 /* cs_defs.h Common service definitions */
44 /* tc_defs.h Thread Control definitions */
45 /* */
46 /* HISTORY */
47 /* */
48 /* NAME DATE REMARKS */
49 /* */
50 /* W. Lamie 03-01-1993 Created initial version 1.0 */
51 /* D. Lamie 04-19-1993 Verified version 1.0 */
52 /* W. Lamie 03-01-1994 Moved include files outside of */
53 /* the file #ifndef to allow the */
54 /* use of actual data structures, */
55 /* removed protection structure, */
56 /* put padding into structure, */
57 /* resulting in version 1.1 */
58 /* R. Pfaff - */
59 /* D. Lamie 03-18-1994 Verified version 1.1 */
60 /* M.Q. Qian 04-17-1996 updated to version 1.2 */
61 /* */
62 /*************************************************************************/
63
64 #include "cs_defs.h" /* Common service constants */
65 #include "tc_defs.h" /* Thread control constants */
66
67
68 /* Check to see if the file has been included already. */
69
70 #ifndef SM_DEFS
71 #define SM_DEFS
72
73
74 /* Define constants local to this component. */
75
76 #define SM_SEMAPHORE_ID 0x53454d41UL
77
78
79 /* Define the Semaphore Control Block data type. */
80
81 typedef struct SM_SCB_STRUCT
82 {
83 CS_NODE sm_created; /* Node for linking to */
84 /* created semaphore list */
85 UNSIGNED sm_id; /* Internal SCB ID */
86 CHAR sm_name[NU_MAX_NAME]; /* Semaphore name */
87 UNSIGNED sm_semaphore_count; /* Counting semaphore */
88 DATA_ELEMENT sm_fifo_suspend; /* Suspension type flag */
89 #if PAD_1
90 DATA_ELEMENT sm_padding[PAD_1];
91 #endif
92 UNSIGNED sm_tasks_waiting; /* Number of waiting tasks*/
93 struct SM_SUSPEND_STRUCT
94 *sm_suspension_list; /* Suspension list */
95 } SM_SCB;
96
97
98 /* Define the semaphore suspension structure. This structure is allocated
99 off of the caller's stack. */
100
101 typedef struct SM_SUSPEND_STRUCT
102 {
103 CS_NODE sm_suspend_link; /* Link to suspend blocks */
104 SM_SCB *sm_semaphore; /* Pointer to semaphore */
105 TC_TCB *sm_suspended_task; /* Task suspended */
106 STATUS sm_return_status; /* Return status */
107 } SM_SUSPEND;
108
109 #endif