diff options
Diffstat (limited to 'arch/sparc')
| -rw-r--r-- | arch/sparc/boot/Makefile | 6 | ||||
| -rw-r--r-- | arch/sparc/boot/piggyback_32.c | 4 | ||||
| -rw-r--r-- | arch/sparc/boot/piggyback_64.c | 1 | ||||
| -rw-r--r-- | arch/sparc/kernel/irq_64.c | 45 |
4 files changed, 25 insertions, 31 deletions
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile index 96041a8d39e8..1ff0fd924756 100644 --- a/arch/sparc/boot/Makefile +++ b/arch/sparc/boot/Makefile | |||
| @@ -15,7 +15,7 @@ quiet_cmd_elftoaout = ELFTOAOUT $@ | |||
| 15 | 15 | ||
| 16 | ifeq ($(CONFIG_SPARC32),y) | 16 | ifeq ($(CONFIG_SPARC32),y) |
| 17 | quiet_cmd_piggy = PIGGY $@ | 17 | quiet_cmd_piggy = PIGGY $@ |
| 18 | cmd_piggy = $(obj)/piggyback_32 $@ $(obj)/System.map $(ROOT_IMG) | 18 | cmd_piggy = $(obj)/piggyback_32 $@ System.map $(ROOT_IMG) |
| 19 | quiet_cmd_btfix = BTFIX $@ | 19 | quiet_cmd_btfix = BTFIX $@ |
| 20 | cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ | 20 | cmd_btfix = $(OBJDUMP) -x vmlinux | $(obj)/btfixupprep > $@ |
| 21 | quiet_cmd_sysmap = SYSMAP $(obj)/System.map | 21 | quiet_cmd_sysmap = SYSMAP $(obj)/System.map |
| @@ -58,7 +58,7 @@ $(obj)/image: $(obj)/btfix.o FORCE | |||
| 58 | $(obj)/zImage: $(obj)/image | 58 | $(obj)/zImage: $(obj)/image |
| 59 | $(call if_changed,strip) | 59 | $(call if_changed,strip) |
| 60 | 60 | ||
| 61 | $(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE | 61 | $(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_32 System.map $(ROOT_IMG) FORCE |
| 62 | $(call if_changed,elftoaout) | 62 | $(call if_changed,elftoaout) |
| 63 | $(call if_changed,piggy) | 63 | $(call if_changed,piggy) |
| 64 | 64 | ||
| @@ -79,7 +79,7 @@ $(obj)/image: vmlinux FORCE | |||
| 79 | $(call if_changed,strip) | 79 | $(call if_changed,strip) |
| 80 | @echo ' kernel: $@ is ready' | 80 | @echo ' kernel: $@ is ready' |
| 81 | 81 | ||
| 82 | $(obj)/tftpboot.img: vmlinux $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE | 82 | $(obj)/tftpboot.img: $(obj)/image $(obj)/piggyback_64 System.map $(ROOT_IMG) FORCE |
| 83 | $(call if_changed,elftoaout) | 83 | $(call if_changed,elftoaout) |
| 84 | $(call if_changed,piggy) | 84 | $(call if_changed,piggy) |
| 85 | @echo ' kernel: $@ is ready' | 85 | @echo ' kernel: $@ is ready' |
diff --git a/arch/sparc/boot/piggyback_32.c b/arch/sparc/boot/piggyback_32.c index c9f500c1a8b2..e8dc9adfcd61 100644 --- a/arch/sparc/boot/piggyback_32.c +++ b/arch/sparc/boot/piggyback_32.c | |||
| @@ -70,7 +70,7 @@ void die(char *str) | |||
| 70 | int main(int argc,char **argv) | 70 | int main(int argc,char **argv) |
| 71 | { | 71 | { |
| 72 | static char aout_magic[] = { 0x01, 0x03, 0x01, 0x07 }; | 72 | static char aout_magic[] = { 0x01, 0x03, 0x01, 0x07 }; |
| 73 | unsigned char buffer[1024], *q, *r; | 73 | char buffer[1024], *q, *r; |
| 74 | unsigned int i, j, k, start, end, offset; | 74 | unsigned int i, j, k, start, end, offset; |
| 75 | FILE *map; | 75 | FILE *map; |
| 76 | struct stat s; | 76 | struct stat s; |
| @@ -84,7 +84,7 @@ int main(int argc,char **argv) | |||
| 84 | while (fgets (buffer, 1024, map)) { | 84 | while (fgets (buffer, 1024, map)) { |
| 85 | if (!strcmp (buffer + 8, " T start\n") || !strcmp (buffer + 16, " T start\n")) | 85 | if (!strcmp (buffer + 8, " T start\n") || !strcmp (buffer + 16, " T start\n")) |
| 86 | start = strtoul (buffer, NULL, 16); | 86 | start = strtoul (buffer, NULL, 16); |
| 87 | else if (!strcmp (buffer + 8, " A end\n") || !strcmp (buffer + 16, " A end\n")) | 87 | else if (!strcmp (buffer + 8, " A _end\n") || !strcmp (buffer + 16, " A _end\n")) |
| 88 | end = strtoul (buffer, NULL, 16); | 88 | end = strtoul (buffer, NULL, 16); |
| 89 | } | 89 | } |
| 90 | fclose (map); | 90 | fclose (map); |
diff --git a/arch/sparc/boot/piggyback_64.c b/arch/sparc/boot/piggyback_64.c index de364bfed0bb..c63fd1b6bdd4 100644 --- a/arch/sparc/boot/piggyback_64.c +++ b/arch/sparc/boot/piggyback_64.c | |||
| @@ -46,6 +46,7 @@ int main(int argc,char **argv) | |||
| 46 | struct stat s; | 46 | struct stat s; |
| 47 | int image, tail; | 47 | int image, tail; |
| 48 | 48 | ||
| 49 | start = end = 0; | ||
| 49 | if (stat (argv[3], &s) < 0) die (argv[3]); | 50 | if (stat (argv[3], &s) < 0) die (argv[3]); |
| 50 | map = fopen (argv[2], "r"); | 51 | map = fopen (argv[2], "r"); |
| 51 | if (!map) die(argv[2]); | 52 | if (!map) die(argv[2]); |
diff --git a/arch/sparc/kernel/irq_64.c b/arch/sparc/kernel/irq_64.c index bd075054942b..f0ee79055409 100644 --- a/arch/sparc/kernel/irq_64.c +++ b/arch/sparc/kernel/irq_64.c | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
| 21 | #include <linux/proc_fs.h> | 21 | #include <linux/proc_fs.h> |
| 22 | #include <linux/seq_file.h> | 22 | #include <linux/seq_file.h> |
| 23 | #include <linux/bootmem.h> | ||
| 24 | #include <linux/irq.h> | 23 | #include <linux/irq.h> |
| 25 | 24 | ||
| 26 | #include <asm/ptrace.h> | 25 | #include <asm/ptrace.h> |
| @@ -914,25 +913,19 @@ void __cpuinit notrace sun4v_register_mondo_queues(int this_cpu) | |||
| 914 | tb->nonresum_qmask); | 913 | tb->nonresum_qmask); |
| 915 | } | 914 | } |
| 916 | 915 | ||
| 917 | static void __init alloc_one_mondo(unsigned long *pa_ptr, unsigned long qmask) | 916 | /* Each queue region must be a power of 2 multiple of 64 bytes in |
| 918 | { | 917 | * size. The base real address must be aligned to the size of the |
| 919 | unsigned long size = PAGE_ALIGN(qmask + 1); | 918 | * region. Thus, an 8KB queue must be 8KB aligned, for example. |
| 920 | void *p = __alloc_bootmem(size, size, 0); | 919 | */ |
| 921 | if (!p) { | 920 | static void __init alloc_one_queue(unsigned long *pa_ptr, unsigned long qmask) |
| 922 | prom_printf("SUN4V: Error, cannot allocate mondo queue.\n"); | ||
| 923 | prom_halt(); | ||
| 924 | } | ||
| 925 | |||
| 926 | *pa_ptr = __pa(p); | ||
| 927 | } | ||
| 928 | |||
| 929 | static void __init alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask) | ||
| 930 | { | 921 | { |
| 931 | unsigned long size = PAGE_ALIGN(qmask + 1); | 922 | unsigned long size = PAGE_ALIGN(qmask + 1); |
| 932 | void *p = __alloc_bootmem(size, size, 0); | 923 | unsigned long order = get_order(size); |
| 924 | unsigned long p; | ||
| 933 | 925 | ||
| 926 | p = __get_free_pages(GFP_KERNEL, order); | ||
| 934 | if (!p) { | 927 | if (!p) { |
| 935 | prom_printf("SUN4V: Error, cannot allocate kbuf page.\n"); | 928 | prom_printf("SUN4V: Error, cannot allocate queue.\n"); |
| 936 | prom_halt(); | 929 | prom_halt(); |
| 937 | } | 930 | } |
| 938 | 931 | ||
| @@ -942,11 +935,11 @@ static void __init alloc_one_kbuf(unsigned long *pa_ptr, unsigned long qmask) | |||
| 942 | static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb) | 935 | static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb) |
| 943 | { | 936 | { |
| 944 | #ifdef CONFIG_SMP | 937 | #ifdef CONFIG_SMP |
| 945 | void *page; | 938 | unsigned long page; |
| 946 | 939 | ||
| 947 | BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64)); | 940 | BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64)); |
| 948 | 941 | ||
| 949 | page = alloc_bootmem_pages(PAGE_SIZE); | 942 | page = get_zeroed_page(GFP_KERNEL); |
| 950 | if (!page) { | 943 | if (!page) { |
| 951 | prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n"); | 944 | prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n"); |
| 952 | prom_halt(); | 945 | prom_halt(); |
| @@ -965,13 +958,13 @@ static void __init sun4v_init_mondo_queues(void) | |||
| 965 | for_each_possible_cpu(cpu) { | 958 | for_each_possible_cpu(cpu) { |
| 966 | struct trap_per_cpu *tb = &trap_block[cpu]; | 959 | struct trap_per_cpu *tb = &trap_block[cpu]; |
| 967 | 960 | ||
| 968 | alloc_one_mondo(&tb->cpu_mondo_pa, tb->cpu_mondo_qmask); | 961 | alloc_one_queue(&tb->cpu_mondo_pa, tb->cpu_mondo_qmask); |
| 969 | alloc_one_mondo(&tb->dev_mondo_pa, tb->dev_mondo_qmask); | 962 | alloc_one_queue(&tb->dev_mondo_pa, tb->dev_mondo_qmask); |
| 970 | alloc_one_mondo(&tb->resum_mondo_pa, tb->resum_qmask); | 963 | alloc_one_queue(&tb->resum_mondo_pa, tb->resum_qmask); |
| 971 | alloc_one_kbuf(&tb->resum_kernel_buf_pa, tb->resum_qmask); | 964 | alloc_one_queue(&tb->resum_kernel_buf_pa, tb->resum_qmask); |
| 972 | alloc_one_mondo(&tb->nonresum_mondo_pa, tb->nonresum_qmask); | 965 | alloc_one_queue(&tb->nonresum_mondo_pa, tb->nonresum_qmask); |
| 973 | alloc_one_kbuf(&tb->nonresum_kernel_buf_pa, | 966 | alloc_one_queue(&tb->nonresum_kernel_buf_pa, |
| 974 | tb->nonresum_qmask); | 967 | tb->nonresum_qmask); |
| 975 | } | 968 | } |
| 976 | } | 969 | } |
| 977 | 970 | ||
| @@ -999,7 +992,7 @@ void __init init_IRQ(void) | |||
| 999 | kill_prom_timer(); | 992 | kill_prom_timer(); |
| 1000 | 993 | ||
| 1001 | size = sizeof(struct ino_bucket) * NUM_IVECS; | 994 | size = sizeof(struct ino_bucket) * NUM_IVECS; |
| 1002 | ivector_table = alloc_bootmem(size); | 995 | ivector_table = kzalloc(size, GFP_KERNEL); |
| 1003 | if (!ivector_table) { | 996 | if (!ivector_table) { |
| 1004 | prom_printf("Fatal error, cannot allocate ivector_table\n"); | 997 | prom_printf("Fatal error, cannot allocate ivector_table\n"); |
| 1005 | prom_halt(); | 998 | prom_halt(); |
