aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/uefi.zig
AgeCommit message (Collapse)Author
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-07-12std.os.uefi.tables: ziggify boot and runtime services (#23441)Carmen
* std.os.uefi.tables: ziggify boot and runtime services * avoid T{} syntax Co-authored-by: linusg <mail@linusgroh.de> * misc fixes * work * self-review quickfixes * dont make MemoryMapSlice generic * more review fixes, work * more work * more work * review fixes * update boot/runtime services references throughout codebase * self-review fixes * couple of fixes i forgot to commit earlier * fixes from integrating in my own project * fixes from refAllDeclsRecursive * Apply suggestions from code review Co-authored-by: truemedian <truemedian@gmail.com> * more fixes from review * fixes from project integration * make natural alignment of Guid align-8 * EventRegistration is a new opaque type * fix getNextHighMonotonicCount * fix locateProtocol * fix exit * partly revert 7372d65 * oops exit data_len is num of bytes * fixes from project integration * MapInfo consistency, MemoryType update per review * turn EventRegistration back into a pointer * forgot to finish updating MemoryType methods * fix IntFittingRange calls * set uefi.Page nat alignment * Back out "set uefi.Page nat alignment" This backs out commit cdd9bd6f7f5fb763f994b8fbe3e1a1c2996a2393. * get rid of some error.NotFound-s * fix .exit call in panic * review comments, add format method * fix resetSystem data alignment * oops, didnt do a final refAllDeclsRecursive i guess * review comments * writergate update MemoryType.format * fix rename --------- Co-authored-by: linusg <mail@linusgroh.de> Co-authored-by: truemedian <truemedian@gmail.com>
2025-07-09std: fmt.format to io.Writer.printAndrew Kelley
allows reverting format -> deprecatedFormat, plus I think this is a nicer place for the function.
2025-07-07std.fmt: fully remove format string from format methodsAndrew Kelley
Introduces `std.fmt.alt` which is a helper for calling alternate format methods besides one named "format".
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-04-01std.start: allow return uefi error union in main (#23425)Carmen
2025-04-01std.os.uefi.protocol: ziggify function signatures (#23214)Carmen
2025-03-08std.time.epoch: change getDaysInMonth to accept the year as an argumentJeremy Hertel
2025-03-02std.os.uefi: Fix two padding mistakes in the Time structLinus Groh
```c //************************************************ //EFI_TIME //************************************************ // This represents the current time information typedef struct { UINT16 Year; // 1900 - 9999 UINT8 Month; // 1 - 12 UINT8 Day; // 1 - 31 UINT8 Hour; // 0 - 23 UINT8 Minute; // 0 - 59 UINT8 Second; // 0 - 59 UINT8 Pad1; UINT32 Nanosecond; // 0 - 999,999,999 INT16 TimeZone; // —1440 to 1440 or 2047 UINT8 Daylight; UINT8 Pad2; } EFI_TIME; ```
2025-03-02std.os.uefi: Fix integer overflow in Time.toEpoch()Linus Groh
Instead of thinking hard about what the actual supported maximum value for each sub-calculation is we can simply use an u64 from hours onwards.
2025-02-09std.os.uefi: Adjust casing of remaining enum fieldsLinus Groh
Work towards #2101.
2024-10-25std.os.uefi: Fix calling convention build errorLinus Groh
``` std/os/uefi/protocol/simple_text_input.zig:10:63: error: no field named 'Win64' in enum '@typeInfo(builtin.CallingConvention).@"union".tag_type.?' std/builtin.zig:169:31: note: enum declared here std/os/uefi/protocol/simple_text_output.zig:9:64: error: no field named 'Win64' in enum '@typeInfo(builtin.CallingConvention).@"union".tag_type.?' std/builtin.zig:169:31: note: enum declared here std/os/uefi/tables/runtime_services.zig:26:86: error: no field named 'Win64' in enum '@typeInfo(builtin.CallingConvention).@"union".tag_type.?' std/builtin.zig:169:31: note: enum declared here ```
2023-12-20os.uefi: add ns to epochTristan Ross
2023-12-19os.uefi: add time to epoch conversionTristan Ross
2023-11-19lib: correct unnecessary uses of 'var'mlugg
2023-08-24std.os.uefi: reorganize namespacesAndrew Kelley
This is a breaking change. This commit applies the following rules to std.os.uefi: * avoid redundant names in the namespace such as "protocol.FooProtocol" * don't initialize struct field to undefined. do that at the initialization site if you want that, or create a named constant that sets all the fields to undefined. * avoid the word "data", "info", "context", "state", "details", or "config" in the type name, especially if a word from that category is already in the type name. * embrace tree structure After following these rules, `usingnamespace` disappeared naturally. This commit eliminates 26/53 (49%) instances of `usingnamespace` in the standard library. All these uses were due to not understanding how to properly use namespaces. I did not test this commit. The standard library UEFI code is experimental and pull requests have been accepted with minimal vetting. Users of std.os.uefi will need to submit follow-up pull requests to fix up whatever regressions this commit introduces, this time without abusing namespaces (pun intended).
2023-07-08std.os.uefi: use std.os.uefi.cc instead of .C as calling conventionr00ster91
I tested this and this definitely compiles and these changes were done programmatically but if there's still anything wrong it shouldn't be hard to fix. With this change it's going to be very easy to make further adjustments to the calling conventions of all these external UEFI functions. Closes #16309
2023-06-24all: migrate code to new cast builtin syntaxmlugg
Most of this migration was performed automatically with `zig fmt`. There were a few exceptions which I had to manually fix: * `@alignCast` and `@addrSpaceCast` cannot be automatically rewritten * `@truncate`'s fixup is incorrect for vectors * Test cases are not formatted, and their error locations change
2022-11-12Make invalidFmtError public and use in place of compileErrors for bad format ↵Nick Cernis
strings (#13526) * Export invalidFmtErr To allow consistent use of "invalid format string" compile error response for badly formatted format strings. See https://github.com/ziglang/zig/pull/13489#issuecomment-1311759340. * Replace format compile errors with invalidFmtErr - Provides more consistent compile errors. - Gives user info about the type of the badly formated value. * Rename invalidFmtErr as invalidFmtError For consistency. Zig seems to use “Error” more often than “Err”. * std: add invalid format string checks to remaining custom formatters * pass reference-trace to comp when building build file; fix checkobjectstep
2022-10-30change uefi packed structs to new integer backed syntax (#13173)Nameless
* std.os.uefi: integer backed structs, add tests to catch regressions device_path_protocol now uses extern structs with align(1) fields because the transition to integer backed packed struct broke alignment added comptime asserts that device_path_protocol structs do not violate alignment and size specifications
2022-08-22stage2+stage1: remove type parameter from bit builtinsVeikka Tuominen
Closes #12529 Closes #12511 Closes #6835
2022-04-17std.os.uefi: fix GUID formatting (#11452)Yusuf Bham
2022-01-16std/os/uefi: Simplify packed struct padding and default zero-initializefifty-six
Beyond adding default zero-initialization, this commit changes undefined initialization to zero, as some cases reserved the padding and on other cases, I've found some systems act strange when giving uninit instead of zero even when it shouldn't be an issue, one example being FileProtocol.Open's attributes, which *should* be ignored when not creating a file, but ended up giving an unrelated error.
2022-01-14std/os/uefi: Complete DevicePathProtocol typesfifty-six
2022-01-11std.fs.path: revert recent public API changeAndrew Kelley
41fd343508880ffdfbc83c7b053237da09199f02 made a breaking change to the public API; this commit reverts the API changes but keeps the improved logic.
2022-01-11std/os/uefi: Add pool_allocator and raw_pool_allocatorfifty-six
2021-08-24remove redundant license headers from zig standard libraryAndrew Kelley
We already have a LICENSE file that covers the Zig Standard Library. We no longer need to remind everyone that the license is MIT in every single file. Previously this was introduced to clarify the situation for a fork of Zig that made Zig's LICENSE file harder to find, and replaced it with their own license that required annual payments to their company. However that fork now appears to be dead. So there is no need to reinforce the copyright notice in every single file.
2021-06-21fix code broken from previous commitJacob G-W
2021-02-21std.os.uefi.Guid fixes (#8032)Asherah Connor
* uefi: Guid.format compiles again Also use "writer" nomenclature in argument name. * uefi: add Guid.eql
2020-12-31Year++Frank Denis
2020-10-06Update zig files for opaque type syntaxTadeo Kondrak
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-07-11run zig fmt on std lib and self hostedVexu
2020-04-28@OpaqueType -> @Type(.Opaque)Tadeo Kondrak
2020-03-13Merge branch 'format-stream' of https://github.com/fengb/zig into ↵Andrew Kelley
fengb-format-stream
2020-03-12std/os/uefi: status reformNick Erdmann
2020-03-12std/os/uefi: Add shell parameters protocolNick Erdmann
2020-03-12std/os/uefi: require guid output function be comptimeNick Erdmann
2020-03-12Replace fmt with new fmtstreamBenjamin Feng
2020-03-12Integrated outstreams with new formatterBenjamin Feng
2020-02-01Run `zig fmt`LemonBoy
2020-01-09Fix remaining variadic formatted printsRyan Liptak
Used a series of regex searches to try to find as many instances of the old pattern as I could and update them.
2019-12-10Replace @typeOf with @TypeOf in all zig sourceRobin Voetter
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-10-24get rid of std.os.foo.is_the_targetAndrew Kelley
It had the downside of running all the comptime blocks and resolving all the usingnamespaces of each system, when just trying to discover if the current system is a particular one. For Darwin, where it's nice to use `std.Target.current.isDarwin()`, this demonstrates the utility that #425 would provide.
2019-10-16std/os/uefi: add documentationNick Erdmann
2019-10-16std/os/uefi: add Guid format()Nick Erdmann
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221