Fix PANIC macro
This commit is contained in:
6
common.h
6
common.h
@@ -13,12 +13,6 @@
|
||||
|
||||
#define offsetof(type, member) ((size_t)&(((type*)0)->member))
|
||||
|
||||
#define PANIC(fmt, ...) \
|
||||
do { \
|
||||
printf("panic %s:%d" fmt "\n", __FILE__, __LINE__, ## __VAR_ARGS__); \
|
||||
while(1){}; \
|
||||
} while(0)
|
||||
|
||||
typedef int bool;
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t ;
|
||||
|
||||
2
kernel.c
2
kernel.c
@@ -42,6 +42,8 @@ void kernel_main(void)
|
||||
printf("offsetof(sbiret, error) = %x\n", offsetof(sbiret, error));
|
||||
printf("offsetof(sbiret, value) = %x\n", offsetof(sbiret, value));
|
||||
|
||||
PANIC("booted!");
|
||||
|
||||
while(1) {
|
||||
// wfi -> wait for interrupt
|
||||
__asm__ __volatile__("wfi");
|
||||
|
||||
Reference in New Issue
Block a user