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

TOMOYO Linux Cross Reference
Linux/arch/arc/include/asm/ptrace.h

Version: ~ [ linux-5.12-rc1 ] ~ [ linux-5.11.2 ] ~ [ linux-5.10.19 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.101 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.177 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.222 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.258 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.258 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ 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.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  3  *
  4  * This program is free software; you can redistribute it and/or modify
  5  * it under the terms of the GNU General Public License version 2 as
  6  * published by the Free Software Foundation.
  7  *
  8  * Amit Bhor, Sameer Dhavale: Codito Technologies 2004
  9  */
 10 #ifndef __ASM_ARC_PTRACE_H
 11 #define __ASM_ARC_PTRACE_H
 12 
 13 #include <uapi/asm/ptrace.h>
 14 
 15 #ifndef __ASSEMBLY__
 16 
 17 /* THE pt_regs: Defines how regs are saved during entry into kernel */
 18 
 19 struct pt_regs {
 20 
 21         /* Real registers */
 22         long bta;       /* bta_l1, bta_l2, erbta */
 23 
 24         long lp_start, lp_end, lp_count;
 25 
 26         long status32;  /* status32_l1, status32_l2, erstatus */
 27         long ret;       /* ilink1, ilink2 or eret */
 28         long blink;
 29         long fp;
 30         long r26;       /* gp */
 31 
 32         long r12, r11, r10, r9, r8, r7, r6, r5, r4, r3, r2, r1, r0;
 33 
 34         long sp;        /* user/kernel sp depending on where we came from  */
 35         long orig_r0;
 36 
 37         /*
 38          * To distinguish bet excp, syscall, irq
 39          * For traps and exceptions, Exception Cause Register.
 40          *      ECR: <00> <VV> <CC> <PP>
 41          *      Last word used by Linux for extra state mgmt (syscall-restart)
 42          * For interrupts, use artificial ECR values to note current prio-level
 43          */
 44         union {
 45                 struct {
 46 #ifdef CONFIG_CPU_BIG_ENDIAN
 47                         unsigned long state:8, ecr_vec:8,
 48                                       ecr_cause:8, ecr_param:8;
 49 #else
 50                         unsigned long ecr_param:8, ecr_cause:8,
 51                                       ecr_vec:8, state:8;
 52 #endif
 53                 };
 54                 unsigned long event;
 55         };
 56 
 57         long user_r25;
 58 };
 59 
 60 /* Callee saved registers - need to be saved only when you are scheduled out */
 61 
 62 struct callee_regs {
 63         long r25, r24, r23, r22, r21, r20, r19, r18, r17, r16, r15, r14, r13;
 64 };
 65 
 66 #define instruction_pointer(regs)       ((regs)->ret)
 67 #define profile_pc(regs)                instruction_pointer(regs)
 68 
 69 /* return 1 if user mode or 0 if kernel mode */
 70 #define user_mode(regs) (regs->status32 & STATUS_U_MASK)
 71 
 72 #define user_stack_pointer(regs)\
 73 ({  unsigned int sp;            \
 74         if (user_mode(regs))    \
 75                 sp = (regs)->sp;\
 76         else                    \
 77                 sp = -1;        \
 78         sp;                     \
 79 })
 80 
 81 /* return 1 if PC in delay slot */
 82 #define delay_mode(regs) ((regs->status32 & STATUS_DE_MASK) == STATUS_DE_MASK)
 83 
 84 #define in_syscall(regs)    ((regs->ecr_vec == ECR_V_TRAP) && !regs->ecr_param)
 85 #define in_brkpt_trap(regs) ((regs->ecr_vec == ECR_V_TRAP) && regs->ecr_param)
 86 
 87 #define STATE_SCALL_RESTARTED   0x01
 88 
 89 #define syscall_wont_restart(reg) (reg->state |= STATE_SCALL_RESTARTED)
 90 #define syscall_restartable(reg) !(reg->state &  STATE_SCALL_RESTARTED)
 91 
 92 #define current_pt_regs()                                       \
 93 ({                                                              \
 94         /* open-coded current_thread_info() */                  \
 95         register unsigned long sp asm ("sp");                   \
 96         unsigned long pg_start = (sp & ~(THREAD_SIZE - 1));     \
 97         (struct pt_regs *)(pg_start + THREAD_SIZE) - 1; \
 98 })
 99 
100 static inline long regs_return_value(struct pt_regs *regs)
101 {
102         return regs->r0;
103 }
104 
105 #endif /* !__ASSEMBLY__ */
106 
107 #endif /* __ASM_PTRACE_H */
108 

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