Linux Audio

Check our new training course

Loading...
v4.17
 
  1/*
  2 * Thread support for the Hexagon architecture
  3 *
  4 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
  5 *
  6 * This program is free software; you can redistribute it and/or modify
  7 * it under the terms of the GNU General Public License version 2 and
  8 * only version 2 as published by the Free Software Foundation.
  9 *
 10 * This program is distributed in the hope that it will be useful,
 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13 * GNU General Public License for more details.
 14 *
 15 * You should have received a copy of the GNU General Public License
 16 * along with this program; if not, write to the Free Software
 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 18 * 02110-1301, USA.
 19 */
 20
 21#ifndef _ASM_THREAD_INFO_H
 22#define _ASM_THREAD_INFO_H
 23
 24#ifdef __KERNEL__
 25
 26#ifndef __ASSEMBLY__
 27#include <asm/processor.h>
 28#include <asm/registers.h>
 29#include <asm/page.h>
 30#endif
 31
 32#define THREAD_SHIFT		12
 33#define THREAD_SIZE		(1<<THREAD_SHIFT)
 34#define THREAD_SIZE_ORDER	(THREAD_SHIFT - PAGE_SHIFT)
 35
 36#ifndef __ASSEMBLY__
 37
 38typedef struct {
 39	unsigned long seg;
 40} mm_segment_t;
 41
 42/*
 43 * This is union'd with the "bottom" of the kernel stack.
 44 * It keeps track of thread info which is handy for routines
 45 * to access quickly.
 46 */
 47
 48struct thread_info {
 49	struct task_struct	*task;		/* main task structure */
 50	unsigned long		flags;          /* low level flags */
 51	__u32                   cpu;            /* current cpu */
 52	int                     preempt_count;  /* 0=>preemptible,<0=>BUG */
 53	mm_segment_t            addr_limit;     /* segmentation sux */
 54	/*
 55	 * used for syscalls somehow;
 56	 * seems to have a function pointer and four arguments
 57	 */
 58	/* Points to the current pt_regs frame  */
 59	struct pt_regs		*regs;
 60	/*
 61	 * saved kernel sp at switch_to time;
 62	 * not sure if this is used (it's not in the VM model it seems;
 63	 * see thread_struct)
 64	 */
 65	unsigned long		sp;
 66};
 67
 68#else /* !__ASSEMBLY__ */
 69
 70#include <asm/asm-offsets.h>
 71
 72#endif  /* __ASSEMBLY__  */
 73
 74#ifndef __ASSEMBLY__
 75
 76#define INIT_THREAD_INFO(tsk)                   \
 77{                                               \
 78	.task           = &tsk,                 \
 79	.flags          = 0,                    \
 80	.cpu            = 0,                    \
 81	.preempt_count  = 1,                    \
 82	.addr_limit     = KERNEL_DS,            \
 83	.sp = 0,				\
 84	.regs = NULL,			\
 85}
 86
 87/* Tacky preprocessor trickery */
 88#define	qqstr(s) qstr(s)
 89#define qstr(s) #s
 90#define QUOTED_THREADINFO_REG qqstr(THREADINFO_REG)
 91
 92register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);
 93#define current_thread_info()  __current_thread_info
 94
 95#endif /* __ASSEMBLY__ */
 96
 97/*
 98 * thread information flags
 99 * - these are process state flags that various assembly files
100 *   may need to access
101 * - pending work-to-be-done flags are in LSW
102 * - other flags in MSW
103 */
104
105#define TIF_SYSCALL_TRACE       0       /* syscall trace active */
106#define TIF_NOTIFY_RESUME       1       /* resumption notification requested */
107#define TIF_SIGPENDING          2       /* signal pending */
108#define TIF_NEED_RESCHED        3       /* rescheduling necessary */
109#define TIF_SINGLESTEP          4       /* restore ss @ return to usr mode */
110#define TIF_RESTORE_SIGMASK     6       /* restore sig mask in do_signal() */
 
111/* true if poll_idle() is polling TIF_NEED_RESCHED */
112#define TIF_MEMDIE              17      /* OOM killer killed process */
113
114#define _TIF_SYSCALL_TRACE      (1 << TIF_SYSCALL_TRACE)
115#define _TIF_NOTIFY_RESUME      (1 << TIF_NOTIFY_RESUME)
116#define _TIF_SIGPENDING         (1 << TIF_SIGPENDING)
117#define _TIF_NEED_RESCHED       (1 << TIF_NEED_RESCHED)
118#define _TIF_SINGLESTEP         (1 << TIF_SINGLESTEP)
 
119
120/* work to do on interrupt/exception return - All but TIF_SYSCALL_TRACE */
121#define _TIF_WORK_MASK          (0x0000FFFF & ~_TIF_SYSCALL_TRACE)
122
123/* work to do on any return to u-space */
124#define _TIF_ALLWORK_MASK       0x0000FFFF
125
126#endif /* __KERNEL__ */
127
128#endif
v5.14.15
  1/* SPDX-License-Identifier: GPL-2.0-only */
  2/*
  3 * Thread support for the Hexagon architecture
  4 *
  5 * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  6 */
  7
  8#ifndef _ASM_THREAD_INFO_H
  9#define _ASM_THREAD_INFO_H
 10
 11#ifdef __KERNEL__
 12
 13#ifndef __ASSEMBLY__
 14#include <asm/processor.h>
 15#include <asm/registers.h>
 16#include <asm/page.h>
 17#endif
 18
 19#define THREAD_SHIFT		12
 20#define THREAD_SIZE		(1<<THREAD_SHIFT)
 21#define THREAD_SIZE_ORDER	(THREAD_SHIFT - PAGE_SHIFT)
 22
 23#ifndef __ASSEMBLY__
 24
 25typedef struct {
 26	unsigned long seg;
 27} mm_segment_t;
 28
 29/*
 30 * This is union'd with the "bottom" of the kernel stack.
 31 * It keeps track of thread info which is handy for routines
 32 * to access quickly.
 33 */
 34
 35struct thread_info {
 36	struct task_struct	*task;		/* main task structure */
 37	unsigned long		flags;          /* low level flags */
 38	__u32                   cpu;            /* current cpu */
 39	int                     preempt_count;  /* 0=>preemptible,<0=>BUG */
 40	mm_segment_t            addr_limit;     /* segmentation sux */
 41	/*
 42	 * used for syscalls somehow;
 43	 * seems to have a function pointer and four arguments
 44	 */
 45	/* Points to the current pt_regs frame  */
 46	struct pt_regs		*regs;
 47	/*
 48	 * saved kernel sp at switch_to time;
 49	 * not sure if this is used (it's not in the VM model it seems;
 50	 * see thread_struct)
 51	 */
 52	unsigned long		sp;
 53};
 54
 55#else /* !__ASSEMBLY__ */
 56
 57#include <asm/asm-offsets.h>
 58
 59#endif  /* __ASSEMBLY__  */
 60
 61#ifndef __ASSEMBLY__
 62
 63#define INIT_THREAD_INFO(tsk)                   \
 64{                                               \
 65	.task           = &tsk,                 \
 66	.flags          = 0,                    \
 67	.cpu            = 0,                    \
 68	.preempt_count  = 1,                    \
 69	.addr_limit     = KERNEL_DS,            \
 70	.sp = 0,				\
 71	.regs = NULL,			\
 72}
 73
 74/* Tacky preprocessor trickery */
 75#define	qqstr(s) qstr(s)
 76#define qstr(s) #s
 77#define QUOTED_THREADINFO_REG qqstr(THREADINFO_REG)
 78
 79register struct thread_info *__current_thread_info asm(QUOTED_THREADINFO_REG);
 80#define current_thread_info()  __current_thread_info
 81
 82#endif /* __ASSEMBLY__ */
 83
 84/*
 85 * thread information flags
 86 * - these are process state flags that various assembly files
 87 *   may need to access
 88 * - pending work-to-be-done flags are in LSW
 89 * - other flags in MSW
 90 */
 91
 92#define TIF_SYSCALL_TRACE       0       /* syscall trace active */
 93#define TIF_NOTIFY_RESUME       1       /* resumption notification requested */
 94#define TIF_SIGPENDING          2       /* signal pending */
 95#define TIF_NEED_RESCHED        3       /* rescheduling necessary */
 96#define TIF_SINGLESTEP          4       /* restore ss @ return to usr mode */
 97#define TIF_RESTORE_SIGMASK     6       /* restore sig mask in do_signal() */
 98#define TIF_NOTIFY_SIGNAL	7       /* signal notifications exist */
 99/* true if poll_idle() is polling TIF_NEED_RESCHED */
100#define TIF_MEMDIE              17      /* OOM killer killed process */
101
102#define _TIF_SYSCALL_TRACE      (1 << TIF_SYSCALL_TRACE)
103#define _TIF_NOTIFY_RESUME      (1 << TIF_NOTIFY_RESUME)
104#define _TIF_SIGPENDING         (1 << TIF_SIGPENDING)
105#define _TIF_NEED_RESCHED       (1 << TIF_NEED_RESCHED)
106#define _TIF_SINGLESTEP         (1 << TIF_SINGLESTEP)
107#define _TIF_NOTIFY_SIGNAL	(1 << TIF_NOTIFY_SIGNAL)
108
109/* work to do on interrupt/exception return - All but TIF_SYSCALL_TRACE */
110#define _TIF_WORK_MASK          (0x0000FFFF & ~_TIF_SYSCALL_TRACE)
111
112/* work to do on any return to u-space */
113#define _TIF_ALLWORK_MASK       0x0000FFFF
114
115#endif /* __KERNEL__ */
116
117#endif