mirror of
https://github.com/ziglang/zig.git
synced 2026-02-17 06:49:23 +00:00
add some comments to explain workarounds
This commit is contained in:
parent
4776128099
commit
72560b8db5
@ -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 {
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user