ReactOS
0.4.15-dev-5836-g942b022
apicsmp.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS HAL
3
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4
* FILE: hal/halx86/apic/apicsmp.c
5
* PURPOSE: SMP specific APIC code
6
* PROGRAMMERS: Copyright 2021 Timo Kreuzer (timo.kreuzer@reactos.org)
7
*/
8
9
/* INCLUDES *******************************************************************/
10
11
#include <hal.h>
12
#include "
apicp.h
"
13
#define NDEBUG
14
#include <debug.h>
15
16
/* INTERNAL FUNCTIONS *********************************************************/
17
56
FORCEINLINE
57
VOID
58
ApicRequestGlobalInterrupt
(
59
_In_
UCHAR
DestinationProcessor,
60
_In_
UCHAR
Vector
,
61
_In_
APIC_MT
MessageType,
62
_In_
APIC_TGM
TriggerMode,
63
_In_
APIC_DSH
DestinationShortHand)
64
{
65
APIC_INTERRUPT_COMMAND_REGISTER
Icr;
66
67
/* Setup the command register */
68
Icr.
LongLong
= 0;
69
Icr.
Vector
=
Vector
;
70
Icr.
MessageType
= MessageType;
71
Icr.
DestinationMode
=
APIC_DM_Physical
;
72
Icr.
DeliveryStatus
= 0;
73
Icr.
Level
= 0;
74
Icr.
TriggerMode
= TriggerMode;
75
Icr.
RemoteReadStatus
= 0;
76
Icr.
DestinationShortHand
= DestinationShortHand;
77
Icr.
Destination
= DestinationProcessor;
78
79
/* Write the low dword last to send the interrupt */
80
ApicWrite
(
APIC_ICR1
, Icr.
Long1
);
81
ApicWrite
(
APIC_ICR0
, Icr.
Long0
);
82
}
83
84
85
/* SMP SUPPORT FUNCTIONS ******************************************************/
86
87
// Should be called by SMP version of HalRequestIpi
88
VOID
89
NTAPI
90
HalpRequestIpi
(
KAFFINITY
TargetProcessors)
91
{
92
UNIMPLEMENTED
;
93
__debugbreak
();
94
}
95
96
// APIC specific SMP code here
apicp.h
APIC_DM_Physical
@ APIC_DM_Physical
Definition:
apicp.h:144
APIC_MT
enum _APIC_MT APIC_MT
ApicWrite
FORCEINLINE VOID ApicWrite(APIC_REGISTER Register, ULONG Value)
Definition:
apicp.h:322
APIC_TGM
enum _APIC_TGM APIC_TGM
APIC_ICR0
@ APIC_ICR0
Definition:
apicp.h:93
APIC_ICR1
@ APIC_ICR1
Definition:
apicp.h:94
APIC_DSH
enum _APIC_DSH APIC_DSH
ApicRequestGlobalInterrupt
FORCEINLINE VOID ApicRequestGlobalInterrupt(_In_ UCHAR DestinationProcessor, _In_ UCHAR Vector, _In_ APIC_MT MessageType, _In_ APIC_TGM TriggerMode, _In_ APIC_DSH DestinationShortHand)
Definition:
apicsmp.c:58
HalpRequestIpi
VOID NTAPI HalpRequestIpi(KAFFINITY TargetProcessors)
Definition:
apicsmp.c:90
UNIMPLEMENTED
#define UNIMPLEMENTED
Definition:
debug.h:115
KAFFINITY
ULONG_PTR KAFFINITY
Definition:
compat.h:85
void
Definition:
nsiface.idl:2307
__debugbreak
void __cdecl __debugbreak(void)
Definition:
intrin_ppc.h:698
_In_
#define _In_
Definition:
ms_sal.h:308
Vector
Definition:
filtermapper.c:139
NTAPI
#define NTAPI
Definition:
typedefs.h:36
_APIC_INTERRUPT_COMMAND_REGISTER
Definition:
apicp.h:238
_APIC_INTERRUPT_COMMAND_REGISTER::RemoteReadStatus
UINT64 RemoteReadStatus
Definition:
apicp.h:254
_APIC_INTERRUPT_COMMAND_REGISTER::DestinationMode
UINT64 DestinationMode
Definition:
apicp.h:249
_APIC_INTERRUPT_COMMAND_REGISTER::Long1
UINT32 Long1
Definition:
apicp.h:243
_APIC_INTERRUPT_COMMAND_REGISTER::Long0
UINT32 Long0
Definition:
apicp.h:242
_APIC_INTERRUPT_COMMAND_REGISTER::TriggerMode
UINT64 TriggerMode
Definition:
apicp.h:253
_APIC_INTERRUPT_COMMAND_REGISTER::Destination
UINT64 Destination
Definition:
apicp.h:257
_APIC_INTERRUPT_COMMAND_REGISTER::LongLong
UINT64 LongLong
Definition:
apicp.h:239
_APIC_INTERRUPT_COMMAND_REGISTER::DeliveryStatus
UINT64 DeliveryStatus
Definition:
apicp.h:250
_APIC_INTERRUPT_COMMAND_REGISTER::MessageType
UINT64 MessageType
Definition:
apicp.h:248
_APIC_INTERRUPT_COMMAND_REGISTER::DestinationShortHand
UINT64 DestinationShortHand
Definition:
apicp.h:255
_APIC_INTERRUPT_COMMAND_REGISTER::Level
UINT64 Level
Definition:
apicp.h:252
_APIC_INTERRUPT_COMMAND_REGISTER::Vector
UINT64 Vector
Definition:
apicp.h:247
FORCEINLINE
#define FORCEINLINE
Definition:
wdftypes.h:67
UCHAR
unsigned char UCHAR
Definition:
xmlstorage.h:181
hal
halx86
apic
apicsmp.c
Generated on Mon Mar 20 2023 06:05:43 for ReactOS by
1.9.6