comparison src/gpf3/inc/nuc/dm_defs.h @ 2:c41a534f33c6

src/gpf3: preened GPF goo from TCS3.2
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 25 Sep 2016 23:52:50 +0000
parents
children
comparison
equal deleted inserted replaced
1:864b8cc0cf63 2:c41a534f33c6
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 /* dm_defs.h PLUS 1.2a */
18 /* */
19 /* COMPONENT */
20 /* */
21 /* DM - Dynamic Memory Management */
22 /* */
23 /* DESCRIPTION */
24 /* */
25 /* This file contains data structure definitions and constants for */
26 /* the Dynamic Memory component. */
27 /* */
28 /* AUTHOR */
29 /* */
30 /* William E. Lamie, Accelerated Technology, Inc. */
31 /* */
32 /* DATA STRUCTURES */
33 /* */
34 /* DM_PCB Dynamic Pool control block */
35 /* DM_HEADER Header of each memory block */
36 /* DM_SUSPEND Memory 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 /* added padding logic, */
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 /* M. Trippi 01-07-1996 Added missing PAD_1 field to */
62 /* DM_HEADER_STRUCT to be */
63 /* consistent with other PLUS */
64 /* structures creating 1.2a. */
65 /* */
66 /*************************************************************************/
67
68 #include "cs_defs.h" /* Common service constants */
69 #include "tc_defs.h" /* Thread control constants */
70
71
72 /* Check to see if the file has been included already. */
73
74 #ifndef DM_DEFS
75 #define DM_DEFS
76
77
78 /* Define constants local to this component. */
79
80 #define DM_DYNAMIC_ID 0x44594e41UL
81 #define DM_OVERHEAD ((sizeof(DM_HEADER) + sizeof(UNSIGNED) \
82 - 1)/sizeof(UNSIGNED)) * \
83 sizeof(UNSIGNED)
84
85
86 /* Define the Dynamic Pool Control Block data type. */
87
88 typedef struct DM_PCB_STRUCT
89 {
90 CS_NODE dm_created; /* Node for linking to */
91 /* created dynamic pools */
92 TC_PROTECT dm_protect; /* Protection structure */
93 UNSIGNED dm_id; /* Internal PCB ID */
94 CHAR dm_name[NU_MAX_NAME]; /* Dynamic Pool name */
95 VOID *dm_start_address; /* Starting pool address */
96 UNSIGNED dm_pool_size; /* Size of pool */
97 UNSIGNED dm_min_allocation; /* Minimum allocate size */
98 UNSIGNED dm_available; /* Total available bytes */
99 struct DM_HEADER_STRUCT
100 *dm_memory_list; /* Memory list */
101 struct DM_HEADER_STRUCT
102 *dm_search_ptr; /* Search pointer */
103 DATA_ELEMENT dm_fifo_suspend; /* Suspension type flag */
104 #if PAD_1
105 DATA_ELEMENT dm_padding[PAD_1];
106 #endif
107 UNSIGNED dm_tasks_waiting; /* Number of waiting tasks*/
108 struct DM_SUSPEND_STRUCT
109 *dm_suspension_list; /* Suspension list */
110 } DM_PCB;
111
112
113 /* Define the header structure that is in front of each memory block. */
114
115 typedef struct DM_HEADER_STRUCT
116 {
117 struct DM_HEADER_STRUCT
118 *dm_next_memory, /* Next memory block */
119 *dm_previous_memory; /* Previous memory block */
120 DATA_ELEMENT dm_memory_free; /* Memory block free flag */
121 #if PAD_1
122 DATA_ELEMENT dm_padding[PAD_1];
123 #endif
124 DM_PCB *dm_memory_pool; /* Dynamic pool pointer */
125 } DM_HEADER;
126
127
128 /* Define the dynamic memory suspension structure. This structure is
129 allocated off of the caller's stack. */
130
131 typedef struct DM_SUSPEND_STRUCT
132 {
133 CS_NODE dm_suspend_link; /* Link to suspend blocks */
134 DM_PCB *dm_memory_pool; /* Pointer to pool */
135 UNSIGNED dm_request_size; /* Size of memory request */
136 TC_TCB *dm_suspended_task; /* Task suspended */
137 VOID *dm_return_pointer; /* Return memory address */
138 STATUS dm_return_status; /* Return status */
139 } DM_SUSPEND;
140
141 #endif