Create a place for work on creating a bootloader capable of booting Windows NT (from...
[reactos.git] / include / arch / i386 / 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 __I386_HARDWARE_H_
22 #define __I386_HARDWARE_H_
23
24 #ifndef __REGISTRY_H
25 #include "../../reactos/registry.h"
26 #endif
27
28 /* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags */
29 #define CM_RESOURCE_PORT_MEMORY 0x0000
30 #define CM_RESOURCE_PORT_IO 0x0001
31
32 #define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000
33 #define CM_RESOURCE_INTERRUPT_LATCHED 0x0001
34
35 typedef struct _CM_COMPONENT_INFORMATION
36 {
37 ULONG Flags;
38 ULONG Version;
39 ULONG Key;
40 ULONG Affinity;
41 } __attribute__((packed)) CM_COMPONENT_INFORMATION, *PCM_COMPONENT_INFORMATION;
42
43
44 /* CM_COMPONENT_INFORMATION.Flags */
45 #define Failed 0x00000001
46 //#define ReadOnly 0x00000002
47 #define Removable 0x00000004
48 #define ConsoleIn 0x00000008
49 #define ConsoleOut 0x00000010
50 #define Input 0x00000020
51 #define Output 0x00000040
52
53 #define CONFIG_CMD(bus, dev_fn, where) \
54 (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3))
55
56 /* PROTOTYPES ***************************************************************/
57
58 /* hardware.c */
59
60 VOID StallExecutionProcessor(ULONG Microseconds);
61
62 VOID HalpCalibrateStallExecution(VOID);
63
64 VOID SetComponentInformation(FRLDRHKEY ComponentKey,
65 ULONG Flags,
66 ULONG Key,
67 ULONG Affinity);
68
69 /* hwacpi.c */
70 VOID DetectAcpiBios(FRLDRHKEY SystemKey, ULONG *BusNumber);
71
72 /* hwapm.c */
73 VOID DetectApmBios(FRLDRHKEY SystemKey, ULONG *BusNumber);
74
75 /* hwcpu.c */
76 VOID DetectCPUs(FRLDRHKEY SystemKey);
77
78 /* hwpci.c */
79 VOID DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber);
80
81 /* i386cpu.S */
82 ULONG CpuidSupported(VOID);
83 VOID GetCpuid(ULONG Level,
84 ULONG *eax,
85 ULONG *ebx,
86 ULONG *ecx,
87 ULONG *edx);
88 ULONGLONG RDTSC(VOID);
89
90 /* i386pnp.S */
91 ULONG PnpBiosSupported(VOID);
92 ULONG PnpBiosGetDeviceNodeCount(ULONG *NodeSize,
93 ULONG *NodeCount);
94 ULONG PnpBiosGetDeviceNode(UCHAR *NodeId,
95 UCHAR *NodeBuffer);
96
97 #endif /* __I386_HARDWARE_H_ */
98
99 /* EOF */