9#include <mos/platform_syscall.h>
27 void *
const arg = (
void *) regs->
a0;
36 (*(
volatile u32 *)
pa_va(0x100000)) = 0x5555;
48 __asm__
volatile(
"wfi");
53 pr_info(
"General Purpose Registers:");
110 *to_regs = *from_regs;
140 __asm__
volatile(
"sfence.vma zero, zero");
150#define f_op(reg, val) __asm__ volatile("fld " #reg ", %0" : : "m"(thread->platform_options.f[val]))
191#define f_op(reg, val) __asm__ volatile("fsd " #reg ", %0" : : "m"(thread->platform_options.f[val]))
231 switch (switch_flags)
243 __atomic_store_n(&
current_cpu->thread, new_thread, __ATOMIC_SEQ_CST);
247 bool trash_lock =
false;
248 bool *
const lock =
current ? &
current->state_lock.flag : &trash_lock;
255 sstatus &= ~SSTATUS_SPP;
294 for (
int i = 0; i < 16; i++)
296 pr_info(
" %p: %ps", (
void *) caller_fp, (
void *) *(caller_fp - 1));
297 caller_fp = (
ptr_t *) *(caller_fp - 2);
305 regs->
a7 = syscall_nr;
326 ret_regs.
a0 = sigreturn_data->
signal;
#define MOS_UNREACHABLE()
#define stack_pop_val(stack, val)
#define stack_push_val(stack, val)
void signal_on_returned(sigreturn_data_t *supplimentary_data)
Return from a signal handler.
void signal_exit_to_user_prepare(platform_regs_t *regs)
Prepare to exit to userspace.
MOSAPI void(1, 2) fatal_abort(const char *fmt
ipi_type_t
The type of IPI to send.
#define statement_expr(type,...)
#define is_aligned(ptr, alignment)
#define pr_info2(fmt,...)
const char __riscv64_usermode_trap_entry[]
void riscv64_trap_exit(platform_regs_t *regs)
#define write_csr(reg, val)
#define make_satp(mode, asid, ppn)
void(* sa_restorer)(void)
platform_thread_options_t platform_options
platform-specific thread options
thread_mode mode
user-mode thread or kernel-mode
downwards_stack_t u_stack
user-mode stack
downwards_stack_t k_stack
kernel-mode stack
void(* thread_entry_t)(void *arg)