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

TOMOYO Linux Cross Reference
Linux/arch/csky/include/asm/processor.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 */
  2 
  3 #ifndef __ASM_CSKY_PROCESSOR_H
  4 #define __ASM_CSKY_PROCESSOR_H
  5 
  6 #include <linux/bitops.h>
  7 #include <linux/cache.h>
  8 #include <asm/ptrace.h>
  9 #include <asm/current.h>
 10 #include <abi/reg_ops.h>
 11 #include <abi/regdef.h>
 12 #include <abi/switch_context.h>
 13 #ifdef CONFIG_CPU_HAS_FPU
 14 #include <abi/fpu.h>
 15 #endif
 16 
 17 struct cpuinfo_csky {
 18         unsigned long asid_cache;
 19 } __aligned(SMP_CACHE_BYTES);
 20 
 21 extern struct cpuinfo_csky cpu_data[];
 22 
 23 /*
 24  * User space process size: 2GB. This is hardcoded into a few places,
 25  * so don't change it unless you know what you are doing.  TASK_SIZE
 26  * for a 64 bit kernel expandable to 8192EB, of which the current CSKY
 27  * implementations will "only" be able to use 1TB ...
 28  */
 29 #define TASK_SIZE       (PAGE_OFFSET - (PAGE_SIZE * 8))
 30 
 31 #ifdef __KERNEL__
 32 #define STACK_TOP       TASK_SIZE
 33 #define STACK_TOP_MAX   STACK_TOP
 34 #endif
 35 
 36 /* This decides where the kernel will search for a free chunk of vm
 37  * space during mmap's.
 38  */
 39 #define TASK_UNMAPPED_BASE      (TASK_SIZE / 3)
 40 
 41 struct thread_struct {
 42         unsigned long  sp;        /* kernel stack pointer */
 43         unsigned long  trap_no;   /* saved status register */
 44 
 45         /* FPU regs */
 46         struct user_fp __aligned(16) user_fp;
 47 };
 48 
 49 #define INIT_THREAD  { \
 50         .sp = sizeof(init_stack) + (unsigned long) &init_stack, \
 51 }
 52 
 53 /*
 54  * Do necessary setup to start up a newly executed thread.
 55  *
 56  * pass the data segment into user programs if it exists,
 57  * it can't hurt anything as far as I can tell
 58  */
 59 #define start_thread(_regs, _pc, _usp)                                  \
 60 do {                                                                    \
 61         (_regs)->pc = (_pc);                                            \
 62         (_regs)->regs[1] = 0; /* ABIV1 is R7, uClibc_main rtdl arg */   \
 63         (_regs)->regs[2] = 0;                                           \
 64         (_regs)->regs[3] = 0; /* ABIV2 is R7, use it? */                \
 65         (_regs)->sr &= ~PS_S;                                           \
 66         (_regs)->usp = (_usp);                                          \
 67 } while (0)
 68 
 69 /* Forward declaration, a strange C thing */
 70 struct task_struct;
 71 
 72 /* Prepare to copy thread state - unlazy all lazy status */
 73 #define prepare_to_copy(tsk)    do { } while (0)
 74 
 75 unsigned long __get_wchan(struct task_struct *p);
 76 
 77 #define KSTK_EIP(tsk)           (task_pt_regs(tsk)->pc)
 78 #define KSTK_ESP(tsk)           (task_pt_regs(tsk)->usp)
 79 
 80 #define task_pt_regs(p) \
 81         ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1)
 82 
 83 #define cpu_relax() barrier()
 84 
 85 register unsigned long current_stack_pointer __asm__("sp");
 86 
 87 #endif /* __ASM_CSKY_PROCESSOR_H */
 88 

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