#include <stddef.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdbool.h>
#include "../../Common/Common.h"
#include "../../Memory/Memory.h"

#define IDTBASE  0x800
#define IDTSIZE  0xFF
#define INTGATE  0x8E00
#define TRAPGATE 0xEF00

struct IdtDescriptor{
	uint16_t offset0_15;
	uint16_t select;
	uint16_t type;
	uint16_t offset16_31;
} __attribute__ ((packed));


struct idtr{
	uint16_t limite;
	uint32_t base;
} __attribute__ ((packed));

extern struct idtr kidtr;
extern struct IdtDescriptor kidt[IDTSIZE];

extern void InitIdtDescriptor(uint16_t select, uint32_t offset, uint16_t type, struct IdtDescriptor *desc);
extern void InitIdt(void);
