arch/x86/um/os-Linux/tls.c
Source file repositories/reference/linux-study-clean/arch/x86/um/os-Linux/tls.c
File Facts
- System
- Linux kernel
- Corpus path
arch/x86/um/os-Linux/tls.c- Extension
.c- Size
- 1433 bytes
- Lines
- 70
- Domain
- Architecture Layer
- Bucket
- arch/x86
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
Dependency Surface
errno.hlinux/unistd.hsys/ptrace.hsys/syscall.hunistd.hos.hsysdep/tls.h
Detected Declarations
function check_host_supports_tlsfunction os_set_thread_areafunction os_get_thread_area
Annotated Snippet
if (syscall(__NR_get_thread_area, &info) == 0) {
*tls_min = val[i];
*supports_tls = 1;
return;
} else {
if (errno == EINVAL)
continue;
else if (errno == ENOSYS)
*supports_tls = 0;
return;
}
}
*supports_tls = 0;
}
int os_set_thread_area(user_desc_t *info, int pid)
{
int ret;
ret = ptrace(PTRACE_SET_THREAD_AREA, pid, info->entry_number,
(unsigned long) info);
if (ret < 0)
ret = -errno;
return ret;
}
int os_get_thread_area(user_desc_t *info, int pid)
{
int ret;
ret = ptrace(PTRACE_GET_THREAD_AREA, pid, info->entry_number,
(unsigned long) info);
if (ret < 0)
ret = -errno;
return ret;
}
Annotation
- Immediate include surface: `errno.h`, `linux/unistd.h`, `sys/ptrace.h`, `sys/syscall.h`, `unistd.h`, `os.h`, `sysdep/tls.h`.
- Detected declarations: `function check_host_supports_tls`, `function os_set_thread_area`, `function os_get_thread_area`.
- Atlas domain: Architecture Layer / arch/x86.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.