diff options
Diffstat (limited to 'contrib/syslinux-4.02/com32/lib/pci/bios.c')
-rw-r--r-- | contrib/syslinux-4.02/com32/lib/pci/bios.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/syslinux-4.02/com32/lib/pci/bios.c b/contrib/syslinux-4.02/com32/lib/pci/bios.c new file mode 100644 index 0000000..b3c2c57 --- /dev/null +++ b/contrib/syslinux-4.02/com32/lib/pci/bios.c @@ -0,0 +1,17 @@ +#include <com32.h> +#include <string.h> +#include "pci/pci.h" + +uint32_t __pci_read_write_bios(uint32_t call, uint32_t v, pciaddr_t a) +{ + com32sys_t rs; + memset(&rs, 0, sizeof rs); + rs.eax.w[0] = call; + rs.ebx.w[0] = a >> 8; /* bus:device:function */ + rs.edi.b[0] = a; /* address:reg */ + rs.ecx.l = v; + rs.eflags.l = EFLAGS_CF; + __intcall(0x1a, &rs, &rs); + + return (rs.eflags.l & EFLAGS_CF) ? ~(uint32_t) 0 : rs.ecx.l; +} |