1 #include <com32.h> 2 #include <string.h> 3 #include "pci/pci.h" 4 5 uint32_t __pci_read_write_bios(uint32_t call, uint32_t v, pciaddr_t a) 6 { 7 com32sys_t rs; 8 memset(&rs, 0, sizeof rs); 9 rs.eax.w[0] = call; 10 rs.ebx.w[0] = a >> 8; /* bus:device:function */ 11 rs.edi.b[0] = a; /* address:reg */ 12 rs.ecx.l = v; 13 rs.eflags.l = EFLAGS_CF; 14 __intcall(0x1a, &rs, &rs); 15 16 return (rs.eflags.l & EFLAGS_CF) ? ~(uint32_t) 0 : rs.ecx.l; 17 } 18