diff --git a/lib/std/os/windows.zig b/lib/std/os/windows.zig index 268e13a379..2a4d0d9a9b 100644 --- a/lib/std/os/windows.zig +++ b/lib/std/os/windows.zig @@ -1776,6 +1776,8 @@ pub fn UnlockFile( } } +/// This is a workaround for the C backend until zig has the ability to put +/// C code in inline assembly. extern fn zig_x86_64_windows_teb() callconv(.C) *anyopaque; pub fn teb() *TEB { diff --git a/lib/std/zig/system/x86.zig b/lib/std/zig/system/x86.zig index 634a04fb43..873659e58c 100644 --- a/lib/std/zig/system/x86.zig +++ b/lib/std/zig/system/x86.zig @@ -528,6 +528,8 @@ const CpuidLeaf = packed struct { edx: u32, }; +/// This is a workaround for the C backend until zig has the ability to put +/// C code in inline assembly. extern fn zig_x86_cpuid(leaf_id: u32, subid: u32, eax: *u32, ebx: *u32, ecx: *u32, edx: *u32) callconv(.C) void; fn cpuid(leaf_id: u32, subid: u32) CpuidLeaf { @@ -553,6 +555,8 @@ fn cpuid(leaf_id: u32, subid: u32) CpuidLeaf { return .{ .eax = eax, .ebx = ebx, .ecx = ecx, .edx = edx }; } +/// This is a workaround for the C backend until zig has the ability to put +/// C code in inline assembly. extern fn zig_x86_get_xcr0() callconv(.C) u32; // Read control register 0 (XCR0). Used to detect features such as AVX.