Neaten PCI Driver.

git-svn-id: https://spexeah.com:8443/svn/Asuro@270 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
kieron 2017-10-27 07:14:46 +00:00
parent 6be02440e2
commit db166e1e03
10 changed files with 11 additions and 6 deletions

BIN
Asuro.iso

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -99,16 +99,17 @@ end;
procedure scanBus(bus : uint8); procedure scanBus(bus : uint8);
var var
i : uint16; slot : uint16;
ii : uint16; func : uint16;
result : boolean; result : boolean;
begin begin
for i := 0 to 31 do begin for slot := 0 to 31 do begin
result := loadDeviceConfig(bus, i, 0); result := loadDeviceConfig(bus, slot, 0);
if result = true then begin if result = true then begin
if devices[device_count - 1].header_type and $40 = 40 then begin if devices[device_count - 1].header_type and $40 = 40 then begin
for ii := 1 to 8 do begin for func := 1 to 8 do begin
loadDeviceConfig(bus, i, ii); loadDeviceConfig(bus, slot, func);
psleep(1000); psleep(1000);
end; end;
end; end;
@ -119,6 +120,7 @@ end;
procedure requestConfig(bus : uint8; slot : uint8; func : uint8; row : uint8); procedure requestConfig(bus : uint8; slot : uint8; func : uint8; row : uint8);
var var
packet : uint32; packet : uint32;
begin begin
packet := ($1 shl 31); packet := ($1 shl 31);
packet := packet or (bus shl 16); packet := packet or (bus shl 16);
@ -133,6 +135,7 @@ procedure loadBusConfig(bus : uint8; slot : uint8; func : uint8; device : TPCI_D
var var
busT : TPCI_Device_Bridge; busT : TPCI_Device_Bridge;
data : uint32; data : uint32;
begin begin
busT.device_id := device.device_id; busT.device_id := device.device_id;
@ -210,6 +213,7 @@ function loadDeviceConfig(bus : uint8; slot : uint8; func : uint8) : boolean;
var var
device : TPCI_Device; device : TPCI_Device;
data : uint32; data : uint32;
begin begin
loadDeviceConfig := false; loadDeviceConfig := false;
@ -311,6 +315,7 @@ function getDeviceInfo(class_code : uint8; subclass_code : uint8; count : intptr
var var
i : uint16; i : uint16;
devices_out : array[0..31] of TPCI_Device; devices_out : array[0..31] of TPCI_Device;
begin begin
count^ := 0; count^ := 0;
for i:=0 to device_count do begin for i:=0 to device_count do begin