POK(kernelpart)
event.c File Reference
#include <libc.h>
#include <types.h>
#include <errno.h>
#include <core/syscall.h>
#include "event.h"
#include "sysdesc.h"

Go to the source code of this file.

Macros

#define IDT_SIZE   256

Functions

pok_ret_t pok_event_init ()
pok_ret_t pok_idt_init ()
void pok_idt_set_gate (uint16_t index, uint16_t segsel, uint32_t offset, e_idte_type t, int dpl)

Variables

idt_entry_t pok_idt [IDT_SIZE]

Macro Definition Documentation

#define IDT_SIZE   256

Definition at line 27 of file event.c.


Function Documentation

pok_ret_t pok_event_init ( )

Definition at line 31 of file event.c.

{
#if defined (POK_NEEDS_DEBUG) || defined (POK_NEEDS_ERROR_HANDLING)
#endif
return (POK_ERRNO_OK);
}
pok_ret_t pok_idt_init ( )

Definition at line 44 of file event.c.

{
sysdesc_t sysdesc;
/* Clear table */
memset(pok_idt, 0, sizeof (idt_entry_t) * IDT_SIZE);
/* Load IDT */
sysdesc.limit = sizeof (pok_idt);
sysdesc.base = (uint32_t)pok_idt;
asm ("lidt %0"
:
: "m" (sysdesc));
return (POK_ERRNO_OK);
}
void pok_idt_set_gate ( uint16_t  index,
uint16_t  segsel,
uint32_t  offset,
e_idte_type  t,
int  dpl 
)

Definition at line 62 of file event.c.

{
pok_idt[index].offset_low = (offset) & 0xFFFF;
pok_idt[index].offset_high = (offset >> 16) & 0xFFFF;
pok_idt[index].segsel = segsel;
pok_idt[index].dpl = dpl;
pok_idt[index].type = t;
pok_idt[index].d = 1;
pok_idt[index].res0 = 0; /* reserved */
pok_idt[index].res1 = 0; /* reserved */
pok_idt[index].present = 1;
}

Variable Documentation

idt_entry_t pok_idt[IDT_SIZE]

Definition at line 29 of file event.c.