Add pre-defined panic utilities

This commit is contained in:
Michael Scire 2018-03-04 17:23:16 -08:00
parent 4c38be1560
commit 1fa64fccbf
3 changed files with 29 additions and 0 deletions

View file

@ -5,6 +5,8 @@
#include <stddef.h>
#include <stdint.h>
#include "panic_color.h"
#define BIT(n) (1u << (n))
#define BITL(n) (1ull << (n))
#define MASK(n) (BIT(n) - 1)
@ -52,6 +54,7 @@ typedef struct {
__attribute__ ((noreturn)) void panic(uint32_t code);
__attribute__ ((noreturn)) void generic_panic(void);
__attribute__ ((noreturn)) void panic_predefined(uint32_t which);
bool overlaps(uint64_t as, uint64_t ae, uint64_t bs, uint64_t be);
static inline uintptr_t get_physical_address(const void *vaddr) {