aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/uefi
AgeCommit message (Collapse)Author
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-08-28std.os.uefi: fix type error at MemoryType.format()tokyo4j
2025-08-21std.os.uefi: Fix typo that causes compile time error #22809"Lwazi Dube
2025-08-03zig fmt: apply new cast builtin orderJustus Klausecker
2025-07-18std.os.uefi.protocol.file: fix getInfo() buffer alignment (#24496)AsmArtisan256
* std.os.uefi.protocol.file: use @alignCast in getInfo() method to fix #24480 * std.os.uefi.protocol.file: pass alignment responsabilities to caller by redefining the buffer type instead of blindly calling @alignCast
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-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-07-07std.io: deprecated Reader/Writer; introduce new APIAndrew Kelley
2025-04-04fix reviewCarmen
2025-04-04OpenMode is exhaustiveCarmen
2025-04-04dont return tuple, split into 2 functionsCarmen
2025-04-04Payload -> @FieldType and use mem.sliceToCarmen
2025-04-04std.os.uefi.protocol.File: fix some typed definitionsCarmen
2025-04-01std.os.uefi.protocol: ziggify function signatures (#23214)Carmen
2025-03-09lib/std/os/uefi/status.zig: add error to enum conversion fnCarmen
2025-02-09std.os.uefi: Drop 'Efi' prefix from type namesLinus Groh
The UEFI spec only does this because C doesn't have namespaces, we don't have that problem. Most type names were already omitting the prefix.
2025-02-09std.os.uefi: Adjust casing of remaining enum fieldsLinus Groh
Work towards #2101.
2025-02-09std.os.uefi: Adjust casing to match style guide in a few placesLinus Groh
2025-02-08std.os.uefi: Add missing SystemTable revision constantsLinus Groh
2025-02-08std.os.uefi: fix allocators compilingTristan Ross
2025-02-07fix: getEndPos return end positionKouosi Takayama
2025-01-16all: update to `std.builtin.Type.Pointer.Size` field renamesmlugg
This was done by regex substitution with `sed`. I then manually went over the entire diff and fixed any incorrect changes. This diff also changes a lot of `callconv(.C)` to `callconv(.c)`, since my regex happened to also trigger here. I opted to leave these changes in, since they *are* a correct migration, even if they're not the one I was trying to do!
2024-09-24uefi: erroneous alignment check in pool_allocatorNameless
Fixes #21446 Both UefiPoolAllocator and UefiRawPoolAllocator were passing the value of `log2_ptr_align` directly to `mem.alignAllocLen` which expects a alignment value. Both of these calls to `mem.alignAllocLen` are pointless and the result of the alignment both always true, and was thrown away anyway. I have removed these calls entirely.
2024-08-29std: avoid field/decl name conflictsmlugg
Most of these changes seem like improvements. The PDB thing had a TODO saying it used to crash; I anticipate it works now, we'll see what CI does. The `std.os.uefi` field renames are a notable breaking change.
2024-08-28std: update `std.builtin.Type` fields to follow naming conventionsmlugg
The compiler actually doesn't need any functional changes for this: Sema does reification based on the tag indices of `std.builtin.Type` already! So, no zig1.wasm update is necessary. This change is necessary to disallow name clashes between fields and decls on a type, which is a prerequisite of #9938.
2024-07-28chore: correct non-standard comments.matt ettler
Comments throughout the codebase start with a space. This commit corrects comments that do not adhere to this norm.
2024-07-28feat(std.os.uefi.protocol): add Serial IOMatthew Ettler
2024-02-05Make EfiPhysicalAddress in std/os/uefi/tables.zig publicSamuel Fiedler
2024-02-01std: eliminate some uses of `usingnamespace`mlugg
This eliminates some simple usages of `usingnamespace` in the standard library. This construct may in future be removed from the language, and is generally an inappropriate way to formulate code. It is also problematic for incremental compilation, which may not initially support projects using it. I wasn't entirely sure what the appropriate namespacing for the types in `std.os.uefi.tables` would be, so I ofted to preserve the current namespacing, meaning this is not a breaking change. It's possible some of the moved types should instead be namespaced under `BootServices` etc, but this can be a future enhancement.
2023-11-19lib: correct unnecessary uses of 'var'mlugg
2023-11-09replace deprecated std.math.absCastBogdan Romanyuk
2023-08-25fix compile errors introduced by #16953 (#16955)xdBronch
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-20more UEFI alignment fixesxdBronch
2023-07-14fix alignment error in uefi FileInfo protocolxdBronch
previously complained about `[*]const u8` having alignment 1 and `[*:0]const u16` having alignment 2
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
2023-06-19all: zig fmt and rename "@XToY" to "@YFromX"Eric Joldasov
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
2023-06-17mem: rename align*Generic to mem.align*Motiejus Jakštys
Anecdote 1: The generic version is way more popular than the non-generic one in Zig codebase: git grep -w alignForward | wc -l 56 git grep -w alignForwardGeneric | wc -l 149 git grep -w alignBackward | wc -l 6 git grep -w alignBackwardGeneric | wc -l 15 Anecdote 2: In my project (turbonss) that does much arithmetic and alignment I exclusively use the Generic functions. Anecdote 3: we used only the Generic versions in the Macho Man's linker workshop.
2023-04-28std: update to use `@memcpy` directlyAndrew Kelley
2023-02-18update std lib and compiler sources to new for loop syntaxAndrew Kelley
2023-01-31std.os.uefi: fix shift in pool allocator (again) (#14497)leap123
2023-01-29std.os.uefi: fix shift in pool allocatorYusuf Bham
2023-01-23[UEFI] Delete unnecessary padding and fix number_of_pages typeDavid Gonzalez Martin
2023-01-12UEFI pool allocator changesantlilja
* Changed the interface to align with the new allocator interface. * Fixed bug where not enough memory was allocated for the header or to align the pointer.
2022-12-17std.builtin: rename Type.UnionField and Type.StructField's field_type to typer00ster91
2022-12-06remove most conditional compilation based on stage1Andrew Kelley
There are still a few occurrences of "stage1" in the standard library and self-hosted compiler source, however, these instances need a bit more careful inspection to ensure no breakage.
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-10-21UEFI: Querying memory map size with no allocationDavid Gonzalez Martin
This makes possible to query the memory map size from EFI firmware without making any allocation beforehand. This makes possible to be precise about the size of the allocation which will own a copy of the memory map from the UEFI application.
2022-10-07fix: wrong amount of arguments passed to functionr00ster91
I don't know why that one argument was discarded. Is there a reason? It failed to compile.