24 lines
542 B
C
24 lines
542 B
C
#pragma once
|
|
|
|
#include "common.h"
|
|
|
|
struct sbiret {
|
|
long error;
|
|
long value;
|
|
};
|
|
|
|
#define SBI_SUCCESS 0
|
|
#define SBI_ERR_FAILED -1
|
|
#define SBI_ERR_NOT_SUPPORTED -2
|
|
#define SBI_ERR_INVALID_PARAM -3
|
|
|
|
#define SBI_EXT_BASE 0x10
|
|
#define SBI_EXT_PMU 0x504D55
|
|
#define SBI_EXT_SRST 0x53525354
|
|
|
|
#define PANIC(fmt, ...) do { \
|
|
printf("PANIC: %s:%d: " fmt "\n", __FILE__, __LINE__, ##__VA_ARGS__); \
|
|
for (;;) { __asm__ __volatile__("wfi"); } \
|
|
} while (0)
|
|
|
|
int getchar(void); |