 ee3d250446
			
		
	
	
	ee3d250446
	
	
	
		
			
			Currently, perf fails to compile on powerpc with this error:
     CC util/header.o
 In file included from util/../perf.h:17,
                  from util/header.c:9:
 util/../../../arch/powerpc/include/asm/unistd.h:360:27: error:
 linux/linkage.h: No such file or directory make: ***
 [util/header.o] Error 1
The reason is that we still have a #define __KERNEL__ in effect
at the point where <asm/unistd.h> gets included, which means we
get extra stuff that we don't need or want.
This fixes the problem by undefining __KERNEL__ once we have
included the file for which we need __KERNEL__ defined.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <peterz@infradead.org>
LKML-Reference: <19211.24287.453183.78836@cargo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
		
	
			
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			758 B
			
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			758 B
			
		
	
	
	
		
			C
		
	
	
	
	
	
| #ifndef _PERF_LINUX_BITOPS_H_
 | |
| #define _PERF_LINUX_BITOPS_H_
 | |
| 
 | |
| #define __KERNEL__
 | |
| 
 | |
| #define CONFIG_GENERIC_FIND_NEXT_BIT
 | |
| #define CONFIG_GENERIC_FIND_FIRST_BIT
 | |
| #include "../../../../include/linux/bitops.h"
 | |
| 
 | |
| #undef __KERNEL__
 | |
| 
 | |
| static inline void set_bit(int nr, unsigned long *addr)
 | |
| {
 | |
| 	addr[nr / BITS_PER_LONG] |= 1UL << (nr % BITS_PER_LONG);
 | |
| }
 | |
| 
 | |
| static __always_inline int test_bit(unsigned int nr, const unsigned long *addr)
 | |
| {
 | |
| 	return ((1UL << (nr % BITS_PER_LONG)) &
 | |
| 		(((unsigned long *)addr)[nr / BITS_PER_LONG])) != 0;
 | |
| }
 | |
| 
 | |
| unsigned long generic_find_next_zero_le_bit(const unsigned long *addr, unsigned
 | |
| 		long size, unsigned long offset);
 | |
| 
 | |
| unsigned long generic_find_next_le_bit(const unsigned long *addr, unsigned
 | |
| 		long size, unsigned long offset);
 | |
| 
 | |
| #endif
 |