Merge branch 'link_removal' of git://www.jni.nu/cris

* 'link_removal' of git://www.jni.nu/cris:
[CRIS] Remove links from CRIS build
[CRIS] Merge asm-offsets.c for both arches into one file.

+115 -246
+20 -45
arch/cris/Makefile
··· 23 23 24 24 ifneq ($(arch-y),) 25 25 SARCH := arch-$(arch-y) 26 - inc := -Iarch/cris/include/arch-$(arch-y) -Iarch/cris/include/arch-$(arch-y)/arch 26 + inc := -Iarch/cris/include/$(SARCH) 27 + inc += -Iarch/cris/include/$(SARCH)/arch 27 28 else 28 29 SARCH := 29 30 inc := ··· 53 52 KBUILD_CFLAGS += -fno-omit-frame-pointer 54 53 endif 55 54 56 - head-y := arch/$(ARCH)/$(SARCH)/kernel/head.o 55 + head-y := arch/cris/$(SARCH)/kernel/head.o 57 56 58 57 LIBGCC = $(shell $(CC) $(KBUILD_CFLAGS) -print-file-name=libgcc.a) 59 58 60 - core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/ 61 - core-y += arch/$(ARCH)/$(SARCH)/kernel/ arch/$(ARCH)/$(SARCH)/mm/ 59 + core-y += arch/cris/kernel/ arch/cris/mm/ 60 + core-y += arch/cris/$(SARCH)/kernel/ arch/cris/$(SARCH)/mm/ 62 61 ifdef CONFIG_ETRAX_ARCH_V32 63 - core-y += arch/$(ARCH)/$(SARCH)/$(MACH)/ 62 + core-y += arch/cris/$(SARCH)/$(MACH)/ 64 63 endif 65 - drivers-y += arch/$(ARCH)/$(SARCH)/drivers/ 66 - libs-y += arch/$(ARCH)/$(SARCH)/lib/ $(LIBGCC) 64 + drivers-y += arch/cris/$(SARCH)/drivers/ 65 + libs-y += arch/cris/$(SARCH)/lib/ $(LIBGCC) 67 66 68 67 # cris source path 69 - SRC_ARCH = $(srctree)/arch/$(ARCH) 68 + SRC_ARCH = $(srctree)/arch/cris 70 69 # cris object files path 71 - OBJ_ARCH = $(objtree)/arch/$(ARCH) 70 + OBJ_ARCH = $(objtree)/arch/cris 72 71 73 - boot := arch/$(ARCH)/boot 74 - MACHINE := arch/$(ARCH)/$(SARCH) 72 + boot := arch/cris/$(SARCH)/boot 73 + MACHINE := arch/cris/$(SARCH) 75 74 76 75 all: zImage 77 76 78 77 zImage Image: vmlinux 79 78 $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@ 80 79 81 - archprepare: $(SRC_ARCH)/.links FORCE 82 - 83 - # Create some links to make all tools happy 84 - $(SRC_ARCH)/.links: 85 - @rm -rf $(SRC_ARCH)/drivers 86 - @ln -sfn $(SARCH)/drivers $(SRC_ARCH)/drivers 87 - @rm -rf $(SRC_ARCH)/boot 88 - @ln -sfn $(SARCH)/boot $(SRC_ARCH)/boot 89 - @rm -rf $(SRC_ARCH)/lib 90 - @ln -sfn $(SARCH)/lib $(SRC_ARCH)/lib 91 - @rm -f $(SRC_ARCH)/arch/mach 92 - @rm -rf $(SRC_ARCH)/arch 93 - @ln -sfn $(SARCH) $(SRC_ARCH)/arch 94 - ifdef CONFIG_ETRAX_ARCH_V32 95 - @ln -sfn ../$(SARCH)/$(MACH) $(SRC_ARCH)/arch/mach 96 - endif 97 - @rm -rf $(SRC_ARCH)/kernel/vmlinux.lds.S 98 - @ln -sfn ../$(SARCH)/vmlinux.lds.S $(SRC_ARCH)/kernel/vmlinux.lds.S 99 - @rm -rf $(SRC_ARCH)/kernel/asm-offsets.c 100 - @ln -sfn ../$(SARCH)/kernel/asm-offsets.c $(SRC_ARCH)/kernel/asm-offsets.c 101 - @touch $@ 80 + archprepare: 102 81 103 82 archclean: 104 - $(Q)if [ -e arch/$(ARCH)/boot ]; then \ 105 - $(MAKE) $(clean)=arch/$(ARCH)/boot; \ 83 + $(Q)if [ -e arch/cris/$(SARCH)/boot ]; then \ 84 + $(MAKE) $(clean)=arch/cris/$(SARCH)/boot; \ 106 85 fi 107 86 108 87 CLEAN_FILES += \ 109 88 $(MACHINE)/boot/zImage \ 110 89 $(MACHINE)/boot/compressed/decompress.bin \ 111 90 $(MACHINE)/boot/compressed/piggy.gz \ 112 - $(MACHINE)/boot/rescue/rescue.bin \ 113 - $(SRC_ARCH)/.links 91 + $(MACHINE)/boot/rescue/rescue.bin 114 92 115 - MRPROPER_FILES += \ 116 - $(SRC_ARCH)/drivers \ 117 - $(SRC_ARCH)/boot \ 118 - $(SRC_ARCH)/lib \ 119 - $(SRC_ARCH)/arch \ 120 - $(SRC_ARCH)/kernel/vmlinux.lds.S \ 121 - $(SRC_ARCH)/kernel/asm-offsets.c 93 + 94 + # MRPROPER_FILES += 122 95 123 96 define archhelp 124 - echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)' 125 - echo '* Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' 97 + echo '* zImage - Compressed kernel image (arch/cris/boot/zImage)' 98 + echo '* Image - Uncompressed kernel image (arch/cris/boot/Image)' 126 99 endef
-47
arch/cris/arch-v10/kernel/asm-offsets.c
··· 1 - #include <linux/sched.h> 2 - #include <asm/thread_info.h> 3 - 4 - /* 5 - * Generate definitions needed by assembly language modules. 6 - * This code generates raw asm output which is post-processed to extract 7 - * and format the required data. 8 - */ 9 - 10 - #define DEFINE(sym, val) \ 11 - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 12 - 13 - #define BLANK() asm volatile("\n->" : : ) 14 - 15 - int main(void) 16 - { 17 - #define ENTRY(entry) DEFINE(PT_ ## entry, offsetof(struct pt_regs, entry)) 18 - ENTRY(orig_r10); 19 - ENTRY(r13); 20 - ENTRY(r12); 21 - ENTRY(r11); 22 - ENTRY(r10); 23 - ENTRY(r9); 24 - ENTRY(mof); 25 - ENTRY(dccr); 26 - ENTRY(srp); 27 - BLANK(); 28 - #undef ENTRY 29 - #define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry)) 30 - ENTRY(task); 31 - ENTRY(flags); 32 - ENTRY(preempt_count); 33 - BLANK(); 34 - #undef ENTRY 35 - #define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry)) 36 - ENTRY(ksp); 37 - ENTRY(usp); 38 - ENTRY(dccr); 39 - BLANK(); 40 - #undef ENTRY 41 - #define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry)) 42 - ENTRY(pid); 43 - BLANK(); 44 - DEFINE(LCLONE_VM, CLONE_VM); 45 - DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED); 46 - return 0; 47 - }
-118
arch/cris/arch-v10/vmlinux.lds.S
··· 1 - /* ld script to make the Linux/CRIS kernel 2 - * Authors: Bjorn Wesen (bjornw@axis.com) 3 - * 4 - * It is VERY DANGEROUS to fiddle around with the symbols in this 5 - * script. It is for example quite vital that all generated sections 6 - * that are used are actually named here, otherwise the linker will 7 - * put them at the end, where the init stuff is which is FREED after 8 - * the kernel has booted. 9 - */ 10 - 11 - #include <asm-generic/vmlinux.lds.h> 12 - #include <asm/page.h> 13 - 14 - jiffies = jiffies_64; 15 - SECTIONS 16 - { 17 - . = DRAM_VIRTUAL_BASE; 18 - dram_start = .; 19 - ibr_start = .; 20 - . = . + 0x4000; /* see head.S and pages reserved at the start */ 21 - 22 - _text = .; /* Text and read-only data */ 23 - text_start = .; /* lots of aliases */ 24 - _stext = .; 25 - __stext = .; 26 - .text : { 27 - TEXT_TEXT 28 - SCHED_TEXT 29 - LOCK_TEXT 30 - *(.fixup) 31 - *(.text.__*) 32 - } 33 - 34 - _etext = . ; /* End of text section */ 35 - __etext = .; 36 - 37 - . = ALIGN(4); /* Exception table */ 38 - __start___ex_table = .; 39 - __ex_table : { *(__ex_table) } 40 - __stop___ex_table = .; 41 - 42 - RODATA 43 - 44 - . = ALIGN (4); 45 - ___data_start = . ; 46 - __Sdata = . ; 47 - .data : { /* Data */ 48 - DATA_DATA 49 - } 50 - __edata = . ; /* End of data section */ 51 - _edata = . ; 52 - 53 - . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */ 54 - .data.init_task : { *(.data.init_task) } 55 - 56 - . = ALIGN(PAGE_SIZE); /* Init code and data */ 57 - __init_begin = .; 58 - .init.text : { 59 - _sinittext = .; 60 - INIT_TEXT 61 - _einittext = .; 62 - } 63 - .init.data : { INIT_DATA } 64 - . = ALIGN(16); 65 - __setup_start = .; 66 - .init.setup : { *(.init.setup) } 67 - __setup_end = .; 68 - .initcall.init : { 69 - __initcall_start = .; 70 - INITCALLS 71 - __initcall_end = .; 72 - } 73 - 74 - .con_initcall.init : { 75 - __con_initcall_start = .; 76 - *(.con_initcall.init) 77 - __con_initcall_end = .; 78 - } 79 - SECURITY_INIT 80 - 81 - #ifdef CONFIG_BLK_DEV_INITRD 82 - .init.ramfs : { 83 - __initramfs_start = .; 84 - *(.init.ramfs) 85 - __initramfs_end = .; 86 - } 87 - #endif 88 - __vmlinux_end = .; /* last address of the physical file */ 89 - 90 - /* 91 - * We fill to the next page, so we can discard all init 92 - * pages without needing to consider what payload might be 93 - * appended to the kernel image. 94 - */ 95 - . = ALIGN(PAGE_SIZE); 96 - 97 - __init_end = .; 98 - 99 - __data_end = . ; /* Move to _edata ? */ 100 - __bss_start = .; /* BSS */ 101 - .bss : { 102 - *(COMMON) 103 - *(.bss) 104 - } 105 - 106 - . = ALIGN (0x20); 107 - _end = .; 108 - __end = .; 109 - 110 - /* Sections to be discarded */ 111 - /DISCARD/ : { 112 - EXIT_TEXT 113 - EXIT_DATA 114 - *(.exitcall.exit) 115 - } 116 - 117 - dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024; 118 - }
+14 -2
arch/cris/arch-v32/boot/compressed/head.S
··· 28 28 beq dram_init_finished 29 29 nop 30 30 31 - #include "../../mach/dram_init.S" 31 + #if defined CONFIG_ETRAXFS 32 + #include "../../mach-fs/dram_init.S" 33 + #elif defined CONFIG_CRIS_MACH_ARTPEC3 34 + #include "../../mach-a3/dram_init.S" 35 + #else 36 + #error Only ETRAXFS and ARTPEC-3 supported! 37 + #endif 32 38 33 39 dram_init_finished: 34 40 ··· 136 130 _boot_source: 137 131 .dword 0 138 132 139 - #include "../../mach/hw_settings.S" 133 + #if defined CONFIG_ETRAXFS 134 + #include "../../mach-fs/hw_settings.S" 135 + #elif defined CONFIG_CRIS_MACH_ARTPEC3 136 + #include "../../mach-a3/hw_settings.S" 137 + #else 138 + #error Only ETRAXFS and ARTPEC-3 supported! 139 + #endif
+33 -18
arch/cris/arch-v32/kernel/asm-offsets.c arch/cris/kernel/asm-offsets.c
··· 1 1 #include <linux/sched.h> 2 2 #include <asm/thread_info.h> 3 + #include <linux/autoconf.h> 3 4 4 5 /* 5 6 * Generate definitions needed by assembly language modules. ··· 9 8 */ 10 9 11 10 #define DEFINE(sym, val) \ 12 - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 11 + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) 13 12 14 13 #define BLANK() asm volatile("\n->" : : ) 14 + 15 + #if !defined(CONFIG_ETRAX_ARCH_V10) && !defined(CONFIG_ETRAX_ARCH_V32) 16 + #error One of ARCH v10 and ARCH v32 must be true! 17 + #endif 15 18 16 19 int main(void) 17 20 { ··· 24 19 ENTRY(r13); 25 20 ENTRY(r12); 26 21 ENTRY(r11); 27 - ENTRY(r10); 28 - ENTRY(r9); 22 + ENTRY(r10); 23 + ENTRY(r9); 24 + #ifdef CONFIG_ETRAX_ARCH_V32 29 25 ENTRY(acr); 30 26 ENTRY(srs); 31 - ENTRY(mof); 32 - ENTRY(ccs); 33 - ENTRY(srp); 27 + #endif 28 + ENTRY(mof); 29 + #ifdef CONFIG_ETRAX_ARCH_V10 30 + ENTRY(dccr); 31 + #else 32 + ENTRY(ccs); 33 + #endif 34 + ENTRY(srp); 34 35 BLANK(); 35 36 #undef ENTRY 36 37 #define ENTRY(entry) DEFINE(TI_ ## entry, offsetof(struct thread_info, entry)) 37 - ENTRY(task); 38 - ENTRY(flags); 39 - ENTRY(preempt_count); 40 - BLANK(); 38 + ENTRY(task); 39 + ENTRY(flags); 40 + ENTRY(preempt_count); 41 + BLANK(); 41 42 #undef ENTRY 42 43 #define ENTRY(entry) DEFINE(THREAD_ ## entry, offsetof(struct thread_struct, entry)) 43 44 ENTRY(ksp); 44 - ENTRY(usp); 45 - ENTRY(ccs); 46 - BLANK(); 45 + ENTRY(usp); 46 + #ifdef CONFIG_ETRAX_ARCH_V10 47 + ENTRY(dccr); 48 + #else 49 + ENTRY(ccs); 50 + #endif 51 + BLANK(); 47 52 #undef ENTRY 48 53 #define ENTRY(entry) DEFINE(TASK_ ## entry, offsetof(struct task_struct, entry)) 49 - ENTRY(pid); 50 - BLANK(); 51 - DEFINE(LCLONE_VM, CLONE_VM); 52 - DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED); 53 - return 0; 54 + ENTRY(pid); 55 + BLANK(); 56 + DEFINE(LCLONE_VM, CLONE_VM); 57 + DEFINE(LCLONE_UNTRACED, CLONE_UNTRACED); 58 + return 0; 54 59 }
+17 -3
arch/cris/arch-v32/kernel/head.S
··· 10 10 * The macros found in mmu_defs_asm.h uses the ## concatenation operator, so 11 11 * -traditional must not be used when assembling this file. 12 12 */ 13 - #include <hwregs/reg_rdwr.h> 13 + #include <linux/autoconf.h> 14 14 #include <arch/memmap.h> 15 + #include <hwregs/reg_rdwr.h> 15 16 #include <hwregs/intr_vect.h> 16 17 #include <hwregs/asm/mmu_defs_asm.h> 17 18 #include <hwregs/asm/reg_map_asm.h> ··· 218 217 beq _dram_initialized 219 218 nop 220 219 221 - #include "../mach/dram_init.S" 220 + #if defined CONFIG_ETRAXFS 221 + #include "../mach-fs/dram_init.S" 222 + #elif defined CONFIG_CRIS_MACH_ARTPEC3 223 + #include "../mach-a3/dram_init.S" 224 + #else 225 + #error Only ETRAXFS and ARTPEC-3 supported! 226 + #endif 227 + 222 228 223 229 _dram_initialized: 224 230 ;; Copy the text and data section to DRAM. This depends on that the ··· 480 472 481 473 .section ".init.data", "aw" 482 474 483 - #include "../mach/hw_settings.S" 475 + #if defined CONFIG_ETRAXFS 476 + #include "../mach-fs/hw_settings.S" 477 + #elif defined CONFIG_CRIS_MACH_ARTPEC3 478 + #include "../mach-a3/hw_settings.S" 479 + #else 480 + #error Only ETRAXFS and ARTPEC-3 supported! 481 + #endif
+31 -13
arch/cris/arch-v32/vmlinux.lds.S arch/cris/kernel/vmlinux.lds.S
··· 8 8 * the kernel has booted. 9 9 */ 10 10 11 + #include <linux/autoconf.h> 11 12 #include <asm-generic/vmlinux.lds.h> 12 13 #include <asm/page.h> 13 14 ··· 18 17 #define __CONFIG_ETRAX_VMEM_SIZE 0 19 18 #endif 20 19 20 + 21 21 jiffies = jiffies_64; 22 22 SECTIONS 23 23 { 24 24 . = DRAM_VIRTUAL_BASE; 25 25 dram_start = .; 26 + #ifdef CONFIG_ETRAX_ARCH_V10 27 + ibr_start = .; 28 + #else 26 29 ebp_start = .; 27 - 28 30 /* The boot section is only necessary until the VCS top */ 29 31 /* level testbench includes both flash and DRAM. */ 30 32 .boot : { *(.boot) } 33 + #endif 31 34 32 - /* See head.S and pages reserved at the start. */ 35 + /* see head.S and pages reserved at the start */ 33 36 . = DRAM_VIRTUAL_BASE + 0x4000; 34 37 35 - _text = .; /* Text and read-only data. */ 36 - text_start = .; /* Lots of aliases. */ 38 + _text = .; /* Text and read-only data. */ 39 + text_start = .; /* Lots of aliases. */ 37 40 _stext = .; 38 41 __stext = .; 39 42 .text : { ··· 48 43 *(.text.__*) 49 44 } 50 45 51 - _etext = . ; /* End of text section. */ 46 + _etext = . ; /* End of text section. */ 52 47 __etext = .; 53 48 54 - . = ALIGN(4); /* Exception table. */ 49 + . = ALIGN(4); /* Exception table. */ 55 50 __start___ex_table = .; 56 51 __ex_table : { *(__ex_table) } 57 52 __stop___ex_table = .; ··· 61 56 . = ALIGN (4); 62 57 ___data_start = . ; 63 58 __Sdata = . ; 64 - .data : { /* Data */ 59 + .data : { /* Data */ 65 60 DATA_DATA 66 61 } 67 - __edata = . ; /* End of data section. */ 62 + __edata = . ; /* End of data section. */ 68 63 _edata = . ; 69 64 70 65 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */ 71 66 .data.init_task : { *(.data.init_task) } 72 67 73 - . = ALIGN(PAGE_SIZE); /* Init code and data. */ 68 + . = ALIGN(PAGE_SIZE); /* Init code and data. */ 74 69 __init_begin = .; 75 70 .init.text : { 76 71 _sinittext = .; ··· 82 77 __setup_start = .; 83 78 .init.setup : { *(.init.setup) } 84 79 __setup_end = .; 80 + #ifdef CONFIG_ETRAX_ARCH_V32 85 81 __start___param = .; 86 82 __param : { *(__param) } 87 83 __stop___param = .; 84 + #endif 88 85 .initcall.init : { 89 86 __initcall_start = .; 90 87 INITCALLS ··· 100 93 } 101 94 SECURITY_INIT 102 95 103 - __vmlinux_end = .; /* Last address of the physical file. */ 96 + #ifdef CONFIG_ETRAX_ARCH_V10 97 + #ifdef CONFIG_BLK_DEV_INITRD 98 + .init.ramfs : { 99 + __initramfs_start = .; 100 + *(.init.ramfs) 101 + __initramfs_end = .; 102 + } 103 + #endif 104 + #endif 105 + __vmlinux_end = .; /* Last address of the physical file. */ 106 + #ifdef CONFIG_ETRAX_ARCH_V32 104 107 PERCPU(PAGE_SIZE) 105 108 106 109 .init.ramfs : { ··· 118 101 *(.init.ramfs) 119 102 __initramfs_end = .; 120 103 } 104 + #endif 121 105 122 106 /* 123 107 * We fill to the next page, so we can discard all init 124 108 * pages without needing to consider what payload might be 125 109 * appended to the kernel image. 126 110 */ 127 - . = ALIGN (PAGE_SIZE); 111 + . = ALIGN(PAGE_SIZE); 128 112 129 113 __init_end = .; 130 114 131 - __data_end = . ; /* Move to _edata? */ 132 - __bss_start = .; /* BSS. */ 115 + __data_end = . ; /* Move to _edata ? */ 116 + __bss_start = .; /* BSS. */ 133 117 .bss : { 134 118 *(COMMON) 135 119 *(.bss)