📄 nucleus.h
字号:
/* Define system errors. */#define NU_ERROR_CREATING_TIMER_HISR 1#define NU_ERROR_CREATING_TIMER_TASK 2#define NU_STACK_OVERFLOW 3#define NU_UNHANDLED_INTERRUPT 4/* Define I/O driver constants. */#define NU_IO_ERROR -1#define NU_INITIALIZE 1#define NU_ASSIGN 2#define NU_RELEASE 3#define NU_INPUT 4#define NU_OUTPUT 5#define NU_STATUS 6#define NU_TERMINATE 7/* Define history entry IDs. */#define NU_USER_ID 1#define NU_CREATE_TASK_ID 2#define NU_DELETE_TASK_ID 3#define NU_RESET_TASK_ID 4#define NU_TERMINATE_TASK_ID 5#define NU_RESUME_TASK_ID 6#define NU_SUSPEND_TASK_ID 7#define NU_RELINQUISH_ID 8#define NU_SLEEP_ID 9#define NU_CHANGE_PRIORITY_ID 10#define NU_CHANGE_PREEMPTION_ID 11#define NU_CREATE_MAILBOX_ID 12#define NU_DELETE_MAILBOX_ID 13#define NU_RESET_MAILBOX_ID 14#define NU_SEND_TO_MAILBOX_ID 15#define NU_BROADCAST_TO_MAILBOX_ID 16#define NU_RECEIVE_FROM_MAILBOX_ID 17#define NU_CREATE_QUEUE_ID 18#define NU_DELETE_QUEUE_ID 19#define NU_RESET_QUEUE_ID 20#define NU_SEND_TO_FRONT_OF_QUEUE_ID 21#define NU_SEND_TO_QUEUE_ID 22#define NU_BROADCAST_TO_QUEUE_ID 23#define NU_RECEIVE_FROM_QUEUE_ID 24#define NU_CREATE_PIPE_ID 25 #define NU_DELETE_PIPE_ID 26 #define NU_RESET_PIPE_ID 27#define NU_SEND_TO_FRONT_OF_PIPE_ID 28 #define NU_SEND_TO_PIPE_ID 29 #define NU_BROADCAST_TO_PIPE_ID 30 #define NU_RECEIVE_FROM_PIPE_ID 31 #define NU_CREATE_SEMAPHORE_ID 32#define NU_DELETE_SEMAPHORE_ID 33#define NU_RESET_SEMAPHORE_ID 34#define NU_OBTAIN_SEMAPHORE_ID 35#define NU_RELEASE_SEMAPHORE_ID 36#define NU_CREATE_EVENT_GROUP_ID 37#define NU_DELETE_EVENT_GROUP_ID 38#define NU_SET_EVENTS_ID 39#define NU_RETRIEVE_EVENTS_ID 40#define NU_CREATE_PARTITION_POOL_ID 41#define NU_DELETE_PARTITION_POOL_ID 42#define NU_ALLOCATE_PARTITION_ID 43#define NU_DEALLOCATE_PARTITION_ID 44#define NU_CREATE_MEMORY_POOL_ID 45#define NU_DELETE_MEMORY_POOL_ID 46#define NU_ALLOCATE_MEMORY_ID 47#define NU_DEALLOCATE_MEMORY_ID 48#define NU_CONTROL_SIGNALS_ID 49#define NU_RECEIVE_SIGNALS_ID 50#define NU_REGISTER_SIGNAL_HANDLER_ID 51#define NU_SEND_SIGNALS_ID 52#define NU_REGISTER_LISR_ID 53#define NU_CREATE_HISR_ID 54#define NU_DELETE_HISR_ID 55#define NU_CREATE_TIMER_ID 56#define NU_DELETE_TIMER_ID 57#define NU_CONTROL_TIMER_ID 58#define NU_RESET_TIMER_ID 59#define NU_CREATE_DRIVER_ID 60#define NU_DELETE_DRIVER_ID 61#define NU_REQUEST_DRIVER_ID 62#define NU_RESUME_DRIVER_ID 63#define NU_SUSPEND_DRIVER_ID 64#define NU_CHANGE_TIME_SLICE_ID 65/* Define the basic data structure templates. If the NU_DEBUG conditional compilation is specified, the actual structure definition is used. */#ifdef NU_DEBUG#include "cs_defs.h"#include "tm_defs.h"#include "tc_defs.h"#include "mb_defs.h"#include "qu_defs.h"#include "pi_defs.h"#include "sm_defs.h"#include "ev_defs.h"#include "pm_defs.h"#include "dm_defs.h"#endif#ifndef NU_DEBUG/* Define task control data structure with all internal information hidden. */typedef struct NU_TASK_STRUCT{ UNSIGNED words[NU_TASK_SIZE];} NU_TASK;#else/* Define task control data structure with the actual internal data structure. */typedef TC_TCB NU_TASK;#endif#ifndef NU_DEBUG/* Define HISR control data structure with all internal information hidden. */typedef struct NU_HISR_STRUCT{ UNSIGNED words[NU_HISR_SIZE];} NU_HISR;#else/* Define HISR control data structure with the actual internal data structure. */typedef TC_HCB NU_HISR;#endif#ifndef NU_DEBUG/* Define mailbox control data structure with all internal information hidden. */ typedef struct NU_MAILBOX_STRUCT{ UNSIGNED words[NU_MAILBOX_SIZE];} NU_MAILBOX;#else/* Define mailbox control data structure with the actual internal data structure. */typedef MB_MCB NU_MAILBOX;#endif #ifndef NU_DEBUG/* Define queue control data structure with all internal information hidden. */ typedef struct NU_QUEUE_STRUCT{ UNSIGNED words[NU_QUEUE_SIZE];} NU_QUEUE;#else/* Define queue control data structure with the actual internal data structure. */typedef QU_QCB NU_QUEUE;#endif#ifndef NU_DEBUG/* Define pipe control data structure with all internal information hidden. */ typedef struct NU_PIPE_STRUCT{ UNSIGNED words[NU_PIPE_SIZE];} NU_PIPE;#else/* Define pipe control data structure with the actual internal data structure. */typedef PI_PCB NU_PIPE;#endif#ifndef NU_DEBUG/* Define semaphore control data structure with all internal information hidden. */ typedef struct NU_SEMAPHORE_STRUCT{ UNSIGNED words[NU_SEMAPHORE_SIZE];} NU_SEMAPHORE;#else/* Define semaphore control data structure with the actual internal data structure. */typedef SM_SCB NU_SEMAPHORE;#endif#ifndef NU_DEBUG/* Define event group control data structure with all internal information hidden. */ typedef struct NU_EVENT_GROUP_STRUCT{ UNSIGNED words[NU_EVENT_GROUP_SIZE];} NU_EVENT_GROUP;#else/* Define event group control data structure with the actual internal data structure. */typedef EV_GCB NU_EVENT_GROUP;#endif#ifndef NU_DEBUG/* Define partition pool control data structure with all internal information hidden. */ typedef struct NU_PARTITION_POOL_STRUCT{ UNSIGNED words[NU_PARTITION_POOL_SIZE];} NU_PARTITION_POOL;#else/* Define partition pool control data structure with the actual internal data structure. */typedef PM_PCB NU_PARTITION_POOL;#endif#ifndef NU_DEBUG/* Define memory pool control data structure with all internal information hidden. */ typedef struct NU_MEMORY_POOL_STRUCT{ UNSIGNED words[NU_MEMORY_POOL_SIZE];} NU_MEMORY_POOL;#else/* Define memory pool control data structure with the actual internal data structure. */typedef DM_PCB NU_MEMORY_POOL;#endif#ifndef NU_DEBUG/* Define timer control data structure with all internal information hidden. */ typedef struct NU_TIMER_STRUCT{ UNSIGNED words[NU_TIMER_SIZE];} NU_TIMER;#else/* Define timer control data structure with the actual internal data structure. */typedef TM_APP_TCB NU_TIMER;#endif#ifndef NU_DEBUG/* Define protect control data structure with all internal information hidden. */ typedef struct NU_PROTECT_STRUCT{ UNSIGNED words[NU_PROTECT_SIZE];} NU_PROTECT;#else/* Define protect control data structure with the actual internal data structure. */typedef TC_PROTECT NU_PROTECT;#endif/* Define I/O driver request structures. */struct NU_INITIALIZE_STRUCT{ VOID *nu_io_address; /* Base IO address */ UNSIGNED nu_logical_units; /* Number of logical units */ VOID *nu_memory; /* Generic memory pointer */ INT nu_vector; /* Interrupt vector number */};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -