[HAL]
[reactos.git] / reactos / hal / halx86 / legacy / bus / isabus.c
1 /*
2 * PROJECT: ReactOS HAL
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: hal/halx86/generic/bus/isabus.c
5 * PURPOSE:
6 * PROGRAMMERS: Stefan Ginsberg (stefan.ginsberg@reactos.org)
7 */
8
9 /* INCLUDES *******************************************************************/
10
11 #include <hal.h>
12 #define NDEBUG
13 #include <debug.h>
14
15 /* GLOBALS ********************************************************************/
16
17 /* PRIVATE FUNCTIONS **********************************************************/
18
19 BOOLEAN
20 NTAPI
21 HalpTranslateIsaBusAddress(IN PBUS_HANDLER BusHandler,
22 IN PBUS_HANDLER RootHandler,
23 IN PHYSICAL_ADDRESS BusAddress,
24 IN OUT PULONG AddressSpace,
25 OUT PPHYSICAL_ADDRESS TranslatedAddress)
26 {
27 BOOLEAN Status;
28
29 /* Use system translation */
30 Status = HalpTranslateSystemBusAddress(BusHandler,
31 RootHandler,
32 BusAddress,
33 AddressSpace,
34 TranslatedAddress);
35
36 /* If it didn't work and it was memory address space... */
37 if (!(Status) && (*AddressSpace == 0))
38 {
39 /* Try EISA translation instead */
40 Status = HalTranslateBusAddress(Eisa,
41 BusHandler->BusNumber,
42 BusAddress,
43 AddressSpace,
44 TranslatedAddress);
45 }
46
47 /* Return the result */
48 return Status;
49 }
50
51 /* EOF */