⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nucleus.h

📁 Nucleus嵌入式操作系统在s3c2410上的一个应用程序实验
💻 H
📖 第 1 页 / 共 5 页
字号:

/* 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  */
};

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      */
};


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*/
    
    /* Define a union of all the different types of request structures. */
    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;
    
} 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
#define         NU_Receive_From_Queue           QUC_Receive_From_Queue
#define         NU_Established_Queues           QUF_Established_Queues
#define         NU_Queue_Information            QUF_Queue_Information
#define         NU_Queue_Pointers               QUF_Queue_Pointers
#define         NU_Create_Pipe                  PIC_Create_Pipe 
#define         NU_Delete_Pipe                  PIC_Delete_Pipe 
#define         NU_Reset_Pipe                   PIS_Reset_Pipe
#define         NU_Send_To_Front_Of_Pipe        PIS_Send_To_Front_Of_Pipe 
#define         NU_Send_To_Pipe                 PIC_Send_To_Pipe 
#define         NU_Broadcast_To_Pipe            PIS_Broadcast_To_Pipe 
#define         NU_Receive_From_Pipe            PIC_Receive_From_Pipe 
#define         NU_Established_Pipes            PIF_Established_Pipes   
#define         NU_Pipe_Information             PIF_Pipe_Information
#define         NU_Pipe_Pointers                PIF_Pipe_Pointers
#define         NU_Create_Semaphore             SMC_Create_Semaphore
#define         NU_Delete_Semaphore             SMC_Delete_Semaphore
#define         NU_Reset_Semaphore              SMS_Reset_Semaphore
#define         NU_Obtain_Semaphore             SMC_Obtain_Semaphore
#define         NU_Release_Semaphore            SMC_Release_Semaphore
#define         NU_Established_Semaphores       SMF_Established_Semaphores
#define         NU_Semaphore_Information        SMF_Semaphore_Information
#define         NU_Semaphore_Pointers           SMF_Semaphore_Pointers
#define         NU_Create_Event_Group           EVC_Create_Event_Group
#define         NU_Delete_Event_Group           EVC_Delete_Event_Group
#define         NU_Set_Events                   EVC_Set_Events
#define         NU_Retrieve_Events              EVC_Retrieve_Events

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -