2005-04-17 05:20:36 +07:00
|
|
|
/*
|
|
|
|
* S390 version
|
2012-07-20 16:15:04 +07:00
|
|
|
* Copyright IBM Corp. 2002, 2006
|
2005-04-17 05:20:36 +07:00
|
|
|
* Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _ASM_THREAD_INFO_H
|
|
|
|
#define _ASM_THREAD_INFO_H
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Size of kernel stack for each process
|
|
|
|
*/
|
|
|
|
#define THREAD_ORDER 2
|
|
|
|
#define ASYNC_ORDER 2
|
|
|
|
|
|
|
|
#define THREAD_SIZE (PAGE_SIZE << THREAD_ORDER)
|
|
|
|
#define ASYNC_SIZE (PAGE_SIZE << ASYNC_ORDER)
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
#include <asm/lowcore.h>
|
2009-04-14 20:36:16 +07:00
|
|
|
#include <asm/page.h>
|
|
|
|
#include <asm/processor.h>
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* low level task data that entry.S needs immediate access to
|
|
|
|
* - this struct should fit entirely inside of one cache line
|
|
|
|
* - this struct shares the supervisor stack pages
|
|
|
|
* - if the contents of this structure are changed, the assembly constants must also be changed
|
|
|
|
*/
|
|
|
|
struct thread_info {
|
|
|
|
struct task_struct *task; /* main task structure */
|
|
|
|
unsigned long flags; /* low level flags */
|
2013-04-24 17:58:39 +07:00
|
|
|
unsigned long sys_call_table; /* System call table address */
|
2005-04-17 05:20:36 +07:00
|
|
|
unsigned int cpu; /* current CPU */
|
2005-06-23 14:09:07 +07:00
|
|
|
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
2011-10-30 21:16:47 +07:00
|
|
|
unsigned int system_call;
|
2008-12-31 21:11:39 +07:00
|
|
|
__u64 user_timer;
|
|
|
|
__u64 system_timer;
|
2010-05-17 15:00:05 +07:00
|
|
|
unsigned long last_break; /* last breaking-event-address. */
|
2005-04-17 05:20:36 +07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* macros/functions for gaining access to the thread information structure
|
|
|
|
*/
|
|
|
|
#define INIT_THREAD_INFO(tsk) \
|
|
|
|
{ \
|
|
|
|
.task = &tsk, \
|
|
|
|
.flags = 0, \
|
|
|
|
.cpu = 0, \
|
2009-07-10 19:57:56 +07:00
|
|
|
.preempt_count = INIT_PREEMPT_COUNT, \
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
#define init_thread_info (init_thread_union.thread_info)
|
|
|
|
#define init_stack (init_thread_union.stack)
|
|
|
|
|
|
|
|
/* how to get the thread information struct from C */
|
|
|
|
static inline struct thread_info *current_thread_info(void)
|
|
|
|
{
|
2011-01-05 18:47:42 +07:00
|
|
|
return (struct thread_info *) S390_lowcore.thread_info;
|
2005-04-17 05:20:36 +07:00
|
|
|
}
|
|
|
|
|
2015-03-16 18:46:38 +07:00
|
|
|
void arch_release_task_struct(struct task_struct *tsk);
|
|
|
|
|
2008-07-25 15:45:40 +07:00
|
|
|
#define THREAD_SIZE_ORDER THREAD_ORDER
|
2005-04-17 05:20:36 +07:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* thread information flags bit numbers
|
|
|
|
*/
|
2014-04-15 17:55:07 +07:00
|
|
|
#define TIF_NOTIFY_RESUME 0 /* callback before returning to user */
|
|
|
|
#define TIF_SIGPENDING 1 /* signal pending */
|
|
|
|
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
|
|
|
|
#define TIF_SYSCALL_TRACE 3 /* syscall trace active */
|
|
|
|
#define TIF_SYSCALL_AUDIT 4 /* syscall auditing active */
|
|
|
|
#define TIF_SECCOMP 5 /* secure computing */
|
|
|
|
#define TIF_SYSCALL_TRACEPOINT 6 /* syscall tracepoint instrumentation */
|
2014-09-22 21:39:06 +07:00
|
|
|
#define TIF_UPROBE 7 /* breakpointed or single-stepping */
|
2014-04-15 17:55:07 +07:00
|
|
|
#define TIF_31BIT 16 /* 32bit process */
|
|
|
|
#define TIF_MEMDIE 17 /* is terminating due to OOM killer */
|
|
|
|
#define TIF_RESTORE_SIGMASK 18 /* restore signal mask in do_signal() */
|
|
|
|
#define TIF_SINGLE_STEP 19 /* This task is single stepped */
|
|
|
|
#define TIF_BLOCK_STEP 20 /* This task is block stepped */
|
2014-09-22 21:39:06 +07:00
|
|
|
#define TIF_UPROBE_SINGLESTEP 21 /* This task is uprobe single stepped */
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2008-10-11 02:33:20 +07:00
|
|
|
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
|
2005-04-17 05:20:36 +07:00
|
|
|
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
|
|
|
|
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
|
2009-06-12 15:26:26 +07:00
|
|
|
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
|
|
|
|
#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
|
|
|
|
#define _TIF_SECCOMP (1<<TIF_SECCOMP)
|
2009-08-25 04:43:11 +07:00
|
|
|
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
|
2014-09-22 21:39:06 +07:00
|
|
|
#define _TIF_UPROBE (1<<TIF_UPROBE)
|
2005-04-17 05:20:36 +07:00
|
|
|
#define _TIF_31BIT (1<<TIF_31BIT)
|
2011-10-30 21:16:35 +07:00
|
|
|
#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP)
|
2005-04-17 05:20:36 +07:00
|
|
|
|
2011-01-12 15:55:29 +07:00
|
|
|
#define is_32bit_task() (test_thread_flag(TIF_31BIT))
|
|
|
|
|
2005-04-17 05:20:36 +07:00
|
|
|
#endif /* _ASM_THREAD_INFO_H */
|