ReactOS 0.4.15-dev-5893-g1bb4167
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

VOID AddReactOSArcDiskInfo (IN PSTR ArcName, IN ULONG Signature, IN ULONG Checksum, IN BOOLEAN ValidPartitionTable)
 
VOID NTAPI FldrSetIdentifier (IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCHAR IdentifierString)
 
VOID NTAPI FldrSetConfigurationData (IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size)
 
VOID NTAPI FldrCreateSystemKey (OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
 
static VOID NTAPI FldrLinkToParent (IN PCONFIGURATION_COMPONENT_DATA Parent, IN PCONFIGURATION_COMPONENT_DATA Child)
 
VOID NTAPI 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 PCHAR IdentifierString, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
 

Variables

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

◆ TAG_HW_NAME

#define TAG_HW_NAME   'mNwH'

Definition at line 26 of file archwsup.c.

Function Documentation

◆ AddReactOSArcDiskInfo()

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

Definition at line 29 of file archwsup.c.

34{
36
37 /* Fill out the ARC disk block */
38
42
46
48}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ULONG reactos_disk_count
Definition: archwsup.c:20
ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[32]
Definition: archwsup.c:21
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:211
PCHAR ArcName
Definition: arc.h:210
BOOLEAN ValidPartitionTable
Definition: arc.h:212
ULONG Signature
Definition: arc.h:209

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

◆ FldrCreateComponentKey()

VOID NTAPI 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 PCHAR  IdentifierString,
IN PCM_PARTIAL_RESOURCE_LIST  ResourceList,
IN ULONG  Size,
OUT PCONFIGURATION_COMPONENT_DATA ComponentKey 
)

Definition at line 147 of file archwsup.c.

157{
158 PCONFIGURATION_COMPONENT_DATA ComponentData;
160
161 /* Allocate the node for this component */
162 ComponentData = FrLdrHeapAlloc(sizeof(CONFIGURATION_COMPONENT_DATA),
164 if (!ComponentData) return;
165
166 /* Now save our parent */
167 ComponentData->Parent = SystemNode;
168
169 /* Link us to the parent */
170 if (SystemNode)
171 FldrLinkToParent(SystemNode, ComponentData);
172
173 /* Set us up */
174 Component = &ComponentData->ComponentEntry;
176 Component->Type = Type;
177 Component->Flags = Flags;
178 Component->Key = Key;
179 Component->AffinityMask = Affinity;
180
181 /* Set identifier */
182 if (IdentifierString)
183 FldrSetIdentifier(ComponentData, IdentifierString);
184
185 /* Set configuration data */
186 if (ResourceList)
188
189 /* Return the child */
190 *ComponentKey = ComponentData;
191}
Type
Definition: Type.h:7
static VOID NTAPI FldrLinkToParent(IN PCONFIGURATION_COMPONENT_DATA Parent, IN PCONFIGURATION_COMPONENT_DATA Child)
Definition: archwsup.c:117
VOID NTAPI FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size)
Definition: archwsup.c:78
#define TAG_HW_COMPONENT_DATA
Definition: archwsup.c:25
VOID NTAPI FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCHAR IdentifierString)
Definition: archwsup.c:56
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:174
CONFIGURATION_COMPONENT ComponentEntry
Definition: arc.h:121
struct _CONFIGURATION_COMPONENT_DATA * Parent
Definition: arc.h:118
CONFIGURATION_CLASS Class
Definition: arc.h:104
_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 NTAPI FldrCreateSystemKey ( OUT PCONFIGURATION_COMPONENT_DATA SystemNode)

Definition at line 89 of file archwsup.c.

90{
92
93 /* Allocate the root */
96 if (!FldrArcHwTreeRoot) return;
97
98 /* Set it up */
101 Component->Type = MaximumType;
102 Component->ConfigurationDataLength = 0;
103 Component->Identifier = 0;
104 Component->IdentifierLength = 0;
105 Component->Flags = 0;
106 Component->Version = 0;
107 Component->Revision = 0;
108 Component->Key = 0;
109 Component->AffinityMask = 0xFFFFFFFF;
110
111 /* Return the node */
112 *SystemNode = FldrArcHwTreeRoot;
113}
PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot
Definition: archwsup.c:17
@ SystemClass
Definition: arc.h:90

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

◆ FldrLinkToParent()

static VOID NTAPI FldrLinkToParent ( IN PCONFIGURATION_COMPONENT_DATA  Parent,
IN PCONFIGURATION_COMPONENT_DATA  Child 
)
static

Definition at line 117 of file archwsup.c.

119{
121
122 /* Get the first sibling */
123 Sibling = Parent->Child;
124
125 /* If no sibling exists, then we are the first child */
126 if (!Sibling)
127 {
128 /* Link us in */
129 Parent->Child = Child;
130 }
131 else
132 {
133 /* Loop each sibling */
134 do
135 {
136 /* This is now the parent */
137 Parent = Sibling;
138 } while ((Sibling = Sibling->Sibling));
139
140 /* Found the lowest sibling; mark us as its sibling too */
141 Parent->Sibling = Child;
142 }
143}
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:120
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Definition: wdffdo.h:536

Referenced by FldrCreateComponentKey().

◆ FldrSetConfigurationData()

VOID NTAPI FldrSetConfigurationData ( IN PCONFIGURATION_COMPONENT_DATA  ComponentData,
IN PCM_PARTIAL_RESOURCE_LIST  ResourceList,
IN ULONG  Size 
)

Definition at line 78 of file archwsup.c.

81{
82 /* Set component information */
83 ComponentData->ConfigurationData = ResourceList;
84 ComponentData->ComponentEntry.ConfigurationDataLength = Size;
85}

Referenced by DetectBiosDisks(), and FldrCreateComponentKey().

◆ FldrSetIdentifier()

VOID NTAPI FldrSetIdentifier ( IN PCONFIGURATION_COMPONENT_DATA  ComponentData,
IN PCHAR  IdentifierString 
)

Definition at line 56 of file archwsup.c.

58{
59 PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry;
60 SIZE_T IdentifierLength;
62
63 /* Allocate memory for the identifier */
64 IdentifierLength = strlen(IdentifierString) + 1;
65 Identifier = FrLdrHeapAlloc(IdentifierLength, TAG_HW_NAME);
66 if (!Identifier) return;
67
68 /* Copy the identifier */
69 RtlCopyMemory(Identifier, IdentifierString, IdentifierLength);
70
71 /* Set component information */
72 Component->IdentifierLength = (ULONG)IdentifierLength;
73 Component->Identifier = Identifier;
74}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TAG_HW_NAME
Definition: archwsup.c:26
@ 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(), Pc98HwDetect(), PcHwDetect(), and XboxHwDetect().

Variable Documentation

◆ FldrArcHwTreeRoot

PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot

Definition at line 17 of file archwsup.c.

Referenced by FldrCreateSystemKey().

◆ reactos_arc_disk_info

ARC_DISK_SIGNATURE_EX reactos_arc_disk_info[32]

Definition at line 21 of file archwsup.c.

Referenced by AddReactOSArcDiskInfo(), and WinLdrInitializePhase1().

◆ reactos_disk_count

ULONG reactos_disk_count = 0

Definition at line 20 of file archwsup.c.

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