using Cosmos.Core.PCInformation;
using Cosmos.Core_Asm.CPUInformationPlugs;
using IL2CPU.API.Attribs;
namespace Cosmos.Core_Asm
{
[Plug(Target = typeof(ProcessorInformation))]
public unsafe class ProcessorInformationImpl
{
///
/// Use the rdtsc instruction to read the current time stamp counter
/// In edx will be stored the highest part of the rtdsc
/// In eax the lowest part of the rtdsc
///
/// Lowest part of rtdsc
/// Highest part of rtdsc
[PlugMethod(Assembler = typeof(GetCurrentTimeStampCounter))]
public static void GetCurrentTimeStampCounter(uint* edx, uint* eax) { }
///
/// This function queries cpuid to get the registers involved.
/// If a value is not used it will contain garbage.
/// Requires that none of the arguments are null. THIS IS PROGRAMMER RESPONSABILITY
///
/// call example CPUID(0, &eax, &ebx, &ecx, &edx); where eax, ebx, and edx are UINT
/// Number of the operation that cpuid will do.
/// returned eax register (not null)
/// returned ebx register (not null)
/// returned ecx register (not null)
/// returned edx register (not null)
[PlugMethod(Assembler = typeof(CPUID))]
public static void CPUID(uint eaxOperation, uint* eax, uint* ebx, uint* ecx, uint* edx) { }
[PlugMethod(Assembler = typeof(CanReadCPUID))]
public static int CanReadCPUID() { return 0; }
///
/// The returned integer is like 0x8000000X so we need uint to avoid getting negative numbers (since its binary
/// representation)
///
///
[PlugMethod(Assembler = typeof(GetHighestExtendedFunctionSupported))]
public static uint GetHighestExtendedFunctionSupported() { return 0; }
///
/// Read the model specific register using the rdmsr instruction.
///
/// ECX parameter passed to the rdmsr instruction
/// Lower part of rdmsr
/// Higher part of rdmsr
[PlugMethod(Assembler = typeof(RDMSR))]
public static void RDMSR(uint ecxOperation, uint* eax, uint* edx) { }
}
}