| ... | @@ -46,6 +46,14 @@ pub fn sleep(nanoseconds: u64) void { | ... | @@ -46,6 +46,14 @@ pub fn sleep(nanoseconds: u64) void { |
| 46 | return; | 46 | return; |
| 47 | } | 47 | } |
| 48 | | 48 | |
| | 49 | if (builtin.os.tag == .uefi) { |
| | 50 | const boot_services = os.uefi.system_table.boot_services.?; |
| | 51 | const us_from_ns = nanoseconds / ns_per_us; |
| | 52 | const us = math.cast(usize, us_from_ns) orelse math.maxInt(usize); |
| | 53 | _ = boot_services.stall(us); |
| | 54 | return; |
| | 55 | } |
| | 56 | |
| 49 | const s = nanoseconds / ns_per_s; | 57 | const s = nanoseconds / ns_per_s; |
| 50 | const ns = nanoseconds % ns_per_s; | 58 | const ns = nanoseconds % ns_per_s; |
| 51 | std.os.nanosleep(s, ns); | 59 | std.os.nanosleep(s, ns); |