FreeNOS
IntelACPI.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Niek Linnenbank
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __LIBARCH_INTEL_ACPI_H
19#define __LIBARCH_INTEL_ACPI_H
20
21#include <Types.h>
22#include <CoreManager.h>
23#include "IntelIO.h"
24
39class IntelACPI : public CoreManager
40{
41 private:
42
44 static const uint RSDBase = 0x1000;
45
47 static const uint RSDSize = MegaByte(1) - 0x1000;
48
50 static const uint RootSystemSignature1 = 0x20445352;
51
53 static const uint RootSystemSignature2 = 0x20525450;
54
56 static const u32 RootSystemTableSignature = 0x54445352;
57
59 static const u32 ExtendedSystemTableSignature = 0x54445358;
60
62 static const u32 MultipleAPICTableSignature = 0x43495041;
63
76
89
106
116
126
131 {
134 } __attribute__((packed))
136
148
160
165 {
166 };
167
168 public:
169
173 IntelACPI();
174
180 virtual Result initialize();
181
187 virtual Result discover();
188
196 virtual Result boot(CoreInfo *info);
197
198 private:
199
205 Result scanAPIC(MultipleAPICTable *madt);
206
207 private:
208
211
214};
215
222#endif /* __LIBARCH_INTEL_ACPI_H */
Generic Core Manager.
Definition CoreManager.h:37
Result
Result codes.
Definition CoreManager.h:46
Intel Advanced Configuration and Power Interface (ACPI).
Definition IntelACPI.h:40
static const uint RSDSize
Size of the memory region for searching the RootSystemDescriptor.
Definition IntelACPI.h:47
static const u32 RootSystemTableSignature
Signature for the Root System Descriptor Table (RSDT).
Definition IntelACPI.h:56
static const uint RSDBase
Memory base address for searching the RootSystemDescriptor.
Definition IntelACPI.h:44
Result scanAPIC(MultipleAPICTable *madt)
Scan for cores in the APIC tables.
Definition IntelACPI.cpp:66
virtual Result initialize()
Initialize the ACPI.
Definition IntelACPI.cpp:27
IntelIO m_bios
I/O object for searching the RootSystemDescriptor.
Definition IntelACPI.h:210
static const u32 ExtendedSystemTableSignature
Signature for the Extended System Descriptor Table (XSDT).
Definition IntelACPI.h:59
virtual Result discover()
Discover processors.
Definition IntelACPI.cpp:97
virtual Result boot(CoreInfo *info)
Boot a processor.
static const u32 MultipleAPICTableSignature
Signature for the Multiple APIC Descriptor Table (MADT).
Definition IntelACPI.h:62
IntelIO m_rootIO
Root/Extended SDT table I/O object.
Definition IntelACPI.h:213
static const uint RootSystemSignature2
Signature to detect a valid RootSystemDescriptor (part 2).
Definition IntelACPI.h:53
enum IntelACPI::Registers __attribute__
Registers
Hardware registers.
Definition IntelACPI.h:165
static const uint RootSystemSignature1
Signature to detect a valid RootSystemDescriptor (part 1).
Definition IntelACPI.h:50
IntelACPI()
Constructor.
Definition IntelACPI.cpp:22
Intel I/O functions.
Definition IntelIO.h:39
unsigned int u32
Unsigned 32-bit number.
Definition Types.h:53
#define MegaByte(v)
Convert megabytes to bytes.
Definition Macros.h:57
unsigned int uint
Unsigned integer number.
Definition Types.h:44
unsigned long long u64
Unsigned 64-bit number.
Definition Types.h:50
unsigned char u8
Unsigned 8-bit number.
Definition Types.h:59
Per-Core information structure.
Definition CoreInfo.h:61
Extended System Descriptor Table (XSDT)
Definition IntelACPI.h:121
SystemDescriptorHeader header
Definition IntelACPI.h:122
Multiple APIC Description Table (MADT) entry.
Definition IntelACPI.h:131
Multiple APIC Description Table (MADT) processor entry.
Definition IntelACPI.h:141
MultipleAPICTableEntry header
Definition IntelACPI.h:142
Multiple APIC Description Table (MADT).
Definition IntelACPI.h:153
SystemDescriptorHeader header
Definition IntelACPI.h:154
MultipleAPICTableEntry entry[]
Definition IntelACPI.h:157
Root System Description Pointer (ACPI v1.0).
Definition IntelACPI.h:68
Root System Description Pointer (ACPI v2.0)
Definition IntelACPI.h:81
RootSystemDescriptor1 v1
Definition IntelACPI.h:82
Root System Descriptor Table (RSDT)
Definition IntelACPI.h:111
SystemDescriptorHeader header
Definition IntelACPI.h:112
System Descriptor Header (ACPI v3.0)
Definition IntelACPI.h:94