mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
Merge pull request #20922 from alexrp/vdso
`std.os.linux`: Fix VDSO for mips, add VDSO for riscv
This commit is contained in:
commit
75f78bfb77
@ -1397,7 +1397,7 @@ const VdsoClockGettime = *align(1) const fn (clockid_t, *timespec) callconv(.C)
|
||||
var vdso_clock_gettime: ?VdsoClockGettime = &init_vdso_clock_gettime;
|
||||
|
||||
pub fn clock_gettime(clk_id: clockid_t, tp: *timespec) usize {
|
||||
if (@hasDecl(VDSO, "CGT_SYM")) {
|
||||
if (VDSO != void) {
|
||||
const ptr = @atomicLoad(?VdsoClockGettime, &vdso_clock_gettime, .unordered);
|
||||
if (ptr) |f| {
|
||||
const rc = f(clk_id, tp);
|
||||
|
||||
@ -242,8 +242,8 @@ pub const F = struct {
|
||||
pub const MMAP2_UNIT = 4096;
|
||||
|
||||
pub const VDSO = struct {
|
||||
pub const CGT_SYM = "__kernel_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_2.6.39";
|
||||
pub const CGT_SYM = "__vdso_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_2.6";
|
||||
};
|
||||
|
||||
pub const Flock = extern struct {
|
||||
|
||||
@ -227,8 +227,8 @@ pub const F = struct {
|
||||
pub const MMAP2_UNIT = 4096;
|
||||
|
||||
pub const VDSO = struct {
|
||||
pub const CGT_SYM = "__kernel_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_2.6.39";
|
||||
pub const CGT_SYM = "__vdso_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_2.6";
|
||||
};
|
||||
|
||||
pub const Flock = extern struct {
|
||||
|
||||
@ -188,7 +188,10 @@ pub const Elf_Symndx = u32;
|
||||
|
||||
pub const MMAP2_UNIT = 4096;
|
||||
|
||||
pub const VDSO = struct {};
|
||||
pub const VDSO = struct {
|
||||
pub const CGT_SYM = "__vdso_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_4.15";
|
||||
};
|
||||
|
||||
/// TODO
|
||||
pub const ucontext_t = void;
|
||||
|
||||
@ -215,7 +215,10 @@ pub const Stat = extern struct {
|
||||
|
||||
pub const Elf_Symndx = u32;
|
||||
|
||||
pub const VDSO = struct {};
|
||||
pub const VDSO = struct {
|
||||
pub const CGT_SYM = "__vdso_clock_gettime";
|
||||
pub const CGT_VER = "LINUX_4.15";
|
||||
};
|
||||
|
||||
/// TODO
|
||||
pub const ucontext_t = void;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user