XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESystem

【Rust】XFE系统,基于Rust和汇编

公开
关注 0 Fork 0 Star 0
UTF-8
using System.Runtime.InteropServices;

namespace XFESystem.NativeRuntime.Application;

// Copies only the kernel's versioned fixed integer ABI. It never calls a host
// driver or chooses an acceleration backend from PCI presence or FSP status.
internal static unsafe class NativeGpuDiagnostics
{
    [DllImport("xfe_pal", EntryPoint = "xfe_gpu_discovery_info", CallingConvention = CallingConvention.Cdecl)]
    private static extern ulong Info(uint field);
    [DllImport("xfe_pal", EntryPoint = "xfe_gpu_discovery_record", CallingConvention = CallingConvention.Cdecl)]
    private static extern int CopyRecord(uint index, byte* record, uint bytes);
    [DllImport("xfe_pal", EntryPoint = "xfe_gpu_boot_probe_info", CallingConvention = CallingConvention.Cdecl)]
    private static extern ulong BootInfo(uint field);

    internal static string ReadReport(out bool hasRtx5090)
        => NativeGpuReportFormatter.Format(Info, CopyRecord, BootInfo, out hasRtx5090);
}