28 lines
		
	
	
		
			743 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			743 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| #include "kpanic.h"
 | |
| #include "kprintf.h"
 | |
| #include <stdint.h>
 | |
| 
 | |
| #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)
 | |
| 
 | |
| struct function_entry {
 | |
| 	uint32_t addr;
 | |
| 	char name[64];
 | |
| };
 | |
| 
 | |
| struct stackframe {
 | |
| 	struct stackframe *ebp;
 | |
| 	uint32_t eip;
 | |
| };
 | |
| 
 | |
| void print_stack(void);
 |