ReactOS 0.4.15-dev-7677-g8209aa5
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 PSTR ArcName, IN ULONG Signature, IN ULONG Checksum, IN BOOLEAN ValidPartitionTable)
 
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 73 of file archwsup.c.

◆ TAG_HW_NAME

#define TAG_HW_NAME   'mNwH'

Definition at line 74 of file archwsup.c.

Function Documentation

◆ AddReactOSArcDiskInfo()

VOID AddReactOSArcDiskInfo ( IN PSTR  ArcName,
IN ULONG  Signature,
IN ULONG  Checksum,
IN BOOLEAN  ValidPartitionTable 
)

Definition at line 77 of file archwsup.c.

82{
84
85 /* Fill out the ARC disk block */
86
90
94
96}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ULONG reactos_disk_count
Definition: archwsup.c:68
ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[32]
Definition: archwsup.c:69
static const WCHAR Signature[]
Definition: parser.c:141
#define ASSERT(a)
Definition: mode.c:44
CHAR ArcName[MAX_PATH]
Definition: winldr.h:37
ARC_DISK_SIGNATURE DiskSignature
Definition: winldr.h:36
ULONG CheckSum
Definition: arc.h:258
PCHAR ArcName
Definition: arc.h:257
BOOLEAN ValidPartitionTable
Definition: arc.h:259
ULONG Signature
Definition: arc.h:256

Referenced by ArmHwDetect(), GetHarddiskInformation(), PcInitializeBootDevices(), and UefiInitializeBootDevices().

◆ 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 198 of file archwsup.c.

209{
210 PCONFIGURATION_COMPONENT_DATA ComponentData;
212
213 /* Allocate the node for this component */
214 ComponentData = FrLdrHeapAlloc(sizeof(CONFIGURATION_COMPONENT_DATA),
216 if (!ComponentData) return;
217
218 /* Now save our parent */
219 ComponentData->Parent = SystemNode;
220
221 /* Link us to the parent */
222 if (SystemNode)
223 FldrLinkToParent(SystemNode, ComponentData);
224
225 /* Set us up */
226 Component = &ComponentData->ComponentEntry;
228 Component->Type = Type;
229 Component->Flags = Flags;
230 Component->Key = Key;
231 Component->AffinityMask = Affinity;
232
233 /* Set identifier */
234 if (IdentifierString)
235 FldrSetIdentifier(Component, IdentifierString);
236
237 /* Set configuration data */
238 if (ResourceList)
240
241 TRACE("Created key: %s\\%d\n", ArcTypes[min(Type, MaximumType)], Key);
242
243 /* Return the child */
244 *ComponentKey = ComponentData;
245}
Type
Definition: Type.h:7
static VOID FldrSetIdentifier(_In_ PCONFIGURATION_COMPONENT Component, _In_ PCSTR IdentifierString)
Definition: archwsup.c:103
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:168
#define TAG_HW_COMPONENT_DATA
Definition: archwsup.c:73
VOID FldrSetConfigurationData(_Inout_ PCONFIGURATION_COMPONENT_DATA ComponentData, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size)
Definition: archwsup.c:124
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:174
#define min(a, b)
Definition: monoChain.cc:55
@ MaximumType
Definition: arc.h:145
#define TRACE(s)
Definition: solgame.cpp:4
CONFIGURATION_COMPONENT ComponentEntry
Definition: arc.h:168
struct _CONFIGURATION_COMPONENT_DATA * Parent
Definition: arc.h:165
CONFIGURATION_CLASS Class
Definition: arc.h:151
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_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:496

Referenced by DetectAcpiBios(), DetectApmBios(), DetectBiosDisks(), DetectBiosFloppyController(), DetectBiosFloppyPeripheral(), DetectCBusBios(), DetectDisplayController(), DetectDockingStation(), 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 135 of file archwsup.c.

138{
140
141 /* Allocate the root */
144 if (!FldrArcHwTreeRoot) return;
145
146 /* Set it up */
149 Component->Type = MaximumType;
150 Component->ConfigurationDataLength = 0;
151 Component->Identifier = 0;
152 Component->IdentifierLength = 0;
153 Component->Flags = 0;
154 Component->Version = 0;
155 Component->Revision = 0;
156 Component->Key = 0;
157 Component->AffinityMask = 0xFFFFFFFF;
158
159 /* Set identifier */
160 if (IdentifierString)
161 FldrSetIdentifier(Component, IdentifierString);
162
163 /* Return the node */
164 *SystemNode = FldrArcHwTreeRoot;
165}
PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot
Definition: archwsup.c:65
@ SystemClass
Definition: arc.h:90

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 168 of file archwsup.c.

171{
173
174 /* Get the first sibling */
175 Sibling = Parent->Child;
176
177 /* If no sibling exists, then we are the first child */
178 if (!Sibling)
179 {
180 /* Link us in */
181 Parent->Child = Child;
182 }
183 else
184 {
185 /* Loop each sibling */
186 do
187 {
188 /* This is now the parent */
189 Parent = Sibling;
190 } while ((Sibling = Sibling->Sibling));
191
192 /* Found the lowest sibling; mark us as its sibling too */
193 Parent->Sibling = Child;
194 }
195}
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:167
_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 124 of file archwsup.c.

128{
129 /* Set component information */
130 ComponentData->ConfigurationData = ResourceList;
131 ComponentData->ComponentEntry.ConfigurationDataLength = Size;
132}

Referenced by DetectBiosDisks(), and FldrCreateComponentKey().

◆ FldrSetIdentifier()

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

Definition at line 103 of file archwsup.c.

106{
107 SIZE_T IdentifierLength;
109
110 /* Allocate memory for the identifier */
111 IdentifierLength = strlen(IdentifierString) + 1;
112 Identifier = FrLdrHeapAlloc(IdentifierLength, TAG_HW_NAME);
113 if (!Identifier) return;
114
115 /* Copy the identifier */
116 RtlCopyMemory(Identifier, IdentifierString, IdentifierLength);
117
118 /* Set component information */
119 Component->IdentifierLength = (ULONG)IdentifierLength;
120 Component->Identifier = Identifier;
121}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TAG_HW_NAME
Definition: archwsup.c:74
@ Identifier
Definition: asmpp.cpp:95
ULONG_PTR SIZE_T
Definition: typedefs.h:80
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
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 65 of file archwsup.c.

Referenced by FldrCreateSystemKey().

◆ reactos_arc_disk_info

ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[32]

Definition at line 69 of file archwsup.c.

Referenced by AddReactOSArcDiskInfo(), and WinLdrInitializePhase1().

◆ reactos_disk_count

ULONG reactos_disk_count = 0

Definition at line 68 of file archwsup.c.

Referenced by AddReactOSArcDiskInfo(), ArmHwDetect(), and WinLdrInitializePhase1().