diff --git a/reactos/hal/halx86/Makefile b/reactos/hal/halx86/Makefile index 37286d2e28f..2da7f86fe94 100644 --- a/reactos/hal/halx86/Makefile +++ b/reactos/hal/halx86/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.5 2002/09/08 10:22:24 chorns Exp $ +# $Id: Makefile,v 1.6 2002/10/02 19:32:57 ekohl Exp $ PATH_TO_TOP = ../.. @@ -51,6 +51,7 @@ HAL_OBJECTS = \ isa.o \ kdbg.o \ mbr.o \ + mca.o \ misc.o \ mp.o \ pci.o \ diff --git a/reactos/hal/halx86/bus.c b/reactos/hal/halx86/bus.c index 4bcd6616b51..1ae83eea151 100644 --- a/reactos/hal/halx86/bus.c +++ b/reactos/hal/halx86/bus.c @@ -1,4 +1,4 @@ -/* $Id: bus.c,v 1.3 2002/09/08 10:22:24 chorns Exp $ +/* $Id: bus.c,v 1.4 2002/10/02 19:32:57 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -172,6 +172,16 @@ HalpInitBusHandlers(VOID) BusHandler->TranslateBusAddress = (pTranslateBusAddress)HalpTranslateIsaBusAddress; + + + /* add MicroChannel bus handler */ + BusHandler = HalpAllocateBusHandler(MicroChannel, + Pos, + 0); + if (BusHandler == NULL) + return; + + BusHandler->GetBusData = (pGetSetBusData)HalpGetMicroChannelData; } diff --git a/reactos/hal/halx86/include/bus.h b/reactos/hal/halx86/include/bus.h index a2163d5e1f4..d77a470956a 100644 --- a/reactos/hal/halx86/include/bus.h +++ b/reactos/hal/halx86/include/bus.h @@ -110,6 +110,15 @@ HalpSetCmosData(PBUS_HANDLER BusHandler, ULONG Offset, ULONG Length); +/* mca.h */ +ULONG STDCALL +HalpGetMicroChannelData(PBUS_HANDLER BusHandler, + ULONG BusNumber, + ULONG SlotNumber, + PVOID Buffer, + ULONG Offset, + ULONG Length); + #endif /* __INTERNAL_HAL_BUS_H */ /* EOF */ diff --git a/reactos/hal/halx86/mca.c b/reactos/hal/halx86/mca.c new file mode 100644 index 00000000000..97ff15addf6 --- /dev/null +++ b/reactos/hal/halx86/mca.c @@ -0,0 +1,70 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: mca.c,v 1.1 2002/10/02 19:32:57 ekohl Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: hal/halx86/mca.c + * PURPOSE: Interfaces to the MicroChannel bus + * PROGRAMMER: Eric Kohl (ekohl@rz-online.de) + */ + +/* INCLUDES *****************************************************************/ + +#include +#include + +#define NDEBUG +#include + + +/* FUNCTIONS ****************************************************************/ + +ULONG STDCALL +HalpGetMicroChannelData(PBUS_HANDLER BusHandler, + ULONG BusNumber, + ULONG SlotNumber, + PVOID Buffer, + ULONG Offset, + ULONG Length) +{ + PCM_MCA_POS_DATA PosData = (PCM_MCA_POS_DATA)Buffer; + + DPRINT("HalpGetMicroChannelData() called.\n"); + DPRINT(" BusNumber %lu\n", BusNumber); + DPRINT(" SlotNumber %lu\n", SlotNumber); + DPRINT(" Offset 0x%lx\n", Offset); + DPRINT(" Length 0x%lx\n", Length); + + if ((BusNumber != 0) || (SlotNumber > 7) || (Length < sizeof(CM_MCA_POS_DATA))) + return(0); + + WRITE_PORT_UCHAR((PUCHAR)0x96, ((UCHAR)SlotNumber & 0x07) | 0x08); + + PosData->AdapterId = (READ_PORT_UCHAR((PUCHAR)0x101) << 8) + + READ_PORT_UCHAR((PUCHAR)0x100); + PosData->PosData1 = READ_PORT_UCHAR((PUCHAR)0x102); + PosData->PosData2 = READ_PORT_UCHAR((PUCHAR)0x103); + PosData->PosData3 = READ_PORT_UCHAR((PUCHAR)0x104); + PosData->PosData4 = READ_PORT_UCHAR((PUCHAR)0x105); + + return(sizeof(CM_MCA_POS_DATA)); +} + +/* EOF */ diff --git a/reactos/include/ddk/haltypes.h b/reactos/include/ddk/haltypes.h index 3113899c482..bf668bb5d56 100644 --- a/reactos/include/ddk/haltypes.h +++ b/reactos/include/ddk/haltypes.h @@ -1,4 +1,4 @@ -/* $Id: haltypes.h,v 1.5 2002/09/08 10:47:44 chorns Exp $ +/* $Id: haltypes.h,v 1.6 2002/10/02 19:30:46 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -228,6 +228,18 @@ typedef struct _PCI_SLOT_NUMBER } PCI_SLOT_NUMBER, *PPCI_SLOT_NUMBER; +/* MicroChannel bus data */ + +typedef struct _CM_MCA_POS_DATA +{ + USHORT AdapterId; + UCHAR PosData1; + UCHAR PosData2; + UCHAR PosData3; + UCHAR PosData4; +} CM_MCA_POS_DATA, *PCM_MCA_POS_DATA; + + /* Hal dispatch table */ typedef enum _HAL_QUERY_INFORMATION_CLASS