comparison src/gpf2/inc/nuc/pm_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 /* pm_defs.h PLUS 1.2 */
18 /* */
19 /* COMPONENT */
20 /* */
21 /* PM - Partition Memory Management */
22 /* */
23 /* DESCRIPTION */
24 /* */
25 /* This file contains data structure definitions and constants for */
26 /* the Partition Memory component. */
27 /* */
28 /* AUTHOR */
29 /* */
30 /* William E. Lamie, Accelerated Technology, Inc. */
31 /* */
32 /* DATA STRUCTURES */
33 /* */
34 /* PM_PCB Partition Pool control block */
35 /* PM_HEADER Header of each partition */
36 /* PM_SUSPEND Partition suspension block */
37 /* */
38 /* FUNCTIONS */
39 /* */
40 /* None */
41 /* */
42 /* DEPENDENCIES */
43 /* */
44 /* cs_defs.h Common service definitions */
45 /* tc_defs.h Thread Control definitions */
46 /* */
47 /* HISTORY */
48 /* */
49 /* NAME DATE REMARKS */
50 /* */
51 /* W. Lamie 03-01-1993 Created initial version 1.0 */
52 /* D. Lamie 04-19-1993 Verified version 1.0 */
53 /* W. Lamie 03-01-1994 Moved include files outside of */
54 /* the file #ifndef to allow the */
55 /* use of actual data structures, */
56 /* removed protect structure, */
57 /* added padding logic, */
58 /* resulting in version 1.1 */
59 /* R. Pfaff - */
60 /* D. Lamie 03-18-1994 Verified version 1.1 */
61 /* M.Q. Qian 04-17-1996 updated to version 1.2 */
62 /* */
63 /*************************************************************************/
64
65 #include "cs_defs.h" /* Common service constants */
66 #include "tc_defs.h" /* Thread control constants */
67
68
69 /* Check to see if the file has been included already. */
70
71 #ifndef PM_DEFS
72 #define PM_DEFS
73
74
75 /* Define constants local to this component. */
76
77 #define PM_PARTITION_ID 0x50415254UL
78 #define PM_OVERHEAD ((sizeof(PM_HEADER) + sizeof(UNSIGNED) \
79 - 1)/sizeof(UNSIGNED)) * \
80 sizeof(UNSIGNED)
81
82
83 /* Define the Partition Pool Control Block data type. */
84
85 typedef struct PM_PCB_STRUCT
86 {
87 CS_NODE pm_created; /* Node for linking to */
88 /* created partition list */
89 UNSIGNED pm_id; /* Internal PCB ID */
90 CHAR pm_name[NU_MAX_NAME]; /* Partition Pool name */
91 VOID *pm_start_address; /* Starting pool address */
92 UNSIGNED pm_pool_size; /* Size of pool */
93 UNSIGNED pm_partition_size; /* Size of each partition */
94 UNSIGNED pm_available; /* Available partitions */
95 UNSIGNED pm_allocated; /* Allocated partitions */
96 struct PM_HEADER_STRUCT
97 *pm_available_list; /* Available list */
98 DATA_ELEMENT pm_fifo_suspend; /* Suspension type flag */
99 #if PAD_1
100 DATA_ELEMENT pm_padding[PAD_1];
101 #endif
102 UNSIGNED pm_tasks_waiting; /* Number of waiting tasks*/
103 struct PM_SUSPEND_STRUCT
104 *pm_suspension_list; /* Suspension list */
105 } PM_PCB;
106
107
108 /* Define the header structure that is in front of each memory partition. */
109
110 typedef struct PM_HEADER_STRUCT
111 {
112 struct PM_HEADER_STRUCT
113 *pm_next_available; /* Next available memory */
114 /* partition */
115 PM_PCB *pm_partition_pool; /* Partition pool pointer */
116 } PM_HEADER;
117
118
119 /* Define the partition suspension structure. This structure is allocated
120 off of the caller's stack. */
121
122 typedef struct PM_SUSPEND_STRUCT
123 {
124 CS_NODE pm_suspend_link; /* Link to suspend blocks */
125 PM_PCB *pm_partition_pool; /* Pointer to pool */
126 TC_TCB *pm_suspended_task; /* Task suspended */
127 VOID *pm_return_pointer; /* Return memory address */
128 STATUS pm_return_status; /* Return status */
129 } PM_SUSPEND;
130
131 #endif