Files
pepperOS/src/kernel.h
2026-02-06 14:39:19 +01:00

42 lines
869 B
C

/*
* @author xamidev <xamidev@riseup.net>
* @brief Kernel global macros
* @license GPL-3.0-only
*/
#ifndef KERNEL_H
#define KERNEL_H
enum ErrorCodes
{
ENOMEM,
EIO
};
#define CLEAR_INTERRUPTS __asm__ volatile("cli")
#define SET_INTERRUPTS __asm__ volatile("sti")
#include "io/serial/serial.h"
#include "io/term/printf.h"
#include "idt/idt.h"
#define DEBUG(log, ...) fctprintf((void*)&skputc, 0, "debug: [%s]: " log "\r\n", __FILE__, ##__VA_ARGS__)
#define CHECK_BIT(var,pos) ((var) & (1<<(pos)))
// printf("debug: [%s]: " log "\n", __FILE__, ##__VA_ARGS__);
void panic(struct cpu_status_t* ctx);
void hcf();
#define assert(check) do { if(!(check)) hcf(); } while(0)
struct boot_context
{
struct limine_framebuffer* fb;
struct limine_memmap_response* mmap;
struct limine_hhdm_response* hhdm;
struct limine_kernel_address_response* kaddr;
};
#endif