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

TOMOYO Linux Cross Reference
Linux/arch/nds32/include/asm/processor.h

Version: ~ [ linux-6.2-rc3 ] ~ [ linux-6.1.5 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.87 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.162 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.228 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.269 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.302 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.302 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ 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 */
  2 // Copyright (C) 2005-2017 Andes Technology Corporation
  3 
  4 #ifndef __ASM_NDS32_PROCESSOR_H
  5 #define __ASM_NDS32_PROCESSOR_H
  6 
  7 #ifdef __KERNEL__
  8 
  9 #include <asm/ptrace.h>
 10 #include <asm/types.h>
 11 #include <asm/sigcontext.h>
 12 
 13 #define KERNEL_STACK_SIZE       PAGE_SIZE
 14 #define STACK_TOP       TASK_SIZE
 15 #define STACK_TOP_MAX   TASK_SIZE
 16 
 17 struct cpu_context {
 18         unsigned long r6;
 19         unsigned long r7;
 20         unsigned long r8;
 21         unsigned long r9;
 22         unsigned long r10;
 23         unsigned long r11;
 24         unsigned long r12;
 25         unsigned long r13;
 26         unsigned long r14;
 27         unsigned long fp;
 28         unsigned long pc;
 29         unsigned long sp;
 30 };
 31 
 32 struct thread_struct {
 33         struct cpu_context cpu_context; /* cpu context */
 34         /* fault info     */
 35         unsigned long address;
 36         unsigned long trap_no;
 37         unsigned long error_code;
 38 
 39         struct fpu_struct fpu;
 40 };
 41 
 42 #define INIT_THREAD  {  }
 43 
 44 #ifdef __NDS32_EB__
 45 #define PSW_DE  PSW_mskBE
 46 #else
 47 #define PSW_DE  0x0
 48 #endif
 49 
 50 #ifdef CONFIG_WBNA
 51 #define PSW_valWBNA     PSW_mskWBNA
 52 #else
 53 #define PSW_valWBNA     0x0
 54 #endif
 55 
 56 #ifdef CONFIG_HWZOL
 57 #define PSW_valINIT (PSW_CPL_ANY | PSW_mskAEN | PSW_valWBNA | PSW_mskDT | PSW_mskIT | PSW_DE | PSW_mskGIE)
 58 #else
 59 #define PSW_valINIT (PSW_CPL_ANY | PSW_valWBNA | PSW_mskDT | PSW_mskIT | PSW_DE | PSW_mskGIE)
 60 #endif
 61 
 62 #define start_thread(regs,pc,stack)                     \
 63 ({                                                      \
 64         memzero(regs, sizeof(struct pt_regs));          \
 65         forget_syscall(regs);                           \
 66         regs->ipsw = PSW_valINIT;                       \
 67         regs->ir0 = (PSW_CPL_ANY | PSW_valWBNA | PSW_mskDT | PSW_mskIT | PSW_DE | PSW_SYSTEM | PSW_INTL_1);     \
 68         regs->ipc = pc;                                 \
 69         regs->sp = stack;                               \
 70 })
 71 
 72 /* Forward declaration, a strange C thing */
 73 struct task_struct;
 74 
 75 /* Free all resources held by a thread. */
 76 #define release_thread(thread) do { } while(0)
 77 #if IS_ENABLED(CONFIG_FPU)
 78 #if !IS_ENABLED(CONFIG_UNLAZU_FPU)
 79 extern struct task_struct *last_task_used_math;
 80 #endif
 81 #endif
 82 
 83 /* Prepare to copy thread state - unlazy all lazy status */
 84 #define prepare_to_copy(tsk)    do { } while (0)
 85 
 86 unsigned long get_wchan(struct task_struct *p);
 87 
 88 #define cpu_relax()                     barrier()
 89 
 90 #define task_pt_regs(task) \
 91         ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
 92                 - 8) - 1)
 93 
 94 /*
 95  * Create a new kernel thread
 96  */
 97 extern int kernel_thread(int (*fn) (void *), void *arg, unsigned long flags);
 98 
 99 #define KSTK_EIP(tsk)   instruction_pointer(task_pt_regs(tsk))
100 #define KSTK_ESP(tsk)   user_stack_pointer(task_pt_regs(tsk))
101 
102 #endif
103 
104 #endif /* __ASM_NDS32_PROCESSOR_H */
105 

~ [ 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