Changeset View
Changeset View
Standalone View
Standalone View
sys/riscv/include/cpu.h
Show All 40 Lines | |||||
#include <machine/cpufunc.h> | #include <machine/cpufunc.h> | ||||
#include <machine/frame.h> | #include <machine/frame.h> | ||||
#define TRAPF_PC(tfp) ((tfp)->tf_ra) | #define TRAPF_PC(tfp) ((tfp)->tf_ra) | ||||
#define TRAPF_USERMODE(tfp) (((tfp)->tf_sstatus & SSTATUS_SPP) == 0) | #define TRAPF_USERMODE(tfp) (((tfp)->tf_sstatus & SSTATUS_SPP) == 0) | ||||
#define cpu_getstack(td) ((td)->td_frame->tf_sp) | #define cpu_getstack(td) ((td)->td_frame->tf_sp) | ||||
#define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) | #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) | ||||
#define cpu_spinwait() /* nothing */ | #define cpu_spinwait() __asm __volatile("nop") | ||||
#define cpu_lock_delay() DELAY(1) | #define cpu_lock_delay() DELAY(1) | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
/* | /* | ||||
* 0x0000 CPU ID unimplemented | * 0x0000 CPU ID unimplemented | ||||
* 0x0001 UC Berkeley Rocket repo | * 0x0001 UC Berkeley Rocket repo | ||||
* 0x00020x7FFE Reserved for open-source repos | * 0x00020x7FFE Reserved for open-source repos | ||||
Show All 38 Lines |