On 21 February 2013 11:12, Markos Chandras <[email protected]> wrote: > From: Markos Chandras <[email protected]> > > This patch fixes a bug in sched_setaffinity() for Meta where the affinity > argument was ignored when trying to set a process's scheduling > affinity. > > INTERNAL_SYSCALL places its arguments in the argument registers in > preparation for a system call, e.g. > > register int arg1 __asm__ ("D1Ar1") = _arg1; > register int arg2 __asm__ ("D0Ar2") = _arg2; > > The problem comes when a function call is passed as an argment to > INTERNAL_SYSCALL and the following code results, > > register int arg1 __asm__ ("D1Ar1") = _arg1; > register int arg2 __asm__ ("D0Ar2") = _arg2; > register int arg3 __asm__ ("D1Ar3") = func(); > > Now, because the compiler is smart enough to figure out the argument > registers are not preserved across a function call, and that "func" > takes no arguments, the assignments to D1Ar1 and D0Ar2 are dead code > and the compiler eliminates them. Consequently, the syscall is > performed with garbage arguments in D1Ar1 and D0Ar2. > > The solution is to use a temporary variable in which we store the > result of func() and assign that temporary variable to D1Ar3.
Can't you use an immediate in your constraints? _______________________________________________ uClibc mailing list [email protected] http://lists.busybox.net/mailman/listinfo/uclibc
