xref: /reactos/hal/halx86/include/smp.h (revision 7f26a396)
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 */
11 typedef struct _PROCESSOR_IDENTITY
12 {
13     UCHAR ProcessorId;
14     UCHAR LapicId;
15     BOOLEAN ProcessorStarted;
16     BOOLEAN BSPCheck;
17     PKPRCB ProcessorPrcb;
18 
19 } PROCESSOR_IDENTITY, *PPROCESSOR_IDENTITY;
20 
21 /* This table is counter of the overall APIC constants acquired from madt */
22 typedef struct _HALP_APIC_INFO_TABLE
23 {
24     ULONG ApicMode;
25     ULONG ProcessorCount; /* Count of all physical cores, This includes BSP */
26     ULONG IOAPICCount;
27     ULONG LocalApicPA;                // The 32-bit physical address at which each processor can access its local interrupt controller
28     ULONG IoApicVA[256];
29     ULONG IoApicPA[256];
30     ULONG IoApicIrqBase[256]; // Global system interrupt base
31 
32 } HALP_APIC_INFO_TABLE, *PHALP_APIC_INFO_TABLE;
33 
34 VOID
35 HalpParseApicTables(
36     _In_ PLOADER_PARAMETER_BLOCK LoaderBlock);
37 
38 VOID
39 HalpSetupProcessorsTable(
40     _In_ UINT32 NTProcessorNumber);
41 
42 VOID
43 HalpPrintApicTables(VOID);
44 
45 VOID
46 FASTCALL
47 HalpBroadcastClockIpi(
48     _In_ UCHAR Vector);
49 
50 /* APIC specific functions inside apic/apicsmp.c */
51 
52 VOID
53 ApicStartApplicationProcessor(
54     _In_ ULONG NTProcessorNumber,
55     _In_ PHYSICAL_ADDRESS StartupLoc);
56 
57 VOID
58 NTAPI
59 HalpRequestIpi(
60     _In_ KAFFINITY TargetProcessors);
61 
62 VOID
63 NTAPI
64 HalpBroadcastIpiSpecifyVector(
65     _In_ UCHAR Vector,
66     _In_ BOOLEAN IncludeSelf);
67 
68 VOID
69 NTAPI
70 HalRequestIpiSpecifyVector(
71     _In_ KAFFINITY TargetSet,
72     _In_ UCHAR Vector);
73 
74 #ifdef _M_AMD64
75 
76 NTHALAPI
77 VOID
78 NTAPI
79 HalpSendNMI(
80     _In_ KAFFINITY TargetSet);
81 
82 NTHALAPI
83 VOID
84 NTAPI
85 HalpSendSoftwareInterrupt(
86     _In_ KAFFINITY TargetSet,
87     _In_ KIRQL Irql);
88 
89 #endif // _M_AMD64
90