Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Joe deBlaquiere <jadb@redhat.com>
To: Ralf Baechle <ralf@oss.sgi.com>
Cc: Florian Lohoff <flo@rfc822.org>, linux-mips@oss.sgi.com
Subject: Re: [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_from_sys_call
Date: Thu, 25 Jan 2001 18:53:44 -0600	[thread overview]
Message-ID: <3A70CA98.102@redhat.com> (raw)
In-Reply-To: 20010125141952.C2311@bacchus.dhis.org

Ralf,
	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!)

#ifdef CONFIG_CPU_VR41XX
	/* 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 */
		save_and_cli(flags);
		tmp = *p ;
		*p = arg2 ;
		restore_flags(flags);
		return tmp;

	}
#endif

The trailer in the normal call is like :

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

		__asm__ __volatile__(
			"move\t$29, %0\n\t"
			"j\tret_from_sys_call"
			: /* 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 Vr4181...it's 
certainly an interesting task so far...

Ralf Baechle wrote:

> On Thu, Jan 25, 2001 at 01:35:23PM -0600, Joe deBlaquiere wrote:
> 
> 
>> sysmips(MIPS_ATOMIC_SET,ptr,val)
>> {
>> 	 *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;
> }
> 
>    Ralf


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

  reply	other threads:[~2001-01-26  0:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-24 15:30 OOps - very obscure Florian Lohoff
2001-01-24 15:59 ` Florian Lohoff
2001-01-24 16:22   ` Florian Lohoff
2001-01-24 21:18   ` Keith Owens
2001-01-25 12:43   ` Florian Lohoff
2001-01-25 18:59     ` Jun Sun
2001-01-25 19:22       ` Florian Lohoff
2001-01-25 15:55   ` [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_from_sys_call Florian Lohoff
2001-01-25 15:55     ` Florian Lohoff
2001-01-25 16:34     ` Origin 200 crash nick
2001-01-25 18:28     ` [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_from_sys_call Joe deBlaquiere
2001-01-25 19:35       ` Joe deBlaquiere
2001-01-25 22:19         ` Ralf Baechle
2001-01-26  0:53           ` Joe deBlaquiere [this message]
2001-01-26 10:21             ` Maciej W. Rozycki
2001-01-26 15:41               ` Joe deBlaquiere
2001-01-26 21:16                 ` Ralf Baechle
2001-01-27  7:20                 ` Maciej W. Rozycki
2001-01-26 21:15               ` Ralf Baechle
2001-01-27  7:28                 ` Maciej W. Rozycki
2001-01-27 19:42                   ` Ralf Baechle
2001-01-29 15:03                     ` Maciej W. Rozycki
2001-01-26 20:01             ` Jun Sun
2001-01-26 20:38               ` Joe deBlaquiere
2001-01-26 21:02                 ` Jun Sun
2001-04-04 22:13           ` Florian Lohoff
2001-02-19 13:11     ` strace sysmips support (was: Re: [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_from_sys_call) Wichert Akkerman
2001-02-19 19:52       ` newbie question Can Altineller
2001-02-20  7:06         ` David Jez
2001-02-20 20:26           ` Mike McDonald
2001-02-20 20:30             ` nick
2001-02-20 20:53             ` Ralf Baechle
2001-02-20 20:41       ` strace sysmips support (was: Re: [FIX] sysmips(MIPS_ATMIC_SET, ...) ret_from_sys_call vs. o32_ret_from_sys_call) Ralf Baechle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3A70CA98.102@redhat.com \
    --to=jadb@redhat.com \
    --cc=flo@rfc822.org \
    --cc=linux-mips@oss.sgi.com \
    --cc=ralf@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox