From de4f6e5b41bef50fc981410ae8380f27f4e93bf8 Mon Sep 17 00:00:00 2001 From: Chris Zankel Date: Thu, 31 May 2007 17:47:01 -0700 Subject: [XTENSA] clean-up header files The header files in the asm-xtensa directory are not clean and 'make headers_check' fails. This is a first patch to fix most of the header files. It removes unnecessary include statements and adds some that are required for building the kernel. The linker script required some updates or the linking stage would fail. Signed-off-by: Chris Zankel --- include/asm-xtensa/bitops.h | 15 ++++++++------- include/asm-xtensa/byteorder.h | 3 ++- include/asm-xtensa/mmu_context.h | 1 + include/asm-xtensa/page.h | 2 +- include/asm-xtensa/param.h | 4 +--- include/asm-xtensa/ptrace.h | 5 +++-- include/asm-xtensa/shmparam.h | 2 -- include/asm-xtensa/thread_info.h | 2 ++ 8 files changed, 18 insertions(+), 16 deletions(-) (limited to 'include/asm-xtensa') diff --git a/include/asm-xtensa/bitops.h b/include/asm-xtensa/bitops.h index 96303df..1c1e0d9 100644 --- a/include/asm-xtensa/bitops.h +++ b/include/asm-xtensa/bitops.h @@ -57,9 +57,6 @@ static inline int __ffs(unsigned long x) return 31 - __cntlz(x & -x); } - -#ifdef __KERNEL__ - /* * ffs: Find first bit set in word. This is defined the same way as * the libc and compiler builtin ffs routines, therefore @@ -97,11 +94,15 @@ static inline int fls (unsigned int x) #include #ifdef __XTENSA_EL__ -# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr),(addr)) -# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr),(addr)) +# define ext2_set_bit_atomic(lock,nr,addr) \ + test_and_set_bit((nr), (unsigned long*)(addr)) +# define ext2_clear_bit_atomic(lock,nr,addr) \ + test_and_clear_bit((nr), (unsigned long*)(addr)) #elif defined(__XTENSA_EB__) -# define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr) ^ 0x18, (addr)) -# define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr)^0x18,(addr)) +# define ext2_set_bit_atomic(lock,nr,addr) \ + test_and_set_bit((nr) ^ 0x18, (unsigned long*)(addr)) +# define ext2_clear_bit_atomic(lock,nr,addr) \ + test_and_clear_bit((nr) ^ 0x18, (unsigned long*)(addr)) #else # error processor byte order undefined! #endif diff --git a/include/asm-xtensa/byteorder.h b/include/asm-xtensa/byteorder.h index 0f540a5..765edf1 100644 --- a/include/asm-xtensa/byteorder.h +++ b/include/asm-xtensa/byteorder.h @@ -12,6 +12,7 @@ #define _XTENSA_BYTEORDER_H #include +#include static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) { @@ -78,4 +79,4 @@ static __inline__ __attribute_const__ __u16 ___arch__swab16(__u16 x) # error processor byte order undefined! #endif -#endif /* __ASM_XTENSA_BYTEORDER_H */ +#endif /* _XTENSA_BYTEORDER_H */ diff --git a/include/asm-xtensa/mmu_context.h b/include/asm-xtensa/mmu_context.h index 92f9483..c0fd8e5 100644 --- a/include/asm-xtensa/mmu_context.h +++ b/include/asm-xtensa/mmu_context.h @@ -14,6 +14,7 @@ #define _XTENSA_MMU_CONTEXT_H #include +#include #include #include diff --git a/include/asm-xtensa/page.h b/include/asm-xtensa/page.h index c631d00..1213cde 100644 --- a/include/asm-xtensa/page.h +++ b/include/asm-xtensa/page.h @@ -131,6 +131,6 @@ void copy_user_page(void *to,void* from,unsigned long vaddr,struct page* page); #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) -#endif /* __KERNEL__ */ #include +#endif /* __KERNEL__ */ #endif /* _XTENSA_PAGE_H */ diff --git a/include/asm-xtensa/param.h b/include/asm-xtensa/param.h index 6f28139..ce3a336 100644 --- a/include/asm-xtensa/param.h +++ b/include/asm-xtensa/param.h @@ -11,15 +11,13 @@ #ifndef _XTENSA_PARAM_H #define _XTENSA_PARAM_H -#include - #ifdef __KERNEL__ # define HZ 100 /* internal timer frequency */ # define USER_HZ 100 /* for user interfaces in "ticks" */ # define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */ #endif -#define EXEC_PAGESIZE (1 << XCHAL_MMU_MIN_PTE_PAGE_SIZE) +#define EXEC_PAGESIZE 4096 #ifndef NGROUPS #define NGROUPS 32 diff --git a/include/asm-xtensa/ptrace.h b/include/asm-xtensa/ptrace.h index 1b7fe36..cad83e8 100644 --- a/include/asm-xtensa/ptrace.h +++ b/include/asm-xtensa/ptrace.h @@ -11,8 +11,6 @@ #ifndef _XTENSA_PTRACE_H #define _XTENSA_PTRACE_H -#include - /* * Kernel stack * @@ -113,6 +111,9 @@ struct pt_regs { }; #ifdef __KERNEL__ + +#include + # define task_pt_regs(tsk) ((struct pt_regs*) \ (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) # define user_mode(regs) (((regs)->ps & 0x00000020)!=0) diff --git a/include/asm-xtensa/shmparam.h b/include/asm-xtensa/shmparam.h index d3b65bf..c8cc16c 100644 --- a/include/asm-xtensa/shmparam.h +++ b/include/asm-xtensa/shmparam.h @@ -9,8 +9,6 @@ #ifndef _XTENSA_SHMPARAM_H #define _XTENSA_SHMPARAM_H -#include - /* * Xtensa can have variable size caches, and if * the size of single way is larger than the page size, diff --git a/include/asm-xtensa/thread_info.h b/include/asm-xtensa/thread_info.h index 5ae34ab..3fa2979 100644 --- a/include/asm-xtensa/thread_info.h +++ b/include/asm-xtensa/thread_info.h @@ -116,6 +116,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ #define TIF_IRET 5 /* return with iret */ #define TIF_MEMDIE 6 +#define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal() */ #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define _TIF_SYSCALL_TRACE (1<