uint ReadConfig(int bus, int dev, int func, int reg_no) { uint address = (uint)reg_no; address &= 0xfc; // zero out lower 2 bits address |= ((uint)func & 0x7U) << 8; address |= ((uint)dev & 0x1fU) << 11; address |= ((uint)bus & 0xffU) << 16; address |= 0x80000000U; CONFIG_ADDRESS.Write(CONFIG_ADDRESS.Addr32, 4, address); return(CONFIG_DATA.Read(CONFIG_DATA.Addr32, 4)); }
public void WriteIOQWord(ulong Addr, ulong v) { tysos.x86_64.IOResource io = a.ios.Contains(Addr, 8); if (io != null) { io.Write(Addr, 8, v); } else { throw new Exception("Invalid IO port: " + Addr.ToString("X")); } }
public void WriteIOWord(ulong Addr, ushort v) { /* If its a write to the vbox dbg port, log it */ if (Addr == 0x3000 && is_vbox) { vbox_write(v); } tysos.x86_64.IOResource io = a.ios.Contains(Addr, 2); if (io != null) { io.Write(Addr, 2, v); } else { throw new Exception("Invalid IO port: " + Addr.ToString("X")); } }
public void WriteIODWord(ulong Addr, uint v) { /* If its a write to the vbox dbg port, log it */ if (Addr == 0x3000 && is_vbox) { vbox_write(v); } tysos.x86_64.IOResource io = a.ios.Contains(Addr, 4); if (io != null) { //System.Diagnostics.Debugger.Log(0, "acpipc", "WriteIODWord: " + v.ToString("X8") + " to: " + Addr.ToString("X8")); io.Write(Addr, 4, v); } else { throw new Exception("Invalid IO port: " + Addr.ToString("X")); } }
void WriteRegister(ushort RegId, ushort val) { index.Write(VBE_DISPI_IOPORT_INDEX, 2, RegId); index.Write(VBE_DISPI_IOPORT_DATA, 2, val); }