2024-09-17 05:10:41 -04:00
|
|
|
#pragma once
|
|
|
|
|
2024-10-18 08:45:37 -04:00
|
|
|
#include "kpanic.h"
|
2024-10-17 10:11:40 -04:00
|
|
|
#include "kprintf.h"
|
2024-09-17 05:10:41 -04:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2024-10-18 08:45:37 -04:00
|
|
|
#define PRINT_PTR(X) kprintf("%s: %p\n", #X, X)
|
|
|
|
#define PRINT_INT(X) kprintf("%s: %d\n", #X, X)
|
|
|
|
#define assert(X) \
|
|
|
|
do { \
|
|
|
|
if (!(X)) { \
|
|
|
|
kpanic("ASSERT_FAIL %s:%u %s\n", __FILE__, __LINE__, \
|
|
|
|
#X); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2024-10-17 10:11:40 -04:00
|
|
|
|
|
|
|
struct function_entry {
|
|
|
|
uint32_t addr;
|
|
|
|
char name[64];
|
|
|
|
};
|
|
|
|
|
2024-09-17 05:10:41 -04:00
|
|
|
struct stackframe {
|
|
|
|
struct stackframe *ebp;
|
|
|
|
uint32_t eip;
|
|
|
|
};
|
2024-09-22 03:54:56 -04:00
|
|
|
|
2024-10-17 10:11:40 -04:00
|
|
|
void print_stack(void);
|