summaryrefslogtreecommitdiff
path: root/stage3/interrupts.h
blob: a73a68d7dc9dfe059e47225f88c4eefe290c8ba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef INTERRUPTS_H
#define INTERRUPTS_H

#include "def.h"

typedef struct __attribute__((packed)) {
	u64 rax, rbx, rcx, rdx, rbp, rdi, rsi, r8, r9, r10, r11, r12, r13, r14, r15;
	u64 which, error_code;
	u64 rip, cs, rflags, rsp, ss;
} interrupt_frame;

void interrupts_init();

extern bool in_isr;

#ifdef DEBUG
void interrupts_unsafe(const char *function);
#define ISR_UNSAFE interrupts_unsafe(__FUNCTION__);
#else
#define ISR_UNSAFE
#endif

#endif