diff --git a/arch/risc-v/include/rv32im/syscall.h b/arch/risc-v/include/rv32im/syscall.h index 0ec1f888971..0b07f51e7eb 100644 --- a/arch/risc-v/include/rv32im/syscall.h +++ b/arch/risc-v/include/rv32im/syscall.h @@ -65,7 +65,7 @@ /* SYS call 0: * - * int up_saveusercontext(uint32_t *saveregs); + * int riscv_saveusercontext(uint32_t *saveregs); * * Return: * 0: Normal Return @@ -73,35 +73,35 @@ */ #define SYS_save_context (0) -#define up_saveusercontext(saveregs) \ +#define riscv_saveusercontext(saveregs) \ (int)sys_call1(SYS_save_context, (uintptr_t)saveregs) /* SYS call 1: * - * void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function; + * void riscv_fullcontextrestore(uint32_t *restoreregs) noreturn_function; */ #define SYS_restore_context (1) -#define up_fullcontextrestore(restoreregs) \ +#define riscv_fullcontextrestore(restoreregs) \ sys_call1(SYS_restore_context, (uintptr_t)restoreregs) /* SYS call 2: * - * void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs); + * void riscv_switchcontext(uint32_t *saveregs, uint32_t *restoreregs); */ #define SYS_switch_context (2) -#define up_switchcontext(saveregs, restoreregs) \ +#define riscv_switchcontext(saveregs, restoreregs) \ sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs) #ifdef CONFIG_BUILD_KERNEL /* SYS call 3: * - * void up_syscall_return(void); + * void riscv_syscall_return(void); */ #define SYS_syscall_return (3) -#define up_syscall_return() (void)sys_call0(SYS_syscall_return) +#define riscv_syscall_return() (void)sys_call0(SYS_syscall_return) #endif #endif /* __ASSEMBLY__ */ diff --git a/arch/risc-v/include/rv64gc/syscall.h b/arch/risc-v/include/rv64gc/syscall.h index bc8c9adc6d0..e398cc424cf 100644 --- a/arch/risc-v/include/rv64gc/syscall.h +++ b/arch/risc-v/include/rv64gc/syscall.h @@ -90,7 +90,7 @@ /* SYS call 0: * - * int up_saveusercontext(uint64_t *saveregs); + * int riscv_saveusercontext(uint64_t *saveregs); * * Return: * 0: Normal Return @@ -98,35 +98,35 @@ */ #define SYS_save_context (0) -#define up_saveusercontext(saveregs) \ +#define riscv_saveusercontext(saveregs) \ (int)sys_call1(SYS_save_context, (uintptr_t)saveregs) /* SYS call 1: * - * void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function; + * void riscv_fullcontextrestore(uint32_t *restoreregs) noreturn_function; */ #define SYS_restore_context (1) -#define up_fullcontextrestore(restoreregs) \ +#define riscv_fullcontextrestore(restoreregs) \ sys_call1(SYS_restore_context, (uintptr_t)restoreregs) /* SYS call 2: * - * void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs); + * void riscv_switchcontext(uint32_t *saveregs, uint32_t *restoreregs); */ #define SYS_switch_context (2) -#define up_switchcontext(saveregs, restoreregs) \ +#define riscv_switchcontext(saveregs, restoreregs) \ sys_call2(SYS_switch_context, (uintptr_t)saveregs, (uintptr_t)restoreregs) #ifdef CONFIG_BUILD_KERNEL /* SYS call 3: * - * void up_syscall_return(void); + * void riscv_syscall_return(void); */ #define SYS_syscall_return (3) -#define up_syscall_return() sys_call0(SYS_syscall_return) +#define riscv_syscall_return() sys_call0(SYS_syscall_return) #endif #endif /* __ASSEMBLY__ */ diff --git a/arch/risc-v/src/common/riscv_exit.c b/arch/risc-v/src/common/riscv_exit.c index ad59d60649b..455cff34f34 100644 --- a/arch/risc-v/src/common/riscv_exit.c +++ b/arch/risc-v/src/common/riscv_exit.c @@ -190,9 +190,9 @@ void up_exit(int status) /* Then switch contexts */ - up_fullcontextrestore(tcb->xcp.regs); + riscv_fullcontextrestore(tcb->xcp.regs); - /* up_fullcontextrestore() should not return but could if the software + /* riscv_fullcontextrestore() should not return but could if the software * interrupts are disabled. */ diff --git a/arch/risc-v/src/rv32im/riscv_blocktask.c b/arch/risc-v/src/rv32im/riscv_blocktask.c index 748c411cc1d..de1d1ff4dd5 100644 --- a/arch/risc-v/src/rv32im/riscv_blocktask.c +++ b/arch/risc-v/src/rv32im/riscv_blocktask.c @@ -165,9 +165,9 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) /* Then switch contexts */ - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + riscv_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the + /* riscv_switchcontext forces a context switch to the task at the * head of the ready-to-run list. It does not 'return' in the * normal sense. When it does return, it is because the blocked * task is again ready to run and has execution priority. diff --git a/arch/risc-v/src/rv32im/riscv_releasepending.c b/arch/risc-v/src/rv32im/riscv_releasepending.c index e2873dd2e0e..bbc4740c912 100644 --- a/arch/risc-v/src/rv32im/riscv_releasepending.c +++ b/arch/risc-v/src/rv32im/riscv_releasepending.c @@ -137,9 +137,9 @@ void up_release_pending(void) /* Then switch contexts */ - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + riscv_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the + /* riscv_switchcontext forces a context switch to the task at the * head of the ready-to-run list. It does not 'return' in the * normal sense. When it does return, it is because the blocked * task is again ready to run and has execution priority. diff --git a/arch/risc-v/src/rv32im/riscv_reprioritizertr.c b/arch/risc-v/src/rv32im/riscv_reprioritizertr.c index 99dd027a428..cb0b0f6b36a 100644 --- a/arch/risc-v/src/rv32im/riscv_reprioritizertr.c +++ b/arch/risc-v/src/rv32im/riscv_reprioritizertr.c @@ -190,12 +190,13 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) /* Then switch contexts */ - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + riscv_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the - * head of the ready-to-run list. It does not 'return' in the - * normal sense. When it does return, it is because the blocked - * task is again ready to run and has execution priority. + /* riscv_switchcontext forces a context switch to the task at + * the head of the ready-to-run list. It does not 'return' in + * the normal sense. When it does return, it is because the + * blocked task is again ready to run and has execution + * priority. */ } } diff --git a/arch/risc-v/src/rv32im/riscv_sigdeliver.c b/arch/risc-v/src/rv32im/riscv_sigdeliver.c index ee813864255..fb2394d957c 100644 --- a/arch/risc-v/src/rv32im/riscv_sigdeliver.c +++ b/arch/risc-v/src/rv32im/riscv_sigdeliver.c @@ -137,9 +137,9 @@ void riscv_sigdeliver(void) */ board_autoled_off(LED_SIGNAL); - up_fullcontextrestore(regs); + riscv_fullcontextrestore(regs); - /* up_fullcontextrestore() should not return but could if the software + /* riscv_fullcontextrestore() should not return but could if the software * interrupts are disabled. */ diff --git a/arch/risc-v/src/rv32im/riscv_swint.c b/arch/risc-v/src/rv32im/riscv_swint.c index 8eacfa0c667..ac360bf9401 100644 --- a/arch/risc-v/src/rv32im/riscv_swint.c +++ b/arch/risc-v/src/rv32im/riscv_swint.c @@ -147,7 +147,7 @@ int riscv_swint(int irq, FAR void *context, FAR void *arg) { /* A0=SYS_save_context: This is a save context command: * - * int up_saveusercontext(uint32_t *saveregs); + * int riscv_saveusercontext(uint32_t *saveregs); * * At this point, the following values are saved in context: * @@ -172,7 +172,8 @@ int riscv_swint(int irq, FAR void *context, FAR void *arg) /* A0=SYS_restore_context: This a restore context command: * - * void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function; + * void + * riscv_fullcontextrestore(uint32_t *restoreregs) noreturn_function; * * At this point, the following values are saved in context: * @@ -195,7 +196,7 @@ int riscv_swint(int irq, FAR void *context, FAR void *arg) /* A0=SYS_switch_context: This a switch context command: * - * void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs); + * void riscv_switchcontext(uint32_t *saveregs, uint32_t *restoreregs); * * At this point, the following values are saved in context: * diff --git a/arch/risc-v/src/rv32im/riscv_unblocktask.c b/arch/risc-v/src/rv32im/riscv_unblocktask.c index e80d1f500ff..9acb8fc0d12 100644 --- a/arch/risc-v/src/rv32im/riscv_unblocktask.c +++ b/arch/risc-v/src/rv32im/riscv_unblocktask.c @@ -151,9 +151,9 @@ void up_unblock_task(struct tcb_s *tcb) /* Then switch contexts */ - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + riscv_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the + /* riscv_switchcontext forces a context switch to the task at the * head of the ready-to-run list. It does not 'return' in the * normal sense. When it does return, it is because the blocked * task is again ready to run and has execution priority. diff --git a/arch/risc-v/src/rv64gc/riscv_blocktask.c b/arch/risc-v/src/rv64gc/riscv_blocktask.c index 46f2859f7c7..f584cbde6c5 100644 --- a/arch/risc-v/src/rv64gc/riscv_blocktask.c +++ b/arch/risc-v/src/rv64gc/riscv_blocktask.c @@ -165,9 +165,9 @@ void up_block_task(struct tcb_s *tcb, tstate_t task_state) /* Then switch contexts */ - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + riscv_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the + /* riscv_switchcontext forces a context switch to the task at the * head of the ready-to-run list. It does not 'return' in the * normal sense. When it does return, it is because the blocked * task is again ready to run and has execution priority. diff --git a/arch/risc-v/src/rv64gc/riscv_releasepending.c b/arch/risc-v/src/rv64gc/riscv_releasepending.c index b792ebb937d..cbb1b528c86 100644 --- a/arch/risc-v/src/rv64gc/riscv_releasepending.c +++ b/arch/risc-v/src/rv64gc/riscv_releasepending.c @@ -137,9 +137,9 @@ void up_release_pending(void) /* Then switch contexts */ - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + riscv_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the + /* riscv_switchcontext forces a context switch to the task at the * head of the ready-to-run list. It does not 'return' in the * normal sense. When it does return, it is because the blocked * task is again ready to run and has execution priority. diff --git a/arch/risc-v/src/rv64gc/riscv_reprioritizertr.c b/arch/risc-v/src/rv64gc/riscv_reprioritizertr.c index 1f2c513c6c1..782c5b62302 100644 --- a/arch/risc-v/src/rv64gc/riscv_reprioritizertr.c +++ b/arch/risc-v/src/rv64gc/riscv_reprioritizertr.c @@ -190,12 +190,13 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority) /* Then switch contexts */ - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + riscv_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the - * head of the ready-to-run list. It does not 'return' in the - * normal sense. When it does return, it is because the blocked - * task is again ready to run and has execution priority. + /* riscv_switchcontext forces a context switch to the task at + * the head of the ready-to-run list. It does not 'return' in + * the normal sense. When it does return, it is because the + * blocked task is again ready to run and has execution + * priority. */ } } diff --git a/arch/risc-v/src/rv64gc/riscv_sigdeliver.c b/arch/risc-v/src/rv64gc/riscv_sigdeliver.c index 1a0d79dc04b..a565ba8055e 100644 --- a/arch/risc-v/src/rv64gc/riscv_sigdeliver.c +++ b/arch/risc-v/src/rv64gc/riscv_sigdeliver.c @@ -183,5 +183,5 @@ void riscv_sigdeliver(void) */ board_autoled_off(LED_SIGNAL); - up_fullcontextrestore(regs); + riscv_fullcontextrestore(regs); } diff --git a/arch/risc-v/src/rv64gc/riscv_swint.c b/arch/risc-v/src/rv64gc/riscv_swint.c index d5becbd8d28..d2900a23304 100644 --- a/arch/risc-v/src/rv64gc/riscv_swint.c +++ b/arch/risc-v/src/rv64gc/riscv_swint.c @@ -170,7 +170,8 @@ int riscv_swint(int irq, FAR void *context, FAR void *arg) { /* A0=SYS_restore_context: This a restore context command: * - * void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function; + * void + * riscv_fullcontextrestore(uint32_t *restoreregs) noreturn_function; * * At this point, the following values are saved in context: * @@ -192,7 +193,7 @@ int riscv_swint(int irq, FAR void *context, FAR void *arg) /* A0=SYS_switch_context: This a switch context command: * - * void up_switchcontext(uint64_t *saveregs, uint64_t *restoreregs); + * void riscv_switchcontext(uint64_t *saveregs, uint64_t *restoreregs); * * At this point, the following values are saved in context: * diff --git a/arch/risc-v/src/rv64gc/riscv_unblocktask.c b/arch/risc-v/src/rv64gc/riscv_unblocktask.c index ec9f61fc513..d179dd86743 100644 --- a/arch/risc-v/src/rv64gc/riscv_unblocktask.c +++ b/arch/risc-v/src/rv64gc/riscv_unblocktask.c @@ -151,9 +151,9 @@ void up_unblock_task(struct tcb_s *tcb) /* Then switch contexts */ - up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); + riscv_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs); - /* up_switchcontext forces a context switch to the task at the + /* riscv_switchcontext forces a context switch to the task at the * head of the ready-to-run list. It does not 'return' in the * normal sense. When it does return, it is because the blocked * task is again ready to run and has execution priority. diff --git a/arch/risc-v/src/rv64gc/svcall.h b/arch/risc-v/src/rv64gc/svcall.h index 27d2dc573e7..690f5620e4e 100644 --- a/arch/risc-v/src/rv64gc/svcall.h +++ b/arch/risc-v/src/rv64gc/svcall.h @@ -63,21 +63,21 @@ /* SYS call 0: * - * int up_saveusercontext(uint32_t *saveregs); + * int riscv_saveusercontext(uint32_t *saveregs); */ #define SYS_save_context (0) /* SYS call 1: * - * void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function; + * void riscv_fullcontextrestore(uint32_t *restoreregs) noreturn_function; */ #define SYS_restore_context (1) /* SYS call 2: * - * void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs); + * void riscv_switchcontext(uint32_t *saveregs, uint32_t *restoreregs); */ #define SYS_switch_context (2) @@ -85,7 +85,7 @@ #ifdef CONFIG_LIB_SYSCALL /* SYS call 3: * - * void up_syscall_return(void); + * void riscv_syscall_return(void); */ #define SYS_syscall_return (3) diff --git a/boards/risc-v/bl602/bl602evb/src/bl602_ostest.c b/boards/risc-v/bl602/bl602evb/src/bl602_ostest.c index 1c54fcce0e9..3d3f0299386 100644 --- a/boards/risc-v/bl602/bl602evb/src/bl602_ostest.c +++ b/boards/risc-v/bl602/bl602evb/src/bl602_ostest.c @@ -72,7 +72,7 @@ void arch_getfpu(FAR uint32_t *fpusave) /* Take a snapshot of the thread context right now */ flags = enter_critical_section(); - up_saveusercontext(g_saveregs); + riscv_saveusercontext(g_saveregs); /* Return only the floating register values */ diff --git a/boards/risc-v/c906/smartl-c906/src/c906_ostest.c b/boards/risc-v/c906/smartl-c906/src/c906_ostest.c index e4529c48e13..a51a0f5ca2a 100644 --- a/boards/risc-v/c906/smartl-c906/src/c906_ostest.c +++ b/boards/risc-v/c906/smartl-c906/src/c906_ostest.c @@ -72,7 +72,7 @@ void arch_getfpu(FAR uint32_t *fpusave) /* Take a snapshot of the thread context right now */ flags = enter_critical_section(); - up_saveusercontext(g_saveregs); + riscv_saveusercontext(g_saveregs); /* Return only the floating register values */