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

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

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ 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-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ 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 /* SPDX-License-Identifier: GPL-2.0 */
  2 // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
  3 
  4 #ifndef __ASM_CSKY_PROCESSOR_H
  5 #define __ASM_CSKY_PROCESSOR_H
  6 
  7 #include <linux/bitops.h>
  8 #include <asm/segment.h>
  9 #include <asm/ptrace.h>
 10 #include <asm/current.h>
 11 #include <asm/cache.h>
 12 #include <abi/reg_ops.h>
 13 #include <abi/regdef.h>
 14 #include <abi/switch_context.h>
 15 #ifdef CONFIG_CPU_HAS_FPU
 16 #include <abi/fpu.h>
 17 #endif
 18 
 19 struct cpuinfo_csky {
 20         unsigned long asid_cache;
 21 } __aligned(SMP_CACHE_BYTES);
 22 
 23 extern struct cpuinfo_csky cpu_data[];
 24 
 25 /*
 26  * User space process size: 2GB. This is hardcoded into a few places,
 27  * so don't change it unless you know what you are doing.  TASK_SIZE
 28  * for a 64 bit kernel expandable to 8192EB, of which the current CSKY
 29  * implementations will "only" be able to use 1TB ...
 30  */
 31 #define TASK_SIZE       0x7fff8000UL
 32 
 33 #ifdef __KERNEL__
 34 #define STACK_TOP       TASK_SIZE
 35 #define STACK_TOP_MAX   STACK_TOP
 36 #endif
 37 
 38 /* This decides where the kernel will search for a free chunk of vm
 39  * space during mmap's.
 40  */
 41 #define TASK_UNMAPPED_BASE      (TASK_SIZE / 3)
 42 
 43 struct thread_struct {
 44         unsigned long  ksp;       /* kernel stack pointer */
 45         unsigned long  sr;        /* saved status register */
 46 
 47         /* FPU regs */
 48         struct user_fp __aligned(16) user_fp;
 49 };
 50 
 51 #define INIT_THREAD  { \
 52         .ksp = sizeof(init_stack) + (unsigned long) &init_stack, \
 53         .sr = DEFAULT_PSR_VALUE, \
 54 }
 55 
 56 /*
 57  * Do necessary setup to start up a newly executed thread.
 58  *
 59  * pass the data segment into user programs if it exists,
 60  * it can't hurt anything as far as I can tell
 61  */
 62 #define start_thread(_regs, _pc, _usp)                                  \
 63 do {                                                                    \
 64         set_fs(USER_DS); /* reads from user space */                    \
 65         (_regs)->pc = (_pc);                                            \
 66         (_regs)->regs[1] = 0; /* ABIV1 is R7, uClibc_main rtdl arg */   \
 67         (_regs)->regs[2] = 0;                                           \
 68         (_regs)->regs[3] = 0; /* ABIV2 is R7, use it? */                \
 69         (_regs)->sr &= ~PS_S;                                           \
 70         (_regs)->usp = (_usp);                                          \
 71 } while (0)
 72 
 73 /* Forward declaration, a strange C thing */
 74 struct task_struct;
 75 
 76 /* Free all resources held by a thread. */
 77 static inline void release_thread(struct task_struct *dead_task)
 78 {
 79 }
 80 
 81 /* Prepare to copy thread state - unlazy all lazy status */
 82 #define prepare_to_copy(tsk)    do { } while (0)
 83 
 84 extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
 85 
 86 #define copy_segments(tsk, mm)          do { } while (0)
 87 #define release_segments(mm)            do { } while (0)
 88 #define forget_segments()               do { } while (0)
 89 
 90 extern unsigned long thread_saved_pc(struct task_struct *tsk);
 91 
 92 unsigned long get_wchan(struct task_struct *p);
 93 
 94 #define KSTK_EIP(tsk)           (task_pt_regs(tsk)->pc)
 95 #define KSTK_ESP(tsk)           (task_pt_regs(tsk)->usp)
 96 
 97 #define task_pt_regs(p) \
 98         ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
 99 
100 #define cpu_relax() barrier()
101 
102 #endif /* __ASM_CSKY_PROCESSOR_H */
103 

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