Path: blob/master/arch/microblaze/include/asm/thread_info.h
26451 views
/* SPDX-License-Identifier: GPL-2.0 */1/*2* Copyright (C) 2006 Atmark Techno, Inc.3*/45#ifndef _ASM_MICROBLAZE_THREAD_INFO_H6#define _ASM_MICROBLAZE_THREAD_INFO_H78#ifdef __KERNEL__910/* we have 8k stack */11#define THREAD_SHIFT 1312#define THREAD_SIZE (1 << THREAD_SHIFT)13#define THREAD_SIZE_ORDER 11415#ifndef __ASSEMBLY__16# include <linux/types.h>17# include <asm/processor.h>1819/*20* low level task data that entry.S needs immediate access to21* - this struct should fit entirely inside of one cache line22* - this struct shares the supervisor stack pages23* - if the contents of this structure are changed, the assembly constants24* must also be changed25*/2627struct cpu_context {28__u32 r1; /* stack pointer */29__u32 r2;30/* dedicated registers */31__u32 r13;32__u32 r14;33__u32 r15;34__u32 r16;35__u32 r17;36__u32 r18;37/* non-volatile registers */38__u32 r19;39__u32 r20;40__u32 r21;41__u32 r22;42__u32 r23;43__u32 r24;44__u32 r25;45__u32 r26;46__u32 r27;47__u32 r28;48__u32 r29;49__u32 r30;50/* r31 is used as current task pointer */51/* special purpose registers */52__u32 msr;53__u32 ear;54__u32 esr;55__u32 fsr;56};5758struct thread_info {59struct task_struct *task; /* main task structure */60unsigned long flags; /* low level flags */61unsigned long status; /* thread-synchronous flags */62__u32 cpu; /* current CPU */63__s32 preempt_count; /* 0 => preemptable,< 0 => BUG*/6465struct cpu_context cpu_context;66};6768/*69* macros/functions for gaining access to the thread information structure70*/71#define INIT_THREAD_INFO(tsk) \72{ \73.task = &tsk, \74.flags = 0, \75.cpu = 0, \76.preempt_count = INIT_PREEMPT_COUNT, \77}7879/* how to get the thread information struct from C */80static inline struct thread_info *current_thread_info(void)81{82register unsigned long sp asm("r1");8384return (struct thread_info *)(sp & ~(THREAD_SIZE-1));85}8687/* thread information allocation */88#endif /* __ASSEMBLY__ */8990/*91* thread information flags92* - these are process state flags that various assembly files may93* need to access94* - pending work-to-be-done flags are in LSW95* - other flags in MSW96*/97#define TIF_SYSCALL_TRACE 0 /* syscall trace active */98#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */99#define TIF_SIGPENDING 2 /* signal pending */100#define TIF_NEED_RESCHED 3 /* rescheduling necessary */101/* restore singlestep on return to user mode */102#define TIF_SINGLESTEP 4103#define TIF_NOTIFY_SIGNAL 5 /* signal notifications exist */104#define TIF_MEMDIE 6 /* is terminating due to OOM killer */105#define TIF_SYSCALL_AUDIT 9 /* syscall auditing active */106#define TIF_SECCOMP 10 /* secure computing */107108/* true if poll_idle() is polling TIF_NEED_RESCHED */109#define TIF_POLLING_NRFLAG 16110111#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)112#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)113#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)114#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)115#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)116#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)117#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)118#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)119#define _TIF_SECCOMP (1 << TIF_SECCOMP)120121/* work to do in syscall trace */122#define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \123_TIF_SYSCALL_AUDIT | _TIF_SECCOMP)124125/* work to do on interrupt/exception return */126#define _TIF_WORK_MASK 0x0000FFFE127128/* work to do on any return to u-space */129#define _TIF_ALLWORK_MASK 0x0000FFFF130131/*132* Thread-synchronous status.133*134* This is different from the flags in that nobody else135* ever touches our thread-synchronous status, so we don't136* have to worry about atomic accesses.137*/138/* FPU was used by this task this quantum (SMP) */139#define TS_USEDFPU 0x0001140141#endif /* __KERNEL__ */142#endif /* _ASM_MICROBLAZE_THREAD_INFO_H */143144145