
Applied Micro Circuits Corporation
6195 Lusk Blvd., San Diego, CA 92121  (619) 450-9333
15-77
PCI CONTROLLER
S5933
/* Call read_configuration_area function with dword data */
ret_status = read_configuration_area(READ_CONFIG_DWORD,
bus_number,
device_and_function,
register_number,
&data);
if (ret_status == SUCCESSFUL) {
/* Extract dword */
*dword_read = data;
}
return (ret_status);
}
/****************************************************************************/
/*
*/
/*
READ_CONFIGURATION_AREA
*/
/*
*/
/* Purpose: Reads a byte/word/dword from the configuration space of a
*/
/*
specific device
*/
/*
*/
/* Inputs:
*/
/*
*/
/*
byte bus_number
*/
/*
PCI bus to read configuration data from
*/
/*
*/
/*
byte device_and_function
*/
/*
Device Number in upper 5 bits, Function Number in lower 3 bits
*/
/*
*/
/*
byte register_number
*/
/*
Register Number of configuration space to read
*/
/*
*/
/* Outputs:
*/
/*
*/
/*
dword *dword_read
*/
/*
Dword read from Configuration Space
*/
/*
*/
/*
Return Value - Indicates presence of device
*/
/*
SUCCESSFUL - Device found
*/
/*
NOT_SUCCESSFUL - BIOS error
*/
/*
BAD_REGISTER_NUMBER - Invalid Register Number
*/
/*
*/
/****************************************************************************/
static int read_configuration_area(byte function,
byte bus_number,
byte device_and_function,
byte register_number,
dword *data)
{
int ret_status; /* Function Return Status */
word ax, flags; /* Temporary variables to hold register values */
dword ecx;
/* Temporary variable to hold ECX register value */
/* Load entry registers for PCI BIOS */
_BH = bus_number;
_BL = device_and_function;