ReactOS
0.4.17-dev-806-gffa4164
xipdisp.c
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Kernel
3
* LICENSE: GPL - See COPYING in the top level directory
4
* FILE: ntoskrnl/ex/xipdisp.c
5
* PURPOSE: eXecute In Place (XIP) Support.
6
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7
*/
8
9
/* INCLUDES ******************************************************************/
10
11
#include <ntoskrnl.h>
12
#include <debug.h>
13
14
/* GLOBALS *******************************************************************/
15
16
/* FUNCTIONS *****************************************************************/
17
18
NTSTATUS
19
NTAPI
20
XIPDispatch
(
IN
ULONG
DispatchCode,
21
OUT
PVOID
Buffer
,
22
IN
ULONG
BufferSize
)
23
{
24
UNIMPLEMENTED
;
25
return
STATUS_NOT_IMPLEMENTED
;
26
}
27
28
CODE_SEG
(
"INIT"
)
29
PMEMORY_ALLOCATION_DESCRIPTOR
30
NTAPI
31
XIPpFindMemoryDescriptor
(
IN
PLOADER_PARAMETER_BLOCK
LoaderBlock)
32
{
33
PLIST_ENTRY
NextEntry;
34
PMEMORY_ALLOCATION_DESCRIPTOR
Descriptor
=
NULL
;
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,
43
MEMORY_ALLOCATION_DESCRIPTOR
,
44
ListEntry);
45
if
(
Descriptor
->MemoryType ==
LoaderXIPRom
)
return
Descriptor
;
46
}
47
48
/* Nothing found if we got here */
49
return
NULL
;
50
}
51
52
CODE_SEG
(
"INIT"
)
53
VOID
54
NTAPI
55
XIPInit
(
IN
PLOADER_PARAMETER_BLOCK
LoaderBlock)
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
}
96
97
/* EOF */
CODE_SEG
#define CODE_SEG(...)
Definition:
Bus_PDO_EvalMethod.c:90
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
DPRINT1
#define DPRINT1
Definition:
precomp.h:8
UNIMPLEMENTED
#define UNIMPLEMENTED
Definition:
ntoskrnl.c:15
Buffer
Definition:
bufpool.h:45
STATUS_NOT_IMPLEMENTED
#define STATUS_NOT_IMPLEMENTED
Definition:
d3dkmdt.h:42
BufferSize
_In_ ULONG BufferSize
Definition:
dispmprt.h:490
NULL
#define NULL
Definition:
types.h:112
strstr
_ACRTIMP char *__cdecl strstr(const char *, const char *)
Definition:
string.c:3420
DbgPrint
#define DbgPrint
Definition:
hal.h:12
void
Definition:
nsiface.idl:2307
LoaderXIPRom
@ LoaderXIPRom
Definition:
arc.h:318
DPRINT
#define DPRINT
Definition:
sndvol32.h:73
_LIST_ENTRY
Definition:
typedefs.h:120
_LIST_ENTRY::Flink
struct _LIST_ENTRY * Flink
Definition:
typedefs.h:121
_LOADER_PARAMETER_BLOCK
Definition:
arc.h:813
_MEMORY_ALLOCATION_DESCRIPTOR
Definition:
arc.h:326
NTAPI
#define NTAPI
Definition:
typedefs.h:36
ULONG_PTR
uint32_t ULONG_PTR
Definition:
typedefs.h:65
IN
#define IN
Definition:
typedefs.h:39
CONTAINING_RECORD
#define CONTAINING_RECORD(address, type, field)
Definition:
typedefs.h:260
ULONG
uint32_t ULONG
Definition:
typedefs.h:59
OUT
#define OUT
Definition:
typedefs.h:40
PCHAR
char * PCHAR
Definition:
typedefs.h:51
Descriptor
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition:
wdfresource.h:342
XIPDispatch
NTSTATUS NTAPI XIPDispatch(IN ULONG DispatchCode, OUT PVOID Buffer, IN ULONG BufferSize)
Definition:
xipdisp.c:20
XIPInit
VOID NTAPI XIPInit(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition:
xipdisp.c:55
XIPpFindMemoryDescriptor
PMEMORY_ALLOCATION_DESCRIPTOR NTAPI XIPpFindMemoryDescriptor(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition:
xipdisp.c:31
ntoskrnl
ex
xipdisp.c
Generated on Fri Sep 11 2026 06:15:17 for ReactOS by
1.9.6