Code: Select all
int pcibios_read_config_byte(unsigned char bus,
unsigned char device_fn, unsigned char where, unsigned char *value)
{
unsigned long ret;
unsigned long bx = (bus << 8) | device_fn;
__asm__("lcall (%%esi)\n\t"
"jc 1f\n\t"
"xor %%ah, %%ah\n"
"1:"
: "=c" (*value),
"=a" (ret)
: "1" (PCIBIOS_READ_CONFIG_BYTE),
"b" (bx),
"D" ((long) where),
"S" (&pci_indirect));
return (int) (ret & 0xff00) >> 8;
}
Code: Select all
static struct {
unsigned long address;
unsigned short segment;
} pci_indirect = { 0, KERNEL_CS };
the code come from the driver of PCI, but i do not understand it clearly...
especially how does "lcall (%%esi)" works...