- Implement first part of SMP support.
[planlOS.git] / system / include / ke / smp.h
blobf5e665668dfe5c1bdafa3a0bcf07f836a41d6518
1 /*
2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 #ifndef KE_SMP_H_INCLUDED
23 #define KE_SMP_H_INCLUDED
25 #include <stdint.h>
27 typedef struct FloatingPointerStruct
29 int8_t signature[4];
30 uint32_t configtable;
31 uint8_t length;
32 uint8_t revision;
33 uint8_t checksum;
34 uint8_t feature0;
35 uint8_t feature1;
36 uint8_t feature2;
37 uint8_t feature3;
38 uint8_t feature4;
39 } __attribute((packed)) FloatingPointerStruct;
41 typedef struct SMPConfigTable
43 int8_t signature[4];
44 uint16_t tablelength;
45 uint8_t revision;
46 uint8_t checksum;
47 int8_t oemid[8];
48 int8_t productid[12];
49 uint32_t oemtableptr;
50 uint16_t oemtablesize;
51 uint16_t entrycount;
52 uint32_t apicaddr;
53 uint16_t extendedlength;
54 uint16_t extendedchecksum;
55 } __attribute((packed)) SMPConfigTable;
57 typedef struct SMPProcessorEntry
59 uint8_t type;
60 uint8_t lapicid;
61 uint8_t lapicversion;
62 uint8_t flags;
63 uint32_t signature;
64 uint32_t featureflags;
65 uint32_t reserved1;
66 uint32_t reserved2;
67 } __attribute((packed)) SMPProcessorEntry;
69 #define KE_SMP_PROCESSOR_ENABLED 1
70 #define KE_SMP_PROCESSOR_BOOTSTRAP 1
72 void keInitSMP(void);
74 uint32_t keGetCPUCount(void);
76 #endif