~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/c6x/include/asm/thread_info.h

Version: ~ [ linux-5.9-rc6 ] ~ [ linux-5.8.10 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.66 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.146 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.198 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.236 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.236 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  Port on Texas Instruments TMS320C6x architecture
  3  *
  4  *  Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated
  5  *  Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com)
  6  *
  7  *  Updated for 2.6.3x: Mark Salter <msalter@redhat.com>
  8  *
  9  *  This program is free software; you can redistribute it and/or modify
 10  *  it under the terms of the GNU General Public License version 2 as
 11  *  published by the Free Software Foundation.
 12  */
 13 #ifndef _ASM_C6X_THREAD_INFO_H
 14 #define _ASM_C6X_THREAD_INFO_H
 15 
 16 #ifdef __KERNEL__
 17 
 18 #include <asm/page.h>
 19 
 20 #ifdef CONFIG_4KSTACKS
 21 #define THREAD_SIZE             4096
 22 #define THREAD_SHIFT            12
 23 #define THREAD_SIZE_ORDER       0
 24 #else
 25 #define THREAD_SIZE             8192
 26 #define THREAD_SHIFT            13
 27 #define THREAD_SIZE_ORDER       1
 28 #endif
 29 
 30 #define THREAD_START_SP         (THREAD_SIZE - 8)
 31 
 32 #ifndef __ASSEMBLY__
 33 
 34 typedef struct {
 35         unsigned long seg;
 36 } mm_segment_t;
 37 
 38 /*
 39  * low level task data.
 40  */
 41 struct thread_info {
 42         struct task_struct      *task;          /* main task structure */
 43         unsigned long           flags;          /* low level flags */
 44         int                     cpu;            /* cpu we're on */
 45         int                     preempt_count;  /* 0 = preemptable, <0 = BUG */
 46         mm_segment_t            addr_limit;     /* thread address space */
 47 };
 48 
 49 /*
 50  * macros/functions for gaining access to the thread information structure
 51  *
 52  * preempt_count needs to be 1 initially, until the scheduler is functional.
 53  */
 54 #define INIT_THREAD_INFO(tsk)                   \
 55 {                                               \
 56         .task           = &tsk,                 \
 57         .flags          = 0,                    \
 58         .cpu            = 0,                    \
 59         .preempt_count  = INIT_PREEMPT_COUNT,   \
 60         .addr_limit     = KERNEL_DS,            \
 61 }
 62 
 63 #define init_thread_info        (init_thread_union.thread_info)
 64 #define init_stack              (init_thread_union.stack)
 65 
 66 /* get the thread information struct of current task */
 67 static inline __attribute__((const))
 68 struct thread_info *current_thread_info(void)
 69 {
 70         struct thread_info *ti;
 71         asm volatile (" clr   .s2 B15,0,%1,%0\n"
 72                       : "=b" (ti)
 73                       : "Iu5" (THREAD_SHIFT - 1));
 74         return ti;
 75 }
 76 
 77 #define get_thread_info(ti)     get_task_struct((ti)->task)
 78 #define put_thread_info(ti)     put_task_struct((ti)->task)
 79 #endif /* __ASSEMBLY__ */
 80 
 81 /*
 82  * thread information flag bit numbers
 83  * - pending work-to-be-done flags are in LSW
 84  * - other flags in MSW
 85  */
 86 #define TIF_SYSCALL_TRACE       0       /* syscall trace active */
 87 #define TIF_NOTIFY_RESUME       1       /* resumption notification requested */
 88 #define TIF_SIGPENDING          2       /* signal pending */
 89 #define TIF_NEED_RESCHED        3       /* rescheduling necessary */
 90 #define TIF_RESTORE_SIGMASK     4       /* restore signal mask in do_signal() */
 91 
 92 #define TIF_MEMDIE              17      /* OOM killer killed process */
 93 
 94 #define TIF_WORK_MASK           0x00007FFE /* work on irq/exception return */
 95 #define TIF_ALLWORK_MASK        0x00007FFF /* work on any return to u-space */
 96 
 97 #endif /* __KERNEL__ */
 98 
 99 #endif /* _ASM_C6X_THREAD_INFO_H */
100 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp