5#include "mos/platform/platform_defs.hpp"
11#include <mos/platform_syscall.h>
39 void *
const arg = (
void *) regs->
a0;
46 (*(
volatile u32 *)
pa_va(0x100000)) = 0x5555;
58 __asm__
volatile(
"wfi");
63 pr_info(
"General Purpose Registers:");
121 *to_regs = *from_regs;
151 __asm__
volatile(
"sfence.vma zero, zero");
161#define f_op(reg, val) __asm__ volatile("fld " #reg ", %0" : : "m"(thread->platform_options.f[val]))
202#define f_op(reg, val) __asm__ volatile("fsd " #reg ", %0" : : "m"(thread->platform_options.f[val]))
242 switch (switch_flags)
254 __atomic_store_n(&
current_cpu->thread, new_thread, __ATOMIC_SEQ_CST);
258 bool trash_lock =
false;
259 bool *
const lock =
current ? &
current->state_lock.flag : &trash_lock;
305 for (
int i = 0; i < 16; i++)
307 pr_info(
" %p: %ps", (
void *) caller_fp, (
void *) *(caller_fp - 1));
308 caller_fp = (
ptr_t *) *(caller_fp - 2);
316 regs->
a7 = syscall_nr;
337 ret_regs->a0 = sigreturn_data->
signal;
371 const auto val = (
volatile u64 *)
pa_va(0x101000);
372 constexpr auto RTC_TIME = 0x00;
373 *timestamp = *(val + RTC_TIME);
378 mWarn <<
"Stack dump not implemented";
#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.
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)
shared_ptr< T > make_shared(Args &&...args)
#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(* thread_entry_t)(void *arg)
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(* sa_restorer)(void)