ReactOS 0.4.16-dev-2610-ge2c92c0
archwsup.c File Reference
#include <freeldr.h>
#include <debug.h>
Include dependency graph for archwsup.c:

Go to the source code of this file.

Macros

#define TAG_HW_COMPONENT_DATA   'DCwH'
 
#define TAG_HW_NAME   'mNwH'
 

Functions

 DBG_DEFAULT_CHANNEL (HWDETECT)
 
VOID AddReactOSArcDiskInfo (_In_ PCSTR ArcName, _In_opt_ PGUID GptDiskGuid, _In_ ULONG Signature, _In_ ULONG Checksum, _In_ BOOLEAN ValidPartitionTable)
 
ULONG ArcGetDiskCount (VOID)
 
PARC_DISK_SIGNATURE_EX ArcGetDiskInfo (ULONG Index)
 
static VOID FldrSetIdentifier (_In_ PCONFIGURATION_COMPONENT Component, _In_ PCSTR IdentifierString)
 
VOID FldrSetConfigurationData (_Inout_ PCONFIGURATION_COMPONENT_DATA ComponentData, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size)
 
VOID FldrCreateSystemKey (_Out_ PCONFIGURATION_COMPONENT_DATA *SystemNode, _In_ PCSTR IdentifierString)
 
static VOID FldrLinkToParent (_In_ PCONFIGURATION_COMPONENT_DATA Parent, _In_ PCONFIGURATION_COMPONENT_DATA Child)
 
VOID FldrCreateComponentKey (_In_ PCONFIGURATION_COMPONENT_DATA SystemNode, _In_ CONFIGURATION_CLASS Class, _In_ CONFIGURATION_TYPE Type, _In_ IDENTIFIER_FLAG Flags, _In_ ULONG Key, _In_ ULONG Affinity, _In_ PCSTR IdentifierString, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size, _Out_ PCONFIGURATION_COMPONENT_DATA *ComponentKey)
 

Variables

const PCSTR ArcTypes [MaximumType+1]
 
PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot
 
ULONG reactos_disk_count = 0
 
ARC_DISK_SIGNATURE_EX reactos_arc_disk_info [32]
 

Macro Definition Documentation

◆ TAG_HW_COMPONENT_DATA

#define TAG_HW_COMPONENT_DATA   'DCwH'

Definition at line 65 of file archwsup.c.

◆ TAG_HW_NAME

#define TAG_HW_NAME   'mNwH'

Definition at line 66 of file archwsup.c.

Function Documentation

◆ AddReactOSArcDiskInfo()

VOID AddReactOSArcDiskInfo ( _In_ PCSTR  ArcName,
_In_opt_ PGUID  GptDiskGuid,
_In_ ULONG  Signature,
_In_ ULONG  Checksum,
_In_ BOOLEAN  ValidPartitionTable 
)

Definition at line 77 of file archwsup.c.

83{
84 PARC_DISK_SIGNATURE ArcDiskSignature;
85 C_ASSERT(sizeof(*GptDiskGuid) == sizeof(ArcDiskSignature->GptSignature));
86
88
89 /* Fill out the ARC disk block */
93
94 ArcDiskSignature->Signature = Signature;
95 ArcDiskSignature->CheckSum = Checksum;
96 ArcDiskSignature->ValidPartitionTable = ValidPartitionTable;
97
98 ArcDiskSignature->IsGpt = (GptDiskGuid != NULL);
99 if (GptDiskGuid)
100 {
101 RtlCopyMemory(&ArcDiskSignature->GptSignature,
102 GptDiskGuid, sizeof(*GptDiskGuid));
103 }
104
107
109}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
ULONG reactos_disk_count
Definition: archwsup.c:71
ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[32]
Definition: archwsup.c:72
#define NULL
Definition: types.h:112
static const WCHAR Signature[]
Definition: parser.c:141
#define C_ASSERT(e)
Definition: intsafe.h:73
#define ASSERT(a)
Definition: mode.c:44
strcpy
Definition: string.h:131
CHAR ArcName[MAX_PATH]
Definition: winldr.h:37
ARC_DISK_SIGNATURE DiskSignature
Definition: winldr.h:36
BOOLEAN IsGpt
Definition: arc.h:349
ULONG CheckSum
Definition: arc.h:346
CHAR GptSignature[16]
Definition: arc.h:351
PCHAR ArcName
Definition: arc.h:345
BOOLEAN ValidPartitionTable
Definition: arc.h:347
ULONG Signature
Definition: arc.h:344
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

Referenced by ArmHwDetect(), and DiskInitialize().

◆ ArcGetDiskCount()

ULONG ArcGetDiskCount ( VOID  )

Definition at line 111 of file archwsup.c.

112{
113 return reactos_disk_count;
114}

Referenced by WinLdrInitializePhase1().

◆ ArcGetDiskInfo()

PARC_DISK_SIGNATURE_EX ArcGetDiskInfo ( ULONG  Index)

Definition at line 116 of file archwsup.c.

117{
119 return NULL;
121}
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by WinLdrInitializePhase1().

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( HWDETECT  )

◆ FldrCreateComponentKey()

VOID FldrCreateComponentKey ( _In_ PCONFIGURATION_COMPONENT_DATA  SystemNode,
_In_ CONFIGURATION_CLASS  Class,
_In_ CONFIGURATION_TYPE  Type,
_In_ IDENTIFIER_FLAG  Flags,
_In_ ULONG  Key,
_In_ ULONG  Affinity,
_In_ PCSTR  IdentifierString,
_In_ PCM_PARTIAL_RESOURCE_LIST  ResourceList,
_In_ ULONG  Size,
_Out_ PCONFIGURATION_COMPONENT_DATA ComponentKey 
)

Definition at line 224 of file archwsup.c.

235{
236 PCONFIGURATION_COMPONENT_DATA ComponentData;
238
239 /* Allocate the node for this component */
240 ComponentData = FrLdrHeapAlloc(sizeof(CONFIGURATION_COMPONENT_DATA),
242 if (!ComponentData) return;
243
244 /* Now save our parent */
245 ComponentData->Parent = SystemNode;
246
247 /* Link us to the parent */
248 if (SystemNode)
249 FldrLinkToParent(SystemNode, ComponentData);
250
251 /* Set us up */
252 Component = &ComponentData->ComponentEntry;
254 Component->Type = Type;
255 Component->Flags = Flags;
256 Component->Key = Key;
257 Component->AffinityMask = Affinity;
258
259 /* Set identifier */
260 if (IdentifierString)
261 FldrSetIdentifier(Component, IdentifierString);
262
263 /* Set configuration data */
264 if (ResourceList)
266
267 TRACE("Created key: %s\\%d\n", ArcTypes[min(Type, MaximumType)], Key);
268
269 /* Return the child */
270 *ComponentKey = ComponentData;
271}
Type
Definition: Type.h:7
static VOID FldrSetIdentifier(_In_ PCONFIGURATION_COMPONENT Component, _In_ PCSTR IdentifierString)
Definition: archwsup.c:129
const PCSTR ArcTypes[MaximumType+1]
Definition: archwsup.c:19
static VOID FldrLinkToParent(_In_ PCONFIGURATION_COMPONENT_DATA Parent, _In_ PCONFIGURATION_COMPONENT_DATA Child)
Definition: archwsup.c:194
#define TAG_HW_COMPONENT_DATA
Definition: archwsup.c:65
VOID FldrSetConfigurationData(_Inout_ PCONFIGURATION_COMPONENT_DATA ComponentData, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size)
Definition: archwsup.c:150
PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: heap.c:533
#define min(a, b)
Definition: monoChain.cc:55
@ MaximumType
Definition: arc.h:154
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGURATION_COMPONENT ComponentEntry
Definition: arc.h:287
struct _CONFIGURATION_COMPONENT_DATA * Parent
Definition: arc.h:284
CONFIGURATION_CLASS Class
Definition: arc.h:160
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:309
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:174
_In_ ULONG Component
Definition: potypes.h:499

Referenced by DetectAcpiBios(), DetectApmBios(), DetectBiosDisks(), DetectBiosFloppyController(), DetectBiosFloppyPeripheral(), DetectCBusBios(), DetectDisplayController(), DetectDockingStation(), DetectInternal(), DetectIsaBios(), DetectKeyboardController(), DetectKeyboardPeripheral(), DetectNesaBios(), DetectParallelPorts(), DetectPciBios(), DetectPciIrqRoutingTable(), DetectPnpBios(), DetectPointerController(), DetectPointerPeripheral(), DetectPS2Mouse(), DetectSerialPointerPeripheral(), and DetectSerialPorts().

◆ FldrCreateSystemKey()

VOID FldrCreateSystemKey ( _Out_ PCONFIGURATION_COMPONENT_DATA SystemNode,
_In_ PCSTR  IdentifierString 
)

Definition at line 161 of file archwsup.c.

164{
166
167 /* Allocate the root */
170 if (!FldrArcHwTreeRoot) return;
171
172 /* Set it up */
175 Component->Type = MaximumType;
176 Component->ConfigurationDataLength = 0;
177 Component->Identifier = 0;
178 Component->IdentifierLength = 0;
179 Component->Flags = 0;
180 Component->Version = 0;
181 Component->Revision = 0;
182 Component->Key = 0;
183 Component->AffinityMask = 0xFFFFFFFF;
184
185 /* Set identifier */
186 if (IdentifierString)
187 FldrSetIdentifier(Component, IdentifierString);
188
189 /* Return the node */
190 *SystemNode = FldrArcHwTreeRoot;
191}
PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot
Definition: archwsup.c:68
@ SystemClass
Definition: arc.h:99

Referenced by ArmHwDetect(), Pc98HwDetect(), PcHwDetect(), UefiHwDetect(), and XboxHwDetect().

◆ FldrLinkToParent()

static VOID FldrLinkToParent ( _In_ PCONFIGURATION_COMPONENT_DATA  Parent,
_In_ PCONFIGURATION_COMPONENT_DATA  Child 
)
static

Definition at line 194 of file archwsup.c.

197{
199
200 /* Get the first sibling */
201 Sibling = Parent->Child;
202
203 /* If no sibling exists, then we are the first child */
204 if (!Sibling)
205 {
206 /* Link us in */
207 Parent->Child = Child;
208 }
209 else
210 {
211 /* Loop each sibling */
212 do
213 {
214 /* This is now the parent */
215 Parent = Sibling;
216 } while ((Sibling = Sibling->Sibling));
217
218 /* Found the lowest sibling; mark us as its sibling too */
219 Parent->Sibling = Child;
220 }
221}
ACPI_PHYSICAL_ADDRESS ACPI_SIZE BOOLEAN Warn UINT32 *TableIdx UINT32 ACPI_TABLE_HEADER *OutTableHeader ACPI_TABLE_HEADER **OutTable ACPI_HANDLE UINT32 ACPI_WALK_CALLBACK ACPI_WALK_CALLBACK void void **ReturnValue UINT32 ACPI_BUFFER *RetPathPtr ACPI_OBJECT_HANDLER void *Data ACPI_OBJECT_HANDLER void **Data ACPI_STRING ACPI_OBJECT_LIST ACPI_BUFFER *ReturnObjectBuffer ACPI_DEVICE_INFO **ReturnBuffer ACPI_HANDLE Parent
Definition: acpixf.h:732
struct _CONFIGURATION_COMPONENT_DATA * Sibling
Definition: arc.h:286
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536

Referenced by FldrCreateComponentKey().

◆ FldrSetConfigurationData()

VOID FldrSetConfigurationData ( _Inout_ PCONFIGURATION_COMPONENT_DATA  ComponentData,
_In_ PCM_PARTIAL_RESOURCE_LIST  ResourceList,
_In_ ULONG  Size 
)

Definition at line 150 of file archwsup.c.

154{
155 /* Set component information */
156 ComponentData->ConfigurationData = ResourceList;
157 ComponentData->ComponentEntry.ConfigurationDataLength = Size;
158}

Referenced by DetectBiosDisks(), and FldrCreateComponentKey().

◆ FldrSetIdentifier()

static VOID FldrSetIdentifier ( _In_ PCONFIGURATION_COMPONENT  Component,
_In_ PCSTR  IdentifierString 
)
static

Definition at line 129 of file archwsup.c.

132{
133 SIZE_T IdentifierLength;
135
136 /* Allocate memory for the identifier */
137 IdentifierLength = strlen(IdentifierString) + 1;
138 Identifier = FrLdrHeapAlloc(IdentifierLength, TAG_HW_NAME);
139 if (!Identifier) return;
140
141 /* Copy the identifier */
142 RtlCopyMemory(Identifier, IdentifierString, IdentifierLength);
143
144 /* Set component information */
145 Component->IdentifierLength = (ULONG)IdentifierLength;
146 Component->Identifier = Identifier;
147}
#define TAG_HW_NAME
Definition: archwsup.c:66
@ Identifier
Definition: asmpp.cpp:95
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1592
ULONG_PTR SIZE_T
Definition: typedefs.h:80
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51

Referenced by FldrCreateComponentKey(), and FldrCreateSystemKey().

Variable Documentation

◆ ArcTypes

const PCSTR ArcTypes[MaximumType+1]

Definition at line 19 of file archwsup.c.

Referenced by FldrCreateComponentKey().

◆ FldrArcHwTreeRoot

PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot

Definition at line 68 of file archwsup.c.

Referenced by FldrCreateSystemKey().

◆ reactos_arc_disk_info

ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[32]

Definition at line 72 of file archwsup.c.

Referenced by AddReactOSArcDiskInfo(), and ArcGetDiskInfo().

◆ reactos_disk_count

ULONG reactos_disk_count = 0

Definition at line 71 of file archwsup.c.

Referenced by AddReactOSArcDiskInfo(), ArcGetDiskCount(), ArcGetDiskInfo(), and ArmHwDetect().