kernel-dev/include/kernel/arch/x86_64/interrupt_procs.h

88 lines
1.6 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
interrupt_entry_gen(UNSUPPORTED);
interrupt_entry_gen(DE);
interrupt_entry_gen(NMI);
interrupt_entry_gen(BP);
#endif