SayoriOS 0.3.3

madt.h
1 #pragma once
2
3 // https://wiki.osdev.org/MADT
4
5 #define MADT_SIGNATURE "APIC"
6 #include <common.h>
7
8 typedef struct {
9 char signature[4];
10 uint32_t length;
11 char revision;
12 char checksum;
13 char oem_id[6];
14 char oem_table$id[8];
15 uint32_t oem_revision;
16 uint32_t creator_id;
17 uint32_t creator_revision;
18
19 uint32_t lapic_addr;
20 uint32_t flags;
21 } MADT_t;
22
23 // After the Flags field, starting at offset 0x2C,
24 // the rest of the MADT table contains a sequence
25 // of variable length records which enumerate the
26 // interrupt devices on this machine.
27
28 typedef enum {
29 PROCESSOR_LOCAL_APIC = 0,
30 IO_APIC = 1,
31 IO_APIC_INTERRUPT_SOURCE = 2,
32 LAPIC_ADDRESS_OVERRIDE = 5
33 } MADTEntryType;
34
35 typedef struct {
36 char type;
37 char length;
38 } MADTEntry_t;
39
40 typedef struct {
41 char processor_id;
42 char apic_id;
43 uint32_t flags;
44 } ProcessorLocalAPIC_t;
45
46 typedef struct {
47 char ioapic_id;
48 char reserved;
49 uint32_t ioapic_address;
50 uint32_t global_system_interrupt_base;
51 } IOAPIC_t;
52
53 typedef struct {
54 char bus_source;
55 char irq_source;
56 uint32_t global_system_interrupt;
57 uint16_t flags;
58 } IOAPICInterruptSource_t;
59
common.h
Основные определения ядра
IOAPIC_t
Definition: madt.h:46
IOAPICInterruptSource_t
Definition: madt.h:53
MADT_t
Definition: madt.h:8
MADTEntry_t
Definition: madt.h:35
ProcessorLocalAPIC_t
Definition: madt.h:40