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

TOMOYO Linux Cross Reference
Linux/arch/sparc/include/asm/processor_32.h

Version: ~ [ linux-6.1-rc7 ] ~ [ linux-6.0.10 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.80 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.156 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.225 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.267 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.300 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.334 ] ~ [ 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 /* include/asm/processor.h
  3  *
  4  * Copyright (C) 1994 David S. Miller (davem@caip.rutgers.edu)
  5  */
  6 
  7 #ifndef __ASM_SPARC_PROCESSOR_H
  8 #define __ASM_SPARC_PROCESSOR_H
  9 
 10 #include <asm/psr.h>
 11 #include <asm/ptrace.h>
 12 #include <asm/head.h>
 13 #include <asm/signal.h>
 14 #include <asm/page.h>
 15 
 16 /* Whee, this is STACK_TOP + PAGE_SIZE and the lowest kernel address too...
 17  * That one page is used to protect kernel from intruders, so that
 18  * we can make our access_ok test faster
 19  */
 20 #define TASK_SIZE       PAGE_OFFSET
 21 #ifdef __KERNEL__
 22 #define STACK_TOP       (PAGE_OFFSET - PAGE_SIZE)
 23 #define STACK_TOP_MAX   STACK_TOP
 24 #endif /* __KERNEL__ */
 25 
 26 struct task_struct;
 27 
 28 #ifdef __KERNEL__
 29 struct fpq {
 30         unsigned long *insn_addr;
 31         unsigned long insn;
 32 };
 33 #endif
 34 
 35 typedef struct {
 36         int seg;
 37 } mm_segment_t;
 38 
 39 /* The Sparc processor specific thread struct. */
 40 struct thread_struct {
 41         struct pt_regs *kregs;
 42         unsigned int _pad1;
 43 
 44         /* Special child fork kpsr/kwim values. */
 45         unsigned long fork_kpsr __attribute__ ((aligned (8)));
 46         unsigned long fork_kwim;
 47 
 48         /* Floating point regs */
 49         unsigned long   float_regs[32] __attribute__ ((aligned (8)));
 50         unsigned long   fsr;
 51         unsigned long   fpqdepth;
 52         struct fpq      fpqueue[16];
 53         unsigned long flags;
 54         mm_segment_t current_ds;
 55 };
 56 
 57 #define SPARC_FLAG_KTHREAD      0x1    /* task is a kernel thread */
 58 #define SPARC_FLAG_UNALIGNED    0x2    /* is allowed to do unaligned accesses */
 59 
 60 #define INIT_THREAD  { \
 61         .flags = SPARC_FLAG_KTHREAD, \
 62         .current_ds = KERNEL_DS, \
 63 }
 64 
 65 /* Do necessary setup to start up a newly executed thread. */
 66 static inline void start_thread(struct pt_regs * regs, unsigned long pc,
 67                                     unsigned long sp)
 68 {
 69         register unsigned long zero asm("g1");
 70 
 71         regs->psr = (regs->psr & (PSR_CWP)) | PSR_S;
 72         regs->pc = ((pc & (~3)) - 4);
 73         regs->npc = regs->pc + 4;
 74         regs->y = 0;
 75         zero = 0;
 76         __asm__ __volatile__("std\t%%g0, [%0 + %3 + 0x00]\n\t"
 77                              "std\t%%g0, [%0 + %3 + 0x08]\n\t"
 78                              "std\t%%g0, [%0 + %3 + 0x10]\n\t"
 79                              "std\t%%g0, [%0 + %3 + 0x18]\n\t"
 80                              "std\t%%g0, [%0 + %3 + 0x20]\n\t"
 81                              "std\t%%g0, [%0 + %3 + 0x28]\n\t"
 82                              "std\t%%g0, [%0 + %3 + 0x30]\n\t"
 83                              "st\t%1, [%0 + %3 + 0x38]\n\t"
 84                              "st\t%%g0, [%0 + %3 + 0x3c]"
 85                              : /* no outputs */
 86                              : "r" (regs),
 87                                "r" (sp - sizeof(struct reg_window32)),
 88                                "r" (zero),
 89                                "i" ((const unsigned long)(&((struct pt_regs *)0)->u_regs[0]))
 90                              : "memory");
 91 }
 92 
 93 /* Free all resources held by a thread. */
 94 #define release_thread(tsk)             do { } while(0)
 95 
 96 unsigned long get_wchan(struct task_struct *);
 97 
 98 #define task_pt_regs(tsk) ((tsk)->thread.kregs)
 99 #define KSTK_EIP(tsk)  ((tsk)->thread.kregs->pc)
100 #define KSTK_ESP(tsk)  ((tsk)->thread.kregs->u_regs[UREG_FP])
101 
102 #ifdef __KERNEL__
103 
104 extern struct task_struct *last_task_used_math;
105 int do_mathemu(struct pt_regs *regs, struct task_struct *fpt);
106 
107 #define cpu_relax()     barrier()
108 
109 extern void (*sparc_idle)(void);
110 
111 #endif
112 
113 #endif /* __ASM_SPARC_PROCESSOR_H */
114 

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