Merge branch 'fixes-for-linus' of git://git.monstr.eu/linux-2.6-microblaze

* 'fixes-for-linus' of git://git.monstr.eu/linux-2.6-microblaze:
microblaze: Makefile cleanup
microblaze: Typo fix for cpu param inconsistency
microblaze: Add support for R_MICROBLAZE_64_NONE
microblaze: Get module loading working
microblaze: remove sys_ipc
microblaze: Support unaligned address for put/get_user macros
microblaze: Detect new Microblaze 7.20 versions
microblaze: Fix do_page_fault for no context
microblaze: Add _PAGE_FILE macros to pgtable.h
microblaze: Fix put_user macro for 64bits arguments
microblaze: Clear print messages for DTB passing via r7
microblaze: Not to clear r7 after copying DTB to kernel
microblaze: Add messages about FDT blob
microblaze: Final support for statically linked DTB
microblaze: remove duplicated #include
microblaze: Define tlb_flush macro

+126 -220
+18 -17
arch/microblaze/Makefile
··· 6 6 7 7 # What CPU vesion are we building for, and crack it open 8 8 # as major.minor.rev 9 - CPU_VER=$(subst ",,$(CONFIG_XILINX_MICROBLAZE0_HW_VER) ) 10 - CPU_MAJOR=$(shell echo $(CPU_VER) | cut -d '.' -f 1) 11 - CPU_MINOR=$(shell echo $(CPU_VER) | cut -d '.' -f 2) 12 - CPU_REV=$(shell echo $(CPU_VER) | cut -d '.' -f 3) 9 + CPU_VER := $(shell echo $(CONFIG_XILINX_MICROBLAZE0_HW_VER)) 10 + CPU_MAJOR := $(shell echo $(CPU_VER) | cut -d '.' -f 1) 11 + CPU_MINOR := $(shell echo $(CPU_VER) | cut -d '.' -f 2) 12 + CPU_REV := $(shell echo $(CPU_VER) | cut -d '.' -f 3) 13 13 14 14 export CPU_VER CPU_MAJOR CPU_MINOR CPU_REV 15 15 16 16 # Use cpu-related CONFIG_ vars to set compile options. 17 + # The various CONFIG_XILINX cpu features options are integers 0/1/2... 18 + # rather than bools y/n 17 19 18 20 # Work out HW multipler support. This is icky. 19 21 # 1. Spartan2 has no HW multiplers. ··· 36 34 37 35 CPUFLAGS-1 += $(call cc-option,-mcpu=v$(CPU_VER)) 38 36 39 - # The various CONFIG_XILINX cpu features options are integers 0/1/2... 40 - # rather than bools y/n 41 - 42 37 # r31 holds current when in kernel mode 43 - CFLAGS_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2) 38 + KBUILD_KERNEL += -ffixed-r31 $(CPUFLAGS-1) $(CPUFLAGS-2) 44 39 45 40 LDFLAGS := 46 41 LDFLAGS_vmlinux := 47 - LDFLAGS_BLOB := --format binary --oformat elf32-microblaze 48 42 49 - LIBGCC := $(shell $(CC) $(CFLAGS_KERNEL) -print-libgcc-file-name) 43 + LIBGCC := $(shell $(CC) $(KBUILD_KERNEL) -print-libgcc-file-name) 50 44 51 - head-y := arch/microblaze/kernel/head.o 52 - libs-y += arch/microblaze/lib/ $(LIBGCC) 53 - core-y += arch/microblaze/kernel/ arch/microblaze/mm/ \ 54 - arch/microblaze/platform/ 45 + head-y := arch/microblaze/kernel/head.o 46 + libs-y += arch/microblaze/lib/ 47 + libs-y += $(LIBGCC) 48 + core-y += arch/microblaze/kernel/ 49 + core-y += arch/microblaze/mm/ 50 + core-y += arch/microblaze/platform/ 55 51 56 - boot := arch/$(ARCH)/boot 52 + boot := arch/microblaze/boot 57 53 58 54 # defines filename extension depending memory management type 59 55 ifeq ($(CONFIG_MMU),) 60 - MMUEXT := -nommu 56 + MMU := -nommu 61 57 endif 62 - export MMUEXT 58 + 59 + export MMU 63 60 64 61 all: linux.bin 65 62
-1
arch/microblaze/include/asm/io.h
··· 14 14 #include <asm/byteorder.h> 15 15 #include <asm/page.h> 16 16 #include <linux/types.h> 17 - #include <asm/byteorder.h> 18 17 #include <linux/mm.h> /* Get struct page {...} */ 19 18 20 19
+3 -3
arch/microblaze/include/asm/pgtable.h
··· 185 185 186 186 /* Definitions for MicroBlaze. */ 187 187 #define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */ 188 + #define _PAGE_FILE 0x001 /* when !present: nonlinear file mapping */ 188 189 #define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */ 189 190 #define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */ 190 191 #define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */ ··· 321 320 static inline int pte_exec(pte_t pte) { return pte_val(pte) & _PAGE_EXEC; } 322 321 static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 323 322 static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 324 - /* FIXME */ 325 - static inline int pte_file(pte_t pte) { return 0; } 323 + static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 326 324 327 325 static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } 328 326 static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } ··· 488 488 /* Encode and decode a nonlinear file mapping entry */ 489 489 #define PTE_FILE_MAX_BITS 29 490 490 #define pte_to_pgoff(pte) (pte_val(pte) >> 3) 491 - #define pgoff_to_pte(off) ((pte_t) { ((off) << 3) }) 491 + #define pgoff_to_pte(off) ((pte_t) { ((off) << 3) | _PAGE_FILE }) 492 492 493 493 extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 494 494
+13 -10
arch/microblaze/include/asm/prom.h
··· 16 16 #define _ASM_MICROBLAZE_PROM_H 17 17 #ifdef __KERNEL__ 18 18 19 + /* Definitions used by the flattened device tree */ 20 + #define OF_DT_HEADER 0xd00dfeed /* marker */ 21 + #define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */ 22 + #define OF_DT_END_NODE 0x2 /* End node */ 23 + #define OF_DT_PROP 0x3 /* Property: name off, size, content */ 24 + #define OF_DT_NOP 0x4 /* nop */ 25 + #define OF_DT_END 0x9 26 + 27 + #define OF_DT_VERSION 0x10 28 + 29 + #ifndef __ASSEMBLY__ 30 + 19 31 #include <linux/types.h> 20 32 #include <linux/proc_fs.h> 21 33 #include <linux/platform_device.h> ··· 40 28 #define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l)) 41 29 #define of_prop_cmp(s1, s2) strcmp((s1), (s2)) 42 30 #define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) 43 - 44 - /* Definitions used by the flattened device tree */ 45 - #define OF_DT_HEADER 0xd00dfeed /* marker */ 46 - #define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */ 47 - #define OF_DT_END_NODE 0x2 /* End node */ 48 - #define OF_DT_PROP 0x3 /* Property: name off, size, content */ 49 - #define OF_DT_NOP 0x4 /* nop */ 50 - #define OF_DT_END 0x9 51 - 52 - #define OF_DT_VERSION 0x10 53 31 54 32 /* 55 33 * This is what gets passed to the kernel by prom_init or kexec ··· 311 309 */ 312 310 #include <linux/of.h> 313 311 312 + #endif /* __ASSEMBLY__ */ 314 313 #endif /* __KERNEL__ */ 315 314 #endif /* _ASM_MICROBLAZE_PROM_H */
+1 -1
arch/microblaze/include/asm/tlb.h
··· 11 11 #ifndef _ASM_MICROBLAZE_TLB_H 12 12 #define _ASM_MICROBLAZE_TLB_H 13 13 14 - #define tlb_flush(tlb) do {} while (0) 14 + #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm) 15 15 16 16 #include <asm-generic/tlb.h> 17 17
+1 -1
arch/microblaze/include/asm/uaccess.h
··· 189 189 190 190 #define __put_user(x, ptr) \ 191 191 ({ \ 192 - __typeof__(*(ptr)) __gu_val = x; \ 192 + __typeof__(*(ptr)) volatile __gu_val = (x); \ 193 193 long __gu_err = 0; \ 194 194 switch (sizeof(__gu_val)) { \ 195 195 case 1: \
+1 -1
arch/microblaze/kernel/Makefile
··· 17 17 obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o 18 18 obj-$(CONFIG_MMU) += misc.o 19 19 20 - obj-y += entry$(MMUEXT).o 20 + obj-y += entry$(MMU).o
+1 -1
arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c
··· 22 22 23 23 #define CI(c, p) { ci->c = PVR_##p(pvr); } 24 24 #define err_printk(x) \ 25 - early_printk("ERROR: Microblaze " x " - different for PVR and DTS\n"); 25 + early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n"); 26 26 27 27 void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu) 28 28 {
+1 -1
arch/microblaze/kernel/cpu/cpuinfo-static.c
··· 18 18 static const char cpu_ver_string[] = CONFIG_XILINX_MICROBLAZE0_HW_VER; 19 19 20 20 #define err_printk(x) \ 21 - early_printk("ERROR: Microblaze " x "- different for kernel and DTS\n"); 21 + early_printk("ERROR: Microblaze " x "-different for kernel and DTS\n"); 22 22 23 23 void __init set_cpuinfo_static(struct cpuinfo *ci, struct device_node *cpu) 24 24 {
+2
arch/microblaze/kernel/cpu/cpuinfo.c
··· 26 26 {"7.10.b", 0x09}, 27 27 {"7.10.c", 0x0a}, 28 28 {"7.10.d", 0x0b}, 29 + {"7.20.a", 0x0c}, 30 + {"7.20.b", 0x0d}, 29 31 /* FIXME There is no keycode defined in MBV for these versions */ 30 32 {"2.10.a", 0x10}, 31 33 {"3.00.a", 0x20},
+13 -4
arch/microblaze/kernel/head.S
··· 31 31 #include <linux/linkage.h> 32 32 #include <asm/thread_info.h> 33 33 #include <asm/page.h> 34 + #include <asm/prom.h> /* for OF_DT_HEADER */ 34 35 35 36 #ifdef CONFIG_MMU 36 37 #include <asm/setup.h> /* COMMAND_LINE_SIZE */ ··· 55 54 andi r1, r1, ~2 56 55 mts rmsr, r1 57 56 58 - /* save fdt to kernel location */ 59 - /* r7 stores pointer to fdt blob */ 60 - beqi r7, no_fdt_arg 57 + /* r7 may point to an FDT, or there may be one linked in. 58 + if it's in r7, we've got to save it away ASAP. 59 + We ensure r7 points to a valid FDT, just in case the bootloader 60 + is broken or non-existent */ 61 + beqi r7, no_fdt_arg /* NULL pointer? don't copy */ 62 + lw r11, r0, r7 /* Does r7 point to a */ 63 + rsubi r11, r11, OF_DT_HEADER /* valid FDT? */ 64 + beqi r11, _prepare_copy_fdt 65 + or r7, r0, r0 /* clear R7 when not valid DTB */ 66 + bnei r11, no_fdt_arg /* No - get out of here */ 67 + _prepare_copy_fdt: 61 68 or r11, r0, r0 /* incremment */ 62 - ori r4, r0, TOPHYS(_fdt_start) /* save bram context */ 69 + ori r4, r0, TOPHYS(_fdt_start) 63 70 ori r3, r0, (0x4000 - 4) 64 71 _copy_fdt: 65 72 lw r12, r7, r11 /* r12 = r7 + r11 */
+46 -63
arch/microblaze/kernel/hw_exception_handler.S
··· 74 74 75 75 #include <asm/mmu.h> 76 76 #include <asm/pgtable.h> 77 + #include <asm/signal.h> 77 78 #include <asm/asm-offsets.h> 78 79 79 80 /* Helpful Macros */ ··· 429 428 mfs r17, rbtr; /* ESR[DS] set - return address in BTR */ 430 429 nop 431 430 _no_delayslot: 432 - #endif 433 - 434 - #ifdef CONFIG_MMU 435 - /* Check if unaligned address is last on a 4k page */ 436 - andi r5, r4, 0xffc 437 - xori r5, r5, 0xffc 438 - bnei r5, _unaligned_ex2 439 - _unaligned_ex1: 440 - RESTORE_STATE; 441 - /* Another page must be accessed or physical address not in page table */ 442 - bri unaligned_data_trap 443 - 444 - _unaligned_ex2: 431 + /* jump to high level unaligned handler */ 432 + RESTORE_STATE; 433 + bri unaligned_data_trap 445 434 #endif 446 435 andi r6, r3, 0x3E0; /* Mask and extract the register operand */ 447 436 srl r6, r6; /* r6 >> 5 */ ··· 441 450 srl r6, r6; 442 451 /* Store the register operand in a temporary location */ 443 452 sbi r6, r0, TOPHYS(ex_reg_op); 444 - #ifdef CONFIG_MMU 445 - /* Get physical address */ 446 - /* If we are faulting a kernel address, we have to use the 447 - * kernel page tables. 448 - */ 449 - ori r5, r0, CONFIG_KERNEL_START 450 - cmpu r5, r4, r5 451 - bgti r5, _unaligned_ex3 452 - ori r5, r0, swapper_pg_dir 453 - bri _unaligned_ex4 454 - 455 - /* Get the PGD for the current thread. */ 456 - _unaligned_ex3: /* user thread */ 457 - addi r5 ,CURRENT_TASK, TOPHYS(0); /* get current task address */ 458 - lwi r5, r5, TASK_THREAD + PGDIR 459 - _unaligned_ex4: 460 - tophys(r5,r5) 461 - BSRLI(r6,r4,20) /* Create L1 (pgdir/pmd) address */ 462 - andi r6, r6, 0xffc 463 - /* Assume pgdir aligned on 4K boundary, no need for "andi r5,r5,0xfffff003" */ 464 - or r5, r5, r6 465 - lwi r6, r5, 0 /* Get L1 entry */ 466 - andi r5, r6, 0xfffff000 /* Extract L2 (pte) base address. */ 467 - beqi r5, _unaligned_ex1 /* Bail if no table */ 468 - 469 - tophys(r5,r5) 470 - BSRLI(r6,r4,10) /* Compute PTE address */ 471 - andi r6, r6, 0xffc 472 - andi r5, r5, 0xfffff003 473 - or r5, r5, r6 474 - lwi r5, r5, 0 /* Get Linux PTE */ 475 - 476 - andi r6, r5, _PAGE_PRESENT 477 - beqi r6, _unaligned_ex1 /* Bail if no page */ 478 - 479 - andi r5, r5, 0xfffff000 /* Extract RPN */ 480 - andi r4, r4, 0x00000fff /* Extract offset */ 481 - or r4, r4, r5 /* Create physical address */ 482 - #endif /* CONFIG_MMU */ 483 453 484 454 andi r6, r3, 0x400; /* Extract ESR[S] */ 485 455 bnei r6, ex_sw; ··· 911 959 andi r6, r3, 0x800; /* Extract ESR[W] - delay slot */ 912 960 ex_lw_vm: 913 961 beqid r6, ex_lhw_vm; 914 - lbui r5, r4, 0; /* Exception address in r4 - delay slot */ 962 + load1: lbui r5, r4, 0; /* Exception address in r4 - delay slot */ 915 963 /* Load a word, byte-by-byte from destination address and save it in tmp space*/ 916 964 la r6, r0, ex_tmp_data_loc_0; 917 965 sbi r5, r6, 0; 918 - lbui r5, r4, 1; 966 + load2: lbui r5, r4, 1; 919 967 sbi r5, r6, 1; 920 - lbui r5, r4, 2; 968 + load3: lbui r5, r4, 2; 921 969 sbi r5, r6, 2; 922 - lbui r5, r4, 3; 970 + load4: lbui r5, r4, 3; 923 971 sbi r5, r6, 3; 924 972 brid ex_lw_tail_vm; 925 973 /* Get the destination register value into r3 - delay slot */ ··· 929 977 * save it in tmp space */ 930 978 la r6, r0, ex_tmp_data_loc_0; 931 979 sbi r5, r6, 0; 932 - lbui r5, r4, 1; 980 + load5: lbui r5, r4, 1; 933 981 sbi r5, r6, 1; 934 982 lhui r3, r6, 0; /* Get the destination register value into r3 */ 935 983 ex_lw_tail_vm: ··· 948 996 swi r3, r5, 0; /* Get the word - delay slot */ 949 997 /* Store the word, byte-by-byte into destination address */ 950 998 lbui r3, r5, 0; 951 - sbi r3, r4, 0; 999 + store1: sbi r3, r4, 0; 952 1000 lbui r3, r5, 1; 953 - sbi r3, r4, 1; 1001 + store2: sbi r3, r4, 1; 954 1002 lbui r3, r5, 2; 955 - sbi r3, r4, 2; 1003 + store3: sbi r3, r4, 2; 956 1004 lbui r3, r5, 3; 957 1005 brid ret_from_exc; 958 - sbi r3, r4, 3; /* Delay slot */ 1006 + store4: sbi r3, r4, 3; /* Delay slot */ 959 1007 ex_shw_vm: 960 1008 /* Store the lower half-word, byte-by-byte into destination address */ 961 1009 lbui r3, r5, 2; 962 - sbi r3, r4, 0; 1010 + store5: sbi r3, r4, 0; 963 1011 lbui r3, r5, 3; 964 1012 brid ret_from_exc; 965 - sbi r3, r4, 1; /* Delay slot */ 1013 + store6: sbi r3, r4, 1; /* Delay slot */ 966 1014 ex_sw_end_vm: /* Exception handling of store word, ends. */ 1015 + 1016 + /* We have to prevent cases that get/put_user macros get unaligned pointer 1017 + * to bad page area. We have to find out which origin instruction caused it 1018 + * and called fixup for that origin instruction not instruction in unaligned 1019 + * handler */ 1020 + ex_unaligned_fixup: 1021 + ori r5, r7, 0 /* setup pointer to pt_regs */ 1022 + lwi r6, r7, PT_PC; /* faulting address is one instruction above */ 1023 + addik r6, r6, -4 /* for finding proper fixup */ 1024 + swi r6, r7, PT_PC; /* a save back it to PT_PC */ 1025 + addik r7, r0, SIGSEGV 1026 + /* call bad_page_fault for finding aligned fixup, fixup address is saved 1027 + * in PT_PC which is used as return address from exception */ 1028 + la r15, r0, ret_from_exc-8 /* setup return address */ 1029 + brid bad_page_fault 1030 + nop 1031 + 1032 + /* We prevent all load/store because it could failed any attempt to access */ 1033 + .section __ex_table,"a"; 1034 + .word load1,ex_unaligned_fixup; 1035 + .word load2,ex_unaligned_fixup; 1036 + .word load3,ex_unaligned_fixup; 1037 + .word load4,ex_unaligned_fixup; 1038 + .word load5,ex_unaligned_fixup; 1039 + .word store1,ex_unaligned_fixup; 1040 + .word store2,ex_unaligned_fixup; 1041 + .word store3,ex_unaligned_fixup; 1042 + .word store4,ex_unaligned_fixup; 1043 + .word store5,ex_unaligned_fixup; 1044 + .word store6,ex_unaligned_fixup; 1045 + .previous; 967 1046 .end _unaligned_data_exception 968 1047 #endif /* CONFIG_MMU */ 969 1048
+14 -5
arch/microblaze/kernel/module.c
··· 57 57 Elf32_Rela *rela = (void *)sechdrs[relsec].sh_addr; 58 58 Elf32_Sym *sym; 59 59 unsigned long int *location; 60 - unsigned long int locoffs; 61 60 unsigned long int value; 62 61 #if __GNUC__ < 4 63 62 unsigned long int old_value; ··· 112 113 break; 113 114 114 115 case R_MICROBLAZE_64_PCREL: 115 - locoffs = (location[0] & 0xFFFF) << 16 | 116 + #if __GNUC__ < 4 117 + old_value = (location[0] & 0xFFFF) << 16 | 116 118 (location[1] & 0xFFFF); 117 - value -= (unsigned long int)(location) + 4 + 118 - locoffs; 119 + value -= old_value; 120 + #endif 121 + value -= (unsigned long int)(location) + 4; 119 122 location[0] = (location[0] & 0xFFFF0000) | 120 123 (value >> 16); 121 124 location[1] = (location[1] & 0xFFFF0000) | 122 125 (value & 0xFFFF); 123 126 pr_debug("R_MICROBLAZE_64_PCREL (%08lx)\n", 124 127 value); 128 + break; 129 + 130 + case R_MICROBLAZE_32_PCREL_LO: 131 + pr_debug("R_MICROBLAZE_32_PCREL_LO\n"); 132 + break; 133 + 134 + case R_MICROBLAZE_64_NONE: 135 + pr_debug("R_MICROBLAZE_NONE\n"); 125 136 break; 126 137 127 138 case R_MICROBLAZE_NONE: ··· 142 133 printk(KERN_ERR "module %s: " 143 134 "Unknown relocation: %u\n", 144 135 module->name, 145 - ELF32_R_TYPE(rela->r_info)); 136 + ELF32_R_TYPE(rela[i].r_info)); 146 137 return -ENOEXEC; 147 138 } 148 139 }
+6 -2
arch/microblaze/kernel/setup.c
··· 138 138 setup_early_printk(NULL); 139 139 #endif 140 140 141 - early_printk("Ramdisk addr 0x%08x, FDT 0x%08x\n", ram, fdt); 142 - printk(KERN_NOTICE "Found FDT at 0x%08x\n", fdt); 141 + early_printk("Ramdisk addr 0x%08x, ", ram); 142 + if (fdt) 143 + early_printk("FDT at 0x%08x\n", fdt); 144 + else 145 + early_printk("Compiled-in FDT at 0x%08x\n", 146 + (unsigned int)_fdt_start); 143 147 144 148 #ifdef CONFIG_MTD_UCLINUX 145 149 early_printk("Found romfs @ 0x%08x (0x%08x)\n",
-99
arch/microblaze/kernel/sys_microblaze.c
··· 33 33 #include <linux/unistd.h> 34 34 35 35 #include <asm/syscalls.h> 36 - /* 37 - * sys_ipc() is the de-multiplexer for the SysV IPC calls.. 38 - * 39 - * This is really horribly ugly. This will be remove with new toolchain. 40 - */ 41 - asmlinkage long 42 - sys_ipc(uint call, int first, int second, int third, void *ptr, long fifth) 43 - { 44 - int version, ret; 45 - 46 - version = call >> 16; /* hack for backward compatibility */ 47 - call &= 0xffff; 48 - 49 - ret = -EINVAL; 50 - switch (call) { 51 - case SEMOP: 52 - ret = sys_semop(first, (struct sembuf *)ptr, second); 53 - break; 54 - case SEMGET: 55 - ret = sys_semget(first, second, third); 56 - break; 57 - case SEMCTL: 58 - { 59 - union semun fourth; 60 - 61 - if (!ptr) 62 - break; 63 - ret = (access_ok(VERIFY_READ, ptr, sizeof(long)) ? 0 : -EFAULT) 64 - || (get_user(fourth.__pad, (void **)ptr)) ; 65 - if (ret) 66 - break; 67 - ret = sys_semctl(first, second, third, fourth); 68 - break; 69 - } 70 - case MSGSND: 71 - ret = sys_msgsnd(first, (struct msgbuf *) ptr, second, third); 72 - break; 73 - case MSGRCV: 74 - switch (version) { 75 - case 0: { 76 - struct ipc_kludge tmp; 77 - 78 - if (!ptr) 79 - break; 80 - ret = (access_ok(VERIFY_READ, ptr, sizeof(tmp)) 81 - ? 0 : -EFAULT) || copy_from_user(&tmp, 82 - (struct ipc_kludge *) ptr, sizeof(tmp)); 83 - if (ret) 84 - break; 85 - ret = sys_msgrcv(first, tmp.msgp, second, tmp.msgtyp, 86 - third); 87 - break; 88 - } 89 - default: 90 - ret = sys_msgrcv(first, (struct msgbuf *) ptr, 91 - second, fifth, third); 92 - break; 93 - } 94 - break; 95 - case MSGGET: 96 - ret = sys_msgget((key_t) first, second); 97 - break; 98 - case MSGCTL: 99 - ret = sys_msgctl(first, second, (struct msqid_ds *) ptr); 100 - break; 101 - case SHMAT: 102 - switch (version) { 103 - default: { 104 - ulong raddr; 105 - ret = access_ok(VERIFY_WRITE, (ulong *) third, 106 - sizeof(ulong)) ? 0 : -EFAULT; 107 - if (ret) 108 - break; 109 - ret = do_shmat(first, (char *) ptr, second, &raddr); 110 - if (ret) 111 - break; 112 - ret = put_user(raddr, (ulong *) third); 113 - break; 114 - } 115 - case 1: /* iBCS2 emulator entry point */ 116 - if (!segment_eq(get_fs(), get_ds())) 117 - break; 118 - ret = do_shmat(first, (char *) ptr, second, 119 - (ulong *) third); 120 - break; 121 - } 122 - break; 123 - case SHMDT: 124 - ret = sys_shmdt((char *)ptr); 125 - break; 126 - case SHMGET: 127 - ret = sys_shmget(first, second, third); 128 - break; 129 - case SHMCTL: 130 - ret = sys_shmctl(first, second, (struct shmid_ds *) ptr); 131 - break; 132 - } 133 - return ret; 134 - } 135 36 136 37 asmlinkage long microblaze_vfork(struct pt_regs *regs) 137 38 {
+1 -1
arch/microblaze/kernel/syscall_table.S
··· 121 121 .long sys_wait4 122 122 .long sys_swapoff /* 115 */ 123 123 .long sys_sysinfo 124 - .long sys_ipc 124 + .long sys_ni_syscall /* old sys_ipc */ 125 125 .long sys_fsync 126 126 .long sys_ni_syscall /* sys_sigreturn_wrapper */ 127 127 .long sys_clone /* 120 */
+5 -10
arch/microblaze/mm/fault.c
··· 69 69 * It is called from do_page_fault above and from some of the procedures 70 70 * in traps.c. 71 71 */ 72 - static void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) 72 + void bad_page_fault(struct pt_regs *regs, unsigned long address, int sig) 73 73 { 74 74 const struct exception_table_entry *fixup; 75 75 /* MS: no context */ ··· 122 122 } 123 123 #endif /* CONFIG_KGDB */ 124 124 125 - if (in_atomic() || mm == NULL) { 126 - /* FIXME */ 127 - if (kernel_mode(regs)) { 128 - printk(KERN_EMERG 129 - "Page fault in kernel mode - Oooou!!! pid %d\n", 130 - current->pid); 131 - _exception(SIGSEGV, regs, code, address); 132 - return; 133 - } 125 + if (in_atomic() || !mm) { 126 + if (kernel_mode(regs)) 127 + goto bad_area_nosemaphore; 128 + 134 129 /* in_atomic() in user mode is really bad, 135 130 as is current->mm == NULL. */ 136 131 printk(KERN_EMERG "Page fault in user mode with "