mirror of https://github.com/tailix/kernel.git
Organize interrupts
This commit is contained in:
parent
040693e30a
commit
67fec262e9
|
@ -24,16 +24,4 @@
|
|||
#define GDT_USER_DS_SELECTOR (GDT_SEGMENT_SELECTOR(GDT_USER_DS_INDEX) | 3)
|
||||
#define GDT_TSS_SELECTOR GDT_SEGMENT_SELECTOR(GDT_TSS_INDEX)
|
||||
|
||||
#define INT_EXCEPTION_COUNT 32
|
||||
#define INT_HWINT_COUNT 16
|
||||
#define INT_TOTAL_COUNT (INT_EXCEPTION_COUNT + INT_HWINT_COUNT)
|
||||
|
||||
#define INT_EXCEPTION_FIRST 0
|
||||
#define INT_EXCEPTION_LAST (INT_EXCEPTION_FIRST + INT_EXCEPTION_COUNT - 1)
|
||||
|
||||
#define INT_HWINT_FIRST (INT_EXCEPTION_LAST + 1)
|
||||
#define INT_HWINT_LAST (INT_HWINT_FIRST + INT_HWINT_COUNT - 1)
|
||||
|
||||
#define INT_SYSCALL 0x80
|
||||
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef KERNEL_INCLUDED_INTERRUPTS_CONFIG
|
||||
#define KERNEL_INCLUDED_INTERRUPTS_CONFIG 1
|
||||
|
||||
#define INT_EXCEPTION_COUNT 32
|
||||
#define INT_HWINT_COUNT 16
|
||||
#define INT_TOTAL_COUNT (INT_EXCEPTION_COUNT + INT_HWINT_COUNT)
|
||||
|
||||
#define INT_EXCEPTION_FIRST 0
|
||||
#define INT_EXCEPTION_LAST (INT_EXCEPTION_FIRST + INT_EXCEPTION_COUNT - 1)
|
||||
|
||||
#define INT_HWINT_FIRST (INT_EXCEPTION_LAST + 1)
|
||||
#define INT_HWINT_LAST (INT_HWINT_FIRST + INT_HWINT_COUNT - 1)
|
||||
|
||||
#define INT_SYSCALL 0x80
|
||||
|
||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||
#include "main.h"
|
||||
#include "../config.h"
|
||||
#include "../panic.h"
|
||||
|
||||
#include <kernaux/drivers/console.h>
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
#include "hwint.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "../config.h"
|
||||
|
||||
#include <kernaux/drivers/console.h>
|
||||
#include <kernaux/drivers/intel_8259_pic.h>
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef KERNEL_INCLUDED_HWINT
|
||||
#define KERNEL_INCLUDED_HWINT 1
|
||||
|
||||
typedef void(*hwint_handler_t)();
|
||||
|
||||
void hwint_register_handler(unsigned int int_no, hwint_handler_t handler);
|
||||
void hwint_unregister_handler(unsigned int int_no);
|
||||
|
||||
#endif
|
|
@ -1,4 +1,5 @@
|
|||
#include "../config.h"
|
||||
#include "config.h"
|
||||
|
||||
%macro INTERRUPT_NOERRCODE 2
|
||||
[GLOBAL interrupt_%2]
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#ifndef KERNEL_INCLUDED_INTERRUPT
|
||||
#define KERNEL_INCLUDED_INTERRUPT 1
|
||||
#ifndef KERNEL_INCLUDED_INTERRUPTS_MAIN
|
||||
#define KERNEL_INCLUDED_INTERRUPTS_MAIN 1
|
||||
|
||||
#include "config.h"
|
||||
|
||||
struct IsrRegisters {
|
||||
unsigned int ds; // Data segment selector
|
||||
|
@ -63,4 +65,25 @@ void interrupt_47();
|
|||
// Syscalls
|
||||
void interrupt_0x80();
|
||||
|
||||
|
||||
|
||||
/*********
|
||||
* hwint *
|
||||
*********/
|
||||
|
||||
typedef void(*hwint_handler_t)();
|
||||
|
||||
void hwint_register_handler(unsigned int int_no, hwint_handler_t handler);
|
||||
void hwint_unregister_handler(unsigned int int_no);
|
||||
|
||||
|
||||
|
||||
/***********
|
||||
* syscall *
|
||||
***********/
|
||||
|
||||
enum Kernel_Syscall_Number {
|
||||
KERNEL_SYSCALL_EXIT = 0,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#include "main.h"
|
||||
|
||||
#include "syscall.h"
|
||||
|
||||
#include <kernaux/drivers/console.h>
|
||||
|
||||
static void syscall_do_exit(struct IsrRegisters regs);
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
#ifndef KERNEL_INCLUDED_SYSCALL
|
||||
#define KERNEL_INCLUDED_SYSCALL 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum Kernel_Syscall_Number {
|
||||
KERNEL_SYSCALL_EXIT = 0,
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "config.h"
|
||||
#include "interrupts/main.h"
|
||||
#include "interrupts/hwint.h"
|
||||
#include "tss.h"
|
||||
|
||||
#include <kernaux/drivers/console.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef KERNEL_INCLUDED_TIMER
|
||||
#define KERNEL_INCLUDED_TIMER 1
|
||||
|
||||
#include "interrupts/hwint.h"
|
||||
#include "interrupts/main.h"
|
||||
|
||||
typedef hwint_handler_t timer_handler_t;
|
||||
|
||||
|
|
Loading…
Reference in New Issue