/* * arch/arm/include/asm/ptrace.h * * Copyright (C) 1996-2003 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef __ASM_ARM_PTRACE_H #define __ASM_ARM_PTRACE_H #include <uapi/asm/ptrace.h> #ifndef __ASSEMBLY__ #include <linux/types.h> struct pt_regs { unsigned long uregs[18]; }; struct svc_pt_regs { struct pt_regs regs; u32 dacr; u32 addr_limit; }; #define to_svc_pt_regs(r) container_of(r, struct svc_pt_regs, regs) #define user_mode(regs) \ (((regs)->ARM_cpsr & 0xf) == 0) #ifdef CONFIG_ARM_THUMB #define thumb_mode(regs) \ (((regs)->ARM_cpsr & PSR_T_BIT)) #else #define thumb_mode(regs) (0) #endif #ifndef CONFIG_CPU_V7M #define isa_mode(regs) \ ((((regs)->ARM_cpsr & PSR_J_BIT) >> (__ffs(PSR_J_BIT) - 1)) | \ (((regs)->ARM_cpsr & PSR_T_BIT) >> (__ffs(PSR_T_BIT)))) #else #define isa_mode(regs) 1 /* Thumb */ #endif #define processor_mode(regs) \ ((regs)->ARM_cpsr & MODE_MASK) #define interrupts_enabled(regs) \ (!((regs)->ARM_cpsr & PSR_I_BIT)) #define fast_interrupts_enabled(regs) \ (!((regs)->ARM_cpsr & PSR_F_BIT)) /* Are the current registers suitable for user mode? * (used to maintain security in signal handlers) */
static inline int valid_user_regs(struct pt_regs *regs) { #ifndef CONFIG_CPU_V7M unsigned long mode = regs->ARM_cpsr & MODE_MASK; /* * Always clear the F (FIQ) and A (delayed abort) bits */ regs->ARM_cpsr &= ~(PSR_F_BIT | PSR_A_BIT); if ((regs->ARM_cpsr & PSR_I_BIT) == 0) { if (mode == USR_MODE) return 1; if (elf_hwcap & HWCAP_26BIT && mode == USR26_MODE) return 1; } /* * Force CPSR to something logical... */ regs->ARM_cpsr &= PSR_f | PSR_s | PSR_x | PSR_T_BIT | MODE32_BIT; if (!(elf_hwcap & HWCAP_26BIT)) regs->ARM_cpsr |= USR_MODE; return 0; #else /* ifndef CONFIG_CPU_V7M */ return 1; #endif }Contributors
Person | Tokens | Prop | Commits | CommitProp | |
russell king | russell king | 76 | 66.67% | 2 | 50.00% |
catalin marinas | catalin marinas | 38 | 33.33% | 2 | 50.00% |
Total | 114 | 100.00% | 4 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
nathaniel husted | nathaniel husted | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
david a. long | david a. long | 23 | 100.00% | 1 | 100.00% |
Total | 23 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
will deacon | will deacon | 46 | 100.00% | 1 | 100.00% |
Total | 46 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
will deacon | will deacon | 18 | 100.00% | 1 | 100.00% |
Total | 18 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
wade farnsworth | wade farnsworth | 18 | 100.00% | 1 | 100.00% |
Total | 18 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp | |
russell king | russell king | 159 | 31.12% | 8 | 29.63% |
will deacon | will deacon | 127 | 24.85% | 1 | 3.70% |
catalin marinas | catalin marinas | 40 | 7.83% | 2 | 7.41% |
pre-git | pre-git | 30 | 5.87% | 3 | 11.11% |
david a. long | david a. long | 23 | 4.50% | 1 | 3.70% |
nikolay borisov | nikolay borisov | 21 | 4.11% | 1 | 3.70% |
zwane mwaikambo | zwane mwaikambo | 18 | 3.52% | 1 | 3.70% |
wade farnsworth | wade farnsworth | 18 | 3.52% | 1 | 3.70% |
nathaniel husted | nathaniel husted | 17 | 3.33% | 1 | 3.70% |
uwe kleine-koenig | uwe kleine-koenig | 16 | 3.13% | 1 | 3.70% |
jamie iles | jamie iles | 12 | 2.35% | 1 | 3.70% |
jon medhurst | jon medhurst | 8 | 1.57% | 1 | 3.70% |
william lee irwin iii | william lee irwin iii | 7 | 1.37% | 1 | 3.70% |
george g. davis | george g. davis | 7 | 1.37% | 1 | 3.70% |
al viro | al viro | 6 | 1.17% | 1 | 3.70% |
behan webster | behan webster | 1 | 0.20% | 1 | 3.70% |
david howells | david howells | 1 | 0.20% | 1 | 3.70% |
Total | 511 | 100.00% | 27 | 100.00% |