Cucumber/Kernel/include/Tier0/smp.h

67 lines
1.3 KiB
C
Raw Normal View History

2011-08-28 11:01:47 +00:00
#ifndef __SMP_H__
#define __SMP_H__
2011-08-28 01:36:23 +00:00
#include "types.h"
2011-08-28 10:56:46 +00:00
// OS structures
typedef enum {
2011-08-28 11:01:47 +00:00
E_SMP_CPU_STATE_DISABLED,
E_SMP_CPU_STATE_HALTED,
E_SMP_CPU_STATE_IDLE,
E_SMP_CPU_STATE_RUNNING
} E_SMP_CPU_STATE;
2011-08-28 10:56:46 +00:00
typedef struct {
u8 ID;
u32 CPUID;
u8 LAPICID;
2011-08-28 11:01:47 +00:00
E_SMP_CPU_STATE State;
2011-08-28 10:56:46 +00:00
u8 Bootstrap : 1;
2011-08-28 11:01:47 +00:00
} T_SMP_CPU;
2011-08-28 10:56:46 +00:00
// BIOS-provided Structures
2011-08-28 01:36:23 +00:00
typedef struct {
s8 Signature[4];
u32 TablePhysical;
u8 Length;
u8 Specification;
u8 Checksum;
2011-08-28 11:01:47 +00:00
} __attribute__((packed)) T_SMP_POINTER;
2011-08-28 01:36:23 +00:00
2011-08-28 02:30:57 +00:00
typedef struct {
u8 Signature[4];
u16 BaseTableLength;
u8 Specification;
u8 Checksum;
u8 OEMName[8];
u8 ProductName[12];
u32 OEMTablePointer;
u16 OEMTableSize;
u16 NumEntries;
u32 LAPICAddress;
u16 ExtendedTableLength;
u8 ExtendedTableChecksum;
u8 Reserved;
2011-08-28 11:01:47 +00:00
} __attribute__((packed)) T_SMP_CONFIGURATION_HEADER;
2011-08-28 02:30:57 +00:00
typedef struct {
u8 EntryType;
u8 LAPICID;
u8 LAPICVersion;
u8 FlagAvailable : 1;
u8 FlagBootstrap : 1;
u8 FlagReserved : 6;
u32 Signature;
u32 CPUID;
u32 Reserved1;
u32 Reserved2;
2011-08-28 11:01:47 +00:00
} __attribute__((packed)) T_SMP_ENTRY_CPU;
2011-08-28 02:30:57 +00:00
2011-08-28 11:01:47 +00:00
u64 smp_find_pointer(u64 Start, u64 End);
void smp_initialize(void);
void smp_parse_configuration_table(u32 TableAddress);
2011-08-28 01:36:23 +00:00
#endif