This repository has been archived on 2024-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
kernel-dev-old/include/kernel/arch/x86_64/interrupt_procs.h

90 lines
1.7 KiB
C
Raw Normal View History

#ifndef X86_64_INTERRUPT_PROCS_H
#define X86_64_INTERRUPT_PROCS_H 1
#include <utils.h>
/**
* @name interrupt_entry
* @addindex x86_64
*
*
*
* ```c
* void interrupt_entry();
* ```
*
* ```asm
* interrupt_entry_xx:
* ;
* interrupt_entry_enter
*
* ;
* ...
*
* ;
* interrupt_entry_leave
* iret
* ```
*/
typedef void (*interrupt_entry)();
/**
* @name interrupt_entry_gen
* @addindex x86_64
*
*
*
* ```c
* #define interrupt_entry_gen(interrupt)
* ```
*/
#define interrupt_entry_gen(interrupt) \
extern void interrupt_entry_##interrupt()
#define interrupt_entry_sym(interrupt) \
interrupt_entry_##interrupt
/**
* @name interrupt_request
* @addindex
*
*
*
* ```c
* void interrupt_request(u64 rip, u64 rsp);
* ```
*
*
*/
typedef void (*interrupt_request)(u64 rip, u64 rsp, u64 errcode);
/**
* @name interrupt_req_gen
* @addindex x86_64
*
*
*
* ```c
* #define interrupt_req_gen(interrupt)
* ```
*/
#define interrupt_req_gen(interrupt) \
void interrupt_req_##interrupt(u64 rip, u64 rsp, u64 errcode)
#define interrupt_req_sym(interrupt) \
interrupt_req_##interrupt
#define UNSUPPORTED
#define DE
#define NMI
#define BP
#define OF
interrupt_entry_gen(UNSUPPORTED);
interrupt_entry_gen(DE); // irq0
interrupt_entry_gen(NMI); // irq2
interrupt_entry_gen(BP); // irq3
interrupt_entry_gen(OF); // ira4
#endif