Linux Audio

Check our new training course

Loading...
v6.8
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _ASM_M68K_THREAD_INFO_H
 3#define _ASM_M68K_THREAD_INFO_H
 4
 5#include <asm/types.h>
 6#include <asm/page.h>
 
 7
 8/*
 9 * On machines with 4k pages we default to an 8k thread size, though we
10 * allow a 4k with config option. Any other machine page size then
11 * the thread size must match the page size (which is 8k and larger here).
12 */
13#if PAGE_SHIFT < 13
14#ifdef CONFIG_4KSTACKS
15#define THREAD_SIZE	4096
16#else
17#define THREAD_SIZE	8192
18#endif
19#else
20#define THREAD_SIZE	PAGE_SIZE
21#endif
22#define THREAD_SIZE_ORDER	((THREAD_SIZE / PAGE_SIZE) - 1)
23
24#ifndef __ASSEMBLY__
25
26struct thread_info {
27	struct task_struct	*task;		/* main task structure */
28	unsigned long		flags;
 
29	int			preempt_count;	/* 0 => preemptable, <0 => BUG */
30	__u32			cpu;		/* should always be 0 on m68k */
31	unsigned long		tp_value;	/* thread pointer */
32};
33#endif /* __ASSEMBLY__ */
34
35#define INIT_THREAD_INFO(tsk)			\
36{						\
37	.task		= &tsk,			\
 
38	.preempt_count	= INIT_PREEMPT_COUNT,	\
39}
40
41#ifndef __ASSEMBLY__
42/* how to get the thread information struct from C */
43static inline struct thread_info *current_thread_info(void)
44{
45	struct thread_info *ti;
46	__asm__(
47		"move.l %%sp, %0 \n\t"
48		"and.l  %1, %0"
49		: "=&d"(ti)
50		: "di" (~(THREAD_SIZE-1))
51		);
52	return ti;
53}
54#endif
55
56/* entry.S relies on these definitions!
57 * bits 0-7 are tested at every exception exit
58 * bits 8-15 are also tested at syscall exit
59 */
60#define TIF_NOTIFY_SIGNAL	4
61#define TIF_NOTIFY_RESUME	5	/* callback before returning to user */
62#define TIF_SIGPENDING		6	/* signal pending */
63#define TIF_NEED_RESCHED	7	/* rescheduling necessary */
64#define TIF_SECCOMP		13	/* seccomp syscall filtering active */
65#define TIF_DELAYED_TRACE	14	/* single step a syscall */
66#define TIF_SYSCALL_TRACE	15	/* syscall trace active */
67#define TIF_MEMDIE		16	/* is terminating due to OOM killer */
68#define TIF_RESTORE_SIGMASK	18	/* restore signal mask in do_signal */
69
70#define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
71#define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
72#define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
73#define _TIF_SECCOMP		(1 << TIF_SECCOMP)
74#define _TIF_DELAYED_TRACE	(1 << TIF_DELAYED_TRACE)
75#define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
76#define _TIF_MEMDIE		(1 << TIF_MEMDIE)
77#define _TIF_RESTORE_SIGMASK	(1 << TIF_RESTORE_SIGMASK)
78
79#endif	/* _ASM_M68K_THREAD_INFO_H */
v5.14.15
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef _ASM_M68K_THREAD_INFO_H
 3#define _ASM_M68K_THREAD_INFO_H
 4
 5#include <asm/types.h>
 6#include <asm/page.h>
 7#include <asm/segment.h>
 8
 9/*
10 * On machines with 4k pages we default to an 8k thread size, though we
11 * allow a 4k with config option. Any other machine page size then
12 * the thread size must match the page size (which is 8k and larger here).
13 */
14#if PAGE_SHIFT < 13
15#ifdef CONFIG_4KSTACKS
16#define THREAD_SIZE	4096
17#else
18#define THREAD_SIZE	8192
19#endif
20#else
21#define THREAD_SIZE	PAGE_SIZE
22#endif
23#define THREAD_SIZE_ORDER	((THREAD_SIZE / PAGE_SIZE) - 1)
24
25#ifndef __ASSEMBLY__
26
27struct thread_info {
28	struct task_struct	*task;		/* main task structure */
29	unsigned long		flags;
30	mm_segment_t		addr_limit;	/* thread address space */
31	int			preempt_count;	/* 0 => preemptable, <0 => BUG */
32	__u32			cpu;		/* should always be 0 on m68k */
33	unsigned long		tp_value;	/* thread pointer */
34};
35#endif /* __ASSEMBLY__ */
36
37#define INIT_THREAD_INFO(tsk)			\
38{						\
39	.task		= &tsk,			\
40	.addr_limit	= KERNEL_DS,		\
41	.preempt_count	= INIT_PREEMPT_COUNT,	\
42}
43
44#ifndef __ASSEMBLY__
45/* how to get the thread information struct from C */
46static inline struct thread_info *current_thread_info(void)
47{
48	struct thread_info *ti;
49	__asm__(
50		"move.l %%sp, %0 \n\t"
51		"and.l  %1, %0"
52		: "=&d"(ti)
53		: "di" (~(THREAD_SIZE-1))
54		);
55	return ti;
56}
57#endif
58
59/* entry.S relies on these definitions!
60 * bits 0-7 are tested at every exception exit
61 * bits 8-15 are also tested at syscall exit
62 */
63#define TIF_NOTIFY_SIGNAL	4
64#define TIF_NOTIFY_RESUME	5	/* callback before returning to user */
65#define TIF_SIGPENDING		6	/* signal pending */
66#define TIF_NEED_RESCHED	7	/* rescheduling necessary */
 
67#define TIF_DELAYED_TRACE	14	/* single step a syscall */
68#define TIF_SYSCALL_TRACE	15	/* syscall trace active */
69#define TIF_MEMDIE		16	/* is terminating due to OOM killer */
70#define TIF_RESTORE_SIGMASK	18	/* restore signal mask in do_signal */
71
72#define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
73#define _TIF_SIGPENDING		(1 << TIF_SIGPENDING)
74#define _TIF_NEED_RESCHED	(1 << TIF_NEED_RESCHED)
 
75#define _TIF_DELAYED_TRACE	(1 << TIF_DELAYED_TRACE)
76#define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
77#define _TIF_MEMDIE		(1 << TIF_MEMDIE)
78#define _TIF_RESTORE_SIGMASK	(1 << TIF_RESTORE_SIGMASK)
79
80#endif	/* _ASM_M68K_THREAD_INFO_H */