about summary refs log tree commit diff
path: root/library/std/src/sys/pal/uefi
AgeCommit message (Collapse)AuthorLines
2025-01-28uefi: process: Fix argsAyush Singh-4/+3
- While working on process env support, I found that args were currently broken. Not sure how I missed it in the PR, but well here is the fix. - Additionally, no point in adding space at the end of args. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-13uefi: helpers: Introduce OwnedDevicePathAyush Singh-7/+16
This PR is split off from #135368 to reduce noise. Rename DevicePath to OwnedDevicePath. This is to allow a non-owning version of DevicePath in the future to work with UEFI shell APIs which provide const pointers to device paths for UEFI shell fs mapping. Also implement Debug for OwnedDevicePath for some quality of life improvements. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-10Initial fs module for uefiAyush Singh-1/+344
- Just a copy of unsupported fs right now to reduce the noise from future PRs to allow for easier review. - For the full working version of fs on uefi, see [0] [0]: https://github.com/Ayush1325/rust/tree/uefi-file-full Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-11-26std: update internal uses of `io::const_error!`joboet-27/+25
2024-11-20Rollup merge of #129838 - Ayush1325:uefi-process-args, r=joboetMatthias Krüger-12/+56
uefi: process: Add args support - Wrap all args with quotes. - Escape ^ and " inside quotes using ^. - Doing reverse of arg parsing: https://github.com/rust-lang/rust/blob/d571ae851d93541bef826c3c48c1e9ad99da77d6/library/std/src/sys/pal/uefi/args.rs#L81 r​? joboet
2024-10-18std: uefi: Use common function for UEFI shellAyush Singh-36/+2
- Since in almost all cases, there will only be 1 UEFI shell, share the shell handle between all functions that require it. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-18std: uefi: Add basic Env variablesAyush Singh-15/+132
- Implement environment variable functions - Using EFI Shell protocol. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-14uefi: Implement getcwd and chdirAyush Singh-14/+73
- Using EFI Shell Protocol. These functions do not make much sense unless a shell is present. - Return the exe dir in case shell protocol is missing. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-10-10uefi: process: Add args supportAyush Singh-12/+56
- Wrap all args with quotes. - Escape ^ and " inside quotes using ^. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2024-09-23std: implement the `random` featurejoboet-33/+0
Implements the ACP https://github.com/rust-lang/libs-team/issues/393.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-3/+3
2024-08-31Fixed some typos in the standard library documentation/commentsranger-ross-1/+1
2024-08-27std: move allocators to `sys`joboet-52/+1
2024-08-01std: Remove has_cpuidJubilee Young-8/+0
The one use of it was guaranteed to be always true.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-20/+19
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-26Fix doc nitsJohn Arundel-6/+8
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-07-19uefi: process: Fixes from PRAyush Singh-151/+230
- Update system table crc32 - Fix unsound use of Box - Free exit data - Code improvements - Introduce OwnedTable - Update r-efi to latest version - Use extended_varargs_abi_support for install_multiple_protocol_interfaces and uninstall_multiple_protocol_interfaces - Fix comments - Stub out args implementation Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19uefi: process: Final TouchupsAyush Singh-19/+19
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19uefi: process: Add CommandArgs supportAyush Singh-14/+26
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19uefi: process: Add support for argsAyush Singh-21/+55
Also fix stdio inherit Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19uefi: process Implement inheritAyush Singh-20/+37
Only tested in 2 levels right now. Need args support for 3 levels Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19uefi: process: Add null protocolAyush Singh-38/+100
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19uefi: process: Add stderr supportAyush Singh-2/+34
Implement stderr support in similar fashion. Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19uefi: process: Add support to capture stdoutAyush Singh-8/+258
Use a custom simple_text_output protocol to capture output. Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-19uefi: Add processAyush Singh-2/+399
Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-07-16uefi: Forbid unwrapped unsafe in platform modulesJubilee Young-0/+1
2024-06-15std: refactor the TLS implementationjoboet-2/+0
As discovered by Mara in #110897, our TLS implementation is a total mess. In the past months, I have simplified the actual macros and their expansions, but the majority of the complexity comes from the platform-specific support code needed to create keys and register destructors. In keeping with #117276, I have therefore moved all of the `thread_local_key`/`thread_local_dtor` modules to the `thread_local` module in `sys` and merged them into a new structure, so that future porters of `std` can simply mix-and-match the existing code instead of having to copy the same (bad) implementation everywhere. The new structure should become obvious when looking at `sys/thread_local/mod.rs`. Unfortunately, the documentation changes associated with the refactoring have made this PR rather large. That said, this contains no functional changes except for two small ones: * the key-based destructor fallback now, by virtue of sharing the implementation used by macOS and others, stores its list in a `#[thread_local]` static instead of in the key, eliminating one indirection layer and drastically simplifying its code. * I've switched over ZKVM (tier 3) to use the same implementation as WebAssembly, as the implementation was just a way worse version of that Please let me know if I can make this easier to review! I know these large PRs aren't optimal, but I couldn't think of any good intermediate steps. @rustbot label +A-thread-locals
2024-06-05Raise `DEFAULT_MIN_STACK_SIZE` to at least 64KiBJubilee Young-1/+1
Prevent copy-paste errors from producing new starved-for-resources threaded platforms by raising `DEFAULT_MIN_STACK_SIZE` from 4096 bytes to at least 64KiB. Two platforms "affected" by this have no actual threads: - UEFI - "unsupported" Platforms that this actually affects: - wasm32-wasi with "atomics" enabled - wasm32-wasi-p1-threads Two exceptions: - SGX: a "secure code execution" platform, stays at 4096B - TEEOS: also a "secure code execution" platform, stays at 8192B I believe either of these may have sufficiently "interesting" semantics around threads, or significant external library support. Either would mean making any choices here for them is suspect.
2024-05-29Make `std::env::{set_var, remove_var}` unsafe in edition 2024Tobias Bucher-2/+2
Allow calling these functions without `unsafe` blocks in editions up until 2021, but don't trigger the `unused_unsafe` lint for `unsafe` blocks containing these functions. Fixes #27970. Fixes #90308. CC #124866.
2024-05-02std: move thread parking to `sys::sync`joboet-2/+0
2024-04-05Revert #121666Chris Denton-5/+1
This reverts #121666 due to #123495
2024-03-31std: move `thread::current` TLS variable out of `thread_info`joboet-10/+0
2024-03-23Rollup merge of #120419 - Ayush1325:uefi-sys-os, r=nicholasbishop,workingjubileeJubilee-10/+81
Expand sys/os for UEFI - Implement current_exe() and getcwd()
2024-03-17Expand sys/os for UEFIAyush Singh-10/+81
- Implement current_exe() - Cache device_path_to_text protocol Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-03-12std: move `Once` implementations to `sys`joboet-2/+0
2024-03-02Rollup merge of #121666 - ChrisDenton:thread-name, r=cuviperMatthias Krüger-1/+5
Use the OS thread name by default if `THREAD_INFO` has not been initialized Currently if `THREAD_INFO` hasn't been initialized then the name will be set to `None`. This PR changes it to use the OS thread name by default. This mostly affects foreign threads at the moment but we could expand this to make more use of the OS thread name in the future. Note: I've only implemented `Thread::get_name` for windows, linux and macos (and macos adjacent) targets. The rest just return `None`.
2024-03-01Add `get_name` placeholder to other targetsChris Denton-1/+5
2024-03-01Auto merge of #114016 - krtab:delete_sys_memchr, r=workingjubileebors-4/+0
Delete architecture-specific memchr code in std::sys Currently all architecture-specific memchr code is only used in `std::io`. Most of the actual `memchr` capacity exposed to the user through the slice API is instead implemented in `core::slice::memchr`. Hence this commit deletes `memchr` from `std::sys[_common]` and replace calls to it by calls to `core::slice::memchr` functions. This deletes `(r)memchr` from the list of symbols linked to libc. The interest of putting architecture specific code back in core is linked to the discussion to be had in #113654
2024-02-22Auto merge of #117174 - Ayush1325:uefi-stdio-improve, r=workingjubileebors-37/+94
Improve UEFI stdio Fixed some things suggested in last PR: #116207 cc `@dvdhrm` cc `@nicholasbishop`
2024-02-20Delete architecture-specific memchr code in std::sysArthur Carcano-4/+0
Currently all architecture-specific memchr code is only used in `std::io`. Most of the actual `memchr` capacity exposed to the user through the slice API is instead implemented in core::slice::memchr. Hence this commit deletes memchr from std::sys[_common] and replace calls to it by calls to core::slice::memchr functions. This deletes (r)memchr from the list of symbols linked to libc.
2024-02-16std: move locks to `sys` on platforms without threadsjoboet-2/+0
2024-02-16Auto merge of #120486 - reitermarkus:use-generic-nonzero, r=dtolnaybors-3/+3
Use generic `NonZero` internally. Tracking issue: https://github.com/rust-lang/rust/issues/120257
2024-02-16Auto merge of #120889 - Ayush1325:uefi-instant, r=joshtriplettbors-0/+116
Implement Instant for UEFI - Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64
2024-02-15Replace `NonZero::<_>::new` with `NonZero::new`.Markus Reiter-1/+1
2024-02-15Use generic `NonZero` internally.Markus Reiter-3/+3
2024-02-13Implement Instant for UEFIAyush Singh-0/+116
- Uses Timestamp Protocol if present. Else use rdtsc for x86 and x86-64 Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-02-11Implement sys/thread for UEFIAyush Singh-1/+60
Since UEFI has no concept of threads, most of this module can be ignored. However, implementing parts that make sense. - Implement sleep - Implement available_parallelism Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-02-09Rollup merge of #120776 - joboet:move_pal_path, r=ChrisDentonMatthias Krüger-26/+0
Move path implementations into `sys` Part of #117276. r? `@ChrisDenton`
2024-02-09Implement SystemTime for UEFIAyush Singh-1/+133
- Uses SystemTable->RuntimeServices->GetTime() Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-02-08std: move path into `sys`joboet-26/+0