ReactOS  0.4.15-dev-1397-g19779b3
envir.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ATAG_HEADER
 
struct  _ATAG_CORE
 
struct  _ATAG_MEM
 
struct  _ATAG_REVISION
 
struct  _ATAG_INITRD2
 
struct  _ATAG_CMDLINE
 
struct  _ATAG
 

Macros

#define ATAG_NONE   0x00000000
 
#define ATAG_CORE   0x54410001
 
#define ATAG_MEM   0x54410002
 
#define ATAG_VIDEOTEXT   0x54410003
 
#define ATAG_RAMDISK   0x54410004
 
#define ATAG_INITRD2   0x54420005
 
#define ATAG_SERIAL   0x54410006
 
#define ATAG_REVISION   0x54410007
 
#define ATAG_VIDEOLFB   0x54410008
 
#define ATAG_CMDLINE   0x54410009
 

Typedefs

typedef struct _ATAG_HEADER ATAG_HEADER
 
typedef struct _ATAG_HEADERPATAG_HEADER
 
typedef struct _ATAG_CORE ATAG_CORE
 
typedef struct _ATAG_COREPATAG_CORE
 
typedef struct _ATAG_MEM ATAG_MEM
 
typedef struct _ATAG_MEMPATAG_MEM
 
typedef struct _ATAG_REVISION ATAG_REVISION
 
typedef struct _ATAG_REVISIONPATAG_REVISION
 
typedef struct _ATAG_INITRD2 ATAG_INITRD2
 
typedef struct _ATAG_INITRD2PATAG_INITRD2
 
typedef struct _ATAG_CMDLINE ATAG_CMDLINE
 
typedef struct _ATAG_CMDLINEPATAG_CMDLINE
 
typedef struct _ATAG ATAG
 
typedef struct _ATAGPATAG
 

Functions

PCHAR NTAPI LlbEnvRead (IN PCHAR Option)
 
BOOLEAN NTAPI LlbEnvGetRamDiskInformation (IN PULONG Base, IN PULONG Size)
 
VOID NTAPI LlbEnvGetMemoryInformation (IN PULONG Base, IN PULONG Size)
 
VOID NTAPI LlbEnvParseArguments (IN PATAG Arguments)
 

Macro Definition Documentation

◆ ATAG_CMDLINE

#define ATAG_CMDLINE   0x54410009

Definition at line 66 of file envir.h.

◆ ATAG_CORE

#define ATAG_CORE   0x54410001

Definition at line 58 of file envir.h.

◆ ATAG_INITRD2

#define ATAG_INITRD2   0x54420005

Definition at line 62 of file envir.h.

◆ ATAG_MEM

#define ATAG_MEM   0x54410002

Definition at line 59 of file envir.h.

◆ ATAG_NONE

#define ATAG_NONE   0x00000000

Definition at line 57 of file envir.h.

◆ ATAG_RAMDISK

#define ATAG_RAMDISK   0x54410004

Definition at line 61 of file envir.h.

◆ ATAG_REVISION

#define ATAG_REVISION   0x54410007

Definition at line 64 of file envir.h.

◆ ATAG_SERIAL

#define ATAG_SERIAL   0x54410006

Definition at line 63 of file envir.h.

◆ ATAG_VIDEOLFB

#define ATAG_VIDEOLFB   0x54410008

Definition at line 65 of file envir.h.

◆ ATAG_VIDEOTEXT

#define ATAG_VIDEOTEXT   0x54410003

Definition at line 60 of file envir.h.

Typedef Documentation

◆ ATAG

typedef struct _ATAG ATAG

◆ ATAG_CMDLINE

◆ ATAG_CORE

◆ ATAG_HEADER

◆ ATAG_INITRD2

◆ ATAG_MEM

◆ ATAG_REVISION

◆ PATAG

typedef struct _ATAG * PATAG

◆ PATAG_CMDLINE

◆ PATAG_CORE

◆ PATAG_HEADER

◆ PATAG_INITRD2

◆ PATAG_MEM

◆ PATAG_REVISION

Function Documentation

◆ LlbEnvGetMemoryInformation()

VOID NTAPI LlbEnvGetMemoryInformation ( IN PULONG  Base,
IN PULONG  Size 
)

Definition at line 97 of file envir.c.

99 {
100  /* Return RAM information */
103 }
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2373
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
ULONG LlbEnvHwMemSize
Definition: envir.c:13
ULONG LlbEnvHwMemStart
Definition: envir.c:12

Referenced by LlbHwBuildMemoryMap().

◆ LlbEnvGetRamDiskInformation()

BOOLEAN NTAPI LlbEnvGetRamDiskInformation ( IN PULONG  Base,
IN PULONG  Size 
)

Definition at line 107 of file envir.c.

109 {
110  /* Do we have a ramdisk? */
111  if (LlbEnvRamDiskSize == 0)
112  {
113  /* No */
114  *Base = 0;
115  *Size = 0;
116  return FALSE;
117  }
118 
119  /* Return ramdisk information */
122  return TRUE;
123 }
#define TRUE
Definition: types.h:120
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2373
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
ULONG LlbEnvRamDiskStart
Definition: envir.c:14
#define FALSE
Definition: types.h:117
ULONG LlbEnvRamDiskSize
Definition: envir.c:15

Referenced by LlbHwBuildMemoryMap(), and LlbHwLoadOsLoaderFromRam().

◆ LlbEnvParseArguments()

VOID NTAPI LlbEnvParseArguments ( IN PATAG  Arguments)

Definition at line 22 of file envir.c.

23 {
24  PATAG Atag;
25 
26  /* Parse the ATAGs */
27  Atag = Arguments;
28  while (Atag->Hdr.Size)
29  {
30  /* Check tag type */
31  switch (Atag->Hdr.Tag)
32  {
33  case ATAG_CORE:
34 
35  /* Save page size */
37  break;
38 
39  case ATAG_REVISION:
40 
41  /* Save page size */
43  break;
44 
45  case ATAG_MEM:
46 
47  /* Save RAM start and size */
49  LlbEnvHwMemSize += Atag->u.Mem.Size;
50  break;
51 
52  case ATAG_INITRD2:
53 
54  /* Save RAMDISK start and size */
57 
58 #ifdef _BEAGLE_
59  /* Make sure it's 16MB-aligned */
60  LlbEnvRamDiskSize = (LlbEnvRamDiskSize + (16 * 1024 * 1024) - 1)
61  &~ ((16 * 1024 * 1024) - 1);
62 
63  /* The RAMDISK actually starts 16MB later */
64  LlbEnvRamDiskStart += 16 * 1024 * 1024;
65  LlbEnvRamDiskSize -= 16 * 1024 * 1024;
66 #endif
67  break;
68 
69  case ATAG_CMDLINE:
70 
71  /* Save command line */
73  Atag->u.CmdLine.CmdLine,
74  Atag->Hdr.Size * sizeof(ULONG));
75  break;
76 
77  /* Nothing left to handle */
78  case ATAG_NONE:
79  default:
80  break;
81  }
82 
83  /* Next tag */
84  Atag = (PATAG)((PULONG)Atag + Atag->Hdr.Size);
85  }
86 
87  /* For debugging */
88  DbgPrint("[BOOTROM] Board Revision: %lx PageSize: %dKB RAM: %dMB CMDLINE: %s\n"
89  "[RAMDISK] Base: %lx Size: %dMB\n",
91  LlbEnvHwPageSize / 1024, LlbEnvHwMemSize / 1024 / 1024, LlbEnvCmdLine,
92  LlbEnvRamDiskStart, LlbEnvRamDiskSize / 1024 / 1024);
93 }
ULONG LlbEnvHwRevision
Definition: envir.c:16
#define DbgPrint
Definition: loader.c:25
#define ATAG_NONE
Definition: envir.h:57
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
ULONG Tag
Definition: envir.h:12
ATAG_CORE Core
Definition: envir.h:49
ULONG LlbEnvRamDiskStart
Definition: envir.c:14
struct _ATAG_CMDLINE ATAG_CMDLINE
CHAR CmdLine[ANYSIZE_ARRAY]
Definition: envir.h:41
struct _ATAG_MEM ATAG_MEM
ULONG Size
Definition: envir.h:36
ULONG LlbEnvRamDiskSize
Definition: envir.c:15
ULONG Size
Definition: envir.h:24
struct _ATAG * PATAG
ULONG LlbEnvHwPageSize
Definition: envir.c:11
union _ATAG::@95 u
struct _ATAG_CORE ATAG_CORE
ULONG Start
Definition: envir.h:35
ULONG Size
Definition: envir.h:11
ULONG Rev
Definition: envir.h:30
struct _ATAG_REVISION ATAG_REVISION
CHAR LlbEnvCmdLine[256]
Definition: envir.c:17
ATAG_INITRD2 InitRd2
Definition: envir.h:52
ULONG PageSize
Definition: envir.h:18
ATAG_MEM Mem
Definition: envir.h:50
unsigned int * PULONG
Definition: retypes.h:1
struct _ATAG_INITRD2 ATAG_INITRD2
ULONG LlbEnvHwMemSize
Definition: envir.c:13
ATAG_CMDLINE CmdLine
Definition: envir.h:53
unsigned int ULONG
Definition: retypes.h:1
Definition: envir.h:44
ULONG Start
Definition: envir.h:25
ATAG_REVISION Revision
Definition: envir.h:51
ATAG_HEADER Hdr
Definition: envir.h:46
ULONG LlbEnvHwMemStart
Definition: envir.c:12

Referenced by LlbStartup().

◆ LlbEnvRead()

PCHAR NTAPI LlbEnvRead ( IN PCHAR  Option)

Definition at line 127 of file envir.c.

128 {
129  PCHAR ValuePointer;
130  ULONG Length = 0;
131 
132  /* Search for the value name */
133  ValuePointer = strstr(LlbEnvCmdLine, ValueName);
134  if (ValuePointer)
135  {
136  /* Get the value data and its length */
137  ValuePointer += strlen(ValueName) + 1;
138  if (strchr(ValuePointer, ','))
139  {
140  /* Stop before next parameter */
141  Length = strchr(ValuePointer, ',') - ValuePointer;
142  }
143  else
144  {
145  /* Stop before the string ends */
146  Length = strlen(ValuePointer);
147  }
148 
149  /* Copy it */
150  strncpy(LlbValueData, ValuePointer, Length);
151  }
152 
153  /* Terminate the data */
155 
156  /* Return the data */
157  return LlbValueData;
158 }
signed char * PCHAR
Definition: retypes.h:7
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
Definition: utclib.c:427
#define ANSI_NULL
CHAR LlbValueData[32]
Definition: envir.c:18
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
CHAR LlbEnvCmdLine[256]
Definition: envir.c:17
char * strchr(const char *String, int ch)
Definition: utclib.c:501
unsigned int ULONG
Definition: retypes.h:1

Referenced by LlbHwLoadOsLoaderFromRam(), and LlbLoadOsLoader().