d6ecd7e30e828f4edb3f88bcddb9e2cb05d0cf57
[reactos.git] / reactos / boot / freeldr / freeldr / include / arch / amd64 / hardware.h
1 /*
2 * FreeLoader
3 *
4 * Copyright (C) 2003 Eric Kohl
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 #ifndef __AMD64_HARDWARE_H_
22 #define __AMD64_HARDWARE_H_
23
24 #ifndef __REGISTRY_H
25 #include "../../reactos/registry.h"
26 #endif
27
28 #define CONFIG_CMD(bus, dev_fn, where) \
29 (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3))
30
31
32 //
33 // Static heap for ARC Hardware Component Tree
34 // 16KB oughta be enough for anyone.
35 //
36 #define HW_MAX_ARC_HEAP_SIZE 16 * 1024
37
38 //
39 // ARC Component Configuration Routines
40 //
41 VOID
42 NTAPI
43 FldrSetComponentInformation(
44 IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
45 IN IDENTIFIER_FLAG Flags,
46 IN ULONG Key,
47 IN ULONG Affinity
48 );
49
50 VOID
51 NTAPI
52 FldrSetIdentifier(
53 IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
54 IN PCHAR Identifier
55 );
56
57 VOID
58 NTAPI
59 FldrCreateSystemKey(
60 OUT PCONFIGURATION_COMPONENT_DATA *SystemKey
61 );
62
63 VOID
64 NTAPI
65 FldrCreateComponentKey(
66 IN PCONFIGURATION_COMPONENT_DATA SystemKey,
67 IN PWCHAR BusName,
68 IN ULONG BusNumber,
69 IN CONFIGURATION_CLASS Class,
70 IN CONFIGURATION_TYPE Type,
71 OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
72 );
73
74 VOID
75 NTAPI
76 FldrSetConfigurationData(
77 IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
78 IN PCM_PARTIAL_RESOURCE_LIST ResourceList,
79 IN ULONG Size
80 );
81
82
83 /* PROTOTYPES ***************************************************************/
84
85 /* hardware.c */
86
87 VOID StallExecutionProcessor(ULONG Microseconds);
88
89 VOID HalpCalibrateStallExecution(VOID);
90
91 /* hwacpi.c */
92 VOID DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber);
93
94 /* hwapm.c */
95 VOID DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber);
96
97 /* hwpci.c */
98 VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber);
99
100 /* i386cpu.S */
101 ULONG CpuidSupported(VOID);
102 VOID GetCpuid(ULONG Level,
103 ULONG *eax,
104 ULONG *ebx,
105 ULONG *ecx,
106 ULONG *edx);
107 ULONGLONG RDTSC(VOID);
108
109 /* i386pnp.S */
110 ULONG_PTR PnpBiosSupported(VOID);
111 ULONG PnpBiosGetDeviceNodeCount(ULONG *NodeSize,
112 ULONG *NodeCount);
113 ULONG PnpBiosGetDeviceNode(UCHAR *NodeId,
114 UCHAR *NodeBuffer);
115
116 #endif /* __AMD64_HARDWARE_H_ */
117
118 /* EOF */