Path: blob/master/arch/hexagon/include/asm/thread_info.h
26481 views
/* SPDX-License-Identifier: GPL-2.0-only */1/*2* Thread support for the Hexagon architecture3*4* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.5*/67#ifndef _ASM_THREAD_INFO_H8#define _ASM_THREAD_INFO_H910#ifdef __KERNEL__1112#ifndef __ASSEMBLY__13#include <asm/processor.h>14#include <asm/registers.h>15#include <asm/page.h>16#endif1718#define THREAD_SHIFT 1219#define THREAD_SIZE (1<<THREAD_SHIFT)20#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)2122#ifndef __ASSEMBLY__2324/*25* This is union'd with the "bottom" of the kernel stack.26* It keeps track of thread info which is handy for routines27* to access quickly.28*/2930struct thread_info {31struct task_struct *task; /* main task structure */32unsigned long flags; /* low level flags */33__u32 cpu; /* current cpu */34int preempt_count; /* 0=>preemptible,<0=>BUG */35/*36* used for syscalls somehow;37* seems to have a function pointer and four arguments38*/39/* Points to the current pt_regs frame */40struct pt_regs *regs;41/*42* saved kernel sp at switch_to time;43* not sure if this is used (it's not in the VM model it seems;44* see thread_struct)45*/46unsigned long sp;47};4849#else /* !__ASSEMBLY__ */5051#include <asm/asm-offsets.h>5253#endif /* __ASSEMBLY__ */5455#ifndef __ASSEMBLY__5657#define INIT_THREAD_INFO(tsk) \58{ \59.task = &tsk, \60.flags = 0, \61.cpu = 0, \62.preempt_count = 1, \63.sp = 0, \64.regs = NULL, \65}6667/* Tacky preprocessor trickery */68#define qqstr(s) qstr(s)69#define qstr(s) #s70#define QUOTED_THREADINFO_REG qqstr(THREADINFO_REG)7172register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);73#define current_thread_info() __current_thread_info7475#endif /* __ASSEMBLY__ */7677/*78* thread information flags79* - these are process state flags that various assembly files80* may need to access81* - pending work-to-be-done flags are in LSW82* - other flags in MSW83*/8485#define TIF_SYSCALL_TRACE 0 /* syscall trace active */86#define TIF_NOTIFY_RESUME 1 /* resumption notification requested */87#define TIF_SIGPENDING 2 /* signal pending */88#define TIF_NEED_RESCHED 3 /* rescheduling necessary */89#define TIF_SINGLESTEP 4 /* restore ss @ return to usr mode */90#define TIF_RESTORE_SIGMASK 6 /* restore sig mask in do_signal() */91#define TIF_NOTIFY_SIGNAL 7 /* signal notifications exist */92/* true if poll_idle() is polling TIF_NEED_RESCHED */93#define TIF_MEMDIE 17 /* OOM killer killed process */9495#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)96#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)97#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)98#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)99#define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP)100#define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL)101102/* work to do on interrupt/exception return - All but TIF_SYSCALL_TRACE */103#define _TIF_WORK_MASK (0x0000FFFF & ~_TIF_SYSCALL_TRACE)104105/* work to do on any return to u-space */106#define _TIF_ALLWORK_MASK 0x0000FFFF107108#endif /* __KERNEL__ */109110#endif111112113