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

📄 arch.h

📁 這是一個實時嵌入式作業系統 實作了MCS51 ARM等MCU
💻 H
📖 第 1 页 / 共 2 页
字号:
EXTERN void up_block_task(FAR _TCB *tcb, tstate_t task_state);/**************************************************************************** * Name: up_release_pending * * Description: *   When tasks become ready-to-run but cannot run because *   pre-emption is disabled, they are placed into a pending *   task list.  This function releases and makes ready-to-run *   all of the tasks that have collected in the pending task *   list.  This can cause a context switch if a new task is *   placed at the head of the ready to run list. * *   This function is called only from the NuttX scheduling *   logic when pre-emptioni is re-enabled.  Interrupts will *   always be disabled when this function is called. * ****************************************************************************/EXTERN void up_release_pending(void);/**************************************************************************** * Name: up_reprioritize_rtr * * Description: *   Called when the priority of a running or *   ready-to-run task changes and the reprioritization will  *   cause a context switch.  Two cases: * *   1) The priority of the currently running task drops and the next *      task in the ready to run list has priority. *   2) An idle, ready to run task's priority has been raised above the *      the priority of the current, running task and it now has the *      priority. * *   This function is called only from the NuttX scheduling *   logic.  Interrupts will always be disabled when this *   function is called. * * Inputs: *   tcb: The TCB of the task that has been reprioritized *   priority: The new task priority * ****************************************************************************/EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority);/**************************************************************************** * Name: _exit * * Description: *   This function causes the currently executing task to cease *   to exist.  This is a special case of task_delete() where the task to *   be deleted is the currently executing task.  It is more complex because *   a context switch must be perform to the the next ready to run task. * *   Unlike other UP APIs, this function may be called directly from user *   programs in various states.  The implementation of this function should *   disable interrupts before performing scheduling operations. * ****************************************************************************//* Prototype is in unistd.h *//**************************************************************************** * Name: up_assert and up_assert_code * * Description: *   Assertions may be handled in an architecture-specific *   way. * ****************************************************************************//* Prototype is in assert.h *//**************************************************************************** * Name: up_schedule_sigaction * * Description: *   This function is called by the OS when one or more *   signal handling actions have been queued for execution. *   The architecture specific code must configure things so *   that the 'igdeliver' callback is executed on the thread *   specified by 'tcb' as soon as possible. * *   This function may be called from interrupt handling logic. * *   This operation should not cause the task to be unblocked *   nor should it cause any immediate execution of sigdeliver. *   Typically, a few cases need to be considered: * *   (1) This function may be called from an interrupt handler *       During interrupt processing, all xcptcontext structures *       should be valid for all tasks.  That structure should *       be modified to invoke sigdeliver() either on return *       from (this) interrupt or on some subsequent context *       switch to the recipient task. *   (2) If not in an interrupt handler and the tcb is NOT *       the currently executing task, then again just modify *       the saved xcptcontext structure for the recipient *       task so it will invoke sigdeliver when that task is *       later resumed. *   (3) If not in an interrupt handler and the tcb IS the *       currently executing task -- just call the signal *       handler now. * ****************************************************************************/#ifndef CONFIG_DISABLE_SIGNALSEXTERN void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver);#endif/**************************************************************************** * Name: up_allocate_heap * * Description: *   The heap may be statically allocated by *   defining CONFIG_HEAP_BASE and CONFIG_HEAP_SIZE.  If these *   are not defined, then this function will be called to *   dynamically set aside the heap region. * ****************************************************************************/#ifndef CONFIG_HEAP_BASEEXTERN void up_allocate_heap(FAR void **heap_start, size_t *heap_size);#endif/**************************************************************************** * Name: up_interrupt_context * * Description: *   Return TRUE is we are currently executing in *   the interrupt handler context. * ****************************************************************************/EXTERN boolean up_interrupt_context(void);/**************************************************************************** * Name: up_enable_irq * * Description: *   On many architectures, there are three levels of interrupt enabling: (1) *   at the global level, (2) at the level of the interrupt controller, *   and (3) at the device level.  In order to receive interrupts, they *   must be enabled at all three levels. * *   This function implements enabling of the device specified by 'irq' *   at the interrupt controller level if supported by the architecture *   (irqsave() supports the global level, the device level is hardware *   specific). * *   Since this API is not supported on all architectures, it should be *   avoided in common implementations where possible. * ****************************************************************************/EXTERN void up_enable_irq(int irq);/**************************************************************************** * Name: up_disable_irq * * Description: *   This function implements disabling of the device specified by 'irq' *   at the interrupt controller level if supported by the architecture *   (irqsave() supports the global level, the device level is hardware *   specific). * *   Since this API is not supported on all architectures, it should be *   avoided in common implementations where possible. * ****************************************************************************/EXTERN void up_disable_irq(int irq);/**************************************************************************** * These are standard interfaces that are exported by the OS * for use by the architecture specific logic ****************************************************************************//**************************************************************************** * Name: sched_process_timer * * Description: *   This function handles system timer events. *   The timer interrupt logic itself is implemented in the *   architecture specific code, but must call the following OS *   function periodically -- the calling interval must be *   MSEC_PER_TICK. * ****************************************************************************/EXTERN void sched_process_timer(void);/**************************************************************************** * Name: irq_dispatch * * Description: *   This function must be called from the achitecture- *   specific logic in order to dispatch an interrupt to *   the appropriate, registered handling logic. * ***************************************************************************/EXTERN void irq_dispatch(int irq, FAR void *context);/**************************************************************************** * Name: up_mdelay and up_udelay * * Description: *   Some device drivers may require that the plaform-specific logic *   provide these timing loops for short delays. * ***************************************************************************/EXTERN void up_mdelay(unsigned int milliseconds);EXTERN void up_udelay(unsigned int microseconds);/**************************************************************************** * Debug interfaces exported by the architecture-specific logic ****************************************************************************//**************************************************************************** * Name: up_putc * * Description: *   Output one character on the console * ****************************************************************************/EXTERN int up_putc(int ch);#undef EXTERN#ifdef __cplusplus}#endif#endif /* __ARCH_H */

⌨️ 快捷键说明

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