mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
Add kernel mode hooks and reminders for other architectures
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3484 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -108,6 +108,17 @@ void up_initial_state(_TCB *tcb)
|
|||||||
|
|
||||||
xcp->regs[REG_PC] = (uint32_t)tcb->start;
|
xcp->regs[REG_PC] = (uint32_t)tcb->start;
|
||||||
|
|
||||||
|
/* Set supervisor- or user-mode, depending on how NuttX is configured and
|
||||||
|
* what kind of thread is being started. Disable FIQs in any event
|
||||||
|
*
|
||||||
|
* If the kernel build is not selected, then all threads run in
|
||||||
|
* supervisor-mode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_NUTTX_KERNEL
|
||||||
|
# error "Missing logic for the CONFIG_NUTTX_KERNEL build"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Enable or disable interrupts, based on user configuration */
|
/* Enable or disable interrupts, based on user configuration */
|
||||||
|
|
||||||
# ifdef CONFIG_SUPPRESS_INTERRUPTS
|
# ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
|
|||||||
@@ -99,8 +99,28 @@ void up_initial_state(_TCB *tcb)
|
|||||||
/* Initialize the initial exception register context structure */
|
/* Initialize the initial exception register context structure */
|
||||||
|
|
||||||
memset(xcp, 0, sizeof(struct xcptcontext));
|
memset(xcp, 0, sizeof(struct xcptcontext));
|
||||||
|
|
||||||
|
/* Set the initial stack pointer to the "base" of the allocated stack */
|
||||||
|
|
||||||
xcp->regs[REG_SP] = (uint32_t)tcb->adj_stack_ptr;
|
xcp->regs[REG_SP] = (uint32_t)tcb->adj_stack_ptr;
|
||||||
|
|
||||||
|
/* Save the task entry point */
|
||||||
|
|
||||||
xcp->regs[REG_PC] = (uint32_t)tcb->start;
|
xcp->regs[REG_PC] = (uint32_t)tcb->start;
|
||||||
|
|
||||||
|
/* Set supervisor- or user-mode, depending on how NuttX is configured and
|
||||||
|
* what kind of thread is being started. Disable FIQs in any event
|
||||||
|
*
|
||||||
|
* If the kernel build is not selected, then all threads run in
|
||||||
|
* supervisor-mode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_NUTTX_KERNEL
|
||||||
|
# error "Missing logic for the CONFIG_NUTTX_KERNEL build"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Enable or disable interrupts, based on user configuration */
|
||||||
|
|
||||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
xcp->regs[REG_SR] = up_getsr() | 0x000000f0;
|
xcp->regs[REG_SR] = up_getsr() | 0x000000f0;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -104,6 +104,17 @@ void up_initial_state(_TCB *tcb)
|
|||||||
xcp->regs[REG_CS] = up_getcs();
|
xcp->regs[REG_CS] = up_getcs();
|
||||||
xcp->regs[REG_SS] = up_getss();
|
xcp->regs[REG_SS] = up_getss();
|
||||||
|
|
||||||
|
/* Set supervisor- or user-mode, depending on how NuttX is configured and
|
||||||
|
* what kind of thread is being started. Disable FIQs in any event
|
||||||
|
*
|
||||||
|
* If the kernel build is not selected, then all threads run in
|
||||||
|
* supervisor-mode.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_NUTTX_KERNEL
|
||||||
|
# error "Missing logic for the CONFIG_NUTTX_KERNEL build"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Enable or disable interrupts, based on user configuration. If the IF
|
/* Enable or disable interrupts, based on user configuration. If the IF
|
||||||
* bit is set, maskable interrupts will be enabled.
|
* bit is set, maskable interrupts will be enabled.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user