arch/loongarch/include/asm/thread_info.h
Source file repositories/reference/linux-study-clean/arch/loongarch/include/asm/thread_info.h
File Facts
- System
- Linux kernel
- Corpus path
arch/loongarch/include/asm/thread_info.h- Extension
.h- Size
- 3499 bytes
- Lines
- 107
- Domain
- Architecture Layer
- Bucket
- arch/loongarch
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/processor.hasm-generic/thread_info_tif.h
Detected Declarations
struct thread_info
Annotated Snippet
struct thread_info {
struct task_struct *task; /* main task structure */
unsigned long flags; /* low level flags */
unsigned long tp_value; /* thread pointer */
__u32 cpu; /* current CPU */
int preempt_count; /* 0 => preemptible, <0 => BUG */
struct pt_regs *regs;
unsigned long syscall; /* syscall number */
unsigned long syscall_work; /* SYSCALL_WORK_ flags */
};
/*
* macros/functions for gaining access to the thread information structure
*/
#define INIT_THREAD_INFO(tsk) \
{ \
.task = &tsk, \
.flags = _TIF_FIXADE, \
.cpu = 0, \
.preempt_count = INIT_PREEMPT_COUNT, \
}
/* How to get the thread information struct from C. */
register struct thread_info *__current_thread_info __asm__("$tp");
static inline struct thread_info *current_thread_info(void)
{
return __current_thread_info;
}
register unsigned long current_stack_pointer __asm__("$sp");
#endif /* !__ASSEMBLER__ */
/* thread information allocation */
#define THREAD_SIZE SZ_16K
#define THREAD_MASK (THREAD_SIZE - 1UL)
#define THREAD_SIZE_ORDER ilog2(THREAD_SIZE / PAGE_SIZE)
/*
* thread information flags
* - these are process state flags that various assembly files may need to
* access
* - pending work-to-be-done flags are in LSW
* - other flags in MSW
*
* Tell the generic TIF infrastructure which special bits loongarch supports
*/
#define HAVE_TIF_NEED_RESCHED_LAZY
#define HAVE_TIF_RESTORE_SIGMASK
#include <asm-generic/thread_info_tif.h>
/* Architecture specific bits */
#define TIF_NOHZ 16 /* in adaptive nohz mode */
#define TIF_USEDFPU 17 /* FPU was used by this task this quantum (SMP) */
#define TIF_USEDSIMD 18 /* SIMD has been used this quantum */
#define TIF_FIXADE 19 /* Fix address errors in software */
#define TIF_LOGADE 20 /* Log address errors to syslog */
#define TIF_32BIT_REGS 21 /* 32-bit general purpose registers */
#define TIF_32BIT_ADDR 22 /* 32-bit address space */
#define TIF_LOAD_WATCH 23 /* If set, load watch registers */
#define TIF_SINGLESTEP 24 /* Single Step */
#define TIF_LSX_CTX_LIVE 25 /* LSX context must be preserved */
#define TIF_LASX_CTX_LIVE 26 /* LASX context must be preserved */
#define TIF_USEDLBT 27 /* LBT was used by this task this quantum (SMP) */
#define TIF_LBT_CTX_LIVE 28 /* LBT context must be preserved */
#define _TIF_NOHZ BIT(TIF_NOHZ)
#define _TIF_USEDFPU BIT(TIF_USEDFPU)
#define _TIF_USEDSIMD BIT(TIF_USEDSIMD)
#define _TIF_FIXADE BIT(TIF_FIXADE)
#define _TIF_LOGADE BIT(TIF_LOGADE)
#define _TIF_32BIT_REGS BIT(TIF_32BIT_REGS)
#define _TIF_32BIT_ADDR BIT(TIF_32BIT_ADDR)
#define _TIF_LOAD_WATCH BIT(TIF_LOAD_WATCH)
#define _TIF_SINGLESTEP BIT(TIF_SINGLESTEP)
#define _TIF_LSX_CTX_LIVE BIT(TIF_LSX_CTX_LIVE)
#define _TIF_LASX_CTX_LIVE BIT(TIF_LASX_CTX_LIVE)
#define _TIF_USEDLBT BIT(TIF_USEDLBT)
#define _TIF_LBT_CTX_LIVE BIT(TIF_LBT_CTX_LIVE)
#endif /* __KERNEL__ */
#endif /* _ASM_THREAD_INFO_H */
Annotation
- Immediate include surface: `asm/processor.h`, `asm-generic/thread_info_tif.h`.
- Detected declarations: `struct thread_info`.
- Atlas domain: Architecture Layer / arch/loongarch.
- 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.