ReactOS 0.4.16-dev-297-gc569aee
processor_mp.c File Reference
#include <hal.h>
#include <debug.h>
Include dependency graph for processor_mp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI HaliHaltSystem (VOID)
 
VOID NTAPI HalInitializeProcessor (ULONG ProcessorNumber, PLOADER_PARAMETER_BLOCK LoaderBlock)
 
BOOLEAN NTAPI HalAllProcessorsStarted (VOID)
 
BOOLEAN NTAPI HalStartNextProcessor (IN struct _LOADER_PARAMETER_BLOCK *LoaderBlock, IN PKPROCESSOR_STATE ProcessorState)
 
VOID NTAPI HalProcessorIdle (VOID)
 

Variables

KAFFINITY HalpActiveProcessors
 
KAFFINITY HalpDefaultInterruptAffinity
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 17 of file processor_mp.c.

Function Documentation

◆ HalAllProcessorsStarted()

BOOLEAN NTAPI HalAllProcessorsStarted ( VOID  )

Definition at line 71 of file processor_mp.c.

72{
73 ULONG CPUs = 0, i;
74
75 DPRINT("HalAllProcessorsStarted()\n");
76 for (i = 0; i < 32; i++)
77 {
78 if (OnlineCPUs & (1 << i))
79 {
80 CPUs++;
81 }
82 }
83 if (CPUs > CPUCount)
84 {
86 }
87 else if (CPUs == CPUCount)
88 {
89
92 if (CPUCount > 1)
93 {
94 APICSyncArbIDs();
95 }
97
98 return TRUE;
99 }
100 return FALSE;
101}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID IOAPICSetupIrqs(VOID)
Definition: ioapic.c:296
VOID IOAPICEnable(VOID)
Definition: ioapic.c:409
VOID IOAPICSetupIds(VOID)
Definition: ioapic.c:432
#define ASSERT(a)
Definition: mode.c:44
ULONG OnlineCPUs
Definition: apic.c:39
ULONG CPUCount
Definition: apic.c:37
#define DPRINT
Definition: sndvol32.h:73
uint32_t ULONG
Definition: typedefs.h:59

◆ HaliHaltSystem()

VOID NTAPI HaliHaltSystem ( VOID  )

Definition at line 26 of file processor_mp.c.

27{
28 /* Disable interrupts and halt the CPU */
29 _disable();
30 __halt();
31}
void __cdecl _disable(void)
Definition: intrin_arm.h:365
__INTRIN_INLINE void __halt(void)
Definition: intrin_x86.h:1714

◆ HalInitializeProcessor()

VOID NTAPI HalInitializeProcessor ( ULONG  ProcessorNumber,
PLOADER_PARAMETER_BLOCK  LoaderBlock 
)

Definition at line 36 of file processor_mp.c.

38{
39 ULONG CPU;
40
41 DPRINT("HalInitializeProcessor(%x %x)\n", ProcessorNumber, LoaderBlock);
42
43 CPU = ThisCPU();
44 if (OnlineCPUs & (1 << CPU))
45 {
47 }
48
49 if (ProcessorNumber == 0)
50 {
52 }
53 else
54 {
55 APICSetup();
56
57 DPRINT("CPU %d says it is now booted.\n", CPU);
58
60 }
61
62 /* This processor is now booted */
63 CPUMap[CPU].Flags |= CPU_ENABLED;
64 OnlineCPUs |= (1 << CPU);
65
66 /* Setup busy waiting */
67 //HalpCalibrateStallExecution();
68}
VOID APICSetup(VOID)
Definition: apic.c:482
VOID APICCalibrateTimer(ULONG CPU)
Definition: apic.c:794
CPU_INFO CPUMap[MAX_CPU]
Definition: apic.c:40
VOID HaliInitBSP(VOID)
Definition: apic.c:886

◆ HalProcessorIdle()

VOID NTAPI HalProcessorIdle ( VOID  )

Definition at line 135 of file processor_mp.c.

136{
138}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

◆ HalStartNextProcessor()

BOOLEAN NTAPI HalStartNextProcessor ( IN struct _LOADER_PARAMETER_BLOCK LoaderBlock,
IN PKPROCESSOR_STATE  ProcessorState 
)

Definition at line 105 of file processor_mp.c.

108{
109 ULONG CPU;
110
111 DPRINT("HalStartNextProcessor(%x %x)\n", LoaderBlock, ProcessorState);
112
113 for (CPU = 0; CPU < CPUCount; CPU++)
114 {
115 if (!(OnlineCPUs & (1<<CPU)))
116 {
117 break;
118 }
119 }
120
121 if (CPU >= CPUCount)
122 {
123 ASSERT(FALSE);
124 }
125
126 DPRINT1("Attempting to boot CPU %d\n", CPU);
127
128 HaliStartApplicationProcessor(CPU, (ULONG)ProcessorState);
129
130 return TRUE;
131}
#define DPRINT1
Definition: precomp.h:8

Variable Documentation

◆ HalpActiveProcessors

KAFFINITY HalpActiveProcessors

Definition at line 20 of file processor_mp.c.

◆ HalpDefaultInterruptAffinity

KAFFINITY HalpDefaultInterruptAffinity

Definition at line 20 of file processor_mp.c.