summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernard Xiong <[email protected]>2018-12-24 09:06:33 +0800
committerBernard Xiong <[email protected]>2018-12-24 09:06:33 +0800
commitf1b2e4ed21066d90c19b710d2f748bfd7d8b32c9 (patch)
tree176076ac756bf6a4ed2b811fef2ef47d6f511b1d
parent6db31e30c7ea5ebc33efe294736ae2da6e7e6daa (diff)
[bsp][qemu-vexpress] code cleanup.
Move idle_wfi to board.c for idle hook.
-rw-r--r--bsp/qemu-vexpress-a9/cpu/context_gcc.S2
-rw-r--r--bsp/qemu-vexpress-a9/cpu/cpuport.c6
-rw-r--r--bsp/qemu-vexpress-a9/cpu/interrupt.c13
-rw-r--r--bsp/qemu-vexpress-a9/drivers/board.c7
4 files changed, 9 insertions, 19 deletions
diff --git a/bsp/qemu-vexpress-a9/cpu/context_gcc.S b/bsp/qemu-vexpress-a9/cpu/context_gcc.S
index 694fb96e72..0aad0200d5 100644
--- a/bsp/qemu-vexpress-a9/cpu/context_gcc.S
+++ b/bsp/qemu-vexpress-a9/cpu/context_gcc.S
@@ -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
/*
- * 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_FIQ, 0x11
diff --git a/bsp/qemu-vexpress-a9/cpu/cpuport.c b/bsp/qemu-vexpress-a9/cpu/cpuport.c
index 22ba8346da..6b129f89ee 100644
--- a/bsp/qemu-vexpress-a9/cpu/cpuport.c
+++ b/bsp/qemu-vexpress-a9/cpu/cpuport.c
@@ -60,14 +60,8 @@ void rt_hw_spin_unlock(rt_hw_spinlock_t *lock)
lock->tickets.owner++;
__asm__ volatile ("dsb ishst\nsev":::"memory");
}
-
#endif /*RT_USING_SMP*/
-void idle_wfi(void)
-{
- asm volatile ("wfi");
-}
-
/**
* @addtogroup ARM CPU
*/
diff --git a/bsp/qemu-vexpress-a9/cpu/interrupt.c b/bsp/qemu-vexpress-a9/cpu/interrupt.c
index d553188e93..d7e9ec08fa 100644
--- a/bsp/qemu-vexpress-a9/cpu/interrupt.c
+++ b/bsp/qemu-vexpress-a9/cpu/interrupt.c
@@ -25,9 +25,9 @@ struct rt_irq_desc isr_table[MAX_HANDLERS];
#ifndef RT_USING_SMP
/* 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_to_thread;
-rt_uint32_t rt_thread_switch_interrupt_flag;
+rt_uint32_t rt_interrupt_from_thread = 0;
+rt_uint32_t rt_interrupt_to_thread = 0;
+rt_uint32_t rt_thread_switch_interrupt_flag = 0;
#endif
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_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
}
/**
diff --git a/bsp/qemu-vexpress-a9/drivers/board.c b/bsp/qemu-vexpress-a9/drivers/board.c
index 26445d33f1..6ffac7efd7 100644
--- a/bsp/qemu-vexpress-a9/drivers/board.c
+++ b/bsp/qemu-vexpress-a9/drivers/board.c
@@ -19,9 +19,13 @@
#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);
+void idle_wfi(void)
+{
+ asm volatile ("wfi");
+}
+
/**
* 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);
#endif
}
-