ReactOS  0.4.15-dev-425-gc40b086
xboxmem.c File Reference
#include <freeldr.h>
#include <debug.h>
Include dependency graph for xboxmem.c:

Go to the source code of this file.

Macros

#define TEST_SIZE   0x200
 
#define TEST_PATTERN1   0xAA
 
#define TEST_PATTERN2   0x55
 

Functions

 DBG_DEFAULT_CHANNEL (MEMORY)
 
VOID SetMemory (PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType)
 
VOID ReserveMemory (PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType, PCHAR Usage)
 
ULONG PcMemFinalizeMemoryMap (PFREELDR_MEMORY_DESCRIPTOR MemoryMap)
 
VOID XboxMemInit (VOID)
 
memory_map_tXboxGetMultibootMemoryMap (INT *Count)
 
TYPE_OF_MEMORY XboxMultibootMemoryType (ULONG Type)
 
PFREELDR_MEMORY_DESCRIPTOR XboxMemGetMemoryMap (ULONG *MemoryMapSize)
 

Variables

static ULONG InstalledMemoryMb = 0
 
static ULONG AvailableMemoryMb = 0
 
multiboot_info_tMultibootInfoPtr
 
PVOID FrameBuffer
 
ULONG FrameBufferSize
 
FREELDR_MEMORY_DESCRIPTOR XboxMemoryMap [MAX_BIOS_DESCRIPTORS+1]
 

Macro Definition Documentation

◆ TEST_PATTERN1

#define TEST_PATTERN1   0xAA

Definition at line 34 of file xboxmem.c.

◆ TEST_PATTERN2

#define TEST_PATTERN2   0x55

Definition at line 35 of file xboxmem.c.

◆ TEST_SIZE

#define TEST_SIZE   0x200

Definition at line 33 of file xboxmem.c.

Function Documentation

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( MEMORY  )

◆ PcMemFinalizeMemoryMap()

ULONG PcMemFinalizeMemoryMap ( PFREELDR_MEMORY_DESCRIPTOR  MemoryMap)

Definition at line 547 of file pcmem.c.

549 {
550  ULONG i;
551 
552  /* Reserve some static ranges for freeldr */
553  ReserveMemory(MemoryMap, 0x1000, STACKLOW - 0x1000, LoaderFirmwareTemporary, "BIOS area");
556 
557  /* Default to 1 page above freeldr for the disk read buffer */
560 
561  /* Scan for free range above freeldr image */
562  for (i = 0; i < PcMapCount; i++)
563  {
564  if ((MemoryMap[i].BasePage > (FREELDR_BASE / PAGE_SIZE)) &&
565  (MemoryMap[i].MemoryType == LoaderFree))
566  {
567  /* Use this range for the disk read buffer */
568  DiskReadBuffer = (PVOID)(MemoryMap[i].BasePage * PAGE_SIZE);
569  DiskReadBufferSize = min(MemoryMap[i].PageCount * PAGE_SIZE,
571  break;
572  }
573  }
574 
575  TRACE("DiskReadBuffer=0x%p, DiskReadBufferSize=0x%lx\n",
577 
579 
580  /* Now reserve the range for the disk read buffer */
585  "Disk read buffer");
586 
587  TRACE("Dumping resulting memory map:\n");
588  for (i = 0; i < PcMapCount; i++)
589  {
590  TRACE("BasePage=0x%lx, PageCount=0x%lx, Type=%s\n",
591  MemoryMap[i].BasePage,
592  MemoryMap[i].PageCount,
593  MmGetSystemMemoryMapTypeString(MemoryMap[i].MemoryType));
594  }
595  return PcMapCount;
596 }
ULONG PcMapCount
Definition: pcmem.c:41
#define FREELDR_BASE
Definition: hardware.h:18
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
#define DiskReadBuffer
Definition: hardware.h:33
unsigned char * PUCHAR
Definition: retypes.h:3
uint32_t ULONG_PTR
Definition: typedefs.h:64
#define STACKADDR
Definition: x86common.h:16
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
#define MAX_DISKREADBUFFER_SIZE
Definition: x86common.h:30
void * PVOID
Definition: retypes.h:9
#define STACKLOW
Definition: x86common.h:15
#define TRACE(s)
Definition: solgame.cpp:4
SIZE_T DiskReadBufferSize
Definition: hwdisk.c:47
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define PAGE_SIZE
Definition: env_spec_w32.h:49
#define min(a, b)
Definition: monoChain.cc:55
VOID ReserveMemory(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType, PCHAR Usage)
Definition: pcmem.c:484
unsigned int ULONG
Definition: retypes.h:1
#define ALIGN_UP_BY(size, align)
SIZE_T FrLdrImageSize
Definition: meminit.c:35

Referenced by PcMemGetMemoryMap(), and XboxMemGetMemoryMap().

◆ ReserveMemory()

VOID ReserveMemory ( PFREELDR_MEMORY_DESCRIPTOR  MemoryMap,
ULONG_PTR  BaseAddress,
SIZE_T  Size,
TYPE_OF_MEMORY  MemoryType,
PCHAR  Usage 
)

Definition at line 484 of file pcmem.c.

490 {
491  ULONG_PTR BasePage, PageCount;
492  ULONG i;
493 
494  BasePage = BaseAddress / PAGE_SIZE;
496 
497  for (i = 0; i < PcMapCount; i++)
498  {
499  /* Check for conflicting descriptor */
500  if ((MemoryMap[i].BasePage < BasePage + PageCount) &&
501  (MemoryMap[i].BasePage + MemoryMap[i].PageCount > BasePage))
502  {
503  /* Check if the memory is free */
504  if (MemoryMap[i].MemoryType != LoaderFree)
505  {
508  __FILE__,
509  __LINE__,
510  "Failed to reserve memory in the range 0x%Ix - 0x%Ix for %s",
511  BaseAddress,
512  Size,
513  Usage);
514  }
515  }
516  }
517 
518  /* Add the memory descriptor */
521  BasePage,
522  PageCount,
523  MemoryType);
524 }
ULONG PcMapCount
Definition: pcmem.c:41
#define MAX_BIOS_DESCRIPTORS
Definition: pcbios.h:12
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
uint32_t ULONG_PTR
Definition: typedefs.h:64
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
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define PAGE_SIZE
Definition: env_spec_w32.h:49
ULONG AddMemoryDescriptor(IN OUT PFREELDR_MEMORY_DESCRIPTOR List, IN ULONG MaxCount, IN PFN_NUMBER BasePage, IN PFN_NUMBER PageCount, IN TYPE_OF_MEMORY MemoryType)
Definition: meminit.c:102
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
VOID FrLdrBugCheckWithMessage(ULONG BugCode, PCHAR File, ULONG Line, PSTR Format,...)
Definition: entry.c:23
unsigned int ULONG
Definition: retypes.h:1

Referenced by PcMemFinalizeMemoryMap(), and XboxMemGetMemoryMap().

◆ SetMemory()

VOID SetMemory ( PFREELDR_MEMORY_DESCRIPTOR  MemoryMap,
ULONG_PTR  BaseAddress,
SIZE_T  Size,
TYPE_OF_MEMORY  MemoryType 
)

Definition at line 527 of file pcmem.c.

532 {
533  ULONG_PTR BasePage, PageCount;
534 
535  BasePage = BaseAddress / PAGE_SIZE;
537 
538  /* Add the memory descriptor */
541  BasePage,
542  PageCount,
543  MemoryType);
544 }
ULONG PcMapCount
Definition: pcmem.c:41
#define MAX_BIOS_DESCRIPTORS
Definition: pcbios.h:12
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
uint32_t ULONG_PTR
Definition: typedefs.h:64
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define PAGE_SIZE
Definition: env_spec_w32.h:49
ULONG AddMemoryDescriptor(IN OUT PFREELDR_MEMORY_DESCRIPTOR List, IN ULONG MaxCount, IN PFN_NUMBER BasePage, IN PFN_NUMBER PageCount, IN TYPE_OF_MEMORY MemoryType)
Definition: meminit.c:102
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361

Referenced by PcMemGetMemoryMap(), and XboxMemGetMemoryMap().

◆ XboxGetMultibootMemoryMap()

memory_map_t* XboxGetMultibootMemoryMap ( INT Count)

Definition at line 104 of file xboxmem.c.

105 {
107 
108  if (!MultibootInfoPtr)
109  {
110  ERR("Multiboot info structure not found!\n");
111  return NULL;
112  }
113 
115  {
116  ERR("Multiboot memory map is not passed!\n");
117  return NULL;
118  }
119 
121 
122  if (!MemoryMap ||
124  MultibootInfoPtr->mmap_length % sizeof(memory_map_t) != 0)
125  {
126  ERR("Multiboot memory map structure is malformed!\n");
127  return NULL;
128  }
129 
131  return MemoryMap;
132 }
multiboot_info_t * MultibootInfoPtr
unsigned long mmap_addr
Definition: multiboot.h:109
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
unsigned long flags
Definition: multiboot.h:96
smooth NULL
Definition: ftsmooth.c:416
#define MB_INFO_FLAG_MEMORY_MAP
Definition: multiboot.h:50
if(!(yy_init))
Definition: macro.lex.yy.c:714
struct memory_map memory_map_t
unsigned long mmap_length
Definition: multiboot.h:108
#define ERR(fmt,...)
Definition: debug.h:110

Referenced by XboxMemGetMemoryMap().

◆ XboxMemGetMemoryMap()

PFREELDR_MEMORY_DESCRIPTOR XboxMemGetMemoryMap ( ULONG MemoryMapSize)

Definition at line 157 of file xboxmem.c.

158 {
159  memory_map_t * MbMap;
160  INT Count, i;
161 
162  TRACE("XboxMemGetMemoryMap()\n");
163 
165  if (MbMap)
166  {
167  /* Obtain memory map via multiboot spec */
168 
169  for (i = 0; i < Count; i++, MbMap++)
170  {
171  TRACE("i = %d, base_addr_low = 0x%p, length_low = 0x%p\n", i, MbMap->base_addr_low, MbMap->length_low);
172 
173  if (MbMap->base_addr_high > 0 || MbMap->length_high > 0)
174  {
175  ERR("Memory descriptor base or size is greater than 4 GB, should not happen on Xbox!\n");
176  ASSERT(FALSE);
177  }
178 
180  MbMap->base_addr_low,
181  MbMap->length_low,
182  XboxMultibootMemoryType(MbMap->type));
183  }
184  }
185  else
186  {
187  /* Synthesize memory map */
188 
189  /* Available RAM block */
191  0,
192  AvailableMemoryMb * 1024 * 1024,
193  LoaderFree);
194 
195  if (FrameBufferSize != 0)
196  {
197  /* Video memory */
202  "Video memory");
203  }
204  }
205 
206  *MemoryMapSize = PcMemFinalizeMemoryMap(XboxMemoryMap);
207  return XboxMemoryMap;
208 }
ULONG FrameBufferSize
Definition: xboxvideo.c:28
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
VOID ReserveMemory(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType, PCHAR Usage)
Definition: pcmem.c:484
TYPE_OF_MEMORY XboxMultibootMemoryType(ULONG Type)
Definition: xboxmem.c:135
int32_t INT
Definition: typedefs.h:57
uint32_t ULONG_PTR
Definition: typedefs.h:64
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
static ULONG AvailableMemoryMb
Definition: xboxmem.c:28
#define TRACE(s)
Definition: solgame.cpp:4
memory_map_t * XboxGetMultibootMemoryMap(INT *Count)
Definition: xboxmem.c:104
unsigned long length_high
Definition: multiboot.h:122
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
unsigned long base_addr_low
Definition: multiboot.h:119
FREELDR_MEMORY_DESCRIPTOR XboxMemoryMap[MAX_BIOS_DESCRIPTORS+1]
Definition: xboxmem.c:154
#define ERR(fmt,...)
Definition: debug.h:110
unsigned long length_low
Definition: multiboot.h:121
unsigned long base_addr_high
Definition: multiboot.h:120
unsigned long type
Definition: multiboot.h:123
VOID SetMemory(PFREELDR_MEMORY_DESCRIPTOR MemoryMap, ULONG_PTR BaseAddress, SIZE_T Size, TYPE_OF_MEMORY MemoryType)
Definition: pcmem.c:527
ULONG PcMemFinalizeMemoryMap(PFREELDR_MEMORY_DESCRIPTOR MemoryMap)
Definition: pcmem.c:547
PVOID FrameBuffer
Definition: xboxvideo.c:27

Referenced by MachInit().

◆ XboxMemInit()

VOID XboxMemInit ( VOID  )

Definition at line 57 of file xboxmem.c.

58 {
59  UCHAR ControlRegion[TEST_SIZE];
60  PVOID MembaseTop = (PVOID)(64 * 1024 * 1024);
61  PVOID MembaseLow = (PVOID)0;
62 
64  WRITE_REGISTER_ULONG((PULONG)(NV2A_FB_CFG0 + 4), 0x11448000);
65 
66  /* Prep hardware for 128 Mb */
67  WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(0, 0, 0x84));
68  WRITE_PORT_ULONG((PULONG)0xCFC, 0x7FFFFFF);
69 
70  InstalledMemoryMb = 64;
71  memset(ControlRegion, TEST_PATTERN1, TEST_SIZE);
72  memset(MembaseTop, TEST_PATTERN1, TEST_SIZE);
73  __wbinvd();
74 
75  if (memcmp(MembaseTop, ControlRegion, TEST_SIZE) == 0)
76  {
77  /* Looks like there is memory .. maybe a 128MB box */
78  memset(ControlRegion, TEST_PATTERN2, TEST_SIZE);
79  memset(MembaseTop, TEST_PATTERN2, TEST_SIZE);
80  __wbinvd();
81  if (memcmp(MembaseTop, ControlRegion, TEST_SIZE) == 0)
82  {
83  /* Definitely looks like there is memory */
84  if (memcmp(MembaseLow, ControlRegion, TEST_SIZE) == 0)
85  {
86  /* Hell, we find the Test-string at 0x0 too! */
87  InstalledMemoryMb = 64;
88  }
89  else
90  {
91  InstalledMemoryMb = 128;
92  }
93  }
94  }
95 
96  /* Set hardware for amount of memory detected */
97  WRITE_PORT_ULONG((PULONG)0xCF8, CONFIG_CMD(0, 0, 0x84));
98  WRITE_PORT_ULONG((PULONG)0xCFC, InstalledMemoryMb * 1024 * 1024 - 1);
99 
101 }
NTKERNELAPI VOID NTAPI WRITE_REGISTER_ULONG(IN PULONG Register, IN ULONG Value)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define TEST_SIZE
Definition: xboxmem.c:33
static ULONG AvailableMemoryMb
Definition: xboxmem.c:28
#define TEST_PATTERN1
Definition: xboxmem.c:34
VOID NTAPI WRITE_PORT_ULONG(IN PULONG Port, IN ULONG Value)
Definition: portio.c:123
void * PVOID
Definition: retypes.h:9
PPC_QUAL void __wbinvd(void)
Definition: intrin_ppc.h:759
unsigned char UCHAR
Definition: xmlstorage.h:181
#define TEST_PATTERN2
Definition: xboxmem.c:35
#define NV2A_FB_CFG0
Definition: machxbox.h:42
unsigned int * PULONG
Definition: retypes.h:1
#define CONFIG_CMD(bus, dev_fn, where)
Definition: hardware.h:23
static ULONG InstalledMemoryMb
Definition: xboxmem.c:27
#define memset(x, y, z)
Definition: compat.h:39

Referenced by MachInit().

◆ XboxMultibootMemoryType()

TYPE_OF_MEMORY XboxMultibootMemoryType ( ULONG  Type)

Definition at line 135 of file xboxmem.c.

136 {
137  switch (Type)
138  {
139  case 0: // Video RAM
141  case 1: // Available RAM
142  return LoaderFree;
143  case 3: // ACPI area
145  case 4: // Hibernation area
146  return LoaderSpecialMemory;
147  case 5: // Reserved or invalid memory
148  return LoaderSpecialMemory;
149  default:
151  }
152 }
Type
Definition: Type.h:6

Referenced by XboxMemGetMemoryMap().

Variable Documentation

◆ AvailableMemoryMb

ULONG AvailableMemoryMb = 0
static

Definition at line 28 of file xboxmem.c.

Referenced by XboxMemGetMemoryMap(), and XboxMemInit().

◆ FrameBuffer

PVOID FrameBuffer

Definition at line 27 of file xboxvideo.c.

Referenced by XboxMemGetMemoryMap().

◆ FrameBufferSize

ULONG FrameBufferSize

Definition at line 28 of file xboxvideo.c.

Referenced by XboxMemGetMemoryMap(), and XboxVideoInit().

◆ InstalledMemoryMb

ULONG InstalledMemoryMb = 0
static

Definition at line 27 of file xboxmem.c.

Referenced by XboxMemInit().

◆ MultibootInfoPtr

multiboot_info_t* MultibootInfoPtr

◆ XboxMemoryMap

Definition at line 154 of file xboxmem.c.

Referenced by XboxMemGetMemoryMap().