ReactOS  0.4.13-dev-257-gfabbd7c
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 DiskStopFloppyMotor (VOID)
 
VOID FrLdrCheckCpuCompatibility (VOID)
 
VOID ArmInit (IN PARM_BOARD_CONFIGURATION_BLOCK BootContext)
 
VOID ArmPrepareForReactOS (IN BOOLEAN Setup)
 
BOOLEAN ArmDiskGetBootPath (OUT PCHAR BootPath, IN ULONG Size)
 
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

◆ ArmDiskGetBootPath()

BOOLEAN ArmDiskGetBootPath ( OUT PCHAR  BootPath,
IN ULONG  Size 
)

Definition at line 99 of file macharm.c.

100 {
101  PCCH Path = "ramdisk(0)";
102 
103  /* Make sure enough space exists */
104  if (Size < sizeof(Path)) return FALSE;
105 
106  /* On ARM platforms, the loader is always in RAM */
107  strcpy(BootPath, Path);
108  return TRUE;
109 }
#define TRUE
Definition: types.h:120
CONST CHAR * PCCH
Definition: ntbasedef.h:399
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
PRTL_UNICODE_STRING_BUFFER Path
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char BootPath[0x100]
Definition: mach.c:35

Referenced by MachInit().

◆ ArmHwDetect()

Definition at line 112 of file macharm.c.

113 {
114  ARM_CACHE_REGISTER CacheReg;
115 
116  /* Create the root node */
117  if (ArmHwDetectRan++) return RootNode;
119 
120  /*
121  * TODO:
122  * There's no such thing as "PnP" on embedded hardware.
123  * The boot loader will send us a device tree, similar to ACPI
124  * or OpenFirmware device trees, and we will convert it to ARC.
125  */
126 
127  /* Get cache information */
128  CacheReg = KeArmCacheRegisterGet();
129  FirstLevelDcacheSize = SizeBits[CacheReg.DSize];
132  FirstLevelIcacheSize = SizeBits[CacheReg.ISize];
139 
140  /* Register RAMDISK Device */
142 
143  /* Fill out the ARC disk block */
144  AddReactOSArcDiskInfo("ramdisk(0)", 0xBADAB00F, 0xDEADBABE, TRUE);
146 
147  /* Return the root node */
148  return RootNode;
149 }
FORCEINLINE ARM_CACHE_REGISTER KeArmCacheRegisterGet(VOID)
Definition: intrin_i.h:109
#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
ULONG SecondLevelDcacheFillSize
Definition: macharm.c:28
BOOLEAN ArmHwDetectRan
Definition: macharm.c:18
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
VOID NTAPI RamDiskInitialize(VOID)
Definition: ramdisk.c:113
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 184 of file macharm.c.

185 {
186  /* UNIMPLEMENTED */
187 }

Referenced by MachInit().

◆ ArmInit()

VOID ArmInit ( IN PARM_BOARD_CONFIGURATION_BLOCK  BootContext)

Definition at line 73 of file macharm.c.

74 {
75  /* Remember the pointer */
76  ArmBoardBlock = BootContext;
77 
78  /* Let's make sure we understand the LLB */
81 
82  /* This should probably go away once we support more boards */
87 
88  /* Call FreeLDR's portable entrypoint with our command-line */
90 }
PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock
Definition: macharm.c:16
#define ARM_BOARD_CONFIGURATION_MAJOR_VERSION
Definition: osloader.h:42
void BootMain(LPSTR CmdLine)
#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 152 of file macharm.c.

153 {
154  /* Emulate old behavior */
155  return (ArmHwDetect() != NULL);
156 }
smooth NULL
Definition: ftsmooth.c:416
PCONFIGURATION_COMPONENT_DATA ArmHwDetect(VOID)
Definition: macharm.c:112

Referenced by MachInit().

◆ ArmMemGetMemoryMap()

PFREELDR_MEMORY_DESCRIPTOR ArmMemGetMemoryMap ( OUT ULONG MemoryMapSize)

Definition at line 161 of file macharm.c.

162 {
163  ULONG i;
165 
166  /* Return whatever the board returned to us (CS0 Base + Size and FLASH0) */
167  for (i = 0; i < ArmBoardBlock->MemoryMapEntryCount; i++)
168  {
173  else
175  }
176 
177  *MemoryMapSize = ArmBoardBlock->MemoryMapEntryCount;
178 
179  // FIXME
180  return NULL;
181 }
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:158
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 ( IN BOOLEAN  Setup)

Definition at line 93 of file macharm.c.

94 {
95  return;
96 }

Referenced by MachInit().

◆ DiskStopFloppyMotor()

VOID DiskStopFloppyMotor ( VOID  )

Definition at line 62 of file macharm.c.

63 {
64 }

Referenced by BootMain(), OptionMenuReboot(), PcPrepareForReactOS(), and XboxPrepareForReactOS().

◆ FrLdrCheckCpuCompatibility()

VOID FrLdrCheckCpuCompatibility ( VOID  )

Definition at line 67 of file macharm.c.

68 {
69  /* Nothing for now */
70 }

Referenced by BootMain().

◆ MachInit()

VOID MachInit ( IN PCCH  CommandLine)

Definition at line 190 of file macharm.c.

191 {
192  /* Copy Machine Routines from Firmware Table */
201 
202  /* Setup board-specific ARM routines */
203  switch (ArmBoardBlock->BoardType)
204  {
205  /* Check for Feroceon-base boards */
206  case MACH_TYPE_FEROCEON:
207  TuiPrintf("Not implemented\n");
208  while (TRUE);
209  break;
210 
211  /* Check for TI OMAP3 ZOOM-II MDK */
213 
214  /* Setup the disk and file system buffers */
215  gDiskReadBuffer = 0x81094000;
216  gFileSysBuffer = 0x81094000;
217  break;
218 
219  /* Check for ARM Versatile PB boards */
221 
222  /* Setup the disk and file system buffers */
223  gDiskReadBuffer = 0x00090000;
224  gFileSysBuffer = 0x00090000;
225  break;
226 
227  /* Check for TI OMAP3 Beagleboard */
229  TuiPrintf("Not implemented\n");
230  while (TRUE);
231  break;
232 
233  default:
234  ASSERT(FALSE);
235  }
236 
237  /* Setup generic ARM routines for all boards */
244 }
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:62
#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:161
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:75
BOOLEAN(* DiskGetBootPath)(PCHAR BootPath, ULONG Size)
Definition: machine.h:64
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
PARM_BOARD_CONFIGURATION_BLOCK ArmBoardBlock
Definition: macharm.c:16
BOOLEAN ArmDiskGetBootPath(OUT PCHAR BootPath, IN ULONG Size)
Definition: macharm.c:99
VOID ArmHwIdle(VOID)
Definition: macharm.c:184
#define MACH_TYPE_OMAP3_BEAGLE
Definition: machtype.h:25
PCONFIGURATION_COMPONENT_DATA ArmHwDetect(VOID)
Definition: macharm.c:112
TIMEINFO *(* GetTime)(VOID)
Definition: machine.h:70
#define MACH_TYPE_OMAP_ZOOM2
Definition: machtype.h:30
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:74
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:51
#define MACH_TYPE_FEROCEON
Definition: machtype.h:13
VOID ArmPrepareForReactOS(IN BOOLEAN Setup)
Definition: macharm.c:93
int(* ConsGetCh)(VOID)
Definition: machine.h:43
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
VOID(* HwIdle)(VOID)
Definition: machine.h:76
BOOLEAN ArmInitializeBootDevices(VOID)
Definition: macharm.c:152
ULONG gDiskReadBuffer
Definition: macharm.c:17
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
#define MACH_TYPE_VERSATILE_PB
Definition: machtype.h:19
MACHVTBL MachVtbl
Definition: machine.c:21
VOID(* PrepareForReactOS)(IN BOOLEAN Setup)
Definition: machine.h:58

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 158 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().