summaryrefslogtreecommitdiff
path: root/src/interrupts.h
blob: d4ceab616bf364e0437aadf5b7f8b11dda897f75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef INTERRUPTS_H
#define INTERRUPTS_H

#include <stdint.h>

typedef struct {
	
} interrupt_gate_descriptor_t;

typedef struct {
	
} interrupt_t;

void interrupts_enable( void );
void interrupts_disable( void );

void interrupts_init( interrupt_t *interrupt );

uint32_t interrupts_handle_interrupt( uint8_t interrupt_no, uint32_t esp );

// initialize IDT
// handle gates
// assembly trampolines calling C (static) functions
// later: tasks and stacks, queues

                //~ struct GateDescriptor
                //~ {
                    //~ myos::common::uint16_t handlerAddressLowBits;
                    //~ myos::common::uint16_t gdt_codeSegmentSelector;
                    //~ myos::common::uint8_t reserved;
                    //~ myos::common::uint8_t access;
                    //~ myos::common::uint16_t handlerAddressHighBits;
                //~ } __attribute__((packed));
//~ struct IDTDescr {
   //~ uint16_t offset_1; // offset bits 0..15
   //~ uint16_t selector; // a code segment selector in GDT or LDT
   //~ uint8_t zero;      // unused, set to 0
   //~ uint8_t type_attr; // type and attributes, see below
   //~ uint16_t offset_2; // offset bits 16..31
//~ };


#endif // INTERRUPTS_H