FreeCalypso > hg > freecalypso-citrine
comparison nucleus/nucleus.h @ 0:75a11d740a02
initial import of gsm-fw from freecalypso-sw rev 1033:5ab737ac3ad7
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Thu, 09 Jun 2016 00:02:41 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:75a11d740a02 |
|---|---|
| 1 /*************************************************************************/ | |
| 2 /* */ | |
| 3 /* Copyright Mentor Graphics Corporation 2002 */ | |
| 4 /* All Rights Reserved. */ | |
| 5 /* */ | |
| 6 /* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS */ | |
| 7 /* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS */ | |
| 8 /* SUBJECT TO LICENSE TERMS. */ | |
| 9 /* */ | |
| 10 /*************************************************************************/ | |
| 11 | |
| 12 /*************************************************************************/ | |
| 13 /* */ | |
| 14 /* FILE NAME VERSION */ | |
| 15 /* */ | |
| 16 /* nucleus.h Nucleus PLUS\ARM925\Code Composer 1.14.1 */ | |
| 17 /* */ | |
| 18 /* COMPONENT */ | |
| 19 /* */ | |
| 20 /* System Constants */ | |
| 21 /* */ | |
| 22 /* DESCRIPTION */ | |
| 23 /* */ | |
| 24 /* This file contains system constants common to both the */ | |
| 25 /* application and the actual Nucleus PLUS components. This file */ | |
| 26 /* also contains data structure definitions that hide internal */ | |
| 27 /* information from the application. */ | |
| 28 /* */ | |
| 29 /* DATA STRUCTURES */ | |
| 30 /* */ | |
| 31 /* NU_DRIVER I/O Driver control block */ | |
| 32 /* NU_EVENT_GROUP Event group control block */ | |
| 33 /* NU_HISR HISR control block */ | |
| 34 /* NU_MAILBOX Mailbox control block */ | |
| 35 /* NU_MEMORY_POOL Memory Pool control block */ | |
| 36 /* NU_PARTITION_POOL Partition Pool control block */ | |
| 37 /* NU_PIPE Pipe control block */ | |
| 38 /* NU_QUEUE Queue control block */ | |
| 39 /* NU_SEMAPHORE Semaphore control block */ | |
| 40 /* NU_TASK Task control block */ | |
| 41 /* NU_TIMER Timer control block */ | |
| 42 /* NU_PROTECT Protection structure */ | |
| 43 /* */ | |
| 44 /* FUNCTIONS */ | |
| 45 /* */ | |
| 46 /* None */ | |
| 47 /* */ | |
| 48 /* DEPENDENCIES */ | |
| 49 /* */ | |
| 50 /* None */ | |
| 51 /* */ | |
| 52 /* HISTORY */ | |
| 53 /* */ | |
| 54 /* NAME DATE REMARKS */ | |
| 55 /* */ | |
| 56 /* B. Ronquillo 08-28-2002 Released version 1.14.1 */ | |
| 57 /* */ | |
| 58 /* */ | |
| 59 /*************************************************************************/ | |
| 60 | |
| 61 /* Check to see if this file has been included already. */ | |
| 62 | |
| 63 #ifndef NUCLEUS | |
| 64 | |
| 65 #ifdef __cplusplus | |
| 66 extern "C" { /* C declarations in C++ */ | |
| 67 #endif | |
| 68 | |
| 69 #define NUCLEUS | |
| 70 | |
| 71 #define PLUS_1_11 1 | |
| 72 #define PLUS_1_13 2 | |
| 73 #define PLUS_1_14 3 | |
| 74 #define PLUS_VERSION_COMP PLUS_1_14 | |
| 75 | |
| 76 #ifndef NU_SUPERV_USER_MODE | |
| 77 #define NU_SUPERV_USER_MODE 0 | |
| 78 #endif | |
| 79 | |
| 80 #ifndef NU_MODULE_SUPPORT | |
| 81 #define NU_MODULE_SUPPORT 0 | |
| 82 #endif | |
| 83 | |
| 84 #ifndef NU_MMU_MODE | |
| 85 #define NU_MMU_MODE 0 | |
| 86 #endif | |
| 87 | |
| 88 /* | |
| 89 * The original version of this file in XVilka's code drop contained | |
| 90 * some definitions specific to the OMAP1510 platform targeted by that | |
| 91 * code drop. Nothing else in this package uses these definitions, | |
| 92 * though, so I have decided that the best thing to do is to simply | |
| 93 * eliminate them altogether. -- Michael Spacefalcon | |
| 94 */ | |
| 95 | |
| 96 #if 0 | |
| 97 | |
| 98 /* Define the clock frequency that is used by the timer control unit (must be defined in hertz */ | |
| 99 #define NU_System_Clock_Frequency 84000000 | |
| 100 | |
| 101 /* Define the number of Nucleus PLUS ticks that will occur every second */ | |
| 102 #define NU_PLUS_Ticks_Per_Second 100 | |
| 103 | |
| 104 /* Define the number of timer ticks that will occur every second. This is | |
| 105 usually the frequency of the timer used by the Nucleus clock. It may | |
| 106 be modified by a prescalar. See the INT assembler file for more info */ | |
| 107 | |
| 108 #define NU_HW_Ticks_Per_Second (NU_System_Clock_Frequency) | |
| 109 | |
| 110 /* The number of timer ticks between Nucleus timer interrupts that increment | |
| 111 TMD_System_Clock. See timer initialization code for details about how to | |
| 112 determine this number. */ | |
| 113 #define NU_HW_Ticks_Per_SW_Tick (NU_HW_Ticks_Per_Second / NU_PLUS_Ticks_Per_Second) | |
| 114 | |
| 115 /* Define NU_COUNT_DOWN if the system timer counts down to 0. | |
| 116 This macro is used to switch between formulas to calculate | |
| 117 the number of ticks since the systems started in NU_Get_Clock */ | |
| 118 #define NU_COUNT_DOWN | |
| 119 | |
| 120 /* This macro returns the value of the Nucleus timer (not the system clock) */ | |
| 121 #define NU_Retrieve_Hardware_Clock(hw_tick) hw_tick = *(UINT32 *)(0xFFFEC608) | |
| 122 | |
| 123 #endif | |
| 124 | |
| 125 /* Define standard data types. These definitions allow Nucleus PLUS to | |
| 126 perform in the same manner on different target platforms. */ | |
| 127 | |
| 128 typedef unsigned long UNSIGNED; | |
| 129 typedef long SIGNED; | |
| 130 typedef unsigned char DATA_ELEMENT; | |
| 131 typedef DATA_ELEMENT OPTION; | |
| 132 typedef int STATUS; | |
| 133 typedef unsigned char UNSIGNED_CHAR; | |
| 134 typedef char CHAR; | |
| 135 typedef int INT; | |
| 136 typedef unsigned long * UNSIGNED_PTR; | |
| 137 typedef unsigned char * BYTE_PTR; | |
| 138 typedef unsigned int UNSIGNED_INT; | |
| 139 | |
| 140 #define VOID void | |
| 141 #define HUGE | |
| 142 #define FAR | |
| 143 | |
| 144 /* need to avoid conflict with Riviera - do what the LoCosto src does */ | |
| 145 #ifndef GENERAL_H | |
| 146 typedef DATA_ELEMENT BOOLEAN; | |
| 147 typedef char INT8; | |
| 148 typedef unsigned char UINT8; | |
| 149 typedef signed short INT16; | |
| 150 typedef unsigned short UINT16; | |
| 151 typedef signed long INT32; | |
| 152 typedef unsigned long UINT32; | |
| 153 #endif | |
| 154 | |
| 155 /* Define register defines. R1, R2, R3, and R4 are used in the Nucleus PLUS | |
| 156 source code in front of variables that are referenced often. In some | |
| 157 ports, defining them as "register" will improve performance. */ | |
| 158 | |
| 159 #define R1 register | |
| 160 #define R2 register | |
| 161 #define R3 register | |
| 162 #define R4 register | |
| 163 | |
| 164 | |
| 165 /* Define the number of accesses required to read or write a pointer data | |
| 166 type. This value is used to make optimizations in some ports of Nucleus | |
| 167 PLUS. */ | |
| 168 | |
| 169 #define NU_POINTER_ACCESS 1 | |
| 170 | |
| 171 | |
| 172 /* Define the padding required for usage of the DATA_ELEMENT type within | |
| 173 Nucleus PLUS structures. These values insure proper alignment for the | |
| 174 next structure member. */ | |
| 175 | |
| 176 #define PAD_1 3 | |
| 177 #define PAD_2 2 | |
| 178 #define PAD_3 1 | |
| 179 | |
| 180 | |
| 181 | |
| 182 /* Define constants that are target dependent and/or are used for internal | |
| 183 purposes. */ | |
| 184 | |
| 185 #define NU_MIN_STACK_SIZE 240 | |
| 186 #define NU_MAX_NAME 8 | |
| 187 #define NU_MAX_VECTORS 64 | |
| 188 #define NU_MAX_LISRS 8 | |
| 189 | |
| 190 | |
| 191 /* Define constants for the number of UNSIGNED words in each of the basic | |
| 192 system data structures. */ | |
| 193 | |
| 194 #define NU_TASK_SIZE 42 | |
| 195 #define NU_HISR_SIZE 22 | |
| 196 #define NU_MAILBOX_SIZE 13 | |
| 197 #define NU_QUEUE_SIZE 18 | |
| 198 #define NU_PIPE_SIZE 18 | |
| 199 #define NU_SEMAPHORE_SIZE 10 | |
| 200 #define NU_EVENT_GROUP_SIZE 9 | |
| 201 #define NU_PARTITION_POOL_SIZE 15 | |
| 202 #define NU_MEMORY_POOL_SIZE 17 | |
| 203 #define NU_TIMER_SIZE 17 | |
| 204 #define NU_PROTECT_SIZE 2 | |
| 205 #define NU_DRIVER_SIZE 3 | |
| 206 | |
| 207 /* Define what an interrupt vector looks like on the target processor. */ | |
| 208 | |
| 209 typedef struct NU_VECTOR_STRUCT | |
| 210 { | |
| 211 VOID *pointer; | |
| 212 } NU_VECTOR; | |
| 213 | |
| 214 | |
| 215 /* Define constants for use in service parameters. */ | |
| 216 | |
| 217 #define NU_AND 2 | |
| 218 #define NU_AND_CONSUME 3 | |
| 219 #define NU_DISABLE_TIMER 4 | |
| 220 #define NU_ENABLE_TIMER 5 | |
| 221 #define NU_FALSE 0 | |
| 222 #define NU_FIFO 6 | |
| 223 #define NU_FIXED_SIZE 7 | |
| 224 #define NU_NO_PREEMPT 8 | |
| 225 #define NU_NO_START 9 | |
| 226 #define NU_NO_SUSPEND 0 | |
| 227 #define NU_NULL 0 | |
| 228 #define NU_OR 0 | |
| 229 #define NU_OR_CONSUME 1 | |
| 230 #define NU_PREEMPT 10 | |
| 231 #define NU_PRIORITY 11 | |
| 232 #define NU_START 12 | |
| 233 #define NU_SUSPEND 0xFFFFFFFFUL | |
| 234 #define NU_TRUE 1 | |
| 235 #define NU_VARIABLE_SIZE 13 | |
| 236 | |
| 237 | |
| 238 /* Define interrupt lockout and enable constants. */ | |
| 239 | |
| 240 #define NU_DISABLE_INTERRUPTS 0xC0 | |
| 241 #define NU_ENABLE_INTERRUPTS 0x00 | |
| 242 | |
| 243 | |
| 244 /* Define task suspension constants. */ | |
| 245 | |
| 246 #define NU_DRIVER_SUSPEND 10 | |
| 247 #define NU_EVENT_SUSPEND 7 | |
| 248 #define NU_FINISHED 11 | |
| 249 #define NU_MAILBOX_SUSPEND 3 | |
| 250 #define NU_MEMORY_SUSPEND 9 | |
| 251 #define NU_PARTITION_SUSPEND 8 | |
| 252 #define NU_PIPE_SUSPEND 5 | |
| 253 #define NU_PURE_SUSPEND 1 | |
| 254 #define NU_QUEUE_SUSPEND 4 | |
| 255 #define NU_READY 0 | |
| 256 #define NU_SEMAPHORE_SUSPEND 6 | |
| 257 #define NU_SLEEP_SUSPEND 2 | |
| 258 #define NU_TERMINATED 12 | |
| 259 | |
| 260 /* Define service completion status constants. */ | |
| 261 | |
| 262 #define NU_SUCCESS 0 | |
| 263 #define NU_END_OF_LOG -1 | |
| 264 #define NU_GROUP_DELETED -2 | |
| 265 #define NU_INVALID_DELETE -3 | |
| 266 #define NU_INVALID_DRIVER -4 | |
| 267 #define NU_INVALID_ENABLE -5 | |
| 268 #define NU_INVALID_ENTRY -6 | |
| 269 #define NU_INVALID_FUNCTION -7 | |
| 270 #define NU_INVALID_GROUP -8 | |
| 271 #define NU_INVALID_HISR -9 | |
| 272 #define NU_INVALID_MAILBOX -10 | |
| 273 #define NU_INVALID_MEMORY -11 | |
| 274 #define NU_INVALID_MESSAGE -12 | |
| 275 #define NU_INVALID_OPERATION -13 | |
| 276 #define NU_INVALID_PIPE -14 | |
| 277 #define NU_INVALID_POINTER -15 | |
| 278 #define NU_INVALID_POOL -16 | |
| 279 #define NU_INVALID_PREEMPT -17 | |
| 280 #define NU_INVALID_PRIORITY -18 | |
| 281 #define NU_INVALID_QUEUE -19 | |
| 282 #define NU_INVALID_RESUME -20 | |
| 283 #define NU_INVALID_SEMAPHORE -21 | |
| 284 #define NU_INVALID_SIZE -22 | |
| 285 #define NU_INVALID_START -23 | |
| 286 #define NU_INVALID_SUSPEND -24 | |
| 287 #define NU_INVALID_TASK -25 | |
| 288 #define NU_INVALID_TIMER -26 | |
| 289 #define NU_INVALID_VECTOR -27 | |
| 290 #define NU_MAILBOX_DELETED -28 | |
| 291 #define NU_MAILBOX_EMPTY -29 | |
| 292 #define NU_MAILBOX_FULL -30 | |
| 293 #define NU_MAILBOX_RESET -31 | |
| 294 #define NU_NO_MEMORY -32 | |
| 295 #define NU_NO_MORE_LISRS -33 | |
| 296 #define NU_NO_PARTITION -34 | |
| 297 #define NU_NOT_DISABLED -35 | |
| 298 #define NU_NOT_PRESENT -36 | |
| 299 #define NU_NOT_REGISTERED -37 | |
| 300 #define NU_NOT_TERMINATED -38 | |
| 301 #define NU_PIPE_DELETED -39 | |
| 302 #define NU_PIPE_EMPTY -40 | |
| 303 #define NU_PIPE_FULL -41 | |
| 304 #define NU_PIPE_RESET -42 | |
| 305 #define NU_POOL_DELETED -43 | |
| 306 #define NU_QUEUE_DELETED -44 | |
| 307 #define NU_QUEUE_EMPTY -45 | |
| 308 #define NU_QUEUE_FULL -46 | |
| 309 #define NU_QUEUE_RESET -47 | |
| 310 #define NU_SEMAPHORE_DELETED -48 | |
| 311 #define NU_SEMAPHORE_RESET -49 | |
| 312 #define NU_TIMEOUT -50 | |
| 313 #define NU_UNAVAILABLE -51 | |
| 314 #define NU_INVALID_DESCRIPTION -52 | |
| 315 #define NU_INVALID_REGION -53 | |
| 316 #define NU_MEMORY_CORRUPT -54 | |
| 317 #define NU_INVALID_DEBUG_ALLOCATION -55 | |
| 318 #define NU_EMPTY_DEBUG_ALLOCATION_LIST -56 | |
| 319 | |
| 320 | |
| 321 | |
| 322 /* Define system errors. */ | |
| 323 | |
| 324 #define NU_ERROR_CREATING_TIMER_HISR 1 | |
| 325 #define NU_ERROR_CREATING_TIMER_TASK 2 | |
| 326 #define NU_STACK_OVERFLOW 3 | |
| 327 #define NU_UNHANDLED_INTERRUPT 4 | |
| 328 | |
| 329 | |
| 330 /* Define I/O driver constants. */ | |
| 331 | |
| 332 #define NU_IO_ERROR -1 | |
| 333 #define NU_INITIALIZE 1 | |
| 334 #define NU_ASSIGN 2 | |
| 335 #define NU_RELEASE 3 | |
| 336 #define NU_INPUT 4 | |
| 337 #define NU_OUTPUT 5 | |
| 338 #define NU_STATUS 6 | |
| 339 #define NU_TERMINATE 7 | |
| 340 | |
| 341 | |
| 342 /* Define history entry IDs. */ | |
| 343 | |
| 344 #define NU_USER_ID 1 | |
| 345 #define NU_CREATE_TASK_ID 2 | |
| 346 #define NU_DELETE_TASK_ID 3 | |
| 347 #define NU_RESET_TASK_ID 4 | |
| 348 #define NU_TERMINATE_TASK_ID 5 | |
| 349 #define NU_RESUME_TASK_ID 6 | |
| 350 #define NU_SUSPEND_TASK_ID 7 | |
| 351 #define NU_RELINQUISH_ID 8 | |
| 352 #define NU_SLEEP_ID 9 | |
| 353 #define NU_CHANGE_PRIORITY_ID 10 | |
| 354 #define NU_CHANGE_PREEMPTION_ID 11 | |
| 355 #define NU_CREATE_MAILBOX_ID 12 | |
| 356 #define NU_DELETE_MAILBOX_ID 13 | |
| 357 #define NU_RESET_MAILBOX_ID 14 | |
| 358 #define NU_SEND_TO_MAILBOX_ID 15 | |
| 359 #define NU_BROADCAST_TO_MAILBOX_ID 16 | |
| 360 #define NU_RECEIVE_FROM_MAILBOX_ID 17 | |
| 361 #define NU_CREATE_QUEUE_ID 18 | |
| 362 #define NU_DELETE_QUEUE_ID 19 | |
| 363 #define NU_RESET_QUEUE_ID 20 | |
| 364 #define NU_SEND_TO_FRONT_OF_QUEUE_ID 21 | |
| 365 #define NU_SEND_TO_QUEUE_ID 22 | |
| 366 #define NU_BROADCAST_TO_QUEUE_ID 23 | |
| 367 #define NU_RECEIVE_FROM_QUEUE_ID 24 | |
| 368 #define NU_CREATE_PIPE_ID 25 | |
| 369 #define NU_DELETE_PIPE_ID 26 | |
| 370 #define NU_RESET_PIPE_ID 27 | |
| 371 #define NU_SEND_TO_FRONT_OF_PIPE_ID 28 | |
| 372 #define NU_SEND_TO_PIPE_ID 29 | |
| 373 #define NU_BROADCAST_TO_PIPE_ID 30 | |
| 374 #define NU_RECEIVE_FROM_PIPE_ID 31 | |
| 375 #define NU_CREATE_SEMAPHORE_ID 32 | |
| 376 #define NU_DELETE_SEMAPHORE_ID 33 | |
| 377 #define NU_RESET_SEMAPHORE_ID 34 | |
| 378 #define NU_OBTAIN_SEMAPHORE_ID 35 | |
| 379 #define NU_RELEASE_SEMAPHORE_ID 36 | |
| 380 #define NU_CREATE_EVENT_GROUP_ID 37 | |
| 381 #define NU_DELETE_EVENT_GROUP_ID 38 | |
| 382 #define NU_SET_EVENTS_ID 39 | |
| 383 #define NU_RETRIEVE_EVENTS_ID 40 | |
| 384 #define NU_CREATE_PARTITION_POOL_ID 41 | |
| 385 #define NU_DELETE_PARTITION_POOL_ID 42 | |
| 386 #define NU_ALLOCATE_PARTITION_ID 43 | |
| 387 #define NU_DEALLOCATE_PARTITION_ID 44 | |
| 388 #define NU_CREATE_MEMORY_POOL_ID 45 | |
| 389 #define NU_DELETE_MEMORY_POOL_ID 46 | |
| 390 #define NU_ALLOCATE_MEMORY_ID 47 | |
| 391 #define NU_DEALLOCATE_MEMORY_ID 48 | |
| 392 #define NU_CONTROL_SIGNALS_ID 49 | |
| 393 #define NU_RECEIVE_SIGNALS_ID 50 | |
| 394 #define NU_REGISTER_SIGNAL_HANDLER_ID 51 | |
| 395 #define NU_SEND_SIGNALS_ID 52 | |
| 396 #define NU_REGISTER_LISR_ID 53 | |
| 397 #define NU_CREATE_HISR_ID 54 | |
| 398 #define NU_DELETE_HISR_ID 55 | |
| 399 #define NU_CREATE_TIMER_ID 56 | |
| 400 #define NU_DELETE_TIMER_ID 57 | |
| 401 #define NU_CONTROL_TIMER_ID 58 | |
| 402 #define NU_RESET_TIMER_ID 59 | |
| 403 #define NU_CREATE_DRIVER_ID 60 | |
| 404 #define NU_DELETE_DRIVER_ID 61 | |
| 405 #define NU_REQUEST_DRIVER_ID 62 | |
| 406 #define NU_RESUME_DRIVER_ID 63 | |
| 407 #define NU_SUSPEND_DRIVER_ID 64 | |
| 408 #define NU_CHANGE_TIME_SLICE_ID 65 | |
| 409 #define NU_ASSERT_ID 66 | |
| 410 #define NU_ALLOCATE_ALIGNED_ID 67 | |
| 411 | |
| 412 | |
| 413 /* Define the basic data structure templates. If the NU_DEBUG conditional | |
| 414 compilation is specified, the actual structure definition is used. */ | |
| 415 | |
| 416 #ifdef NU_DEBUG | |
| 417 #include "cs_defs.h" | |
| 418 #include "tm_defs.h" | |
| 419 #include "tc_defs.h" | |
| 420 #include "mb_defs.h" | |
| 421 #include "qu_defs.h" | |
| 422 #include "pi_defs.h" | |
| 423 #include "sm_defs.h" | |
| 424 #include "ev_defs.h" | |
| 425 #include "pm_defs.h" | |
| 426 #include "dm_defs.h" | |
| 427 #endif | |
| 428 | |
| 429 | |
| 430 #ifndef NU_DEBUG | |
| 431 | |
| 432 /* Define task control data structure with all internal information | |
| 433 hidden. */ | |
| 434 typedef struct NU_TASK_STRUCT | |
| 435 { | |
| 436 UNSIGNED words[NU_TASK_SIZE]; | |
| 437 } NU_TASK; | |
| 438 #else | |
| 439 | |
| 440 /* Define task control data structure with the actual internal data | |
| 441 structure. */ | |
| 442 typedef TC_TCB NU_TASK; | |
| 443 #endif | |
| 444 | |
| 445 | |
| 446 #ifndef NU_DEBUG | |
| 447 | |
| 448 /* Define HISR control data structure with all internal information | |
| 449 hidden. */ | |
| 450 typedef struct NU_HISR_STRUCT | |
| 451 { | |
| 452 UNSIGNED words[NU_HISR_SIZE]; | |
| 453 } NU_HISR; | |
| 454 #else | |
| 455 | |
| 456 /* Define HISR control data structure with the actual internal data | |
| 457 structure. */ | |
| 458 typedef TC_HCB NU_HISR; | |
| 459 #endif | |
| 460 | |
| 461 | |
| 462 #ifndef NU_DEBUG | |
| 463 | |
| 464 /* Define mailbox control data structure with all internal information | |
| 465 hidden. */ | |
| 466 typedef struct NU_MAILBOX_STRUCT | |
| 467 { | |
| 468 UNSIGNED words[NU_MAILBOX_SIZE]; | |
| 469 } NU_MAILBOX; | |
| 470 #else | |
| 471 | |
| 472 /* Define mailbox control data structure with the actual internal data | |
| 473 structure. */ | |
| 474 typedef MB_MCB NU_MAILBOX; | |
| 475 #endif | |
| 476 | |
| 477 | |
| 478 #ifndef NU_DEBUG | |
| 479 | |
| 480 /* Define queue control data structure with all internal information | |
| 481 hidden. */ | |
| 482 typedef struct NU_QUEUE_STRUCT | |
| 483 { | |
| 484 UNSIGNED words[NU_QUEUE_SIZE]; | |
| 485 } NU_QUEUE; | |
| 486 #else | |
| 487 | |
| 488 /* Define queue control data structure with the actual internal data | |
| 489 structure. */ | |
| 490 typedef QU_QCB NU_QUEUE; | |
| 491 #endif | |
| 492 | |
| 493 | |
| 494 #ifndef NU_DEBUG | |
| 495 | |
| 496 /* Define pipe control data structure with all internal information | |
| 497 hidden. */ | |
| 498 typedef struct NU_PIPE_STRUCT | |
| 499 { | |
| 500 UNSIGNED words[NU_PIPE_SIZE]; | |
| 501 } NU_PIPE; | |
| 502 #else | |
| 503 | |
| 504 /* Define pipe control data structure with the actual internal data | |
| 505 structure. */ | |
| 506 typedef PI_PCB NU_PIPE; | |
| 507 #endif | |
| 508 | |
| 509 | |
| 510 #ifndef NU_DEBUG | |
| 511 | |
| 512 /* Define semaphore control data structure with all internal information | |
| 513 hidden. */ | |
| 514 typedef struct NU_SEMAPHORE_STRUCT | |
| 515 { | |
| 516 UNSIGNED words[NU_SEMAPHORE_SIZE]; | |
| 517 } NU_SEMAPHORE; | |
| 518 #else | |
| 519 | |
| 520 /* Define semaphore control data structure with the actual internal data | |
| 521 structure. */ | |
| 522 typedef SM_SCB NU_SEMAPHORE; | |
| 523 #endif | |
| 524 | |
| 525 | |
| 526 #ifndef NU_DEBUG | |
| 527 | |
| 528 /* Define event group control data structure with all internal information | |
| 529 hidden. */ | |
| 530 typedef struct NU_EVENT_GROUP_STRUCT | |
| 531 { | |
| 532 UNSIGNED words[NU_EVENT_GROUP_SIZE]; | |
| 533 } NU_EVENT_GROUP; | |
| 534 #else | |
| 535 | |
| 536 /* Define event group control data structure with the actual internal data | |
| 537 structure. */ | |
| 538 typedef EV_GCB NU_EVENT_GROUP; | |
| 539 #endif | |
| 540 | |
| 541 | |
| 542 #ifndef NU_DEBUG | |
| 543 | |
| 544 /* Define partition pool control data structure with all internal | |
| 545 information hidden. */ | |
| 546 typedef struct NU_PARTITION_POOL_STRUCT | |
| 547 { | |
| 548 UNSIGNED words[NU_PARTITION_POOL_SIZE]; | |
| 549 } NU_PARTITION_POOL; | |
| 550 #else | |
| 551 | |
| 552 /* Define partition pool control data structure with the actual internal | |
| 553 data structure. */ | |
| 554 typedef PM_PCB NU_PARTITION_POOL; | |
| 555 #endif | |
| 556 | |
| 557 | |
| 558 #ifndef NU_DEBUG | |
| 559 | |
| 560 /* Define memory pool control data structure with all internal information | |
| 561 hidden. */ | |
| 562 typedef struct NU_MEMORY_POOL_STRUCT | |
| 563 { | |
| 564 UNSIGNED words[NU_MEMORY_POOL_SIZE]; | |
| 565 } NU_MEMORY_POOL; | |
| 566 #else | |
| 567 | |
| 568 /* Define memory pool control data structure with the actual internal data | |
| 569 structure. */ | |
| 570 typedef DM_PCB NU_MEMORY_POOL; | |
| 571 #endif | |
| 572 | |
| 573 | |
| 574 #ifndef NU_DEBUG | |
| 575 | |
| 576 /* Define timer control data structure with all internal information | |
| 577 hidden. */ | |
| 578 typedef struct NU_TIMER_STRUCT | |
| 579 { | |
| 580 UNSIGNED words[NU_TIMER_SIZE]; | |
| 581 } NU_TIMER; | |
| 582 #else | |
| 583 | |
| 584 /* Define timer control data structure with the actual internal data | |
| 585 structure. */ | |
| 586 typedef TM_APP_TCB NU_TIMER; | |
| 587 #endif | |
| 588 | |
| 589 | |
| 590 #ifndef NU_DEBUG | |
| 591 | |
| 592 /* Define protect control data structure with all internal information | |
| 593 hidden. */ | |
| 594 typedef struct NU_PROTECT_STRUCT | |
| 595 { | |
| 596 UNSIGNED words[NU_PROTECT_SIZE]; | |
| 597 } NU_PROTECT; | |
| 598 #else | |
| 599 | |
| 600 /* Define protect control data structure with the actual internal data | |
| 601 structure. */ | |
| 602 typedef TC_PROTECT NU_PROTECT; | |
| 603 #endif | |
| 604 | |
| 605 | |
| 606 | |
| 607 /* Define I/O driver request structures. */ | |
| 608 | |
| 609 struct NU_INITIALIZE_STRUCT | |
| 610 { | |
| 611 VOID *nu_io_address; /* Base IO address */ | |
| 612 UNSIGNED nu_logical_units; /* Number of logical units */ | |
| 613 VOID *nu_memory; /* Generic memory pointer */ | |
| 614 INT nu_vector; /* Interrupt vector number */ | |
| 615 }; | |
| 616 | |
| 617 struct NU_ASSIGN_STRUCT | |
| 618 { | |
| 619 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
| 620 INT nu_assign_info; /* Additional assign info */ | |
| 621 }; | |
| 622 | |
| 623 struct NU_RELEASE_STRUCT | |
| 624 { | |
| 625 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
| 626 INT nu_release_info; /* Additional release info */ | |
| 627 }; | |
| 628 | |
| 629 struct NU_INPUT_STRUCT | |
| 630 { | |
| 631 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
| 632 UNSIGNED nu_offset; /* Offset of input */ | |
| 633 UNSIGNED nu_request_size; /* Requested input size */ | |
| 634 UNSIGNED nu_actual_size; /* Actual input size */ | |
| 635 VOID *nu_buffer_ptr; /* Input buffer pointer */ | |
| 636 }; | |
| 637 | |
| 638 struct NU_OUTPUT_STRUCT | |
| 639 { | |
| 640 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
| 641 UNSIGNED nu_offset; /* Offset of output */ | |
| 642 UNSIGNED nu_request_size; /* Requested output size */ | |
| 643 UNSIGNED nu_actual_size; /* Actual output size */ | |
| 644 VOID *nu_buffer_ptr; /* Output buffer pointer */ | |
| 645 }; | |
| 646 | |
| 647 struct NU_STATUS_STRUCT | |
| 648 { | |
| 649 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
| 650 VOID *nu_extra_status; /* Additional status ptr */ | |
| 651 }; | |
| 652 | |
| 653 struct NU_TERMINATE_STRUCT | |
| 654 { | |
| 655 UNSIGNED nu_logical_unit; /* Logical unit number */ | |
| 656 }; | |
| 657 | |
| 658 | |
| 659 typedef union NU_REQUEST_INFO_UNION | |
| 660 { | |
| 661 struct NU_INITIALIZE_STRUCT nu_initialize; | |
| 662 struct NU_ASSIGN_STRUCT nu_assign; | |
| 663 struct NU_RELEASE_STRUCT nu_release; | |
| 664 struct NU_INPUT_STRUCT nu_input; | |
| 665 struct NU_OUTPUT_STRUCT nu_output; | |
| 666 struct NU_STATUS_STRUCT nu_status; | |
| 667 struct NU_TERMINATE_STRUCT nu_terminate; | |
| 668 } nu_request_info_union; | |
| 669 | |
| 670 typedef struct NU_DRIVER_REQUEST_STRUCT | |
| 671 { | |
| 672 INT nu_function; /* I/O request function */ | |
| 673 UNSIGNED nu_timeout; /* Timeout on request */ | |
| 674 STATUS nu_status; /* Status of request */ | |
| 675 UNSIGNED nu_supplemental; /* Supplemental information */ | |
| 676 VOID *nu_supplemental_ptr; /* Supplemental info pointer*/ | |
| 677 nu_request_info_union nu_request_info; | |
| 678 | |
| 679 } NU_DRIVER_REQUEST; | |
| 680 | |
| 681 typedef struct NU_DRIVER_STRUCT | |
| 682 { | |
| 683 UNSIGNED words[NU_DRIVER_SIZE]; /* CS_NODE_STRUCT */ | |
| 684 CHAR nu_driver_name[NU_MAX_NAME]; | |
| 685 VOID *nu_info_ptr; | |
| 686 UNSIGNED nu_driver_id; | |
| 687 VOID (*nu_driver_entry)(struct NU_DRIVER_STRUCT *, | |
| 688 NU_DRIVER_REQUEST *); | |
| 689 } NU_DRIVER; | |
| 690 | |
| 691 | |
| 692 /* Define Nucleus PLUS system interfaces. */ | |
| 693 | |
| 694 VOID Application_Initialize(VOID *first_available_memory); | |
| 695 | |
| 696 | |
| 697 /* The following area is only applicable to application files and is skipped | |
| 698 during compilation of Nucleus PLUS source files. */ | |
| 699 #ifndef NU_SOURCE_FILE | |
| 700 | |
| 701 /* Re-map task control functions depending on whether or not error checking | |
| 702 is specified. */ | |
| 703 | |
| 704 #ifdef NU_NO_ERROR_CHECKING | |
| 705 #define NU_Create_Task TCC_Create_Task | |
| 706 #define NU_Delete_Task TCC_Delete_Task | |
| 707 #define NU_Reset_Task TCC_Reset_Task | |
| 708 #define NU_Terminate_Task TCC_Terminate_Task | |
| 709 #define NU_Resume_Task TCC_Resume_Service | |
| 710 #define NU_Suspend_Task TCC_Suspend_Service | |
| 711 #define NU_Relinquish TCC_Relinquish | |
| 712 #define NU_Sleep TCC_Task_Sleep | |
| 713 #define NU_Change_Priority TCS_Change_Priority | |
| 714 #define NU_Change_Preemption TCS_Change_Preemption | |
| 715 #define NU_Change_Time_Slice TCS_Change_Time_Slice | |
| 716 #define NU_Check_Stack TCT_Check_Stack | |
| 717 #define NU_Current_Task_Pointer TCC_Current_Task_Pointer | |
| 718 #define NU_Established_Tasks TCF_Established_Tasks | |
| 719 #define NU_Task_Information TCF_Task_Information | |
| 720 #define NU_Task_Pointers TCF_Task_Pointers | |
| 721 #define NU_Create_Mailbox MBC_Create_Mailbox | |
| 722 #define NU_Delete_Mailbox MBC_Delete_Mailbox | |
| 723 #define NU_Reset_Mailbox MBS_Reset_Mailbox | |
| 724 #define NU_Send_To_Mailbox MBC_Send_To_Mailbox | |
| 725 #define NU_Broadcast_To_Mailbox MBS_Broadcast_To_Mailbox | |
| 726 #define NU_Receive_From_Mailbox MBC_Receive_From_Mailbox | |
| 727 #define NU_Established_Mailboxes MBF_Established_Mailboxes | |
| 728 #define NU_Mailbox_Information MBF_Mailbox_Information | |
| 729 #define NU_Mailbox_Pointers MBF_Mailbox_Pointers | |
| 730 #define NU_Create_Queue QUC_Create_Queue | |
| 731 #define NU_Delete_Queue QUC_Delete_Queue | |
| 732 #define NU_Reset_Queue QUS_Reset_Queue | |
| 733 #define NU_Send_To_Front_Of_Queue QUS_Send_To_Front_Of_Queue | |
| 734 #define NU_Send_To_Queue QUC_Send_To_Queue | |
| 735 #define NU_Broadcast_To_Queue QUS_Broadcast_To_Queue | |
| 736 #define NU_Receive_From_Queue QUC_Receive_From_Queue | |
| 737 #define NU_Established_Queues QUF_Established_Queues | |
| 738 #define NU_Queue_Information QUF_Queue_Information | |
| 739 #define NU_Queue_Pointers QUF_Queue_Pointers | |
| 740 #define NU_Create_Pipe PIC_Create_Pipe | |
| 741 #define NU_Delete_Pipe PIC_Delete_Pipe | |
| 742 #define NU_Reset_Pipe PIS_Reset_Pipe | |
| 743 #define NU_Send_To_Front_Of_Pipe PIS_Send_To_Front_Of_Pipe | |
| 744 #define NU_Send_To_Pipe PIC_Send_To_Pipe | |
| 745 #define NU_Broadcast_To_Pipe PIS_Broadcast_To_Pipe | |
| 746 #define NU_Receive_From_Pipe PIC_Receive_From_Pipe | |
| 747 #define NU_Established_Pipes PIF_Established_Pipes | |
| 748 #define NU_Pipe_Information PIF_Pipe_Information | |
| 749 #define NU_Pipe_Pointers PIF_Pipe_Pointers | |
| 750 #define NU_Create_Semaphore SMC_Create_Semaphore | |
| 751 #define NU_Delete_Semaphore SMC_Delete_Semaphore | |
| 752 #define NU_Reset_Semaphore SMS_Reset_Semaphore | |
| 753 #define NU_Obtain_Semaphore SMC_Obtain_Semaphore | |
| 754 #define NU_Release_Semaphore SMC_Release_Semaphore | |
| 755 #define NU_Established_Semaphores SMF_Established_Semaphores | |
| 756 #define NU_Semaphore_Information SMF_Semaphore_Information | |
| 757 #define NU_Semaphore_Pointers SMF_Semaphore_Pointers | |
| 758 #define NU_Create_Event_Group EVC_Create_Event_Group | |
| 759 #define NU_Delete_Event_Group EVC_Delete_Event_Group | |
| 760 #define NU_Set_Events EVC_Set_Events | |
| 761 #define NU_Retrieve_Events EVC_Retrieve_Events | |
| 762 #define NU_Established_Event_Groups EVF_Established_Event_Groups | |
| 763 #define NU_Event_Group_Information EVF_Event_Group_Information | |
| 764 #define NU_Event_Group_Pointers EVF_Event_Group_Pointers | |
| 765 #define NU_Create_Partition_Pool PMC_Create_Partition_Pool | |
| 766 #define NU_Delete_Partition_Pool PMC_Delete_Partition_Pool | |
| 767 #define NU_Allocate_Partition PMC_Allocate_Partition | |
| 768 #define NU_Deallocate_Partition PMC_Deallocate_Partition | |
| 769 #define NU_Established_Partition_Pools PMF_Established_Partition_Pools | |
| 770 #define NU_Partition_Pool_Information PMF_Partition_Pool_Information | |
| 771 #define NU_Partition_Pool_Pointers PMF_Partition_Pool_Pointers | |
| 772 #define NU_Create_Memory_Pool DMC_Create_Memory_Pool | |
| 773 #define NU_Delete_Memory_Pool DMC_Delete_Memory_Pool | |
| 774 #define NU_Allocate_Memory DMC_Allocate_Memory | |
| 775 #define NU_Deallocate_Memory DMC_Deallocate_Memory | |
| 776 #define NU_Established_Memory_Pools DMF_Established_Memory_Pools | |
| 777 #define NU_Memory_Pool_Information DMF_Memory_Pool_Information | |
| 778 #define NU_Memory_Pool_Pointers DMF_Memory_Pool_Pointers | |
| 779 #define NU_Control_Signals TCS_Control_Signals | |
| 780 #define NU_Receive_Signals TCS_Receive_Signals | |
| 781 #define NU_Register_Signal_Handler TCS_Register_Signal_Handler | |
| 782 #define NU_Send_Signals TCS_Send_Signals | |
| 783 #define NU_Setup_Vector INT_Setup_Vector | |
| 784 #define NU_Register_LISR TCC_Register_LISR | |
| 785 #define NU_Activate_HISR TCT_Activate_HISR | |
| 786 #define NU_Create_HISR TCC_Create_HISR | |
| 787 #define NU_Delete_HISR TCC_Delete_HISR | |
| 788 #define NU_Current_HISR_Pointer TCC_Current_HISR_Pointer | |
| 789 #define NU_Established_HISRs TCF_Established_HISRs | |
| 790 #define NU_HISR_Pointers TCF_HISR_Pointers | |
| 791 #define NU_HISR_Information TCF_HISR_Information | |
| 792 #define NU_Protect TCT_Protect | |
| 793 #define NU_Unprotect TCT_Unprotect | |
| 794 #define NU_Control_Interrupts TCT_Control_Interrupts | |
| 795 #define NU_Local_Control_Interrupts TCT_Local_Control_Interrupts | |
| 796 #define NU_Restore_Interrupts TCT_Restore_Interrupts | |
| 797 #define NU_Set_Clock TMT_Set_Clock | |
| 798 #define NU_Retrieve_Clock TMT_Retrieve_Clock | |
| 799 #define NU_Create_Timer TMS_Create_Timer | |
| 800 #define NU_Delete_Timer TMS_Delete_Timer | |
| 801 #define NU_Control_Timer TMS_Control_Timer | |
| 802 #define NU_Reset_Timer TMS_Reset_Timer | |
| 803 #define NU_Established_Timers TMF_Established_Timers | |
| 804 #define NU_Timer_Pointers TMF_Timer_Pointers | |
| 805 #define NU_Timer_Information TMF_Timer_Information | |
| 806 #define NU_Get_Remaining_Time TMF_Get_Remaining_Time | |
| 807 #define NU_Release_Information RLC_Release_Information | |
| 808 #define NU_License_Information LIC_License_Information | |
| 809 #define NU_Disable_History_Saving HIC_Disable_History_Saving | |
| 810 #define NU_Enable_History_Saving HIC_Enable_History_Saving | |
| 811 #define NU_Make_History_Entry HIC_Make_History_Entry_Service | |
| 812 #define NU_Retrieve_History_Entry HIC_Retrieve_History_Entry | |
| 813 #define NU_Create_Driver IOC_Create_Driver | |
| 814 #define NU_Delete_Driver IOC_Delete_Driver | |
| 815 #define NU_Request_Driver IOC_Request_Driver | |
| 816 #define NU_Resume_Driver IOC_Resume_Driver | |
| 817 #define NU_Suspend_Driver IOC_Suspend_Driver | |
| 818 #define NU_Established_Drivers IOF_Established_Drivers | |
| 819 #define NU_Driver_Pointers IOF_Driver_Pointers | |
| 820 #else | |
| 821 #define NU_Create_Task TCCE_Create_Task | |
| 822 #define NU_Delete_Task TCCE_Delete_Task | |
| 823 #define NU_Reset_Task TCCE_Reset_Task | |
| 824 #define NU_Terminate_Task TCCE_Terminate_Task | |
| 825 #define NU_Resume_Task TCCE_Resume_Service | |
| 826 #define NU_Suspend_Task TCCE_Suspend_Service | |
| 827 #define NU_Relinquish TCCE_Relinquish | |
| 828 #define NU_Sleep TCCE_Task_Sleep | |
| 829 #define NU_Change_Priority TCSE_Change_Priority | |
| 830 #define NU_Change_Preemption TCSE_Change_Preemption | |
| 831 #define NU_Change_Time_Slice TCSE_Change_Time_Slice | |
| 832 #define NU_Check_Stack TCT_Check_Stack | |
| 833 #define NU_Current_Task_Pointer TCC_Current_Task_Pointer | |
| 834 #define NU_Established_Tasks TCF_Established_Tasks | |
| 835 #define NU_Task_Information TCFE_Task_Information | |
| 836 #define NU_Task_Pointers TCF_Task_Pointers | |
| 837 #define NU_Create_Mailbox MBCE_Create_Mailbox | |
| 838 #define NU_Delete_Mailbox MBCE_Delete_Mailbox | |
| 839 #define NU_Reset_Mailbox MBSE_Reset_Mailbox | |
| 840 #define NU_Send_To_Mailbox MBCE_Send_To_Mailbox | |
| 841 #define NU_Broadcast_To_Mailbox MBSE_Broadcast_To_Mailbox | |
| 842 #define NU_Receive_From_Mailbox MBCE_Receive_From_Mailbox | |
| 843 #define NU_Established_Mailboxes MBF_Established_Mailboxes | |
| 844 #define NU_Mailbox_Information MBF_Mailbox_Information | |
| 845 #define NU_Mailbox_Pointers MBF_Mailbox_Pointers | |
| 846 #define NU_Create_Queue QUCE_Create_Queue | |
| 847 #define NU_Delete_Queue QUCE_Delete_Queue | |
| 848 #define NU_Reset_Queue QUSE_Reset_Queue | |
| 849 #define NU_Send_To_Queue QUCE_Send_To_Queue | |
| 850 #define NU_Send_To_Front_Of_Queue QUSE_Send_To_Front_Of_Queue | |
| 851 #define NU_Broadcast_To_Queue QUSE_Broadcast_To_Queue | |
| 852 #define NU_Receive_From_Queue QUCE_Receive_From_Queue | |
| 853 #define NU_Established_Queues QUF_Established_Queues | |
| 854 #define NU_Queue_Information QUF_Queue_Information | |
| 855 #define NU_Queue_Pointers QUF_Queue_Pointers | |
| 856 #define NU_Create_Pipe PICE_Create_Pipe | |
| 857 #define NU_Delete_Pipe PICE_Delete_Pipe | |
| 858 #define NU_Reset_Pipe PISE_Reset_Pipe | |
| 859 #define NU_Send_To_Front_Of_Pipe PISE_Send_To_Front_Of_Pipe | |
| 860 #define NU_Send_To_Pipe PICE_Send_To_Pipe | |
| 861 #define NU_Broadcast_To_Pipe PISE_Broadcast_To_Pipe | |
| 862 #define NU_Receive_From_Pipe PICE_Receive_From_Pipe | |
| 863 #define NU_Established_Pipes PIF_Established_Pipes | |
| 864 #define NU_Pipe_Information PIF_Pipe_Information | |
| 865 #define NU_Pipe_Pointers PIF_Pipe_Pointers | |
| 866 #define NU_Create_Semaphore SMCE_Create_Semaphore | |
| 867 #define NU_Delete_Semaphore SMCE_Delete_Semaphore | |
| 868 #define NU_Reset_Semaphore SMSE_Reset_Semaphore | |
| 869 #define NU_Obtain_Semaphore SMCE_Obtain_Semaphore | |
| 870 #define NU_Release_Semaphore SMCE_Release_Semaphore | |
| 871 #define NU_Established_Semaphores SMF_Established_Semaphores | |
| 872 #define NU_Semaphore_Information SMF_Semaphore_Information | |
| 873 #define NU_Semaphore_Pointers SMF_Semaphore_Pointers | |
| 874 #define NU_Create_Event_Group EVCE_Create_Event_Group | |
| 875 #define NU_Delete_Event_Group EVCE_Delete_Event_Group | |
| 876 #define NU_Set_Events EVCE_Set_Events | |
| 877 #define NU_Retrieve_Events EVCE_Retrieve_Events | |
| 878 #define NU_Established_Event_Groups EVF_Established_Event_Groups | |
| 879 #define NU_Event_Group_Information EVF_Event_Group_Information | |
| 880 #define NU_Event_Group_Pointers EVF_Event_Group_Pointers | |
| 881 #define NU_Create_Partition_Pool PMCE_Create_Partition_Pool | |
| 882 #define NU_Delete_Partition_Pool PMCE_Delete_Partition_Pool | |
| 883 #define NU_Allocate_Partition PMCE_Allocate_Partition | |
| 884 #define NU_Deallocate_Partition PMCE_Deallocate_Partition | |
| 885 #define NU_Established_Partition_Pools PMF_Established_Partition_Pools | |
| 886 #define NU_Partition_Pool_Information PMF_Partition_Pool_Information | |
| 887 #define NU_Partition_Pool_Pointers PMF_Partition_Pool_Pointers | |
| 888 #define NU_Create_Memory_Pool DMCE_Create_Memory_Pool | |
| 889 #define NU_Delete_Memory_Pool DMCE_Delete_Memory_Pool | |
| 890 | |
| 891 /* The following conditional routes memory allocation calls to functions | |
| 892 that help track memory leaks. */ | |
| 893 #ifdef NU_DEBUG_MEMORY | |
| 894 #define NU_Deallocate_Memory ERC_Deallocate_Memory | |
| 895 #else | |
| 896 #define NU_Deallocate_Memory DMCE_Deallocate_Memory | |
| 897 #endif /* NU_DEBUG_MEMORY */ | |
| 898 | |
| 899 #define NU_Established_Memory_Pools DMF_Established_Memory_Pools | |
| 900 #define NU_Memory_Pool_Information DMF_Memory_Pool_Information | |
| 901 #define NU_Memory_Pool_Pointers DMF_Memory_Pool_Pointers | |
| 902 #define NU_Control_Signals TCSE_Control_Signals | |
| 903 #define NU_Receive_Signals TCSE_Receive_Signals | |
| 904 #define NU_Register_Signal_Handler TCSE_Register_Signal_Handler | |
| 905 #define NU_Send_Signals TCSE_Send_Signals | |
| 906 #define NU_Setup_Vector INT_Setup_Vector | |
| 907 #define NU_Register_LISR TCC_Register_LISR | |
| 908 #define NU_Activate_HISR TCCE_Activate_HISR | |
| 909 #define NU_Create_HISR TCCE_Create_HISR | |
| 910 #define NU_Delete_HISR TCCE_Delete_HISR | |
| 911 #define NU_Current_HISR_Pointer TCC_Current_HISR_Pointer | |
| 912 #define NU_Established_HISRs TCF_Established_HISRs | |
| 913 #define NU_HISR_Pointers TCF_HISR_Pointers | |
| 914 #define NU_HISR_Information TCF_HISR_Information | |
| 915 #define NU_Protect TCT_Protect | |
| 916 #define NU_Unprotect TCT_Unprotect | |
| 917 #define NU_Control_Interrupts TCT_Control_Interrupts | |
| 918 #define NU_Local_Control_Interrupts TCT_Local_Control_Interrupts | |
| 919 #define NU_Restore_Interrupts TCT_Restore_Interrupts | |
| 920 #define NU_Set_Clock TMT_Set_Clock | |
| 921 #define NU_Retrieve_Clock TMT_Retrieve_Clock | |
| 922 #define NU_Create_Timer TMSE_Create_Timer | |
| 923 #define NU_Delete_Timer TMSE_Delete_Timer | |
| 924 #define NU_Control_Timer TMSE_Control_Timer | |
| 925 #define NU_Reset_Timer TMSE_Reset_Timer | |
| 926 #define NU_Established_Timers TMF_Established_Timers | |
| 927 #define NU_Timer_Pointers TMF_Timer_Pointers | |
| 928 #define NU_Timer_Information TMF_Timer_Information | |
| 929 #define NU_Get_Remaining_Time TMF_Get_Remaining_Time | |
| 930 #define NU_Release_Information RLC_Release_Information | |
| 931 #define NU_License_Information LIC_License_Information | |
| 932 #define NU_Disable_History_Saving HIC_Disable_History_Saving | |
| 933 #define NU_Enable_History_Saving HIC_Enable_History_Saving | |
| 934 #define NU_Make_History_Entry HIC_Make_History_Entry_Service | |
| 935 #define NU_Retrieve_History_Entry HIC_Retrieve_History_Entry | |
| 936 #define NU_Create_Driver IOCE_Create_Driver | |
| 937 #define NU_Delete_Driver IOCE_Delete_Driver | |
| 938 #define NU_Request_Driver IOCE_Request_Driver | |
| 939 #define NU_Resume_Driver IOCE_Resume_Driver | |
| 940 #define NU_Suspend_Driver IOCE_Suspend_Driver | |
| 941 #define NU_Established_Drivers IOF_Established_Drivers | |
| 942 #define NU_Driver_Pointers IOF_Driver_Pointers | |
| 943 #endif | |
| 944 | |
| 945 | |
| 946 /* Define task control functions. */ | |
| 947 | |
| 948 STATUS NU_Create_Task(NU_TASK *task, CHAR *name, | |
| 949 VOID (*task_entry)(UNSIGNED, VOID *), UNSIGNED argc, | |
| 950 VOID *argv, VOID *stack_address, UNSIGNED stack_size, | |
| 951 OPTION priority, UNSIGNED time_slice, | |
| 952 OPTION preempt, OPTION auto_start); | |
| 953 STATUS NU_Delete_Task(NU_TASK *task); | |
| 954 STATUS NU_Reset_Task(NU_TASK *task, UNSIGNED argc, VOID *argv); | |
| 955 STATUS NU_Terminate_Task(NU_TASK *task); | |
| 956 STATUS NU_Resume_Task(NU_TASK *task); | |
| 957 STATUS NU_Suspend_Task(NU_TASK *task); | |
| 958 VOID NU_Relinquish(VOID); | |
| 959 VOID NU_Sleep(UNSIGNED ticks); | |
| 960 OPTION NU_Change_Priority(NU_TASK *task, OPTION new_priority); | |
| 961 OPTION NU_Change_Preemption(OPTION preempt); | |
| 962 UNSIGNED NU_Change_Time_Slice(NU_TASK *task, UNSIGNED time_slice); | |
| 963 UNSIGNED NU_Check_Stack(VOID); | |
| 964 NU_TASK *NU_Current_Task_Pointer(VOID); | |
| 965 UNSIGNED NU_Established_Tasks(VOID); | |
| 966 STATUS NU_Task_Information(NU_TASK *task, CHAR *name, | |
| 967 DATA_ELEMENT *status, UNSIGNED *scheduled_count, | |
| 968 OPTION *priority, OPTION *preempt, | |
| 969 UNSIGNED *time_slice, VOID **stack_base, | |
| 970 UNSIGNED *stack_size, UNSIGNED *minimum_stack); | |
| 971 UNSIGNED NU_Task_Pointers(NU_TASK **pointer_list, | |
| 972 UNSIGNED maximum_pointers); | |
| 973 | |
| 974 /* Define Mailbox management functions. */ | |
| 975 | |
| 976 STATUS NU_Create_Mailbox(NU_MAILBOX *mailbox, CHAR *name, | |
| 977 OPTION suspend_type); | |
| 978 STATUS NU_Delete_Mailbox(NU_MAILBOX *mailbox); | |
| 979 STATUS NU_Reset_Mailbox(NU_MAILBOX *mailbox); | |
| 980 STATUS NU_Send_To_Mailbox(NU_MAILBOX *mailbox, VOID *message, | |
| 981 UNSIGNED suspend); | |
| 982 STATUS NU_Broadcast_To_Mailbox(NU_MAILBOX *mailbox, VOID *message, | |
| 983 UNSIGNED suspend); | |
| 984 STATUS NU_Receive_From_Mailbox(NU_MAILBOX *mailbox, VOID *message, | |
| 985 UNSIGNED suspend); | |
| 986 UNSIGNED NU_Established_Mailboxes(VOID); | |
| 987 STATUS NU_Mailbox_Information(NU_MAILBOX *mailbox, CHAR *name, | |
| 988 OPTION *suspend_type, OPTION *message_present, | |
| 989 UNSIGNED *tasks_waiting, NU_TASK **first_task); | |
| 990 UNSIGNED NU_Mailbox_Pointers(NU_MAILBOX **pointer_list, | |
| 991 UNSIGNED maximum_pointers); | |
| 992 | |
| 993 /* Define Queue management functions. */ | |
| 994 | |
| 995 STATUS NU_Create_Queue(NU_QUEUE *queue, CHAR *name, | |
| 996 VOID *start_address, UNSIGNED queue_size, | |
| 997 OPTION message_type, UNSIGNED message_size, | |
| 998 OPTION suspend_type); | |
| 999 STATUS NU_Delete_Queue(NU_QUEUE *queue); | |
| 1000 STATUS NU_Reset_Queue(NU_QUEUE *queue); | |
| 1001 STATUS NU_Send_To_Front_Of_Queue(NU_QUEUE *queue, VOID *message, | |
| 1002 UNSIGNED size, UNSIGNED suspend); | |
| 1003 STATUS NU_Send_To_Queue(NU_QUEUE *queue, VOID *message, | |
| 1004 UNSIGNED size, UNSIGNED suspend); | |
| 1005 STATUS NU_Broadcast_To_Queue(NU_QUEUE *queue, VOID *message, | |
| 1006 UNSIGNED size, UNSIGNED suspend); | |
| 1007 STATUS NU_Receive_From_Queue(NU_QUEUE *queue, VOID *message, | |
| 1008 UNSIGNED size, UNSIGNED *actual_size, UNSIGNED suspend); | |
| 1009 UNSIGNED NU_Established_Queues(VOID); | |
| 1010 STATUS NU_Queue_Information(NU_QUEUE *queue, CHAR *name, | |
| 1011 VOID **start_address, UNSIGNED *queue_size, | |
| 1012 UNSIGNED *available, UNSIGNED *messages, | |
| 1013 OPTION *message_type, UNSIGNED *message_size, | |
| 1014 OPTION *suspend_type, UNSIGNED *tasks_waiting, | |
| 1015 NU_TASK **first_task); | |
| 1016 UNSIGNED NU_Queue_Pointers(NU_QUEUE **pointer_list, | |
| 1017 UNSIGNED maximum_pointers); | |
| 1018 | |
| 1019 /* Define Pipe management functions. */ | |
| 1020 | |
| 1021 STATUS NU_Create_Pipe(NU_PIPE *pipe, CHAR *name, | |
| 1022 VOID *start_address, UNSIGNED pipe_size, | |
| 1023 OPTION message_type, UNSIGNED message_size, | |
| 1024 OPTION suspend_type); | |
| 1025 STATUS NU_Delete_Pipe(NU_PIPE *pipe); | |
| 1026 STATUS NU_Reset_Pipe(NU_PIPE *pipe); | |
| 1027 STATUS NU_Send_To_Front_Of_Pipe(NU_PIPE *pipe, VOID *message, | |
| 1028 UNSIGNED size, UNSIGNED suspend); | |
| 1029 STATUS NU_Send_To_Pipe(NU_PIPE *pipe, VOID *message, | |
| 1030 UNSIGNED size, UNSIGNED suspend); | |
| 1031 STATUS NU_Broadcast_To_Pipe(NU_PIPE *pipe, VOID *message, | |
| 1032 UNSIGNED size, UNSIGNED suspend); | |
| 1033 STATUS NU_Receive_From_Pipe(NU_PIPE *pipe, VOID *message, | |
| 1034 UNSIGNED size, UNSIGNED *actual_size, UNSIGNED suspend); | |
| 1035 UNSIGNED NU_Established_Pipes(VOID); | |
| 1036 STATUS NU_Pipe_Information(NU_PIPE *pipe, CHAR *name, | |
| 1037 VOID **start_address, UNSIGNED *pipe_size, | |
| 1038 UNSIGNED *available, UNSIGNED *messages, | |
| 1039 OPTION *message_type, UNSIGNED *message_size, | |
| 1040 OPTION *suspend_type, UNSIGNED *tasks_waiting, | |
| 1041 NU_TASK **first_task); | |
| 1042 UNSIGNED NU_Pipe_Pointers(NU_PIPE **pointer_list, | |
| 1043 UNSIGNED maximum_pointers); | |
| 1044 | |
| 1045 /* Define Semaphore management functions. */ | |
| 1046 | |
| 1047 STATUS NU_Create_Semaphore(NU_SEMAPHORE *semaphore, CHAR *name, | |
| 1048 UNSIGNED initial_count, OPTION suspend_type); | |
| 1049 STATUS NU_Delete_Semaphore(NU_SEMAPHORE *semaphore); | |
| 1050 STATUS NU_Reset_Semaphore(NU_SEMAPHORE *semaphore, | |
| 1051 UNSIGNED initial_count); | |
| 1052 STATUS NU_Obtain_Semaphore(NU_SEMAPHORE *semaphore, UNSIGNED suspend); | |
| 1053 STATUS NU_Release_Semaphore(NU_SEMAPHORE *semaphore); | |
| 1054 UNSIGNED NU_Established_Semaphores(VOID); | |
| 1055 STATUS NU_Semaphore_Information(NU_SEMAPHORE *semaphore, CHAR *name, | |
| 1056 UNSIGNED *current_count, OPTION *suspend_type, | |
| 1057 UNSIGNED *tasks_waiting, NU_TASK **first_task); | |
| 1058 UNSIGNED NU_Semaphore_Pointers(NU_SEMAPHORE **pointer_list, | |
| 1059 UNSIGNED maximum_pointers); | |
| 1060 | |
| 1061 /* Define Event Group management functions. */ | |
| 1062 | |
| 1063 STATUS NU_Create_Event_Group(NU_EVENT_GROUP *group, CHAR *name); | |
| 1064 STATUS NU_Delete_Event_Group(NU_EVENT_GROUP *group); | |
| 1065 STATUS NU_Set_Events(NU_EVENT_GROUP *group, UNSIGNED events, | |
| 1066 OPTION operation); | |
| 1067 STATUS NU_Retrieve_Events(NU_EVENT_GROUP *group, | |
| 1068 UNSIGNED requested_flags, OPTION operation, | |
| 1069 UNSIGNED *retrieved_flags, UNSIGNED suspend); | |
| 1070 UNSIGNED NU_Established_Event_Groups(VOID); | |
| 1071 STATUS NU_Event_Group_Information(NU_EVENT_GROUP *group, CHAR *name, | |
| 1072 UNSIGNED *event_flags, UNSIGNED *tasks_waiting, | |
| 1073 NU_TASK **first_task); | |
| 1074 UNSIGNED NU_Event_Group_Pointers(NU_EVENT_GROUP **pointer_list, | |
| 1075 UNSIGNED maximum_pointers); | |
| 1076 | |
| 1077 /* Define Signal processing functions. */ | |
| 1078 | |
| 1079 UNSIGNED NU_Control_Signals(UNSIGNED signal_enable_mask); | |
| 1080 UNSIGNED NU_Receive_Signals(VOID); | |
| 1081 STATUS NU_Register_Signal_Handler(VOID (*signal_handler)(UNSIGNED)); | |
| 1082 STATUS NU_Send_Signals(NU_TASK *task, UNSIGNED signals); | |
| 1083 | |
| 1084 /* Define Partition memory management functions. */ | |
| 1085 | |
| 1086 STATUS NU_Create_Partition_Pool(NU_PARTITION_POOL *pool, CHAR *name, | |
| 1087 VOID *start_address, UNSIGNED pool_size, | |
| 1088 UNSIGNED partition_size, OPTION suspend_type); | |
| 1089 STATUS NU_Delete_Partition_Pool(NU_PARTITION_POOL *pool); | |
| 1090 STATUS NU_Allocate_Partition(NU_PARTITION_POOL *pool, | |
| 1091 VOID **return_pointer, UNSIGNED suspend); | |
| 1092 STATUS NU_Deallocate_Partition(VOID *partition); | |
| 1093 UNSIGNED NU_Established_Partition_Pools(VOID); | |
| 1094 STATUS NU_Partition_Pool_Information(NU_PARTITION_POOL *pool, | |
| 1095 CHAR *name, | |
| 1096 VOID **start_address, UNSIGNED *pool_size, | |
| 1097 UNSIGNED *partition_size, UNSIGNED *available, | |
| 1098 UNSIGNED *allocated, OPTION *suspend_type, | |
| 1099 UNSIGNED *tasks_waiting, NU_TASK **first_task); | |
| 1100 UNSIGNED NU_Partition_Pool_Pointers(NU_PARTITION_POOL **pointer_list, | |
| 1101 UNSIGNED maximum_pointers); | |
| 1102 | |
| 1103 /* Define Dynamic memory management functions. */ | |
| 1104 | |
| 1105 STATUS NU_Create_Memory_Pool(NU_MEMORY_POOL *pool, CHAR *name, | |
| 1106 VOID *start_address, UNSIGNED pool_size, | |
| 1107 UNSIGNED min_allocation, OPTION suspend_type); | |
| 1108 STATUS NU_Delete_Memory_Pool(NU_MEMORY_POOL *pool); | |
| 1109 | |
| 1110 STATUS NU_Allocate_Memory(NU_MEMORY_POOL *pool, VOID **return_pointer, | |
| 1111 UNSIGNED size, UNSIGNED suspend); | |
| 1112 | |
| 1113 /* The following conditional routes memory allocation calls to functions | |
| 1114 that help track memory leaks. */ | |
| 1115 #ifdef NU_DEBUG_MEMORY | |
| 1116 #define NU_Allocate_Memory(a,b,c,d) ERC_Allocate_Memory(a,b,c,d,__LINE__,__FILE__) | |
| 1117 #else | |
| 1118 #define NU_Allocate_Memory DMCE_Allocate_Memory | |
| 1119 #endif /* NU_DEBUG_MEMORY */ | |
| 1120 | |
| 1121 STATUS NU_Deallocate_Memory(VOID *memory); | |
| 1122 UNSIGNED NU_Established_Memory_Pools(VOID); | |
| 1123 STATUS NU_Memory_Pool_Information(NU_MEMORY_POOL *pool, CHAR *name, | |
| 1124 VOID **start_address, UNSIGNED *pool_size, | |
| 1125 UNSIGNED *min_allocation, UNSIGNED *available, | |
| 1126 OPTION *suspend_type, UNSIGNED *tasks_waiting, | |
| 1127 NU_TASK **first_task); | |
| 1128 UNSIGNED NU_Memory_Pool_Pointers(NU_MEMORY_POOL **pointer_list, | |
| 1129 UNSIGNED maximum_pointers); | |
| 1130 | |
| 1131 /* Define Interrupt management functions. */ | |
| 1132 | |
| 1133 INT NU_Control_Interrupts(INT new_level); | |
| 1134 INT NU_Local_Control_Interrupts(INT new_level); | |
| 1135 VOID NU_Restore_Interrupts(VOID); | |
| 1136 VOID *NU_Setup_Vector(INT vector, VOID *new_vector); | |
| 1137 STATUS NU_Register_LISR(INT vector, | |
| 1138 VOID (*new_lisr)(INT), | |
| 1139 VOID (**old_lisr)(INT)); | |
| 1140 STATUS NU_Activate_HISR(NU_HISR *hisr); | |
| 1141 STATUS NU_Create_HISR(NU_HISR *hisr, CHAR *name, | |
| 1142 VOID (*hisr_entry)(VOID), OPTION priority, | |
| 1143 VOID *stack_address, UNSIGNED stack_size); | |
| 1144 STATUS NU_Delete_HISR(NU_HISR *hisr); | |
| 1145 NU_HISR *NU_Current_HISR_Pointer(VOID); | |
| 1146 UNSIGNED NU_Established_HISRs(VOID); | |
| 1147 STATUS NU_HISR_Information(NU_HISR *hisr, CHAR *name, | |
| 1148 UNSIGNED *scheduled_count, DATA_ELEMENT *priority, | |
| 1149 VOID **stack_base, UNSIGNED *stack_size, | |
| 1150 UNSIGNED *minimum_stack); | |
| 1151 UNSIGNED NU_HISR_Pointers(NU_HISR **pointer_list, | |
| 1152 UNSIGNED maximum_pointers); | |
| 1153 VOID NU_Protect(NU_PROTECT *protect_struct); | |
| 1154 VOID NU_Unprotect(VOID); | |
| 1155 | |
| 1156 /* Timer management functions. */ | |
| 1157 | |
| 1158 STATUS NU_Create_Timer(NU_TIMER *timer, CHAR *name, | |
| 1159 VOID (*expiration_routine)(UNSIGNED), UNSIGNED id, | |
| 1160 UNSIGNED initial_time, UNSIGNED reschedule_time, | |
| 1161 OPTION enable); | |
| 1162 STATUS NU_Delete_Timer(NU_TIMER *timer); | |
| 1163 STATUS NU_Reset_Timer(NU_TIMER *timer, | |
| 1164 VOID (*expiration_routine)(UNSIGNED), | |
| 1165 UNSIGNED initial_time, UNSIGNED reschedule_timer, | |
| 1166 OPTION enable); | |
| 1167 STATUS NU_Control_Timer(NU_TIMER *timer, OPTION enable); | |
| 1168 UNSIGNED NU_Established_Timers(VOID); | |
| 1169 STATUS NU_Timer_Information(NU_TIMER *timer, CHAR *name, | |
| 1170 OPTION *enable, UNSIGNED *expirations, UNSIGNED *id, | |
| 1171 UNSIGNED *initial_time, UNSIGNED *reschedule_time); | |
| 1172 UNSIGNED NU_Timer_Pointers(NU_TIMER **pointer_list, | |
| 1173 UNSIGNED maximum_pointers); | |
| 1174 VOID NU_Set_Clock(UNSIGNED new_value); | |
| 1175 UNSIGNED NU_Retrieve_Clock(VOID); | |
| 1176 | |
| 1177 /* Development support functions. */ | |
| 1178 | |
| 1179 CHAR *NU_Release_Information(VOID); | |
| 1180 CHAR *NU_License_Information(VOID); | |
| 1181 VOID NU_Disable_History_Saving(VOID); | |
| 1182 VOID NU_Enable_History_Saving(VOID); | |
| 1183 VOID NU_Make_History_Entry(UNSIGNED param1, UNSIGNED param2, | |
| 1184 UNSIGNED param3); | |
| 1185 STATUS NU_Retrieve_History_Entry(DATA_ELEMENT *id, | |
| 1186 UNSIGNED *param1, UNSIGNED *param2, UNSIGNED *param3, | |
| 1187 UNSIGNED *time, NU_TASK **task, NU_HISR **hisr); | |
| 1188 | |
| 1189 /* Input/Output Driver functions. */ | |
| 1190 | |
| 1191 STATUS NU_Create_Driver(NU_DRIVER *driver, CHAR *name, | |
| 1192 VOID (*driver_entry)(NU_DRIVER *, NU_DRIVER_REQUEST *)); | |
| 1193 STATUS NU_Delete_Driver(NU_DRIVER *driver); | |
| 1194 STATUS NU_Request_Driver(NU_DRIVER *driver, | |
| 1195 NU_DRIVER_REQUEST *request); | |
| 1196 STATUS NU_Resume_Driver(NU_TASK *task); | |
| 1197 STATUS NU_Suspend_Driver(VOID (*terminate_routine)(VOID *), | |
| 1198 VOID *information, UNSIGNED timeout); | |
| 1199 UNSIGNED NU_Established_Drivers(VOID); | |
| 1200 UNSIGNED NU_Driver_Pointers(NU_DRIVER **pointer_list, | |
| 1201 UNSIGNED maximum_pointers); | |
| 1202 | |
| 1203 #endif | |
| 1204 | |
| 1205 /* Define Supervisor and User mode functions */ | |
| 1206 #if (!defined(NU_SUPERV_USER_MODE)) || (NU_SUPERV_USER_MODE < 1) | |
| 1207 | |
| 1208 #define NU_IS_SUPERVISOR_MODE() (NU_TRUE) | |
| 1209 #define NU_SUPERVISOR_MODE() ((void) 0) | |
| 1210 #define NU_USER_MODE() ((void) 0) | |
| 1211 #define NU_SUPERV_USER_VARIABLES /* Not a Supervisor/User kernel */ | |
| 1212 | |
| 1213 #else /* NU_SUPERV_USER_MODE defined */ | |
| 1214 | |
| 1215 #include "tc_defs.h" | |
| 1216 #include "mmu/inc/su_extr.h" | |
| 1217 | |
| 1218 #endif /* NU_SUPERV_USER_MODE */ | |
| 1219 | |
| 1220 #ifdef __cplusplus | |
| 1221 } /* End of C declarations */ | |
| 1222 #endif | |
| 1223 | |
| 1224 #endif /* !NUCLEUS */ | |
| 1225 | |
| 1226 | |
| 1227 | |
| 1228 |
