]> granicus.if.org Git - strace/commitdiff
Rename ia32 to ia64_ia32mode, and make it bool, not long
authorDenys Vlasenko <dvlasenk@redhat.com>
Mon, 1 Jul 2013 10:28:17 +0000 (12:28 +0200)
committerDenys Vlasenko <dvlasenk@redhat.com>
Mon, 1 Jul 2013 10:28:17 +0000 (12:28 +0200)
Grepping for just ia32 was turning up many false positives.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
defs.h
syscall.c
util.c

diff --git a/defs.h b/defs.h
index 3b027e8472c393abace0a7b9b11f030178b5e2ef..807a29045945cdec6a80b9d508828d6c79762302 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -381,7 +381,7 @@ struct arm_pt_regs {
 #if defined(I386)
 extern struct user_regs_struct i386_regs;
 #elif defined(IA64)
-extern long ia32;
+extern bool ia64_ia32mode;
 #elif defined(SPARC) || defined(SPARC64)
 extern struct pt_regs sparc_regs;
 #elif defined(ARM)
index 105b28c99cee6450c15057e51eee5192e8d84516..d6f2692764f804f5d8ef06be068bf3fdf2cf98da 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -720,7 +720,7 @@ static struct iovec x86_io = {
        .iov_base = &x86_regs_union
 };
 #elif defined(IA64)
-long ia32 = 0; /* not static */
+bool ia64_ia32mode = 0; /* not static */
 static long ia64_r8, ia64_r10;
 #elif defined(POWERPC)
 struct pt_regs ppc_regs;
@@ -1322,8 +1322,8 @@ get_scno(struct tcb *tcp)
 #      define IA64_PSR_IS      ((long)1 << 34)
        long psr;
        if (upeek(tcp->pid, PT_CR_IPSR, &psr) >= 0)
-               ia32 = (psr & IA64_PSR_IS) != 0;
-       if (ia32) {
+               ia64_ia32mode = ((psr & IA64_PSR_IS) != 0);
+       if (ia64_ia32mode) {
                if (upeek(tcp->pid, PT_R1, &scno) < 0)
                        return -1;
        } else {
@@ -1619,7 +1619,7 @@ syscall_fixup_on_sysenter(struct tcb *tcp)
                return -1;
        if (upeek(tcp->pid, PT_R8, &ia64_r8) < 0)
                return -1;
-       if (ia32 && ia64_r8 != -ENOSYS) {
+       if (ia64_ia32mode && ia64_r8 != -ENOSYS) {
                if (debug_flag)
                        fprintf(stderr, "not a syscall entry (r8 = %ld)\n", ia64_r8);
                return 0;
@@ -1745,7 +1745,7 @@ get_syscall_args(struct tcb *tcp)
                if (upeek(tcp->pid, REG_A0+i, &tcp->u_arg[i]) < 0)
                        return -1;
 #elif defined(IA64)
-       if (!ia32) {
+       if (!ia64_ia32mode) {
                unsigned long *out0, cfm, sof, sol;
                long rbs_end;
                /* be backwards compatible with kernel < 2.4.4... */
@@ -2078,7 +2078,7 @@ get_syscall_result(struct tcb *tcp)
 #      define IA64_PSR_IS      ((long)1 << 34)
        long psr;
        if (upeek(tcp->pid, PT_CR_IPSR, &psr) >= 0)
-               ia32 = (psr & IA64_PSR_IS) != 0;
+               ia64_ia32mode = ((psr & IA64_PSR_IS) != 0);
        if (upeek(tcp->pid, PT_R8, &ia64_r8) < 0)
                return -1;
        if (upeek(tcp->pid, PT_R10, &ia64_r10) < 0)
@@ -2264,7 +2264,7 @@ get_error(struct tcb *tcp)
                tcp->u_lrval = rax;
        }
 #elif defined(IA64)
-       if (ia32) {
+       if (ia64_ia32mode) {
                int err;
 
                err = (int)ia64_r8;
diff --git a/util.c b/util.c
index 8878ccf4546d1ffa0c07f7a9e27569bd41b12400..db376b33cc66d85cf7e414da5e64f8f845fa0c9e 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1106,7 +1106,7 @@ arg_setup(struct tcb *tcp, arg_setup_state *state)
        unsigned long cfm, sof, sol;
        long bsp;
 
-       if (ia32) {
+       if (ia64_ia32mode) {
                /* Satisfy a false GCC warning.  */
                *state = NULL;
                return 0;
@@ -1132,7 +1132,7 @@ get_arg0(struct tcb *tcp, arg_setup_state *state, long *valp)
 {
        int ret;
 
-       if (ia32)
+       if (ia64_ia32mode)
                ret = upeek(tcp->pid, PT_R11, valp);
        else
                ret = umoven(tcp,
@@ -1146,7 +1146,7 @@ get_arg1(struct tcb *tcp, arg_setup_state *state, long *valp)
 {
        int ret;
 
-       if (ia32)
+       if (ia64_ia32mode)
                ret = upeek(tcp->pid, PT_R9, valp);
        else
                ret = umoven(tcp,
@@ -1161,7 +1161,7 @@ set_arg0(struct tcb *tcp, arg_setup_state *state, long val)
        int req = PTRACE_POKEDATA;
        void *ap;
 
-       if (ia32) {
+       if (ia64_ia32mode) {
                ap = (void *) (intptr_t) PT_R11;         /* r11 == EBX */
                req = PTRACE_POKEUSER;
        } else
@@ -1177,7 +1177,7 @@ set_arg1(struct tcb *tcp, arg_setup_state *state, long val)
        int req = PTRACE_POKEDATA;
        void *ap;
 
-       if (ia32) {
+       if (ia64_ia32mode) {
                ap = (void *) (intptr_t) PT_R9;         /* r9 == ECX */
                req = PTRACE_POKEUSER;
        } else
@@ -1343,7 +1343,7 @@ change_syscall(struct tcb *tcp, arg_setup_state *state, int new)
        /* setbpt/clearbpt never used: */
        /* Blackfin is only supported since about linux-2.6.23 */
 #elif defined(IA64)
-       if (ia32) {
+       if (ia64_ia32mode) {
                switch (new) {
                case 2:
                        break;  /* x86 SYS_fork */