Added minimal MicroChannel bus handler.

svn path=/trunk/; revision=3600
This commit is contained in:
Eric Kohl 2002-10-02 19:32:57 +00:00
parent bf6ff83636
commit 3d254b8d29
5 changed files with 105 additions and 3 deletions

View file

@ -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 \

View file

@ -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;
}

View file

@ -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 */

70
reactos/hal/halx86/mca.c Normal file
View file

@ -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 <ddk/ntddk.h>
#include <bus.h>
#define NDEBUG
#include <internal/debug.h>
/* 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 */

View file

@ -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