branch update for HEAD-2003050101
[reactos.git] / hal / halx86 / sysbus.c
1 /* $Id$
2  *
3  * COPYRIGHT:       See COPYING in the top level directory
4  * PROJECT:         ReactOS kernel
5  * FILE:            ntoskrnl/hal/sysbus.c
6  * PURPOSE:         System bus handler functions
7  * PROGRAMMER:      Eric Kohl (ekohl@rz-online.de)
8  * UPDATE HISTORY:
9  *                  09/04/2000 Created
10  */
11
12 /* INCLUDES *****************************************************************/
13
14 #include <roscfg.h>
15 #include <ddk/ntddk.h>
16 #include <bus.h>
17 #ifdef MP
18 #include <mps.h>
19 #endif
20
21
22 /* FUNCTIONS ****************************************************************/
23
24 ULONG STDCALL
25 HalpGetSystemInterruptVector(PVOID BusHandler,
26                              ULONG BusNumber,
27                              ULONG BusInterruptLevel,
28                              ULONG BusInterruptVector,
29                              PKIRQL Irql,
30                              PKAFFINITY Affinity)
31 {
32 #ifdef MP
33   *Irql = PROFILE_LEVEL - BusInterruptVector;
34   *Affinity = 0xFFFFFFFF;
35   return IRQ2VECTOR(BusInterruptVector);
36 #else
37   *Irql = PROFILE_LEVEL - BusInterruptVector;
38   *Affinity = 0xFFFFFFFF;
39   return BusInterruptVector;
40 #endif
41 }
42
43
44 BOOLEAN STDCALL
45 HalpTranslateSystemBusAddress(PBUS_HANDLER BusHandler,
46                               ULONG BusNumber,
47                               PHYSICAL_ADDRESS BusAddress,
48                               PULONG AddressSpace,
49                               PPHYSICAL_ADDRESS TranslatedAddress)
50 {
51    ULONG BaseAddress = 0;
52
53    if (*AddressSpace == 0)
54      {
55         /* memory space */
56
57      }
58    else if (*AddressSpace == 1)
59      {
60         /* io space */
61
62      }
63    else
64      {
65         /* other */
66         return FALSE;
67      }
68
69    TranslatedAddress->QuadPart = BusAddress.QuadPart + BaseAddress;
70
71    return TRUE;
72 }
73
74 /* EOF */