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

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

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * OpenRISC Linux
  4  *
  5  * Linux architectural port borrowing liberally from similar works of
  6  * others.  All original copyrights apply as per the original source
  7  * declaration.
  8  *
  9  * OpenRISC implementation:
 10  * Copyright (C) 2003 Matjaz Breskvar <phoenix@bsemi.com>
 11  * Copyright (C) 2010-2011 Jonas Bonn <jonas@southpole.se>
 12  * et al.
 13  */
 14 
 15 #ifndef _ASM_THREAD_INFO_H
 16 #define _ASM_THREAD_INFO_H
 17 
 18 #ifdef __KERNEL__
 19 
 20 #ifndef __ASSEMBLY__
 21 #include <asm/types.h>
 22 #include <asm/processor.h>
 23 #endif
 24 
 25 
 26 /* THREAD_SIZE is the size of the task_struct/kernel_stack combo.
 27  * normally, the stack is found by doing something like p + THREAD_SIZE
 28  * in or1k, a page is 8192 bytes, which seems like a sane size
 29  */
 30 
 31 #define THREAD_SIZE_ORDER 0
 32 #define THREAD_SIZE       (PAGE_SIZE << THREAD_SIZE_ORDER)
 33 
 34 /*
 35  * low level task data that entry.S needs immediate access to
 36  * - this struct should fit entirely inside of one cache line
 37  * - this struct shares the supervisor stack pages
 38  * - if the contents of this structure are changed, the assembly constants
 39  *   must also be changed
 40  */
 41 #ifndef __ASSEMBLY__
 42 
 43 struct thread_info {
 44         struct task_struct      *task;          /* main task structure */
 45         unsigned long           flags;          /* low level flags */
 46         __u32                   cpu;            /* current CPU */
 47         __s32                   preempt_count; /* 0 => preemptable, <0 => BUG */
 48 
 49         __u8                    supervisor_stack[0];
 50 
 51         /* saved context data */
 52         unsigned long           ksp;
 53 };
 54 #endif
 55 
 56 /*
 57  * macros/functions for gaining access to the thread information structure
 58  *
 59  * preempt_count needs to be 1 initially, until the scheduler is functional.
 60  */
 61 #ifndef __ASSEMBLY__
 62 #define INIT_THREAD_INFO(tsk)                           \
 63 {                                                       \
 64         .task           = &tsk,                         \
 65         .flags          = 0,                            \
 66         .cpu            = 0,                            \
 67         .preempt_count  = INIT_PREEMPT_COUNT,           \
 68         .ksp            = 0,                            \
 69 }
 70 
 71 /* how to get the thread information struct from C */
 72 register struct thread_info *current_thread_info_reg asm("r10");
 73 #define current_thread_info()   (current_thread_info_reg)
 74 
 75 #define get_thread_info(ti) get_task_struct((ti)->task)
 76 #define put_thread_info(ti) put_task_struct((ti)->task)
 77 
 78 #endif /* !__ASSEMBLY__ */
 79 
 80 /*
 81  * thread information flags
 82  *   these are process state flags that various assembly files may need to
 83  *   access
 84  *   - pending work-to-be-done flags are in LSW
 85  *   - other flags in MSW
 86  */
 87 #define TIF_SYSCALL_TRACE       0       /* syscall trace active */
 88 #define TIF_NOTIFY_RESUME       1       /* resumption notification requested */
 89 #define TIF_SIGPENDING          2       /* signal pending */
 90 #define TIF_NEED_RESCHED        3       /* rescheduling necessary */
 91 #define TIF_SINGLESTEP          4       /* restore singlestep on return to user
 92                                          * mode
 93                                          */
 94 #define TIF_NOTIFY_SIGNAL       5       /* signal notifications exist */
 95 #define TIF_SYSCALL_TRACEPOINT  8       /* for ftrace syscall instrumentation */
 96 #define TIF_RESTORE_SIGMASK     9
 97 #define TIF_POLLING_NRFLAG      16      /* true if poll_idle() is polling                                                * TIF_NEED_RESCHED
 98                                          */
 99 #define TIF_MEMDIE              17
100 
101 #define _TIF_SYSCALL_TRACE      (1<<TIF_SYSCALL_TRACE)
102 #define _TIF_NOTIFY_RESUME      (1<<TIF_NOTIFY_RESUME)
103 #define _TIF_SIGPENDING         (1<<TIF_SIGPENDING)
104 #define _TIF_NEED_RESCHED       (1<<TIF_NEED_RESCHED)
105 #define _TIF_SINGLESTEP         (1<<TIF_SINGLESTEP)
106 #define _TIF_NOTIFY_SIGNAL      (1<<TIF_NOTIFY_SIGNAL)
107 #define _TIF_POLLING_NRFLAG     (1<<TIF_POLLING_NRFLAG)
108 
109 
110 /* Work to do when returning from interrupt/exception */
111 /* For OpenRISC, this is anything in the LSW other than syscall trace */
112 #define _TIF_WORK_MASK (0xff & ~(_TIF_SYSCALL_TRACE|_TIF_SINGLESTEP))
113 
114 #endif /* __KERNEL__ */
115 
116 #endif /* _ASM_THREAD_INFO_H */
117 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php