Files
ReLibreHardwareMonitor/LibreHardwareMonitorLib/PawnIo/LpcACPIEC.cs
T
namazsoandPhyxionNL eb5e1a20be Swap WinRing0 to PawnIO (#1857)
* Replace WinRing0 with PawnIO

* Update RAMSPDToolkit

* Add install check + cleanup

* Move folder + formatting

* Add back missing TryLoadDll

* Update PawnIo.cs

* Add third party notices file

* Remove the how to apply section

* Drop silent

* Don't crash if PawnIO isn't installed

* Formatting

---------

Co-authored-by: PhyxionNL <7643972+PhyxionNL@users.noreply.github.com>
2025-09-16 11:58:31 +02:00

25 lines
713 B
C#

namespace LibreHardwareMonitor.PawnIo;
public class LpcAcpiEc
{
private readonly PawnIo _pawnIO = PawnIo. LoadModuleFromResource(typeof(AmdFamily0F).Assembly, $"{nameof(LibreHardwareMonitor)}.Resources.PawnIo.LpcACPIEC.bin");
public byte ReadPort(byte port)
{
long[] inArray = new long[1];
inArray[0] = port;
long[] outArray = _pawnIO.Execute("ioctl_pio_read", inArray, 1);
return (byte)outArray[0];
}
public void WritePort(byte port, byte value)
{
long[] inArray = new long[2];
inArray[0] = port;
inArray[1] = value;
_pawnIO.Execute("ioctl_pio_write", inArray, 0);
}
public void Close() => _pawnIO.Close();
}