Subject: cpu_has_llsc cleanup broke compilation.

From: "Kaj-Michael Lang" <[email-masked]>
Date: Tue, 17 Aug 2004 09:56:53 +0300

The "using cpu_has_llsc cleanup all users of ll/sc and lld/scd." broke
compilation:

  CC      arch/mips/kernel/offset.s
In file included from include/asm/bitops.h:35,
                 from include/linux/bitops.h:4,
                 from include/linux/thread_info.h:20,
                 from include/linux/spinlock.h:12,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from arch/mips/kernel/offset.c:14:
include/asm/system.h: In function `__xchg_u32':
include/asm/system.h:285: error: `cpu_data' undeclared (first use in this
function)
include/asm/system.h:285: error: (Each undeclared identifier is reported
only once
include/asm/system.h:285: error: for each function it appears in.)
include/asm/system.h:285: error: `MIPS_CPU_LLSC' undeclared (first use in
this function)
include/asm/system.h: In function `__cmpxchg_u32':
include/asm/system.h:382: error: `cpu_data' undeclared (first use in this
function)
include/asm/system.h:382: error: `MIPS_CPU_LLSC' undeclared (first use in
this function)
In file included from include/linux/bitops.h:4,
                 from include/linux/thread_info.h:20,
                 from include/linux/spinlock.h:12,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from arch/mips/kernel/offset.c:14:
include/asm/bitops.h: In function `set_bit':
include/asm/bitops.h:72: error: `cpu_data' undeclared (first use in this
function)
include/asm/bitops.h:72: error: `MIPS_CPU_LLSC' undeclared (first use in
this function)
include/asm/bitops.h: In function `clear_bit':
include/asm/bitops.h:124: error: `cpu_data' undeclared (first use in this
function)
include/asm/bitops.h:124: error: `MIPS_CPU_LLSC' undeclared (first use in
this function)
include/asm/bitops.h: In function `change_bit':
include/asm/bitops.h:172: error: `cpu_data' undeclared (first use in this
function)
include/asm/bitops.h:172: error: `MIPS_CPU_LLSC' undeclared (first use in
this function)
include/asm/bitops.h: In function `test_and_set_bit':
include/asm/bitops.h:223: error: `cpu_data' undeclared (first use in this
function)
include/asm/bitops.h:223: error: `MIPS_CPU_LLSC' undeclared (first use in
this function)
include/asm/bitops.h: In function `test_and_clear_bit':
include/asm/bitops.h:295: error: `cpu_data' undeclared (first use in this
function)
include/asm/bitops.h:295: error: `MIPS_CPU_LLSC' undeclared (first use in
this function)
include/asm/bitops.h: In function `test_and_change_bit':
include/asm/bitops.h:368: error: `cpu_data' undeclared (first use in this
function)
include/asm/bitops.h:368: error: `MIPS_CPU_LLSC' undeclared (first use in
this function)
In file included from include/asm/thread_info.h:16,
                 from include/linux/thread_info.h:21,
                 from include/linux/spinlock.h:12,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from arch/mips/kernel/offset.c:14:
include/asm/processor.h: At top level:
include/asm/processor.h:82: error: `cpu_data' used prior to declaration
make[1]: *** [arch/mips/kernel/offset.s] Error 1
make: *** [arch/mips/kernel/offset.s] Error 2
-- 
Kaj-Michael Lang , [email-masked]

---

From: Ralf Baechle <[email-masked]>
Date: Tue, 17 Aug 2004 09:43:07 +0200

>                  from include/linux/bitops.h:4,

Clearly a kernel bug - but one that also shows poor maintenance of your
target.  It should define cpu_has_llsc which it doesn't, so the kernel
will use generic code and deciede at runtime it should use ll/sc.  I'm
fixing this problem but you really should fix your target also.

  Ralf

---

From: "Kaj-Michael Lang" <[email-masked]>
Date: Tue, 17 Aug 2004 11:46:28 +0300

> target.  It should define cpu_has_llsc which it doesn't, so the kernel

It's IP32

> fixing this problem but you really should fix your target also.

If I knew what to do.. but I don't.. but trying to learn..