Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <chris@zankel.net>

+50 -63
+1
arch/xtensa/kernel/setup.c
··· 41 41 #include <asm/platform.h> 42 42 #include <asm/page.h> 43 43 #include <asm/setup.h> 44 + #include <asm/param.h> 44 45 45 46 #if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_DUMMY_CONSOLE) 46 47 struct screen_info screen_info = { 0, 24, 0, 0, 0, 80, 0, 0, 0, 24, 1, 16};
+31 -47
arch/xtensa/kernel/vmlinux.lds.S
··· 84 84 { 85 85 /* The .head.text section must be the first section! */ 86 86 *(.head.text) 87 - *(.literal) 88 - TEXT_TEXT 89 - *(.srom.text) 87 + *(.literal .text) 90 88 VMLINUX_SYMBOL(__sched_text_start) = .; 91 89 *(.sched.literal .sched.text) 92 90 VMLINUX_SYMBOL(__sched_text_end) = .; ··· 94 96 95 97 } 96 98 _etext = .; 99 + PROVIDE (etext = .); 97 100 98 101 . = ALIGN(16); 99 102 100 103 RODATA 101 104 102 105 /* Relocation table */ 103 - 104 - . = ALIGN(16); 105 - __boot_reloc_table_start = ABSOLUTE(.); 106 - 107 - __relocate : { 108 - 109 - RELOCATE_ENTRY(_WindowVectors_text, 110 - .WindowVectors.text); 111 - #if 0 112 - RELOCATE_ENTRY(_KernelExceptionVector_literal, 113 - .KernelExceptionVector.literal); 114 - #endif 115 - RELOCATE_ENTRY(_KernelExceptionVector_text, 116 - .KernelExceptionVector.text); 117 - #if 0 118 - RELOCATE_ENTRY(_UserExceptionVector_literal, 119 - .UserExceptionVector.literal); 120 - #endif 121 - RELOCATE_ENTRY(_UserExceptionVector_text, 122 - .UserExceptionVector.text); 123 - RELOCATE_ENTRY(_DoubleExceptionVector_literal, 124 - .DoubleExceptionVector.literal); 125 - RELOCATE_ENTRY(_DoubleExceptionVector_text, 126 - .DoubleExceptionVector.text); 127 - } 128 - __boot_reloc_table_end = ABSOLUTE(.) ; 129 106 130 107 .fixup : { *(.fixup) } 131 108 ··· 118 145 _fdata = .; 119 146 .data : 120 147 { 121 - DATA_DATA 122 - CONSTRUCTORS 148 + *(.data) CONSTRUCTORS 123 149 . = ALIGN(XCHAL_ICACHE_LINESIZE); 124 150 *(.data.cacheline_aligned) 125 151 } ··· 146 174 __tagtable_begin = .; 147 175 *(.taglist) 148 176 __tagtable_end = .; 177 + 178 + . = ALIGN(16); 179 + __boot_reloc_table_start = ABSOLUTE(.); 180 + 181 + RELOCATE_ENTRY(_WindowVectors_text, 182 + .WindowVectors.text); 183 + RELOCATE_ENTRY(_KernelExceptionVector_text, 184 + .KernelExceptionVector.text); 185 + RELOCATE_ENTRY(_UserExceptionVector_text, 186 + .UserExceptionVector.text); 187 + RELOCATE_ENTRY(_DoubleExceptionVector_literal, 188 + .DoubleExceptionVector.literal); 189 + RELOCATE_ENTRY(_DoubleExceptionVector_text, 190 + .DoubleExceptionVector.text); 191 + 192 + __boot_reloc_table_end = ABSOLUTE(.) ; 149 193 } 150 194 151 195 . = ALIGN(XCHAL_ICACHE_LINESIZE); ··· 182 194 183 195 SECURITY_INIT 184 196 185 - . = ALIGN(4); 186 - 187 - __start___ftr_fixup = .; 188 - __ftr_fixup : { *(__ftr_fixup) } 189 - __stop___ftr_fixup = .; 190 - 191 - . = ALIGN(4096); 192 - __per_cpu_start = .; 193 - .data.percpu : { *(.data.percpu) } 194 - __per_cpu_end = .; 195 197 196 198 #ifdef CONFIG_BLK_DEV_INITRD 197 199 . = ALIGN(4096); ··· 189 211 .init.ramfs : { *(.init.ramfs) } 190 212 __initramfs_end = .; 191 213 #endif 214 + 215 + . = ALIGN(4096); 216 + __per_cpu_start = .; 217 + .data.percpu : { *(.data.percpu) } 218 + __per_cpu_end = .; 219 + 192 220 193 221 /* We need this dummy segment here */ 194 222 ··· 257 273 258 274 /* BSS section */ 259 275 _bss_start = .; 260 - .sbss : { *(.sbss) *(.scommon) } 261 - .bss : { *(COMMON) *(.bss) } 276 + .bss : { *(.bss.page_aligned) *(.bss) } 262 277 _bss_end = .; 278 + 263 279 _end = .; 264 280 265 281 /* only used by the boot loader */ ··· 277 293 *(.ResetVector.text) 278 294 } 279 295 280 - 281 296 /* Sections to be discarded */ 282 297 /DISCARD/ : 283 298 { 284 - *(.text.exit) 285 - *(.text.exit.literal) 286 - *(.data.exit) 299 + *(.exit.literal .exit.text) 300 + *(.exit.data) 287 301 *(.exitcall.exit) 288 302 } 289 303 304 + .xt.lit : { *(.xt.lit) } 305 + .xt.prop : { *(.xt.prop) } 290 306 291 307 .debug 0 : { *(.debug) } 292 308 .line 0 : { *(.line) }
+8 -7
include/asm-xtensa/bitops.h
··· 57 57 return 31 - __cntlz(x & -x); 58 58 } 59 59 60 - 61 - #ifdef __KERNEL__ 62 - 63 60 /* 64 61 * ffs: Find first bit set in word. This is defined the same way as 65 62 * the libc and compiler builtin ffs routines, therefore ··· 94 97 #include <asm-generic/bitops/ext2-non-atomic.h> 95 98 96 99 #ifdef __XTENSA_EL__ 97 - # define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr),(addr)) 98 - # define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr),(addr)) 100 + # define ext2_set_bit_atomic(lock,nr,addr) \ 101 + test_and_set_bit((nr), (unsigned long*)(addr)) 102 + # define ext2_clear_bit_atomic(lock,nr,addr) \ 103 + test_and_clear_bit((nr), (unsigned long*)(addr)) 99 104 #elif defined(__XTENSA_EB__) 100 - # define ext2_set_bit_atomic(lock,nr,addr) test_and_set_bit((nr) ^ 0x18, (addr)) 101 - # define ext2_clear_bit_atomic(lock,nr,addr) test_and_clear_bit((nr)^0x18,(addr)) 105 + # define ext2_set_bit_atomic(lock,nr,addr) \ 106 + test_and_set_bit((nr) ^ 0x18, (unsigned long*)(addr)) 107 + # define ext2_clear_bit_atomic(lock,nr,addr) \ 108 + test_and_clear_bit((nr) ^ 0x18, (unsigned long*)(addr)) 102 109 #else 103 110 # error processor byte order undefined! 104 111 #endif
+2 -1
include/asm-xtensa/byteorder.h
··· 12 12 #define _XTENSA_BYTEORDER_H 13 13 14 14 #include <asm/types.h> 15 + #include <linux/compiler.h> 15 16 16 17 static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x) 17 18 { ··· 79 78 # error processor byte order undefined! 80 79 #endif 81 80 82 - #endif /* __ASM_XTENSA_BYTEORDER_H */ 81 + #endif /* _XTENSA_BYTEORDER_H */
+1
include/asm-xtensa/mmu_context.h
··· 14 14 #define _XTENSA_MMU_CONTEXT_H 15 15 16 16 #include <linux/stringify.h> 17 + #include <linux/sched.h> 17 18 18 19 #include <asm/pgtable.h> 19 20 #include <asm/cacheflush.h>
+1 -1
include/asm-xtensa/page.h
··· 131 131 #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ 132 132 VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) 133 133 134 - #endif /* __KERNEL__ */ 135 134 #include <asm-generic/memory_model.h> 135 + #endif /* __KERNEL__ */ 136 136 #endif /* _XTENSA_PAGE_H */
+1 -3
include/asm-xtensa/param.h
··· 11 11 #ifndef _XTENSA_PARAM_H 12 12 #define _XTENSA_PARAM_H 13 13 14 - #include <asm/variant/core.h> 15 - 16 14 #ifdef __KERNEL__ 17 15 # define HZ 100 /* internal timer frequency */ 18 16 # define USER_HZ 100 /* for user interfaces in "ticks" */ 19 17 # define CLOCKS_PER_SEC (USER_HZ) /* frequnzy at which times() counts */ 20 18 #endif 21 19 22 - #define EXEC_PAGESIZE (1 << XCHAL_MMU_MIN_PTE_PAGE_SIZE) 20 + #define EXEC_PAGESIZE 4096 23 21 24 22 #ifndef NGROUPS 25 23 #define NGROUPS 32
+3 -2
include/asm-xtensa/ptrace.h
··· 11 11 #ifndef _XTENSA_PTRACE_H 12 12 #define _XTENSA_PTRACE_H 13 13 14 - #include <asm/variant/core.h> 15 - 16 14 /* 17 15 * Kernel stack 18 16 * ··· 111 113 }; 112 114 113 115 #ifdef __KERNEL__ 116 + 117 + #include <asm/variant/core.h> 118 + 114 119 # define task_pt_regs(tsk) ((struct pt_regs*) \ 115 120 (task_stack_page(tsk) + KERNEL_STACK_SIZE - (XCHAL_NUM_AREGS-16)*4) - 1) 116 121 # define user_mode(regs) (((regs)->ps & 0x00000020)!=0)
-2
include/asm-xtensa/shmparam.h
··· 9 9 #ifndef _XTENSA_SHMPARAM_H 10 10 #define _XTENSA_SHMPARAM_H 11 11 12 - #include <asm/processor.h> 13 - 14 12 /* 15 13 * Xtensa can have variable size caches, and if 16 14 * the size of single way is larger than the page size,
+2
include/asm-xtensa/thread_info.h
··· 116 116 #define TIF_SINGLESTEP 4 /* restore singlestep on return to user mode */ 117 117 #define TIF_IRET 5 /* return with iret */ 118 118 #define TIF_MEMDIE 6 119 + #define TIF_RESTORE_SIGMASK 7 /* restore signal mask in do_signal() */ 119 120 #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 120 121 121 122 #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) ··· 126 125 #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 127 126 #define _TIF_IRET (1<<TIF_IRET) 128 127 #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 128 + #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 129 129 130 130 #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ 131 131 #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */