ReactOS  0.4.14-dev-554-g2f8d847
processor.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS HAL
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
7  */
8 
9 /* INCLUDES *******************************************************************/
10 
11 #include <hal.h>
12 #define NDEBUG
13 #include <debug.h>
14 
15 /* GLOBALS ********************************************************************/
16 
21 
22 /* PRIVATE FUNCTIONS **********************************************************/
23 
24 VOID
26 {
27  ARM_ID_CODE_REGISTER IdRegister;
28 
29  /* Don't do it again */
31 
32  // fixfix: Use Pcr->ProcessorId
33 
34  /* Read the ID Code */
35  IdRegister = KeArmIdCodeRegisterGet();
36 
37  /* Architecture "6" CPUs support test-and-clean (926EJ-S and 1026EJ-S) */
38  HalpTestCleanSupported = (IdRegister.Architecture == 6);
39 }
40 
41 /* FUNCTIONS ******************************************************************/
42 
43 /*
44  * @implemented
45  */
46 VOID
47 NTAPI
49  IN PLOADER_PARAMETER_BLOCK LoaderBlock)
50 {
51  /* Do nothing */
52  return;
53 }
54 
55 /*
56  * @implemented
57  */
58 BOOLEAN
59 NTAPI
61 {
62  /* Do nothing */
63  return TRUE;
64 }
65 
66 /*
67  * @implemented
68  */
69 BOOLEAN
70 NTAPI
72  IN PKPROCESSOR_STATE ProcessorState)
73 {
74  /* Ready to start */
75  return FALSE;
76 }
77 
78 /*
79  * @implemented
80  */
81 VOID
82 NTAPI
84 {
85  /* Enable interrupts and halt the processor */
86  _enable();
88  while (TRUE);
89 }
90 
91 /*
92  * @implemented
93  */
94 VOID
95 NTAPI
96 HalRequestIpi(KAFFINITY TargetProcessors)
97 {
98  /* Not implemented on UP */
100  while (TRUE);
101 }
102 
103 /*
104  * @implemented
105  */
106 VOID
108 {
109  /*
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.
112  */
114 
115  /*
116  * Check if we can do it the ARMv5TE-J way
117  */
119  {
120  /* Test, clean, flush D-Cache */
121  __asm__ __volatile__ ("1: mrc p15, 0, pc, c7, c14, 3; bne 1b");
122  }
123  else
124  {
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();
128  }
129 }
130 
131 /*
132  * @implemented
133  */
134 VOID
136 {
137  /* All ARM cores support the same Icache flush command */
139 }
140 
141 /* EOF */
LONG HalpActiveProcessors
Definition: processor.c:17
FORCEINLINE VOID KeArmFlushIcache(VOID)
Definition: intrin_i.h:205
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
KAFFINITY HalpDefaultInterruptAffinity
Definition: processor.c:18
VOID NTAPI HalRequestIpi(KAFFINITY TargetProcessors)
Definition: processor.c:96
void __cdecl _enable(void)
Definition: intrin_arm.h:373
VOID HalSweepIcache(VOID)
Definition: processor.c:135
BOOLEAN HalpTestCleanSupported
Definition: processor.c:20
BOOLEAN HalpProcessorIdentified
Definition: processor.c:19
BOOLEAN NTAPI HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PKPROCESSOR_STATE ProcessorState)
Definition: processor.c:71
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI HalInitializeProcessor(IN ULONG ProcessorNumber, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: processor.c:48
long LONG
Definition: pedump.c:60
__asm__("\t.globl GetPhys\n" "GetPhys:\t\n" "mflr 0\n\t" "stwu 0,-16(1)\n\t" "mfmsr 5\n\t" "andi. 6,5,0xffef\n\t" "mtmsr 6\n\t" "isync\n\t" "sync\n\t" "lwz 3,0(3)\n\t" "mtmsr 5\n\t" "isync\n\t" "sync\n\t" "lwz 0,0(1)\n\t" "addi 1,1,16\n\t" "mtlr 0\n\t" "blr")
unsigned char BOOLEAN
VOID NTAPI HalProcessorIdle(VOID)
Definition: processor.c:83
BOOLEAN NTAPI HalAllProcessorsStarted(VOID)
Definition: processor.c:60
FORCEINLINE ARM_ID_CODE_REGISTER KeArmIdCodeRegisterGet(VOID)
Definition: intrin_i.h:31
ULONG_PTR KAFFINITY
Definition: compat.h:75
VOID HalSweepDcache(VOID)
Definition: processor.c:107
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:114
VOID HalpIdentifyProcessor(VOID)
Definition: processor.c:25