Changeset View
Changeset View
Standalone View
Standalone View
sys/riscv/include/cpu.h
Show All 35 Lines | |||||
#ifndef _MACHINE_CPU_H_ | #ifndef _MACHINE_CPU_H_ | ||||
#define _MACHINE_CPU_H_ | #define _MACHINE_CPU_H_ | ||||
#include <machine/atomic.h> | #include <machine/atomic.h> | ||||
#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_sepc) | ||||
#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() /* nothing */ | ||||
#define cpu_lock_delay() DELAY(1) | #define cpu_lock_delay() DELAY(1) | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |