ReactOS  0.4.14-dev-49-gfb4591c
macharm.c File Reference
#include <freeldr.h>
#include <internal/arm/intrin_i.h>
Include dependency graph for macharm.c:

Go to the source code of this file.

Functions

VOID FrLdrCheckCpuCompatibility (VOID)
 
VOID ArmInit (IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
 
VOID ArmPrepareForReactOS (VOID)
 
PCONFIGURATION_COMPONENT_DATA ArmHwDetect (VOID)
 
BOOLEAN ArmInitializeBootDevices (VOID)
 
PFREELDR_MEMORY_DESCRIPTOR ArmMemGetMemoryMap (OUT ULONG *MemoryMapSize)
 
VOID ArmHwIdle (VOID)
 
VOID MachInit (IN PCCH CommandLine)
 

Variables

PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock
 
ULONG gDiskReadBuffer
 
ULONG gFileSysBuffer
 
BOOLEAN ArmHwDetectRan
 
PCONFIGURATION_COMPONENT_DATA RootNode
 
BOOLEAN AcpiPresent = FALSE
 
ULONG FirstLevelDcacheSize
 
ULONG FirstLevelDcacheFillSize
 
ULONG FirstLevelIcacheSize
 
ULONG FirstLevelIcacheFillSize
 
ULONG SecondLevelDcacheSize
 
ULONG SecondLevelDcacheFillSize
 
ULONG SecondLevelIcacheSize
 
ULONG SecondLevelIcacheFillSize
 
ULONG reactos_disk_count
 
ULONG SizeBits []
 
ULONG AssocBits []
 
ULONG LenBits []
 
FREELDR_MEMORY_DESCRIPTOR ArmMemoryMap [32]
 

Function Documentation

◆ ArmHwDetect()

Definition at line 95 of file macharm.c.

96 {
97  ARM_CACHE_REGISTER CacheReg;
98 
99  /* Create the root node */
100  if (ArmHwDetectRan++) return RootNode;
102 
103  /*
104  * TODO:
105  * There's no such thing as "PnP" on embedded hardware.
106  * The boot loader will send us a device tree, similar to ACPI
107  * or OpenFirmware device trees, and we will convert it to ARC.
108  */
109 
110  /* Get cache information */
111  CacheReg = KeArmCacheRegisterGet();
112  FirstLevelDcacheSize = SizeBits[CacheReg.DSize];
115  FirstLevelIcacheSize = SizeBits[CacheReg.ISize];
122 
123  /* Initialize the RAMDISK Device */
125 
126  /* Fill out the ARC disk block */
127  AddReactOSArcDiskInfo("ramdisk(0)", 0xBADAB00F, 0xDEADBABE, TRUE);
129 
130  /* Return the root node */
131  return RootNode;
132 }
FORCEINLINE ARM_CACHE_REGISTER KeArmCacheRegisterGet(VOID)
Definition: intrin_i.h:109
ARC_STATUS RamDiskInitialize(IN BOOLEAN InitRamDisk, IN PCSTR LoadOptions OPTIONAL, IN PCSTR DefaultPath OPTIONAL)
Definition: ramdisk.c:204
#define TRUE
Definition: types.h:120
ULONG FirstLevelIcacheSize
Definition: macharm.c:25
ULONG FirstLevelDcacheSize
Definition: macharm.c:23
ULONG SecondLevelDcacheSize
Definition: macharm.c:27
ULONG SizeBits[]
Definition: macharm.c:34
smooth NULL
Definition: ftsmooth.c:416
ULONG SecondLevelDcacheFillSize
Definition: macharm.c:28
BOOLEAN ArmHwDetectRan
Definition: macharm.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID AddReactOSArcDiskInfo(IN PSTR ArcName, IN ULONG Signature, IN ULONG Checksum, IN BOOLEAN ValidPartitionTable)
Definition: archwsup.c:29
ULONG FirstLevelDcacheFillSize
Definition: macharm.c:24
ULONG SecondLevelIcacheSize
Definition: macharm.c:29
ULONG reactos_disk_count
Definition: archwsup.c:20
VOID NTAPI FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
Definition: archwsup.c:89
ULONG FirstLevelIcacheFillSize
Definition: macharm.c:26
ULONG SecondLevelIcacheFillSize
Definition: macharm.c:30
ULONG LenBits[]
Definition: macharm.c:53
PCONFIGURATION_COMPONENT_DATA RootNode
Definition: macharm.c:19

Referenced by ArmInitializeBootDevices(), and MachInit().

◆ ArmHwIdle()

VOID ArmHwIdle ( VOID  )

Definition at line 172 of file macharm.c.

173 {
174  /* UNIMPLEMENTED */
175 }

Referenced by MachInit().

◆ ArmInit()

VOID ArmInit ( IN PARM_BOARD_CONFIGURATION_BLOCK  BootContext)

Definition at line 69 of file macharm.c.

70 {
71  /* Remember the pointer */
72  ArmBoardBlock = BootContext;
73 
74  /* Let's make sure we understand the LLB */
77 
78  /* This should probably go away once we support more boards */
83 
84  /* Call FreeLDR's portable entrypoint with our command-line */
86 }
void BootMain(PSTR CmdLine)
PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock
Definition: macharm.c:16
#define ARM_BOARD_CONFIGURATION_MAJOR_VERSION
Definition: osloader.h:42
#define ARM_BOARD_CONFIGURATION_MINOR_VERSION
Definition: osloader.h:43
#define MACH_TYPE_OMAP3_BEAGLE
Definition: machtype.h:25
#define MACH_TYPE_OMAP_ZOOM2
Definition: machtype.h:30
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define MACH_TYPE_FEROCEON
Definition: machtype.h:13
#define MACH_TYPE_VERSATILE_PB
Definition: machtype.h:19

◆ ArmInitializeBootDevices()

BOOLEAN ArmInitializeBootDevices ( VOID  )

Definition at line 135 of file macharm.c.

136 {
137  /* Emulate old behavior */
138  if (ArmHwDetect() == NULL)
139  return FALSE;
140 
141  /* On ARM platforms, the loader is always in RAM */
142  strcpy(FrLdrBootPath, "ramdisk(0)");
143  return TRUE;
144 }
#define TRUE
Definition: types.h:120
smooth NULL
Definition: ftsmooth.c:416
PCONFIGURATION_COMPONENT_DATA ArmHwDetect(VOID)
Definition: macharm.c:95
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
CHAR FrLdrBootPath[MAX_PATH]
Definition: mach.c:34

Referenced by MachInit().

◆ ArmMemGetMemoryMap()

PFREELDR_MEMORY_DESCRIPTOR ArmMemGetMemoryMap ( OUT ULONG MemoryMapSize)

Definition at line 149 of file macharm.c.

150 {
151  ULONG i;
153 
154  /* Return whatever the board returned to us (CS0 Base + Size and FLASH0) */
155  for (i = 0; i < ArmBoardBlock->MemoryMapEntryCount; i++)
156  {
161  else
163  }
164 
165  *MemoryMapSize = ArmBoardBlock->MemoryMapEntryCount;
166 
167  // FIXME
168  return NULL;
169 }
TYPE_OF_MEMORY MemoryType
Definition: mm.h:38
PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock
Definition: macharm.c:16
FREELDR_MEMORY_DESCRIPTOR ArmMemoryMap[32]
Definition: macharm.c:146
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
LONGLONG BaseAddress
Definition: osloader.h:33
smooth NULL
Definition: ftsmooth.c:416
PFN_NUMBER BasePage
Definition: mm.h:39
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define PAGE_SIZE
Definition: env_spec_w32.h:49
PBIOS_MEMORY_MAP MemoryMap
Definition: osloader.h:53
unsigned int ULONG
Definition: retypes.h:1
LONGLONG Length
Definition: osloader.h:34
PFN_NUMBER PageCount
Definition: mm.h:40

Referenced by MachInit().

◆ ArmPrepareForReactOS()

VOID ArmPrepareForReactOS ( VOID  )

Definition at line 89 of file macharm.c.

90 {
91  return;
92 }

Referenced by MachInit().

◆ FrLdrCheckCpuCompatibility()

VOID FrLdrCheckCpuCompatibility ( VOID  )

Definition at line 63 of file macharm.c.

64 {
65  /* Nothing for now */
66 }

Referenced by BootMain().

◆ MachInit()

VOID MachInit ( IN PCCH  CommandLine)

Definition at line 178 of file macharm.c.

179 {
180  /* Copy Machine Routines from Firmware Table */
189 
190  /* Setup board-specific ARM routines */
191  switch (ArmBoardBlock->BoardType)
192  {
193  /* Check for Feroceon-base boards */
194  case MACH_TYPE_FEROCEON:
195  TuiPrintf("Not implemented\n");
196  while (TRUE);
197  break;
198 
199  /* Check for TI OMAP3 ZOOM-II MDK */
201 
202  /* Setup the disk and file system buffers */
203  gDiskReadBuffer = 0x81094000;
204  gFileSysBuffer = 0x81094000;
205  break;
206 
207  /* Check for ARM Versatile PB boards */
209 
210  /* Setup the disk and file system buffers */
211  gDiskReadBuffer = 0x00090000;
212  gFileSysBuffer = 0x00090000;
213  break;
214 
215  /* Check for TI OMAP3 Beagleboard */
217  TuiPrintf("Not implemented\n");
218  while (TRUE);
219  break;
220 
221  default:
222  ASSERT(FALSE);
223  }
224 
225  /* Setup generic ARM routines for all boards */
231 }
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:63
#define TRUE
Definition: types.h:120
int TuiPrintf(const char *format,...)
Definition: tui.c:31
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
PFREELDR_MEMORY_DESCRIPTOR ArmMemGetMemoryMap(OUT ULONG *MemoryMapSize)
Definition: macharm.c:149
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:77
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock
Definition: macharm.c:16
VOID ArmHwIdle(VOID)
Definition: macharm.c:172
#define MACH_TYPE_OMAP3_BEAGLE
Definition: machtype.h:25
PCONFIGURATION_COMPONENT_DATA ArmHwDetect(VOID)
Definition: macharm.c:95
TIMEINFO *(* GetTime)(VOID)
Definition: machine.h:72
#define MACH_TYPE_OMAP_ZOOM2
Definition: machtype.h:30
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:76
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG gFileSysBuffer
Definition: macharm.c:17
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:52
#define MACH_TYPE_FEROCEON
Definition: machtype.h:13
VOID(* PrepareForReactOS)(VOID)
Definition: machine.h:59
int(* ConsGetCh)(VOID)
Definition: machine.h:43
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
MACHVTBL MachVtbl
Definition: arcemul.c:21
VOID(* HwIdle)(VOID)
Definition: machine.h:78
BOOLEAN ArmInitializeBootDevices(VOID)
Definition: macharm.c:135
ULONG gDiskReadBuffer
Definition: macharm.c:17
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
VOID ArmPrepareForReactOS(VOID)
Definition: macharm.c:89
#define MACH_TYPE_VERSATILE_PB
Definition: machtype.h:19

Variable Documentation

◆ AcpiPresent

BOOLEAN AcpiPresent = FALSE

Definition at line 21 of file macharm.c.

◆ ArmBoardBlock

Definition at line 16 of file macharm.c.

Referenced by ArmInit(), ArmMemGetMemoryMap(), and MachInit().

◆ ArmHwDetectRan

BOOLEAN ArmHwDetectRan

Definition at line 18 of file macharm.c.

Referenced by ArmHwDetect().

◆ ArmMemoryMap

FREELDR_MEMORY_DESCRIPTOR ArmMemoryMap[32]

Definition at line 146 of file macharm.c.

Referenced by ArmMemGetMemoryMap().

◆ AssocBits

ULONG AssocBits[]
Initial value:
=
{
-1,
-1,
4
}

Definition at line 46 of file macharm.c.

◆ FirstLevelDcacheFillSize

ULONG FirstLevelDcacheFillSize

Definition at line 24 of file macharm.c.

Referenced by ArmHwDetect(), and WinLdrSetupForNt().

◆ FirstLevelDcacheSize

ULONG FirstLevelDcacheSize

Definition at line 23 of file macharm.c.

Referenced by ArmHwDetect(), and WinLdrSetupForNt().

◆ FirstLevelIcacheFillSize

ULONG FirstLevelIcacheFillSize

Definition at line 26 of file macharm.c.

Referenced by ArmHwDetect(), and WinLdrSetupForNt().

◆ FirstLevelIcacheSize

ULONG FirstLevelIcacheSize

Definition at line 25 of file macharm.c.

Referenced by ArmHwDetect(), and WinLdrSetupForNt().

◆ gDiskReadBuffer

ULONG gDiskReadBuffer

Definition at line 17 of file macharm.c.

Referenced by MachInit().

◆ gFileSysBuffer

ULONG gFileSysBuffer

Definition at line 17 of file macharm.c.

Referenced by MachInit().

◆ LenBits

ULONG LenBits[]
Initial value:
=
{
-1,
-1,
8
}

Definition at line 53 of file macharm.c.

Referenced by ArmHwDetect().

◆ reactos_disk_count

ULONG reactos_disk_count

Definition at line 20 of file archwsup.c.

Referenced by ArmHwDetect().

◆ RootNode

◆ SecondLevelDcacheFillSize

ULONG SecondLevelDcacheFillSize

Definition at line 28 of file macharm.c.

Referenced by ArmHwDetect(), and WinLdrSetupForNt().

◆ SecondLevelDcacheSize

ULONG SecondLevelDcacheSize

Definition at line 27 of file macharm.c.

Referenced by ArmHwDetect(), and WinLdrSetupForNt().

◆ SecondLevelIcacheFillSize

ULONG SecondLevelIcacheFillSize

Definition at line 30 of file macharm.c.

Referenced by ArmHwDetect().

◆ SecondLevelIcacheSize

ULONG SecondLevelIcacheSize

Definition at line 29 of file macharm.c.

Referenced by ArmHwDetect(), and WinLdrSetupForNt().

◆ SizeBits

ULONG SizeBits[]
Initial value:
=
{
-1,
-1,
1 << 12,
1 << 13,
1 << 14,
1 << 15,
1 << 16,
1 << 17
}

Definition at line 34 of file macharm.c.

Referenced by ArmHwDetect().