diff options
| author | Bernard Xiong <[email protected]> | 2021-05-28 16:20:08 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-05-28 16:20:08 +0800 |
| commit | 92beddf3bccf6346e26aa097f82464456fb8e6bd (patch) | |
| tree | 197e4a108118dda016ea02274172f0c40e7ee8ed /libcpu/mips/loongson_1c/exception.c | |
| parent | b18a99b44240ec3152011e159cc24a5af8dff0ce (diff) | |
| parent | 03f4d40e30f3c94e1db0b3a65b3610dee695694a (diff) | |
Merge pull request #4737 from mysterywolf/3,1,xformatv3.1.5
[lts 3.1.x] format codes
Diffstat (limited to 'libcpu/mips/loongson_1c/exception.c')
| -rw-r--r-- | libcpu/mips/loongson_1c/exception.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/libcpu/mips/loongson_1c/exception.c b/libcpu/mips/loongson_1c/exception.c index 4a3745cbc5..dbcec42ab6 100644 --- a/libcpu/mips/loongson_1c/exception.c +++ b/libcpu/mips/loongson_1c/exception.c @@ -25,7 +25,7 @@ /** * exception handle table */ -#define RT_EXCEPTION_MAX 8 +#define RT_EXCEPTION_MAX 8 exception_func_t sys_exception_handlers[RT_EXCEPTION_MAX]; /** @@ -47,45 +47,45 @@ exception_func_t rt_set_except_vector(int n, exception_func_t func) void tlb_refill_handler(void) { - rt_kprintf("tlb-miss happens, epc: 0x%08x\n", read_c0_epc()); - rt_hw_cpu_shutdown(); + rt_kprintf("tlb-miss happens, epc: 0x%08x\n", read_c0_epc()); + rt_hw_cpu_shutdown(); } void cache_error_handler(void) { - rt_kprintf("cache exception happens, epc: 0x%08x\n", read_c0_epc()); - rt_hw_cpu_shutdown(); + rt_kprintf("cache exception happens, epc: 0x%08x\n", read_c0_epc()); + rt_hw_cpu_shutdown(); } static void unhandled_exception_handle(pt_regs_t *regs) { - rt_kprintf("exception happens, epc: 0x%08x, cause: 0x%08x\n", regs->cp0_epc, read_c0_cause()); + rt_kprintf("exception happens, epc: 0x%08x, cause: 0x%08x\n", regs->cp0_epc, read_c0_cause()); } void install_default_execpt_handle(void) { - rt_int32_t i; + rt_int32_t i; - for (i=0; i<RT_EXCEPTION_MAX; i++) - sys_exception_handlers[i] = (exception_func_t)unhandled_exception_handle; + for (i=0; i<RT_EXCEPTION_MAX; i++) + sys_exception_handlers[i] = (exception_func_t)unhandled_exception_handle; } void exception_handler(pt_regs_t *regs) { - rt_uint32_t cause; - rt_uint32_t index; + rt_uint32_t cause; + rt_uint32_t index; - cause = (read_c0_cause() & read_c0_config()); - cause = (cause & 0xfc00) >> 8; + cause = (read_c0_cause() & read_c0_config()); + cause = (cause & 0xfc00) >> 8; - for (index = RT_EXCEPTION_MAX; index > 0; index --) - { - if (cause & (1 << index)) - { - sys_exception_handlers[index](regs); - cause &= ~(1 << index); - } - } + for (index = RT_EXCEPTION_MAX; index > 0; index --) + { + if (cause & (1 << index)) + { + sys_exception_handlers[index](regs); + cause &= ~(1 << index); + } + } } /*@}*/ |
