ReactOS  0.4.14-dev-342-gdc047f9
xipdisp.c File Reference
#include <ntoskrnl.h>
#include <debug.h>
Include dependency graph for xipdisp.c:

Go to the source code of this file.

Functions

NTSTATUS NTAPI XIPDispatch (IN ULONG DispatchCode, OUT PVOID Buffer, IN ULONG BufferSize)
 
INIT_FUNCTION PMEMORY_ALLOCATION_DESCRIPTOR NTAPI XIPpFindMemoryDescriptor (IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 
INIT_FUNCTION VOID NTAPI XIPInit (IN PLOADER_PARAMETER_BLOCK LoaderBlock)
 

Function Documentation

◆ XIPDispatch()

NTSTATUS NTAPI XIPDispatch ( IN ULONG  DispatchCode,
OUT PVOID  Buffer,
IN ULONG  BufferSize 
)

Definition at line 20 of file xipdisp.c.

23 {
26 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ XIPInit()

INIT_FUNCTION VOID NTAPI XIPInit ( IN PLOADER_PARAMETER_BLOCK  LoaderBlock)

Definition at line 55 of file xipdisp.c.

56 {
57  PCHAR CommandLine, XipBoot, XipRom, XipMegs, XipVerbose, XipRam;
58  PMEMORY_ALLOCATION_DESCRIPTOR XipDescriptor;
59 
60  /* Get the command line */
61  CommandLine = LoaderBlock->LoadOptions;
62  if (!CommandLine) return;
63 
64  /* Get XIP settings */
65  XipBoot = strstr(CommandLine, "XIPBOOT");
66  XipRam = strstr(CommandLine, "XIPRAM=");
67  XipRom = strstr(CommandLine, "XIPROM=");
68  XipMegs = strstr(CommandLine, "XIPMEGS=");
69  XipVerbose = strstr(CommandLine, "XIPVERBOSE");
70 
71  /* Check if this is a verbose boot */
72  if (XipVerbose)
73  {
74  /* Print out our header */
75  DbgPrint("\n\nXIP: debug timestamp at line %d in %s: <<<%s %s>>>\n\n",
76  __LINE__,
77  __FILE__,
78  __DATE__,
79  __TIME__);
80  }
81 
82  /* Find the XIP memory descriptor */
83  XipDescriptor = XIPpFindMemoryDescriptor(LoaderBlock);
84  if (!XipDescriptor) return;
85 
86  //
87  // Make sure this is really XIP, and not RAM Disk -- also validate XIP
88  // Basically, either this is a ROM boot or a RAM boot, but not both nor none
89  //
90  if (!((ULONG_PTR)XipRom ^ (ULONG_PTR)XipRam)) return;
91 
92  /* FIXME: TODO */
93  DPRINT1("ReactOS does not yet support eXecute In Place boot technology\n");
94  DPRINT("%s MB requested (XIP = %s)\n", XipMegs, XipBoot);
95 }
signed char * PCHAR
Definition: retypes.h:7
#define DbgPrint
Definition: loader.c:25
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
uint32_t ULONG_PTR
Definition: typedefs.h:63
void DPRINT(...)
Definition: polytest.cpp:61
INIT_FUNCTION PMEMORY_ALLOCATION_DESCRIPTOR NTAPI XIPpFindMemoryDescriptor(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: xipdisp.c:31
#define DPRINT1
Definition: precomp.h:8

Referenced by Phase1InitializationDiscard().

◆ XIPpFindMemoryDescriptor()

INIT_FUNCTION PMEMORY_ALLOCATION_DESCRIPTOR NTAPI XIPpFindMemoryDescriptor ( IN PLOADER_PARAMETER_BLOCK  LoaderBlock)

Definition at line 31 of file xipdisp.c.

32 {
33  PLIST_ENTRY NextEntry;
35 
36  /* Loop the memory descriptors */
37  for (NextEntry = LoaderBlock->MemoryDescriptorListHead.Flink;
38  NextEntry != &LoaderBlock->MemoryDescriptorListHead;
39  NextEntry = NextEntry->Flink)
40  {
41  /* Get the current descriptor and check if it's the XIP ROM */
42  Descriptor = CONTAINING_RECORD(NextEntry,
44  ListEntry);
45  if (Descriptor->MemoryType == LoaderXIPRom) return Descriptor;
46  }
47 
48  /* Nothing found if we got here */
49  return NULL;
50 }
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
Definition: typedefs.h:117
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PSTORAGE_DESCRIPTOR_HEADER * Descriptor
Definition: classpnp.h:966

Referenced by XIPInit().