Fix some function prototypes and avoid real ugly casts

svn path=/trunk/; revision=64212
This commit is contained in:
Timo Kreuzer 2014-09-21 16:00:27 +00:00
parent e0e3a8067f
commit b4aecf7095
4 changed files with 26 additions and 22 deletions

View file

@ -225,7 +225,7 @@ HalGetBusDataByOffset(IN BUS_DATA_TYPE BusDataType,
/* Call PCI function */ /* Call PCI function */
return HalpGetPCIData(&BusHandler, return HalpGetPCIData(&BusHandler,
&BusHandler, &BusHandler,
*(PPCI_SLOT_NUMBER)&SlotNumber, SlotNumber,
Buffer, Buffer,
Offset, Offset,
Length); Length);
@ -304,7 +304,7 @@ HalSetBusDataByOffset(IN BUS_DATA_TYPE BusDataType,
/* Call PCI function */ /* Call PCI function */
return HalpSetPCIData(&BusHandler, return HalpSetPCIData(&BusHandler,
&BusHandler, &BusHandler,
*(PPCI_SLOT_NUMBER)&SlotNumber, SlotNumber,
Buffer, Buffer,
Offset, Offset,
Length); Length);

View file

@ -365,7 +365,7 @@ NTAPI
HalpGetPCIData( HalpGetPCIData(
IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootBusHandler, IN PBUS_HANDLER RootBusHandler,
IN PCI_SLOT_NUMBER SlotNumber, IN ULONG SlotNumber,
IN PVOID Buffer, IN PVOID Buffer,
IN ULONG Offset, IN ULONG Offset,
IN ULONG Length IN ULONG Length
@ -376,7 +376,7 @@ NTAPI
HalpSetPCIData( HalpSetPCIData(
IN PBUS_HANDLER BusHandler, IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootBusHandler, IN PBUS_HANDLER RootBusHandler,
IN PCI_SLOT_NUMBER SlotNumber, IN ULONG SlotNumber,
IN PVOID Buffer, IN PVOID Buffer,
IN ULONG Offset, IN ULONG Offset,
IN ULONG Length IN ULONG Length

View file

@ -343,15 +343,17 @@ ULONG
NTAPI NTAPI
HalpGetPCIData(IN PBUS_HANDLER BusHandler, HalpGetPCIData(IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootHandler, IN PBUS_HANDLER RootHandler,
IN PCI_SLOT_NUMBER Slot, IN ULONG SlotNumber,
IN PVOID Buffer, IN PVOID Buffer,
IN ULONG Offset, IN ULONG Offset,
IN ULONG Length) IN ULONG Length)
{ {
PCI_SLOT_NUMBER Slot;
UCHAR PciBuffer[PCI_COMMON_HDR_LENGTH]; UCHAR PciBuffer[PCI_COMMON_HDR_LENGTH];
PPCI_COMMON_CONFIG PciConfig = (PPCI_COMMON_CONFIG)PciBuffer; PPCI_COMMON_CONFIG PciConfig = (PPCI_COMMON_CONFIG)PciBuffer;
ULONG Len = 0; ULONG Len = 0;
Slot.u.AsULONG = SlotNumber;
#ifdef SARCH_XBOX #ifdef SARCH_XBOX
/* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely /* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely
* hang the Xbox. Also, the device number doesn't seem to be decoded for the * hang the Xbox. Also, the device number doesn't seem to be decoded for the
@ -433,15 +435,17 @@ ULONG
NTAPI NTAPI
HalpSetPCIData(IN PBUS_HANDLER BusHandler, HalpSetPCIData(IN PBUS_HANDLER BusHandler,
IN PBUS_HANDLER RootHandler, IN PBUS_HANDLER RootHandler,
IN PCI_SLOT_NUMBER Slot, IN ULONG SlotNumber,
IN PVOID Buffer, IN PVOID Buffer,
IN ULONG Offset, IN ULONG Offset,
IN ULONG Length) IN ULONG Length)
{ {
PCI_SLOT_NUMBER Slot;
UCHAR PciBuffer[PCI_COMMON_HDR_LENGTH]; UCHAR PciBuffer[PCI_COMMON_HDR_LENGTH];
PPCI_COMMON_CONFIG PciConfig = (PPCI_COMMON_CONFIG)PciBuffer; PPCI_COMMON_CONFIG PciConfig = (PPCI_COMMON_CONFIG)PciBuffer;
ULONG Len = 0; ULONG Len = 0;
Slot.u.AsULONG = SlotNumber;
#ifdef SARCH_XBOX #ifdef SARCH_XBOX
/* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely /* Trying to get PCI config data from devices 0:0:1 and 0:0:2 will completely
* hang the Xbox. Also, the device number doesn't seem to be decoded for the * hang the Xbox. Also, the device number doesn't seem to be decoded for the

View file

@ -208,11 +208,11 @@ HalpAllocateAndInitPciBusHandler(IN ULONG PciType,
sizeof(PCIPBUSDATA)); sizeof(PCIPBUSDATA));
/* Set it up */ /* Set it up */
Bus->GetBusData = (PGETSETBUSDATA)HalpGetPCIData; Bus->GetBusData = HalpGetPCIData;
Bus->SetBusData = (PGETSETBUSDATA)HalpSetPCIData; Bus->SetBusData = HalpSetPCIData;
Bus->GetInterruptVector = (PGETINTERRUPTVECTOR)HalpGetPCIIntOnISABus; Bus->GetInterruptVector = HalpGetPCIIntOnISABus;
Bus->AdjustResourceList = (PADJUSTRESOURCELIST)HalpAdjustPCIResourceList; Bus->AdjustResourceList = HalpAdjustPCIResourceList;
Bus->AssignSlotResources = (PASSIGNSLOTRESOURCES)HalpAssignPCISlotResources; Bus->AssignSlotResources = HalpAssignPCISlotResources;
Bus->BusAddresses->Dma.Limit = 0; Bus->BusAddresses->Dma.Limit = 0;
/* Get our custom bus data */ /* Get our custom bus data */
@ -221,12 +221,12 @@ HalpAllocateAndInitPciBusHandler(IN ULONG PciType,
/* Setup custom bus data */ /* Setup custom bus data */
BusData->CommonData.Tag = PCI_DATA_TAG; BusData->CommonData.Tag = PCI_DATA_TAG;
BusData->CommonData.Version = PCI_DATA_VERSION; BusData->CommonData.Version = PCI_DATA_VERSION;
BusData->CommonData.ReadConfig = (PciReadWriteConfig)HalpReadPCIConfig; BusData->CommonData.ReadConfig = HalpReadPCIConfig;
BusData->CommonData.WriteConfig = (PciReadWriteConfig)HalpWritePCIConfig; BusData->CommonData.WriteConfig = HalpWritePCIConfig;
BusData->CommonData.Pin2Line = (PciPin2Line)HalpPCIPin2ISALine; BusData->CommonData.Pin2Line = HalpPCIPin2ISALine;
BusData->CommonData.Line2Pin = (PciLine2Pin)HalpPCIISALine2Pin; BusData->CommonData.Line2Pin = HalpPCIISALine2Pin;
BusData->MaxDevice = PCI_MAX_DEVICES; BusData->MaxDevice = PCI_MAX_DEVICES;
BusData->GetIrqRange = (PciIrqRange)HalpGetISAFixedPCIIrq; BusData->GetIrqRange = HalpGetISAFixedPCIIrq;
/* Initialize the bitmap */ /* Initialize the bitmap */
RtlInitializeBitMap(&BusData->DeviceConfigured, BusData->ConfiguredBits, 256); RtlInitializeBitMap(&BusData->DeviceConfigured, BusData->ConfiguredBits, 256);