aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os/linux/tls.zig
AgeCommit message (Collapse)Author
2025-10-23std.os.linux.tls: add hppa supportAlex Rønne Petersen
Turns out Linux on PA-RISC does system calls in a pretty fascinating way; see arch/parisc/kernel/syscall.S for details.
2025-10-23std.os.linux.tls: add sh supportAlex Rønne Petersen
2025-10-23std.os.linux.tls: add microblaze supportAlex Rønne Petersen
Implemented according to glibc because I'm pretty sure musl gets it wrong.
2025-10-23std.os.linux.tls: add alpha supportAlex Rønne Petersen
2025-10-23std.Target: add arceb and xtensaeb Cpu.Arch tagsAlex Rønne Petersen
2025-10-18std.os.linux.tls: implement or1k supportAlex Rønne Petersen
2025-10-17std.os.linux.tls: don't unnecessarily use std.posixAlex Rønne Petersen
2025-07-16zig fmtAndrew Kelley
2025-04-07std.os.linux: use heap.pageSize() instead of MMAP2_UNITStefan Weigl-Bosker
2025-03-27check result of mmap() call to handle a large base_addr value correctlySean Stasiak
2025-02-06adjust runtime page size APIsAndrew Kelley
* fix merge conflicts * rename the declarations * reword documentation * extract FixedBufferAllocator to separate file * take advantage of locals * remove the assertion about max alignment in Allocator API, leaving it Allocator implementation defined * fix non-inline function call in start logic The GeneralPurposeAllocator implementation is totally broken because it uses global state but I didn't address that in this commit.
2025-02-06runtime page size detectionArchbirdplus
heap.zig: define new default page sizes heap.zig: add min/max_page_size and their options lib/std/c: add miscellaneous declarations heap.zig: add pageSize() and its options switch to new page sizes, especially in GPA/stdlib mem.zig: remove page_size
2024-10-04std.os.linux: Fix mmap() syscall invocation for s390x.Alex Rønne Petersen
The s390x mmap() syscall existed before Linux supported syscalls with 5+ parameters, so it takes a single pointer to an array of arguments instead.
2024-08-15loongarch: fix asm to set thread pointer (#21086)YANG Xudong
Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2024-08-12std.os.linux.tls: Support sparc32.Alex Rønne Petersen
2024-07-30std.os.linux.tls: Add csky support.Alex Rønne Petersen
2024-07-30std.os.linux.tls: Add arc support.Alex Rønne Petersen
2024-07-30std.os.linux.tls: Add hexagon support.Alex Rønne Petersen
2024-07-30std.os.linux.tls: Add s390x support.Alex Rønne Petersen
2024-07-30std.os.linux.tls: Add loongarch support.Alex Rønne Petersen
2024-07-30std.os.linux.tls: Add m68k support.Alex Rønne Petersen
2024-07-30std.os.linux.tls: Fix layout computation for the modified Variant I.Alex Rønne Petersen
2024-07-30std.os.linux.tls: Refactor and improve documentation.Alex Rønne Petersen
* Elaborate on the sub-variants of Variant I. * Clarify the use of the TCB term. * Rename a bunch of stuff to be more accurate/descriptive. * Follow Zig's style around namespacing more. * Use a structure for the ABI TCB. No functional change intended.
2024-07-29std.os.linux.tls: Handle riscv32 in setThreadPointer().Alex Rønne Petersen
2024-07-23std.os.linux.tls: Fix setThreadPointer() for armeb and thumbeb.Alex Rønne Petersen
2024-07-23std.os.linux.tls: Set some constants correctly for powerpcle.Alex Rønne Petersen
2024-07-23std.os.linux.tls: Set tls_tcb_size correctly for thumbeb.Alex Rønne Petersen
2024-07-23std.os.linux.tls: Set tls_variant correctly for thumbeb.Alex Rønne Petersen
2024-07-22update start code to use `@disableInstrumentation`Andrew Kelley
This prevents it from trying to access thread local storage before it has set up thread local storage, particularly when code coverage instrumentation is enabled.
2024-03-19extract std.posix from std.osAndrew Kelley
closes #5019
2024-02-06std.os.linux.MAP: use a packed structAndrew Kelley
Introduces type safety to this constant. Eliminates one use of `usingnamespace`.
2023-07-31std: finish cleanup up asmJacob Young
This also required implementing the necessary syntax in the x86_64 backend.
2023-07-31std: cleanup asm usageJacob Young
After fixing some issues with inline assembly in the C backend, the std cleanups have the side effect of making these functions compatible with the backend, allowing it to be used on linux without linking libc.
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-04-28update codebase to use `@memset` and `@memcpy`Andrew Kelley
2023-02-04Add support for mips64/mips64elSuirad
2022-11-04all: rename i386 to x86Ali Chraghi
2022-05-13target: Rename sparcv9 -> sparc64Koakuma
Rename all references of sparcv9 to sparc64, to make Zig align more with other projects. Also, added new function to convert glibc arch name to Zig arch name, since it refers to the architecture as sparcv9. This is based on the suggestion by @kubkon in PR 11847. (https://github.com/ziglang/zig/pull/11487#pullrequestreview-963761757)
2021-10-23std: Fix edge case in TLS tp calculationLemonBoy
The TLS area may be located in the upper part of the address space and, if the platform expects a constant offset to be applied, may make the tp register calculation overflow. Use +% instead of +, the overflow is harmless.
2021-10-04migrate from `std.Target.current` to `@import("builtin").target`Andrew Kelley
closes #9388 closes #9321
2021-09-01std.os reorganization, avoiding `usingnamespace`Andrew Kelley
The main purpose of this branch is to explore avoiding the `usingnamespace` feature of the zig language, specifically with regards to `std.os` and related functionality. If this experiment is successful, it will provide a data point on whether or not it would be practical to entirely remove `usingnamespace` from the language. In this commit, `usingnamespace` has been completely eliminated from the Linux x86_64 compilation path, aside from io_uring. The behavior tests pass, however that's as far as this branch goes. It is very breaking, and a lot more work is needed before it could be considered mergeable. I wanted to put a pull requset up early so that zig programmers have time to provide feedback. This is progress towards closing #6600 since it clarifies where the actual "owner" of each declaration is, and reduces the number of different ways to import the same declarations. One of the main organizational strategies used here is to do namespacing with real namespaces (e.g. structs) rather than by having declarations share a common prefix (the C strategy). It's no coincidence that `usingnamespace` has similar semantics to `#include` and becomes much less necessary when using proper namespaces.
2021-08-29zig fmt: respect trailing commas in inline assemblyjdmichaud
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-19std: Fix PIE startup sequenceLemonBoy
* Don't skip the TLS initialization (Fixes #9083) * Add a test case where a PIE program is built and run * Refactor the common initialization code in the Linux startup sequence.
2021-05-20Run `zig fmt` on src/ and lib/std/Isaac Freund
This replaces callconv(.Inline) with the more idiomatic inline keyword.
2021-05-08Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgenAndrew Kelley
Conflicts: * lib/std/os/linux/tls.zig * test/behavior/align.zig * test/behavior/atomics.zig * test/behavior/vector.zig
2021-05-04std: Initial bringup for Linux on Thumb2LemonBoy
There are some small problems here and there, mostly due to the pointers having the lsb set and disrupting the fn alignment tests and the `@FrameSize` implementation.