📄 nucleus.h
字号:
#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 NU_ASSERT_ID 66
#define NU_ALLOCATE_ALIGNED_ID 67
/* Define the basic data structure templates. */
#include "plus/inc/cs_defs.h"
#include "plus/inc/tm_defs.h"
#include "plus/inc/tc_defs.h"
#include "plus/inc/mb_defs.h"
#include "plus/inc/qu_defs.h"
#include "plus/inc/pi_defs.h"
#include "plus/inc/sm_defs.h"
#include "plus/inc/ev_defs.h"
#include "plus/inc/pm_defs.h"
#include "plus/inc/dm_defs.h"
/* Define the number of UNSIGNED words in the NU_DRIVER structure. */
#define NU_DRIVER_SIZE 5
/* Define task control data structure with the actual internal data structure. */
typedef TC_TCB NU_TASK;
/* Define HISR control data structure with the actual internal data structure. */
typedef TC_HCB NU_HISR;
/* Define mailbox control data structure with the actual internal data structure. */
typedef MB_MCB NU_MAILBOX;
/* Define queue control data structure with the actual internal data structure. */
typedef QU_QCB NU_QUEUE;
/* Define pipe control data structure with the actual internal data structure. */
typedef PI_PCB NU_PIPE;
/* Define semaphore control data structure with the actual internal data structure. */
typedef SM_SCB NU_SEMAPHORE;
/* Define event group control data structure with the actual internal data structure. */
typedef EV_GCB NU_EVENT_GROUP;
/* Define partition pool control data structure with the actual internal data structure. */
typedef PM_PCB NU_PARTITION_POOL;
/* Define memory pool control data structure with the actual internal data structure. */
typedef DM_PCB NU_MEMORY_POOL;
/* Define timer control data structure with the actual internal data structure. */
typedef TM_APP_TCB NU_TIMER;
/* Define protect control data structure with the actual internal data structure. */
typedef TC_PROTECT NU_PROTECT;
/* 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 */
};
struct NU_ASSIGN_STRUCT
{
UNSIGNED nu_logical_unit; /* Logical unit number */
INT nu_assign_info; /* Additional assign info */
};
struct NU_RELEASE_STRUCT
{
UNSIGNED nu_logical_unit; /* Logical unit number */
INT nu_release_info; /* Additional release info */
};
struct NU_INPUT_STRUCT
{
UNSIGNED nu_logical_unit; /* Logical unit number */
UNSIGNED nu_offset; /* Offset of input */
UNSIGNED nu_request_size; /* Requested input size */
UNSIGNED nu_actual_size; /* Actual input size */
VOID *nu_buffer_ptr; /* Input buffer pointer */
};
struct NU_OUTPUT_STRUCT
{
UNSIGNED nu_logical_unit; /* Logical unit number */
UNSIGNED nu_offset; /* Offset of output */
UNSIGNED nu_request_size; /* Requested output size */
UNSIGNED nu_actual_size; /* Actual output size */
VOID *nu_buffer_ptr; /* Output buffer pointer */
};
struct NU_STATUS_STRUCT
{
UNSIGNED nu_logical_unit; /* Logical unit number */
VOID *nu_extra_status; /* Additional status ptr */
};
struct NU_TERMINATE_STRUCT
{
UNSIGNED nu_logical_unit; /* Logical unit number */
};
/* Define a union of all the different types of request structures. */
typedef union NU_REQUEST_INFO_UNION
{
struct NU_INITIALIZE_STRUCT nu_initialize;
struct NU_ASSIGN_STRUCT nu_assign;
struct NU_RELEASE_STRUCT nu_release;
struct NU_INPUT_STRUCT nu_input;
struct NU_OUTPUT_STRUCT nu_output;
struct NU_STATUS_STRUCT nu_status;
struct NU_TERMINATE_STRUCT nu_terminate;
} nu_request_info_union;
typedef struct NU_DRIVER_REQUEST_STRUCT
{
INT nu_function; /* I/O request function */
UNSIGNED nu_timeout; /* Timeout on request */
STATUS nu_status; /* Status of request */
UNSIGNED nu_supplemental; /* Supplemental information */
VOID *nu_supplemental_ptr; /* Supplemental info pointer*/
nu_request_info_union nu_request_info;
} NU_DRIVER_REQUEST;
typedef struct NU_DRIVER_STRUCT
{
UNSIGNED words[NU_DRIVER_SIZE]; /* CS_NODE_STRUCT */
CHAR nu_driver_name[NU_MAX_NAME];
VOID *nu_info_ptr;
UNSIGNED nu_driver_id;
VOID (*nu_driver_entry)(struct NU_DRIVER_STRUCT *,
NU_DRIVER_REQUEST *);
} NU_DRIVER;
/* Define Nucleus PLUS system interfaces. */
VOID Application_Initialize(VOID *first_available_memory);
/* The following area is only applicable to application files and is skipped
during compilation of Nucleus PLUS source files. */
#ifndef NU_SOURCE_FILE
/* Re-map task control functions depending on whether or not error checking
is specified. */
#ifdef NU_NO_ERROR_CHECKING
#define NU_Create_Task TCC_Create_Task
#define NU_Delete_Task TCC_Delete_Task
#define NU_Reset_Task TCC_Reset_Task
#define NU_Terminate_Task TCC_Terminate_Task
#define NU_Resume_Task TCC_Resume_Service
#define NU_Suspend_Task TCC_Suspend_Service
#define NU_Relinquish TCC_Relinquish
#define NU_Sleep TCC_Task_Sleep
#define NU_Change_Priority TCS_Change_Priority
#define NU_Change_Preemption TCS_Change_Preemption
#define NU_Change_Time_Slice TCS_Change_Time_Slice
#define NU_Check_Stack TCT_Check_Stack
#define NU_Current_Task_Pointer TCC_Current_Task_Pointer
#define NU_Established_Tasks TCF_Established_Tasks
#define NU_Task_Information TCF_Task_Information
#define NU_Task_Pointers TCF_Task_Pointers
#define NU_Create_Mailbox MBC_Create_Mailbox
#define NU_Delete_Mailbox MBC_Delete_Mailbox
#define NU_Reset_Mailbox MBS_Reset_Mailbox
#define NU_Send_To_Mailbox MBC_Send_To_Mailbox
#define NU_Broadcast_To_Mailbox MBS_Broadcast_To_Mailbox
#define NU_Receive_From_Mailbox MBC_Receive_From_Mailbox
#define NU_Established_Mailboxes MBF_Established_Mailboxes
#define NU_Mailbox_Information MBF_Mailbox_Information
#define NU_Mailbox_Pointers MBF_Mailbox_Pointers
#define NU_Create_Queue QUC_Create_Queue
#define NU_Delete_Queue QUC_Delete_Queue
#define NU_Reset_Queue QUS_Reset_Queue
#define NU_Send_To_Front_Of_Queue QUS_Send_To_Front_Of_Queue
#define NU_Send_To_Queue QUC_Send_To_Queue
#define NU_Broadcast_To_Queue QUS_Broadcast_To_Queue
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -