authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-02 14:08:50-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-01-02 14:08:50-07:00
log72560b8db525ac81877799035ef093d9badd6bfd
treea574ee1fd11375a0778c7eda2905ffb410bbff92
parent4776128099e3c5096ee7365a59dd73adce04f0e9

add some comments to explain workarounds


2 files changed, 6 insertions(+), 0 deletions(-)

lib/std/os/windows.zig+2
......@@ -1776,6 +1776,8 @@ pub fn UnlockFile(
17761776 }
17771777}
17781778
1779/// This is a workaround for the C backend until zig has the ability to put
1780/// C code in inline assembly.
17791781extern fn zig_x86_64_windows_teb() callconv(.C) *anyopaque;
17801782
17811783pub fn teb() *TEB {
lib/std/zig/system/x86.zig+4
......@@ -528,6 +528,8 @@ const CpuidLeaf = packed struct {
528528 edx: u32,
529529};
530530
531/// This is a workaround for the C backend until zig has the ability to put
532/// C code in inline assembly.
531533extern fn zig_x86_cpuid(leaf_id: u32, subid: u32, eax: *u32, ebx: *u32, ecx: *u32, edx: *u32) callconv(.C) void;
532534
533535fn cpuid(leaf_id: u32, subid: u32) CpuidLeaf {
......@@ -553,6 +555,8 @@ fn cpuid(leaf_id: u32, subid: u32) CpuidLeaf {
553555 return .{ .eax = eax, .ebx = ebx, .ecx = ecx, .edx = edx };
554556}
555557
558/// This is a workaround for the C backend until zig has the ability to put
559/// C code in inline assembly.
556560extern fn zig_x86_get_xcr0() callconv(.C) u32;
557561
558562// Read control register 0 (XCR0). Used to detect features such as AVX.