Commit 72560b8db5
Changed files (2)
lib
std
zig
system
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 {
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.