From: Len B. <len...@in...> - 2004-03-30 20:06:32
|
I can make sure that ACPI checks implicitly or explicitly that CMPXCHG is available -- but I can't make sure that some other random part of the kernel which may not have been written yet does. So I'd rather that they not build, like ACPI didn't. BTW. CMPXCHG (486 and above) doesn't seem to be in CPUID, CMPXCHG8B is, but that starts with Pentium and above. Maybe simpler to rely on the implicit "check" that we did in previous releases... Earliest known ACPI implementation as on Pentium-1. cheers, -Len On Tue, 2004-03-30 at 13:30, Arkadiusz Miskiewicz wrote: > Dnia Tuesday 30 of March 2004 19:44, Len Brown napisa=B3: >=20 > > Luming has already taking a swing at this patch here: > > http://bugzilla.kernel.org/show_bug.cgi?id=3D2391 > Wouldn't be better to just remove #ifdef CONFIG_X86_CMPXCHG around __cm= pxchg()=20 > and cmpxchg macro in ./include/asm-i386/system.h so cmpxchg() would be = there=20 > always even on i386 but leave CONFIG_X86_CMPXCHG macro if anyone want's= to=20 > check for it in some code. No code duplication and you get what you nee= d. >=20 > It would be something like: >=20 > #ifdef CONFIG_X86_CMPXCHG > #define __HAVE_ARCH_CMPXCHG 1 > #endif > static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long= old, > unsigned long new, int size) > { > } > #define cmpxchg(ptr,o,n)\ > ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ > (unsigned long)(n),sizeof(*(ptr= )))) >=20 > instead of current: >=20 > #ifdef CONFIG_X86_CMPXCHG > #define __HAVE_ARCH_CMPXCHG 1 >=20 > static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long= old, > unsigned long new, int size) > { > } > #define cmpxchg(ptr,o,n)\ > ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\ > (unsigned long)(n),sizeof(*(ptr= )))) >=20 > #else > /* Compiling for a 386 proper. Is it worth implementing via cli/sti? = */ > #endif >=20 > ? >=20 > > thanks, > > -Len |