linux-mips
[Top] [All Lists]

Re: [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_fro

To: Ralf Baechle <ralf@oss.sgi.com>
Subject: Re: [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_from_sys_call
From: Florian Lohoff <flo@rfc822.org>
Date: Thu, 5 Apr 2001 00:13:29 +0200
Cc: linux-mips@oss.sgi.com
In-reply-to: <20010125141952.C2311@bacchus.dhis.org>; from ralf@oss.sgi.com on Thu, Jan 25, 2001 at 02:19:52PM -0800
Organization: rfc822 - pure communication
References: <20010124163048.B15348@paradigm.rfc822.org> <20010124165919.C15348@paradigm.rfc822.org> <20010125165530.B12576@paradigm.rfc822.org> <3A70705C.5020600@redhat.com> <3A707FFB.60802@redhat.com> <20010125141952.C2311@bacchus.dhis.org>
Sender: owner-linux-mips@oss.sgi.com
User-agent: Mutt/1.3.15i
On Thu, Jan 25, 2001 at 02:19:52PM -0800, Ralf Baechle wrote:
> It's more:
> 
> sysmips(MIPS_ATOMIC_SET, ptr, val)
> {
>       result = *ptr;
>       *ptr = val;
> 
>       return result;
> }

If thats the case - shouldnt the attached patch fix the sysmips stuff ?
I stumbled once again over sysmips - To get a MIPS ISA I compatible
glibc 2.2.2 you need to compile it with sysmips(MIPS_ATOMIC_SET, ...)
which breaks badly with "Illegal Instruction" on current cvs kernels.


Index: arch/mips/kernel/sysmips.c
===================================================================
RCS file: /cvs/linux/arch/mips/kernel/sysmips.c,v
retrieving revision 1.17
diff -u -r1.17 sysmips.c
--- arch/mips/kernel/sysmips.c  2001/02/09 21:05:46     1.17
+++ arch/mips/kernel/sysmips.c  2001/04/04 22:09:18
@@ -75,7 +75,6 @@
        }
 
        case MIPS_ATOMIC_SET: {
-               unsigned int tmp;
 
                p = (int *) arg1;
                errno = verify_area(VERIFY_WRITE, p, sizeof(*p));
@@ -98,7 +97,7 @@
                        ".word\t1b, 3b\n\t"
                        ".word\t2b, 3b\n\t"
                        ".previous\n\t"
-                       : "=&r" (tmp), "=o" (* (u32 *) p), "=r" (errno)
+                       : "=&r" (retval), "=o" (* (u32 *) p), "=r" (errno)
                        : "r" (arg2), "o" (* (u32 *) p), "2" (errno)
                        : "$1");
 
@@ -109,15 +108,7 @@
                if (current->ptrace & PT_TRACESYS)
                        syscall_trace();
 
-               ((struct pt_regs *)&cmd)->regs[2] = tmp;
-               ((struct pt_regs *)&cmd)->regs[7] = 0;
-
-               __asm__ __volatile__(
-                       "move\t$29, %0\n\t"
-                       "j\to32_ret_from_sys_call"
-                       : /* No outputs */
-                       : "r" (&cmd));
-               /* Unreached */
+               goto out;
        }
 
        case MIPS_FIXADE:


What makes me wonder is that we try to return -EFAULT and stuff
which then limits the values for MIPS_ATOMIC_SET to positive ints. 
I dont think this is correct.

Comments ?

Flo
-- 
Florian Lohoff                  flo@rfc822.org             +49-5201-669912
     Why is it called "common sense" when nobody seems to have any?


<Prev in Thread] Current Thread [Next in Thread>
  • Re: [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_from_sys_call, Florian Lohoff <=