[FREELDR] Add PCI BIOS emulation and PCI bus enumeration for Xbox (#1830)
[reactos.git] / boot / freeldr / freeldr / include / arch / pc / 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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21 #pragma once
22
23 #define CONFIG_CMD(bus, dev_fn, where) \
24 (0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3))
25
26 #define TAG_HW_RESOURCE_LIST 'lRwH'
27 #define TAG_HW_DISK_CONTEXT 'cDwH'
28
29 /* PROTOTYPES ***************************************************************/
30
31 /* hardware.c */
32 VOID StallExecutionProcessor(ULONG Microseconds);
33 VOID HalpCalibrateStallExecution(VOID);
34
35 typedef
36 PCM_PARTIAL_RESOURCE_LIST
37 (*GET_HARDDISK_CONFIG_DATA)(UCHAR DriveNumber, ULONG* pSize);
38
39 extern GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData;
40
41 typedef
42 BOOLEAN
43 (*FIND_PCI_BIOS)(PPCI_REGISTRY_INFO BusData);
44
45 extern FIND_PCI_BIOS FindPciBios;
46
47 VOID
48 DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
49 PCONFIGURATION_COMPONENT_DATA BusKey);
50
51 /* hwacpi.c */
52 VOID DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber);
53
54 /* hwapm.c */
55 VOID DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber);
56
57 /* hwpci.c */
58 VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber);
59
60 /* i386pnp.S */
61 ULONG_PTR __cdecl PnpBiosSupported(VOID);
62 ULONG __cdecl PnpBiosGetDeviceNodeCount(ULONG *NodeSize,
63 ULONG *NodeCount);
64 ULONG __cdecl PnpBiosGetDeviceNode(UCHAR *NodeId,
65 UCHAR *NodeBuffer);
66
67 /* i386pxe.S */
68 USHORT __cdecl PxeCallApi(USHORT Segment, USHORT Offset, USHORT Service, VOID* Parameter);
69
70 /* EOF */