[bsp][qemu-vexpress] code cleanup.

Move idle_wfi to board.c for idle hook.
This commit is contained in:
Bernard Xiong 2018-12-24 09:06:33 +08:00
parent 6db31e30c7
commit f1b2e4ed21
4 changed files with 9 additions and 19 deletions

View File

@ -117,7 +117,7 @@ rt_hw_context_switch:
ldmfd sp!, {r0-r12, lr, pc}^ @ pop new task r0-r12, lr & pc, copy spsr to cpsr ldmfd sp!, {r0-r12, lr, pc}^ @ pop new task r0-r12, lr & pc, copy spsr to cpsr
/* /*
* void rt_hw_context_switch_interrupt(rt_uint32 from, rt_uint32 to); * void rt_hw_context_switch_interrupt(rt_ubase_t from, rt_ubase_t to);
*/ */
.equ Mode_USR, 0x10 .equ Mode_USR, 0x10
.equ Mode_FIQ, 0x11 .equ Mode_FIQ, 0x11

View File

@ -60,14 +60,8 @@ void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
lock->tickets.owner++; lock->tickets.owner++;
__asm__ volatile ("dsb ishst\nsev":::"memory"); __asm__ volatile ("dsb ishst\nsev":::"memory");
} }
#endif /*RT_USING_SMP*/ #endif /*RT_USING_SMP*/
void idle_wfi(void)
{
asm volatile ("wfi");
}
/** /**
* @addtogroup ARM CPU * @addtogroup ARM CPU
*/ */

View File

@ -25,9 +25,9 @@ struct rt_irq_desc isr_table[MAX_HANDLERS];
#ifndef RT_USING_SMP #ifndef RT_USING_SMP
/* Those varibles will be accessed in ISR, so we need to share them. */ /* Those varibles will be accessed in ISR, so we need to share them. */
rt_uint32_t rt_interrupt_from_thread; rt_uint32_t rt_interrupt_from_thread = 0;
rt_uint32_t rt_interrupt_to_thread; rt_uint32_t rt_interrupt_to_thread = 0;
rt_uint32_t rt_thread_switch_interrupt_flag; rt_uint32_t rt_thread_switch_interrupt_flag = 0;
#endif #endif
const unsigned int VECTOR_BASE = 0x00; const unsigned int VECTOR_BASE = 0x00;
@ -59,13 +59,6 @@ void rt_hw_interrupt_init(void)
arm_gic_dist_init(0, gic_dist_base, 0); arm_gic_dist_init(0, gic_dist_base, 0);
arm_gic_cpu_init(0, gic_cpu_base); arm_gic_cpu_init(0, gic_cpu_base);
/* init interrupt nest, and context in thread sp */
#ifndef RT_USING_SMP
rt_interrupt_from_thread = 0;
rt_interrupt_to_thread = 0;
rt_thread_switch_interrupt_flag = 0;
#endif
} }
/** /**

View File

@ -19,9 +19,13 @@
#define SYS_CTRL __REG32(REALVIEW_SCTL_BASE) #define SYS_CTRL __REG32(REALVIEW_SCTL_BASE)
extern void idle_wfi(void);
extern void rt_hw_ipi_handler_install(int ipi_vector, rt_isr_handler_t ipi_isr_handler); extern void rt_hw_ipi_handler_install(int ipi_vector, rt_isr_handler_t ipi_isr_handler);
void idle_wfi(void)
{
asm volatile ("wfi");
}
/** /**
* This function will initialize beaglebone board * This function will initialize beaglebone board
*/ */
@ -42,4 +46,3 @@ void rt_hw_board_init(void)
rt_hw_ipi_handler_install(RT_SCHEDULE_IPI, rt_scheduler_ipi_handler); rt_hw_ipi_handler_install(RT_SCHEDULE_IPI, rt_scheduler_ipi_handler);
#endif #endif
} }