[Top] [All Lists]

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

To: Ralf Baechle <>
Subject: Re: [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_from_sys_call
From: Joe deBlaquiere <>
Date: Thu, 25 Jan 2001 18:53:44 -0600
Cc: Florian Lohoff <>,
Organization: Red Hat, Inc.
References: <> <> <> <> <> <>
User-agent: Mozilla/5.0 (X11; U; Linux 2.2.16-22 i686; en-US; m18) Gecko/20001107 Netscape6/6.0
Thanks for the help. I generally consider myself a pseudo-expert on Linux, but at the same time I'm amazed by how much I learn on a daily basis.

So I've got the following code which seems to work... (I can't use the ll/sc ops on the Vr41xx since they are not implemeted!)

        /* this version is inherently single processor! */
        case MIPS_ATOMIC_SET: {
                unsigned int tmp;
                unsigned long flags;

                p = (int *) arg1;
                errno = verify_area(VERIFY_WRITE, p, sizeof(*p));
                if (errno)
                        return errno;
                errno = 0;

                /* the Vr processors can't be SMP, so just lock ints */
                tmp = *p ;
                *p = arg2 ;
                return tmp;


The trailer in the normal call is like :

                /* We're skipping error handling etc.  */
                if (current->ptrace & PT_TRACESYS)

                __asm__ __volatile__(
                        "move\t$29, %0\n\t"
                        : /* No outputs */
                        : "r" (&cmd));
                /* Unreached */

Which says "no outputs" although sysmips is specified as

extern int sysmips __P ((__const cmd, __const int arg1,
                         __const int arg2, __const int arg3));

and the usage of this call in glibc pthreads implies that there should be a return value. Should I be bypassing the scheduler to return also?

The end goal of this is to make pthreads work on the's certainly an interesting task so far...

Ralf Baechle wrote:

On Thu, Jan 25, 2001 at 01:35:23PM -0600, Joe deBlaquiere wrote:

         *ptr = val ;
        val 0 ;

but it is an atomic operation

if this correct in a pseudo-code sense?

It's more:

sysmips(MIPS_ATOMIC_SET, ptr, val)
        result = *ptr;
        *ptr = val;

        return result;


Joe deBlaquiere
Red Hat, Inc.
307 Wynn Drive
Huntsville AL, 35805
voice : (256)-704-9200
fax   : (256)-837-3839

<Prev in Thread] Current Thread [Next in Thread>