Path: blob/master/arch/unicore32/include/asm/thread_info.h
10818 views
/*1* linux/arch/unicore32/include/asm/thread_info.h2*3* Code specific to PKUnity SoC and UniCore ISA4*5* Copyright (C) 2001-2010 GUAN Xue-tao6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/11#ifndef __UNICORE_THREAD_INFO_H__12#define __UNICORE_THREAD_INFO_H__1314#ifdef __KERNEL__1516#include <linux/compiler.h>17#include <asm/fpstate.h>1819#define THREAD_SIZE_ORDER 120#define THREAD_SIZE 819221#define THREAD_START_SP (THREAD_SIZE - 8)2223#ifndef __ASSEMBLY__2425struct task_struct;26struct exec_domain;2728#include <asm/types.h>2930typedef struct {31unsigned long seg;32} mm_segment_t;3334struct cpu_context_save {35__u32 r4;36__u32 r5;37__u32 r6;38__u32 r7;39__u32 r8;40__u32 r9;41__u32 r10;42__u32 r11;43__u32 r12;44__u32 r13;45__u32 r14;46__u32 r15;47__u32 r16;48__u32 r17;49__u32 r18;50__u32 r19;51__u32 r20;52__u32 r21;53__u32 r22;54__u32 r23;55__u32 r24;56__u32 r25;57__u32 r26;58__u32 fp;59__u32 sp;60__u32 pc;61};6263/*64* low level task data that entry.S needs immediate access to.65* __switch_to() assumes cpu_context follows immediately after cpu_domain.66*/67struct thread_info {68unsigned long flags; /* low level flags */69int preempt_count; /* 0 => preemptable */70/* <0 => bug */71mm_segment_t addr_limit; /* address limit */72struct task_struct *task; /* main task structure */73struct exec_domain *exec_domain; /* execution domain */74__u32 cpu; /* cpu */75struct cpu_context_save cpu_context; /* cpu context */76__u32 syscall; /* syscall number */77__u8 used_cp[16]; /* thread used copro */78#ifdef CONFIG_UNICORE_FPU_F6479struct fp_state fpstate __attribute__((aligned(8)));80#endif81struct restart_block restart_block;82};8384#define INIT_THREAD_INFO(tsk) \85{ \86.task = &tsk, \87.exec_domain = &default_exec_domain, \88.flags = 0, \89.preempt_count = INIT_PREEMPT_COUNT, \90.addr_limit = KERNEL_DS, \91.restart_block = { \92.fn = do_no_restart_syscall, \93}, \94}9596#define init_thread_info (init_thread_union.thread_info)97#define init_stack (init_thread_union.stack)9899/*100* how to get the thread information struct from C101*/102static inline struct thread_info *current_thread_info(void) __attribute_const__;103104static inline struct thread_info *current_thread_info(void)105{106register unsigned long sp asm ("sp");107return (struct thread_info *)(sp & ~(THREAD_SIZE - 1));108}109110#define thread_saved_pc(tsk) \111((unsigned long)(task_thread_info(tsk)->cpu_context.pc))112#define thread_saved_sp(tsk) \113((unsigned long)(task_thread_info(tsk)->cpu_context.sp))114#define thread_saved_fp(tsk) \115((unsigned long)(task_thread_info(tsk)->cpu_context.fp))116117#endif118119/*120* We use bit 30 of the preempt_count to indicate that kernel121* preemption is occurring. See <asm/hardirq.h>.122*/123#define PREEMPT_ACTIVE 0x40000000124125/*126* thread information flags:127* TIF_SYSCALL_TRACE - syscall trace active128* TIF_SIGPENDING - signal pending129* TIF_NEED_RESCHED - rescheduling necessary130* TIF_NOTIFY_RESUME - callback before returning to user131*/132#define TIF_SIGPENDING 0133#define TIF_NEED_RESCHED 1134#define TIF_NOTIFY_RESUME 2 /* callback before returning to user */135#define TIF_SYSCALL_TRACE 8136#define TIF_MEMDIE 18137#define TIF_FREEZE 19138#define TIF_RESTORE_SIGMASK 20139140#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)141#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)142#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)143#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)144#define _TIF_FREEZE (1 << TIF_FREEZE)145#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)146147/*148* Change these and you break ASM code in entry-common.S149*/150#define _TIF_WORK_MASK 0x000000ff151152#endif /* __KERNEL__ */153#endif /* __UNICORE_THREAD_INFO_H__ */154155156