rulimine/common/sys/sbi.h
xvanc 9274ee656e
Initial riscv64 port (#274)
* initial riscv64 port

* enable Paging Mode feature for all architectures

* riscv: add missing protocol docs

* riscv: fix tests

* docs: clarify `LIMINE_PAGING_MODE_DEFAULT` macro

* build: fix whitespace in common/GNUmakefile

* riscv: default to Sv48 paging when supported

* vmm: make `VMM_MAX_LEVEL` 1-indexed

* limine: do not call `reported_addr()` before finaling paging mode

smp/riscv: do not overwrite the argument passed to APs

* limine/riscv: update default paging mode in limine.h

* test/riscv: pad OVMF.fd when downloading it
2023-06-04 01:36:06 +02:00

33 lines
930 B
C

#ifndef __SYS__SBI_H__
#define __SYS__SBI_H__
#include <stddef.h>
#include <stdint.h>
struct sbiret {
long error;
long value;
};
#define SBI_SUCCESS ((long)0)
#define SBI_ERR_FAILED ((long)-1)
#define SBI_ERR_NOT_SUPPORTED ((long)-2)
#define SBI_ERR_INVALID_PARAM ((long)-3)
#define SBI_ERR_DENIED ((long)-4)
#define SBI_ERR_INVALID_ADDRESS ((long)-5)
#define SBI_ERR_ALREADY_AVAILABLE ((long)-6)
#define SBI_ERR_ALREADY_STARTED ((long)-7)
#define SBI_ERR_ALREADY_STOPPED ((long)-8)
extern struct sbiret sbicall(int eid, int fid, ...);
#define SBI_EID_HSM 0x48534d
static inline struct sbiret sbi_hart_start(unsigned long hartid,
unsigned long start_addr,
unsigned long opaque) {
return sbicall(SBI_EID_HSM, 0, hartid, start_addr, opaque);
}
#endif