Squash commits for public release

This commit is contained in:
2025-02-12 09:54:05 -05:00
commit 7118adc514
1108 changed files with 80873 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
#ifndef _KERNEL_PLATFORM_RISCV64_REGISTERS_H
#define _KERNEL_PLATFORM_RISCV64_REGISTERS_H
#include <libkern/types.h>
#include <platform/riscv64/system.h>
extern uint64_t read_ip();
static inline uint64_t read_scause()
{
uint64_t x;
asm volatile("csrr %0, scause"
: "=r"(x));
return x;
}
static inline uint64_t read_stval()
{
uint64_t x;
asm volatile("csrr %0, stval"
: "=r"(x));
return x;
}
static inline uint64_t read_sip()
{
uint64_t x;
asm volatile("csrr %0, sip"
: "=r"(x));
return x;
}
static inline void write_sip(uint64_t val)
{
asm volatile("csrw sip, %0"
:
: "r"(val)
: "memory");
}
#endif /* _KERNEL_PLATFORM_RISCV64_REGISTERS_H */