PageRenderTime 29ms CodeModel.GetById 9ms app.highlight 13ms RepoModel.GetById 1ms app.codeStats 0ms

/idt.h

https://bitbucket.org/seed/kernalion
C Header | 32 lines | 24 code | 6 blank | 2 comment | 0 complexity | f65556845202cd9312211978d54b7f3e MD5 | raw file
 1#ifndef _IDT_H_
 2# define _IDT_H_
 3
 4# define IDT_NB_ENTRIES 256
 5
 6struct int_gate_s
 7{
 8   unsigned short offset_low; // offset 0-15 bits
 9   unsigned short segment_sel;// segment selector
10   unsigned char  reserved;   // must be zeroed
11   unsigned char  flags;      // flags
12   unsigned short offset_high;// offset 16-31 bits
13} __attribute__((packed));
14typedef struct int_gate_s int_gate_t;
15
16// A struct describing a pointer to an array of interrupt handlers.
17// This is in a format suitable for giving to 'lidt'.
18struct lidt_param_s
19{
20   unsigned short limit; // IDT size in bytes
21   unsigned int base;  // IDT address
22} __attribute__((packed));
23typedef struct lidt_param_s lidt_param_t;
24
25
26void init_idt(void);
27void init_tick(void);
28void init_pic(void);
29void set_interrupt(unsigned char index, unsigned int offset, unsigned short segment_sel, unsigned char flags);
30void load_idt();
31
32#endif /* !_IDT_H_ */