3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: hal/halarm/generic/processor.c
5 * PURPOSE: HAL Processor Routines
6 * PROGRAMMERS: ReactOS Portable Systems Group
9 /* INCLUDES *******************************************************************/
15 /* GLOBALS ********************************************************************/
17 LONG HalpActiveProcessors
;
18 KAFFINITY HalpDefaultInterruptAffinity
;
19 BOOLEAN HalpProcessorIdentified
;
20 BOOLEAN HalpTestCleanSupported
;
22 /* PRIVATE FUNCTIONS **********************************************************/
25 HalpIdentifyProcessor(VOID
)
27 ARM_ID_CODE_REGISTER IdRegister
;
29 /* Don't do it again */
30 HalpProcessorIdentified
= TRUE
;
32 // fixfix: Use Pcr->ProcessorId
34 /* Read the ID Code */
35 IdRegister
= KeArmIdCodeRegisterGet();
37 /* Architecture "6" CPUs support test-and-clean (926EJ-S and 1026EJ-S) */
38 HalpTestCleanSupported
= (IdRegister
.Architecture
== 6);
41 /* FUNCTIONS ******************************************************************/
48 HalInitializeProcessor(IN ULONG ProcessorNumber
,
49 IN PLOADER_PARAMETER_BLOCK LoaderBlock
)
60 HalAllProcessorsStarted(VOID
)
71 HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock
,
72 IN PKPROCESSOR_STATE ProcessorState
)
83 HalProcessorIdle(VOID
)
85 /* Enable interrupts and halt the processor */
96 HalRequestIpi(KAFFINITY TargetProcessors
)
98 /* Not implemented on UP */
110 * We get called very early on, before HalInitSystem or any of the Hal*
111 * processor routines, so we need to figure out what CPU we're on.
113 if (!HalpProcessorIdentified
) HalpIdentifyProcessor();
116 * Check if we can do it the ARMv5TE-J way
118 if (HalpTestCleanSupported
)
120 /* Test, clean, flush D-Cache */
121 __asm__
__volatile__ ("1: mrc p15, 0, pc, c7, c14, 3; bne 1b");
125 /* We need to do it it by set/way. For now always call ARMv7 function */
126 //extern VOID v7_flush_dcache_all(VOID);
127 //v7_flush_dcache_all();
137 /* All ARM cores support the same Icache flush command */