POK(kernelpart)
event.h File Reference
#include <types.h>
#include <arch/x86/interrupt.h>
#include "gdt.h"

Go to the source code of this file.

Data Structures

struct  __attribute__

Macros

#define EXCEPTION_DIVIDE_ERROR   0
#define EXCEPTION_DEBUG   1
#define EXCEPTION_NMI   2
#define EXCEPTION_BREAKPOINT   3
#define EXCEPTION_OVERFLOW   4
#define EXCEPTION_BOUNDRANGE   5
#define EXCEPTION_INVALIDOPCODE   6
#define EXCEPTION_NOMATH_COPROC   7
#define EXCEPTION_DOUBLEFAULT   8
#define EXCEPTION_COPSEG_OVERRUN   9
#define EXCEPTION_INVALID_TSS   10
#define EXCEPTION_SEGMENT_NOT_PRESENT   11
#define EXCEPTION_STACKSEG_FAULT   12
#define EXCEPTION_GENERAL_PROTECTION   13
#define EXCEPTION_PAGEFAULT   14
#define EXCEPTION_RESERVED   15
#define EXCEPTION_FPU_FAULT   16
#define EXCEPTION_ALIGNEMENT_CHECK   17
#define EXCEPTION_MACHINE_CHECK   18
#define EXCEPTION_SIMD_FAULT   19

Typedefs

typedef enum e_idte_type e_idte_type

Enumerations

enum  e_idte_type { IDTE_TASK = 5, IDTE_INTERRUPT = 6, IDTE_TRAP = 7 }

Functions

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

Macro Definition Documentation

#define EXCEPTION_ALIGNEMENT_CHECK   17

Definition at line 63 of file event.h.

#define EXCEPTION_BOUNDRANGE   5

Definition at line 51 of file event.h.

#define EXCEPTION_BREAKPOINT   3

Definition at line 49 of file event.h.

#define EXCEPTION_COPSEG_OVERRUN   9

Definition at line 55 of file event.h.

#define EXCEPTION_DEBUG   1

Definition at line 47 of file event.h.

#define EXCEPTION_DIVIDE_ERROR   0

Definition at line 46 of file event.h.

#define EXCEPTION_DOUBLEFAULT   8

Definition at line 54 of file event.h.

#define EXCEPTION_FPU_FAULT   16

Definition at line 62 of file event.h.

#define EXCEPTION_GENERAL_PROTECTION   13

Definition at line 59 of file event.h.

#define EXCEPTION_INVALID_TSS   10

Definition at line 56 of file event.h.

#define EXCEPTION_INVALIDOPCODE   6

Definition at line 52 of file event.h.

#define EXCEPTION_MACHINE_CHECK   18

Definition at line 64 of file event.h.

#define EXCEPTION_NMI   2

Definition at line 48 of file event.h.

#define EXCEPTION_NOMATH_COPROC   7

Definition at line 53 of file event.h.

#define EXCEPTION_OVERFLOW   4

Definition at line 50 of file event.h.

#define EXCEPTION_PAGEFAULT   14

Definition at line 60 of file event.h.

#define EXCEPTION_RESERVED   15

Definition at line 61 of file event.h.

#define EXCEPTION_SEGMENT_NOT_PRESENT   11

Definition at line 57 of file event.h.

#define EXCEPTION_SIMD_FAULT   19

Definition at line 65 of file event.h.

#define EXCEPTION_STACKSEG_FAULT   12

Definition at line 58 of file event.h.


Typedef Documentation

typedef enum e_idte_type e_idte_type

Enumeration Type Documentation

Enumerator:
IDTE_TASK 
IDTE_INTERRUPT 
IDTE_TRAP 

Definition at line 26 of file event.h.


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_exception_init ( )
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;
}
pok_ret_t pok_syscall_init ( )

Init system calls

Definition at line 83 of file syscalls.c.