[Kgdb-bugreport] 2.6.23-rc3-mm1: kgdb build failure on powerpc

Jason Wessel jason.wessel at windriver.com
Thu Aug 23 08:44:12 EST 2007


Andrew Morton wrote:
> On Wed, 22 Aug 2007 21:04:28 +0200
> Mariusz Kozlowski <m.kozlowski at tuxland.pl> wrote:
>
>   
>> Hello,
>>
>> 	Got that on imac g3.
>>
>>   CC      kernel/kgdb.o
>> kernel/kgdb.c: In function 'kgdb_handle_exception':
>> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
>> kernel/kgdb.c:940: warning: type defaults to 'int' in declaration of '_o_'
>> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
>> kernel/kgdb.c:940: warning: type defaults to 'int' in declaration of '_n_'
>> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
>> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
>> kernel/kgdb.c:940: error: invalid lvalue in unary '&'
>> kernel/kgdb.c:940: warning: type defaults to 'int' in declaration of 'type name'
>> make[1]: *** [kernel/kgdb.o] Blad 1
>> make: *** [kernel] Blad 2
>>
>>     
>
>   
Against the tip of the kernel + kgdb patches this config builds.  I 
wonder if is the compiler or the macros for atomic_read or cmpxchg have 
changed for in the -mm tree.  Perhaps it is not relevant though if you 
read on.
> I'm not surprised.
>
> 	while (cmpxchg(&atomic_read(&debugger_active), 0, (procid + 1)) != 0) {
>
> a) cmpxchg isn't available on all architectures
>
>   
It was available for all the archs that the kgdb had been implemented on 
at the time.
> b) we can't just go and take the address of atomic_read()'s return value!
>
>   
Perhaps yes, perhaps no I guess it depends on what actually gets 
generated...  In the past the intent of this was to guard for the race 
to be the master processor and looked like some attempt to do it 
atomically.  This code had been in use for a number of years at this point.
> c) that's pretty ugly-looking stuff anyway.
>
>   

Perhaps there is a cleaner way to do the same thing and avoid the 
cmpxchg all together.  I used the attached patch to eliminate the 
cmpxchg operation.


Jason.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kgdb_enter_atomic.patch
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070822/565b736f/attachment.asc>


More information about the Linuxppc-dev mailing list