arch/risc-v: Internal functions should be prefixed by "riscv_" instead

of "up_"

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
This commit is contained in:
Abdelatif Guettouche 2021-03-20 14:08:09 +01:00 committed by Alan Carvalho de Assis
parent a0fae8c4d6
commit fb0fd36a5c
18 changed files with 58 additions and 54 deletions

View File

@ -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__ */

View File

@ -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__ */

View File

@ -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.
*/

View File

@ -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.

View File

@ -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.

View File

@ -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.
*/
}
}

View File

@ -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.
*/

View File

@ -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:
*

View File

@ -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.

View File

@ -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.

View File

@ -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.

View File

@ -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.
*/
}
}

View File

@ -183,5 +183,5 @@ void riscv_sigdeliver(void)
*/
board_autoled_off(LED_SIGNAL);
up_fullcontextrestore(regs);
riscv_fullcontextrestore(regs);
}

View File

@ -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:
*

View File

@ -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.

View File

@ -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)

View File

@ -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 */

View File

@ -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 */