ReactOS 0.4.17-dev-1190-g4c812f4
smp.h
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Header File for SMP support
5 * COPYRIGHT: Copyright 2021 Justin Miller <justinmiller100@gmail.com>
6 */
7
8#pragma once
9
10/* This table is filled for each physical processor on system */
11typedef struct _PROCESSOR_IDENTITY
12{
19
21
22/* This table is counter of the overall APIC constants acquired from madt */
23#define HALP_APIC_INFO_TABLE_IOAPIC_NUMBER 256 // ACPI_MADT_IO_APIC.Id is a UINT8.
24#define HALP_ISA_IRQ_COUNT 16
26{
28 ULONG ProcessorCount; /* Count of all physical cores, This includes BSP */
30 ULONG LocalApicPA; // The 32-bit physical address at which each processor can access its local interrupt controller
33 ULONG IoApicIrqBase[HALP_APIC_INFO_TABLE_IOAPIC_NUMBER]; // Global system interrupt base
34 ULONG IsaIrqGsi[HALP_ISA_IRQ_COUNT]; // Interrupt source override target
35 KINTERRUPT_POLARITY IsaIrqPolarity[HALP_ISA_IRQ_COUNT]; // Unknown when conforming to the bus
37
38/* HALP_APIC_INFO_TABLE.ApicMode values */
39// TODO: What are the other modes/values?
40#define HALP_APIC_MODE_LEGACY 0x00000010
41
42VOID
44 _In_ PLOADER_PARAMETER_BLOCK LoaderBlock);
45
46VOID
48 _In_ UINT32 NTProcessorNumber);
49
50VOID
52
53VOID
57
58/* APIC specific functions inside apic/apicsmp.c */
59
60VOID
62 _In_ ULONG NTProcessorNumber,
63 _In_ PHYSICAL_ADDRESS StartupLoc);
64
65VOID
68 _In_ KAFFINITY TargetProcessors);
69
70VOID
74 _In_ BOOLEAN IncludeSelf);
75
76VOID
79 _In_ KAFFINITY TargetSet,
81
82#ifdef _M_AMD64
83
85VOID
87HalpSendNMI(
88 _In_ KAFFINITY TargetSet);
89
91VOID
93HalpSendSoftwareInterrupt(
94 _In_ KAFFINITY TargetSet,
96
97#endif // _M_AMD64
unsigned char BOOLEAN
Definition: actypes.h:127
_Out_ PKIRQL Irql
Definition: csq.h:179
ULONG_PTR KAFFINITY
Definition: compat.h:85
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define MAXIMUM_PROCESSORS
Definition: rwlock.h:5
#define _In_
Definition: no_sal2.h:158
#define FASTCALL
Definition: nt_native.h:50
#define NTHALAPI
Definition: ntoskrnl.h:40
VOID FASTCALL HalpBroadcastClockIpi(_In_ UCHAR Vector)
Definition: up.c:45
VOID ApicStartApplicationProcessor(_In_ ULONG NTProcessorNumber, _In_ PHYSICAL_ADDRESS StartupLoc)
Definition: apicsmp.c:107
VOID NTAPI HalpRequestIpi(_In_ KAFFINITY TargetProcessors)
Requests an IPI interrupt on the specified processors.
Definition: apicsmp.c:237
VOID HalpParseApicTables(_In_ PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: madt.c:295
#define HALP_ISA_IRQ_COUNT
Definition: smp.h:24
VOID HalpPrintApicTables(VOID)
Definition: madt.c:315
struct _HALP_APIC_INFO_TABLE * PHALP_APIC_INFO_TABLE
struct _PROCESSOR_IDENTITY PROCESSOR_IDENTITY
struct _HALP_APIC_INFO_TABLE HALP_APIC_INFO_TABLE
VOID NTAPI HalRequestIpiSpecifyVector(_In_ KAFFINITY TargetSet, _In_ UCHAR Vector)
Requests an IPI with a specified vector on the specified processors.
Definition: apicsmp.c:183
struct _PROCESSOR_IDENTITY * PPROCESSOR_IDENTITY
VOID NTAPI HalpBroadcastIpiSpecifyVector(_In_ UCHAR Vector, _In_ BOOLEAN IncludeSelf)
Broadcasts an IPI with a specified vector to all processors.
Definition: apicsmp.c:158
VOID HalpSetupProcessorsTable(_In_ UINT32 NTProcessorNumber)
Definition: up.c:37
#define HALP_APIC_INFO_TABLE_IOAPIC_NUMBER
Definition: smp.h:23
PROCESSOR_IDENTITY HalpProcessorIdentity[MAXIMUM_PROCESSORS]
Definition: madt.c:25
ULONG ProcessorCount
Definition: smp.h:28
ULONG IsaIrqGsi[HALP_ISA_IRQ_COUNT]
Definition: smp.h:34
ULONG IoApicVA[HALP_APIC_INFO_TABLE_IOAPIC_NUMBER]
Definition: smp.h:31
ULONG IoApicPA[HALP_APIC_INFO_TABLE_IOAPIC_NUMBER]
Definition: smp.h:32
ULONG IOAPICCount
Definition: smp.h:29
ULONG ApicMode
Definition: smp.h:27
ULONG IoApicIrqBase[HALP_APIC_INFO_TABLE_IOAPIC_NUMBER]
Definition: smp.h:33
ULONG LocalApicPA
Definition: smp.h:30
KINTERRUPT_POLARITY IsaIrqPolarity[HALP_ISA_IRQ_COUNT]
Definition: smp.h:35
BOOLEAN ProcessorStarted
Definition: smp.h:15
ULONG ProcessorId
Definition: smp.h:13
ULONG LapicId
Definition: smp.h:14
BOOLEAN BSPCheck
Definition: smp.h:16
PKPRCB ProcessorPrcb
Definition: smp.h:17
unsigned char UCHAR
Definition: typedefs.h:53
#define NTAPI
Definition: typedefs.h:36
uint32_t UINT32
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
enum _KINTERRUPT_POLARITY KINTERRUPT_POLARITY