View | Details | Raw Unified
Collapse All | Expand All

(-) linux-2.6.19.ppc/arch/powerpc/kernel/ppc_ksyms.c~ (+23 lines)
Line     Link Here 
On Thu, 2006-12-14 at 14:58 -0500, Kyle McMartin wrote:
On Thu, 2006-12-14 at 14:58 -0500, Kyle McMartin wrote:
| I posted a patch to Paul this week to fix this, 
| I posted a patch to Paul this week to fix this, 
Hm, I didn't see it on linuxppc-dev.
Hm, I didn't see it on linuxppc-dev.
| Since ppc32 can't do a 64bit comparison on its own it seems, gcc
| Since ppc32 can't do a 64bit comparison on its own it seems, gcc
| will generate a call to a helper function from libgcc. What other
| will generate a call to a helper function from libgcc. What other
| arches do is link libgcc.a into libs-y, and export the symbol
| arches do is link libgcc.a into libs-y, and export the symbol
| they want from it.
| they want from it.
You still get to 'accidentally' do 64-bit arithmetic in-kernel that way
You still get to 'accidentally' do 64-bit arithmetic in-kernel that way
though. Might be better just to provide __ucmpdi2, just as we have for
though. Might be better just to provide __ucmpdi2, just as we have for
the other functions which are required from libgcc 
the other functions which are required from libgcc 
It'd be better just to fix the compiler though -- which is in fact what
It'd be better just to fix the compiler though -- which is in fact what
they've done: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25724
they've done: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25724
              http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21237
              http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21237
I've applied this as a temporary hack to the Fedora kernel until the
I've applied this as a temporary hack to the Fedora kernel until the
compiler is updated there...
compiler is updated there...
 Lines 728-733   _GLOBAL(__lshrdi3) Link Here 
	or	r4,r4,r7	# LSW |= t2
	or	r4,r4,r7	# LSW |= t2
	blr
	blr
/*
 * __ucmpdi2: 64-bit comparison
 *
 * R3/R4 has 64 bit value A
 * R5/R6 has 64 bit value B
 * result in R3: 0 for A < B
 *		 1 for A == B
 *		 2 for A > B
 */
_GLOBAL(__ucmpdi2)
	cmplw	r7,r3,r5	# compare high words
	li	r3,0
	blt	r7,2f		# a < b ... return 0
	bgt	r7,1f		# a > b ... return 2
	cmplw	r6,r4,r6	# compare low words
	blt	r6,2f		# a < b ... return 0
	li	r3,1
	ble	r6,2f		# a = b ... return 1
1:	li	r3,2
2:	blr
_GLOBAL(abs)
_GLOBAL(abs)
	srawi	r4,r3,31
	srawi	r4,r3,31
	xor	r3,r3,r4
	xor	r3,r3,r4
 Lines 161-169   EXPORT_SYMBOL(to_tm); Link Here 
long long __ashrdi3(long long, int);
long long __ashrdi3(long long, int);
long long __ashldi3(long long, int);
long long __ashldi3(long long, int);
long long __lshrdi3(long long, int);
long long __lshrdi3(long long, int);
int __ucmpdi2(uint64_t, uint64_t);
EXPORT_SYMBOL(__ashrdi3);
EXPORT_SYMBOL(__ashrdi3);
EXPORT_SYMBOL(__ashldi3);
EXPORT_SYMBOL(__ashldi3);
EXPORT_SYMBOL(__lshrdi3);
EXPORT_SYMBOL(__lshrdi3);
EXPORT_SYMBOL(__ucmpdi2);
#endif
#endif
EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(memcpy);
-- 
-- 
dwmw2
dwmw2
-
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Please read the FAQ at  http://www.tux.org/lkml/