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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux