📄 nucleus.h
字号:
UNSIGNED NU_Check_Stack(VOID);
NU_TASK *NU_Current_Task_Pointer(VOID);
UNSIGNED NU_Established_Tasks(VOID);
STATUS NU_Task_Information(NU_TASK *task, CHAR *name,
DATA_ELEMENT *status, UNSIGNED *scheduled_count,
OPTION *priority, OPTION *preempt,
UNSIGNED *time_slice, VOID **stack_base,
UNSIGNED *stack_size, UNSIGNED *minimum_stack);
UNSIGNED NU_Task_Pointers(NU_TASK **pointer_list,
UNSIGNED maximum_pointers);
/* Define Mailbox management functions. */
STATUS NU_Create_Mailbox(NU_MAILBOX *mailbox, CHAR *name,
OPTION suspend_type);
STATUS NU_Delete_Mailbox(NU_MAILBOX *mailbox);
STATUS NU_Reset_Mailbox(NU_MAILBOX *mailbox);
STATUS NU_Send_To_Mailbox(NU_MAILBOX *mailbox, VOID *message,
UNSIGNED suspend);
STATUS NU_Broadcast_To_Mailbox(NU_MAILBOX *mailbox, VOID *message,
UNSIGNED suspend);
STATUS NU_Receive_From_Mailbox(NU_MAILBOX *mailbox, VOID *message,
UNSIGNED suspend);
UNSIGNED NU_Established_Mailboxes(VOID);
STATUS NU_Mailbox_Information(NU_MAILBOX *mailbox, CHAR *name,
OPTION *suspend_type, OPTION *message_present,
UNSIGNED *tasks_waiting, NU_TASK **first_task);
UNSIGNED NU_Mailbox_Pointers(NU_MAILBOX **pointer_list,
UNSIGNED maximum_pointers);
/* Define Queue management functions. */
STATUS NU_Create_Queue(NU_QUEUE *queue, CHAR *name,
VOID *start_address, UNSIGNED queue_size,
OPTION message_type, UNSIGNED message_size,
OPTION suspend_type);
STATUS NU_Delete_Queue(NU_QUEUE *queue);
STATUS NU_Reset_Queue(NU_QUEUE *queue);
STATUS NU_Send_To_Front_Of_Queue(NU_QUEUE *queue, VOID *message,
UNSIGNED size, UNSIGNED suspend);
STATUS NU_Send_To_Queue(NU_QUEUE *queue, VOID *message,
UNSIGNED size, UNSIGNED suspend);
STATUS NU_Broadcast_To_Queue(NU_QUEUE *queue, VOID *message,
UNSIGNED size, UNSIGNED suspend);
STATUS NU_Receive_From_Queue(NU_QUEUE *queue, VOID *message,
UNSIGNED size, UNSIGNED *actual_size, UNSIGNED suspend);
UNSIGNED NU_Established_Queues(VOID);
STATUS NU_Queue_Information(NU_QUEUE *queue, CHAR *name,
VOID **start_address, UNSIGNED *queue_size,
UNSIGNED *available, UNSIGNED *messages,
OPTION *message_type, UNSIGNED *message_size,
OPTION *suspend_type, UNSIGNED *tasks_waiting,
NU_TASK **first_task);
UNSIGNED NU_Queue_Pointers(NU_QUEUE **pointer_list,
UNSIGNED maximum_pointers);
/* Define Pipe management functions. */
STATUS NU_Create_Pipe(NU_PIPE *pipe, CHAR *name,
VOID *start_address, UNSIGNED pipe_size,
OPTION message_type, UNSIGNED message_size,
OPTION suspend_type);
STATUS NU_Delete_Pipe(NU_PIPE *pipe);
STATUS NU_Reset_Pipe(NU_PIPE *pipe);
STATUS NU_Send_To_Front_Of_Pipe(NU_PIPE *pipe, VOID *message,
UNSIGNED size, UNSIGNED suspend);
STATUS NU_Send_To_Pipe(NU_PIPE *pipe, VOID *message,
UNSIGNED size, UNSIGNED suspend);
STATUS NU_Broadcast_To_Pipe(NU_PIPE *pipe, VOID *message,
UNSIGNED size, UNSIGNED suspend);
STATUS NU_Receive_From_Pipe(NU_PIPE *pipe, VOID *message,
UNSIGNED size, UNSIGNED *actual_size, UNSIGNED suspend);
UNSIGNED NU_Established_Pipes(VOID);
STATUS NU_Pipe_Information(NU_PIPE *pipe, CHAR *name,
VOID **start_address, UNSIGNED *pipe_size,
UNSIGNED *available, UNSIGNED *messages,
OPTION *message_type, UNSIGNED *message_size,
OPTION *suspend_type, UNSIGNED *tasks_waiting,
NU_TASK **first_task);
UNSIGNED NU_Pipe_Pointers(NU_PIPE **pointer_list,
UNSIGNED maximum_pointers);
/* Define Semaphore management functions. */
STATUS NU_Create_Semaphore(NU_SEMAPHORE *semaphore, CHAR *name,
UNSIGNED initial_count, OPTION suspend_type);
STATUS NU_Delete_Semaphore(NU_SEMAPHORE *semaphore);
STATUS NU_Reset_Semaphore(NU_SEMAPHORE *semaphore,
UNSIGNED initial_count);
STATUS NU_Obtain_Semaphore(NU_SEMAPHORE *semaphore, UNSIGNED suspend);
STATUS NU_Release_Semaphore(NU_SEMAPHORE *semaphore);
UNSIGNED NU_Established_Semaphores(VOID);
STATUS NU_Semaphore_Information(NU_SEMAPHORE *semaphore, CHAR *name,
UNSIGNED *current_count, OPTION *suspend_type,
UNSIGNED *tasks_waiting, NU_TASK **first_task);
UNSIGNED NU_Semaphore_Pointers(NU_SEMAPHORE **pointer_list,
UNSIGNED maximum_pointers);
/* Define Event Group management functions. */
STATUS NU_Create_Event_Group(NU_EVENT_GROUP *group, CHAR *name);
STATUS NU_Delete_Event_Group(NU_EVENT_GROUP *group);
STATUS NU_Set_Events(NU_EVENT_GROUP *group, UNSIGNED events,
OPTION operation);
STATUS NU_Retrieve_Events(NU_EVENT_GROUP *group,
UNSIGNED requested_flags, OPTION operation,
UNSIGNED *retrieved_flags, UNSIGNED suspend);
UNSIGNED NU_Established_Event_Groups(VOID);
STATUS NU_Event_Group_Information(NU_EVENT_GROUP *group, CHAR *name,
UNSIGNED *event_flags, UNSIGNED *tasks_waiting,
NU_TASK **first_task);
UNSIGNED NU_Event_Group_Pointers(NU_EVENT_GROUP **pointer_list,
UNSIGNED maximum_pointers);
/* Define Signal processing functions. */
UNSIGNED NU_Control_Signals(UNSIGNED signal_enable_mask);
UNSIGNED NU_Receive_Signals(VOID);
STATUS NU_Register_Signal_Handler(VOID (*signal_handler)(UNSIGNED));
STATUS NU_Send_Signals(NU_TASK *task, UNSIGNED signals);
/* Define Partition memory management functions. */
STATUS NU_Create_Partition_Pool(NU_PARTITION_POOL *pool, CHAR *name,
VOID *start_address, UNSIGNED pool_size,
UNSIGNED partition_size, OPTION suspend_type);
STATUS NU_Delete_Partition_Pool(NU_PARTITION_POOL *pool);
STATUS NU_Allocate_Partition(NU_PARTITION_POOL *pool,
VOID **return_pointer, UNSIGNED suspend);
STATUS NU_Deallocate_Partition(VOID *partition);
UNSIGNED NU_Established_Partition_Pools(VOID);
STATUS NU_Partition_Pool_Information(NU_PARTITION_POOL *pool,
CHAR *name,
VOID **start_address, UNSIGNED *pool_size,
UNSIGNED *partition_size, UNSIGNED *available,
UNSIGNED *allocated, OPTION *suspend_type,
UNSIGNED *tasks_waiting, NU_TASK **first_task);
UNSIGNED NU_Partition_Pool_Pointers(NU_PARTITION_POOL **pointer_list,
UNSIGNED maximum_pointers);
/* Define Dynamic memory management functions. */
STATUS NU_Create_Memory_Pool(NU_MEMORY_POOL *pool, CHAR *name,
VOID *start_address, UNSIGNED pool_size,
UNSIGNED min_allocation, OPTION suspend_type);
STATUS NU_Delete_Memory_Pool(NU_MEMORY_POOL *pool);
STATUS NU_Allocate_Memory(NU_MEMORY_POOL *pool, VOID **return_pointer,
UNSIGNED size, UNSIGNED suspend);
#if defined(NU_MMU_MODE) && (NU_MMU_MODE > 0)
STATUS NU_Allocate_Aligned_Memory(NU_MEMORY_POOL *pool_ptr,
VOID **return_pointer, UNSIGNED size,
UNSIGNED alignment, UNSIGNED suspend);
#endif
STATUS NU_Deallocate_Memory(VOID *memory);
UNSIGNED NU_Established_Memory_Pools(VOID);
STATUS NU_Memory_Pool_Information(NU_MEMORY_POOL *pool, CHAR *name,
VOID **start_address, UNSIGNED *pool_size,
UNSIGNED *min_allocation, UNSIGNED *available,
OPTION *suspend_type, UNSIGNED *tasks_waiting,
NU_TASK **first_task);
UNSIGNED NU_Memory_Pool_Pointers(NU_MEMORY_POOL **pointer_list,
UNSIGNED maximum_pointers);
/* Define Interrupt management functions. */
INT NU_Control_Interrupts(INT new_level);
INT NU_Local_Control_Interrupts(INT new_level);
VOID NU_Restore_Interrupts(VOID);
VOID *NU_Setup_Vector(INT vector, VOID *new_vector);
STATUS NU_Register_LISR(INT vector,
VOID (*new_lisr)(INT),
VOID (**old_lisr)(INT));
STATUS NU_Activate_HISR(NU_HISR *hisr);
STATUS NU_Create_HISR(NU_HISR *hisr, CHAR *name,
VOID (*hisr_entry)(VOID), OPTION priority,
VOID *stack_address, UNSIGNED stack_size);
STATUS NU_Delete_HISR(NU_HISR *hisr);
NU_HISR *NU_Current_HISR_Pointer(VOID);
UNSIGNED NU_Established_HISRs(VOID);
STATUS NU_HISR_Information(NU_HISR *hisr, CHAR *name,
UNSIGNED *scheduled_count, DATA_ELEMENT *priority,
VOID **stack_base, UNSIGNED *stack_size,
UNSIGNED *minimum_stack);
UNSIGNED NU_HISR_Pointers(NU_HISR **pointer_list,
UNSIGNED maximum_pointers);
VOID NU_Protect(NU_PROTECT *protect_struct);
VOID NU_Unprotect(VOID);
/* Timer management functions. */
STATUS NU_Create_Timer(NU_TIMER *timer, CHAR *name,
VOID (*expiration_routine)(UNSIGNED), UNSIGNED id,
UNSIGNED initial_time, UNSIGNED reschedule_time,
OPTION enable);
STATUS NU_Delete_Timer(NU_TIMER *timer);
STATUS NU_Reset_Timer(NU_TIMER *timer,
VOID (*expiration_routine)(UNSIGNED),
UNSIGNED initial_time, UNSIGNED reschedule_timer,
OPTION enable);
STATUS NU_Control_Timer(NU_TIMER *timer, OPTION enable);
UNSIGNED NU_Established_Timers(VOID);
STATUS NU_Timer_Information(NU_TIMER *timer, CHAR *name,
OPTION *enable, UNSIGNED *expirations, UNSIGNED *id,
UNSIGNED *initial_time, UNSIGNED *reschedule_time);
UNSIGNED NU_Timer_Pointers(NU_TIMER **pointer_list,
UNSIGNED maximum_pointers);
VOID NU_Set_Clock(UNSIGNED new_value);
UNSIGNED NU_Retrieve_Clock(VOID);
/* Development support functions. */
CHAR *NU_Release_Information(VOID);
CHAR *NU_License_Information(VOID);
VOID NU_Disable_History_Saving(VOID);
VOID NU_Enable_History_Saving(VOID);
VOID NU_Make_History_Entry(UNSIGNED param1, UNSIGNED param2,
UNSIGNED param3);
STATUS NU_Retrieve_History_Entry(DATA_ELEMENT *id,
UNSIGNED *param1, UNSIGNED *param2, UNSIGNED *param3,
UNSIGNED *time, NU_TASK **task, NU_HISR **hisr);
/* Input/Output Driver functions. */
STATUS NU_Create_Driver(NU_DRIVER *driver, CHAR *name,
VOID (*driver_entry)(NU_DRIVER *, NU_DRIVER_REQUEST *));
STATUS NU_Delete_Driver(NU_DRIVER *driver);
STATUS NU_Request_Driver(NU_DRIVER *driver,
NU_DRIVER_REQUEST *request);
STATUS NU_Resume_Driver(NU_TASK *task);
STATUS NU_Suspend_Driver(VOID (*terminate_routine)(VOID *),
VOID *information, UNSIGNED timeout);
UNSIGNED NU_Established_Drivers(VOID);
UNSIGNED NU_Driver_Pointers(NU_DRIVER **pointer_list,
UNSIGNED maximum_pointers);
#endif
/* Define Supervisor and User mode functions */
#if (!defined(NU_SUPERV_USER_MODE)) || (NU_SUPERV_USER_MODE < 1)
#define NU_IS_SUPERVISOR_MODE() (NU_TRUE)
#define NU_SUPERVISOR_MODE() ((void) 0)
#define NU_USER_MODE() ((void) 0)
#define NU_SUPERV_USER_VARIABLES /* Not a Supervisor/User kernel */
#else /* NU_SUPERV_USER_MODE defined */
#include "tc_defs.h"
#include "mmu/inc/su_extr.h"
#endif /* NU_SUPERV_USER_MODE */
#ifdef __cplusplus
} /* End of C declarations */
#endif
#endif /* !NUCLEUS */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -