Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (29 commits)
sh: enable maple_keyb in dreamcast_defconfig.
SH2(A) cache update
nommu: Provide vmalloc_exec().
add addrespace definition for sh2a.
sh: Kill off ARCH_SUPPORTS_AOUT and remnants of a.out support.
sh: define GENERIC_HARDIRQS_NO__DO_IRQ.
sh: define GENERIC_LOCKBREAK.
sh: Save NUMA node data in vmcore for crash dumps.
sh: module_alloc() should be using vmalloc_exec().
sh: Fix up __bug_table handling in module loader.
sh: Add documentation and integrate into docbook build.
sh: Fix up broken kerneldoc comments.
maple: Kill useless private_data pointer.
maple: Clean up maple_driver_register/unregister routines.
input: Clean up maple keyboard driver
maple: allow removal and reinsertion of keyboard driver module
sh: /proc/asids depends on MMU.
arch/sh/boards/mach-se/7343/irq.c: removed duplicated #include
arch/sh/boards/board-ap325rxa.c: removed duplicated #include
sh/boards/Makefile typo fix
...

+853 -509
+1 -1
Documentation/DocBook/Makefile
··· 12 12 kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \ 13 13 gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ 14 14 genericirq.xml s390-drivers.xml uio-howto.xml scsi.xml \ 15 - mac80211.xml debugobjects.xml 15 + mac80211.xml debugobjects.xml sh.xml 16 16 17 17 ### 18 18 # The build process is as follows (targets):
+105
Documentation/DocBook/sh.tmpl
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" 3 + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []> 4 + 5 + <book id="sh-drivers"> 6 + <bookinfo> 7 + <title>SuperH Interfaces Guide</title> 8 + 9 + <authorgroup> 10 + <author> 11 + <firstname>Paul</firstname> 12 + <surname>Mundt</surname> 13 + <affiliation> 14 + <address> 15 + <email>lethal@linux-sh.org</email> 16 + </address> 17 + </affiliation> 18 + </author> 19 + </authorgroup> 20 + 21 + <copyright> 22 + <year>2008</year> 23 + <holder>Paul Mundt</holder> 24 + </copyright> 25 + <copyright> 26 + <year>2008</year> 27 + <holder>Renesas Technology Corp.</holder> 28 + </copyright> 29 + 30 + <legalnotice> 31 + <para> 32 + This documentation is free software; you can redistribute 33 + it and/or modify it under the terms of the GNU General Public 34 + License version 2 as published by the Free Software Foundation. 35 + </para> 36 + 37 + <para> 38 + This program is distributed in the hope that it will be 39 + useful, but WITHOUT ANY WARRANTY; without even the implied 40 + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 41 + See the GNU General Public License for more details. 42 + </para> 43 + 44 + <para> 45 + You should have received a copy of the GNU General Public 46 + License along with this program; if not, write to the Free 47 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 48 + MA 02111-1307 USA 49 + </para> 50 + 51 + <para> 52 + For more details see the file COPYING in the source 53 + distribution of Linux. 54 + </para> 55 + </legalnotice> 56 + </bookinfo> 57 + 58 + <toc></toc> 59 + 60 + <chapter id="mm"> 61 + <title>Memory Management</title> 62 + <sect1 id="sh4"> 63 + <title>SH-4</title> 64 + <sect2 id="sq"> 65 + <title>Store Queue API</title> 66 + !Earch/sh/kernel/cpu/sh4/sq.c 67 + </sect2> 68 + </sect1> 69 + <sect1 id="sh5"> 70 + <title>SH-5</title> 71 + <sect2 id="tlb"> 72 + <title>TLB Interfaces</title> 73 + !Iarch/sh/mm/tlb-sh5.c 74 + !Iarch/sh/include/asm/tlb_64.h 75 + </sect2> 76 + </sect1> 77 + </chapter> 78 + <chapter id="clk"> 79 + <title>Clock Framework Extensions</title> 80 + !Iarch/sh/include/asm/clock.h 81 + </chapter> 82 + <chapter id="mach"> 83 + <title>Machine Specific Interfaces</title> 84 + <sect1 id="dreamcast"> 85 + <title>mach-dreamcast</title> 86 + !Iarch/sh/boards/mach-dreamcast/rtc.c 87 + </sect1> 88 + <sect1 id="x3proto"> 89 + <title>mach-x3proto</title> 90 + !Earch/sh/boards/mach-x3proto/ilsel.c 91 + </sect1> 92 + </chapter> 93 + <chapter id="busses"> 94 + <title>Busses</title> 95 + <sect1 id="superhyway"> 96 + <title>SuperHyway</title> 97 + !Edrivers/sh/superhyway/superhyway.c 98 + </sect1> 99 + 100 + <sect1 id="maple"> 101 + <title>Maple</title> 102 + !Edrivers/sh/maple/maple.c 103 + </sect1> 104 + </chapter> 105 + </book>
+24 -3
arch/sh/Kconfig
··· 48 48 config GENERIC_HARDIRQS 49 49 def_bool y 50 50 51 + config GENERIC_HARDIRQS_NO__DO_IRQ 52 + def_bool y 53 + 51 54 config GENERIC_IRQ_PROBE 52 55 def_bool y 53 56 ··· 65 62 66 63 config GENERIC_CLOCKEVENTS 67 64 def_bool n 65 + 66 + config GENERIC_LOCKBREAK 67 + def_bool y 68 + depends on SMP && PREEMPT 68 69 69 70 config SYS_SUPPORTS_PM 70 71 bool ··· 99 92 def_bool n 100 93 101 94 config ARCH_NO_VIRT_TO_BUS 102 - def_bool y 103 - 104 - config ARCH_SUPPORTS_AOUT 105 95 def_bool y 106 96 107 97 config IO_TRAPPED ··· 486 482 MEMORY_START. 487 483 488 484 For more details see Documentation/kdump/kdump.txt 485 + 486 + config SECCOMP 487 + bool "Enable seccomp to safely compute untrusted bytecode" 488 + depends on PROC_FS 489 + default y 490 + help 491 + This kernel feature is useful for number crunching applications 492 + that may need to compute untrusted bytecode during their 493 + execution. By using pipes or other transports made available to 494 + the process as file descriptors supporting the read/write 495 + syscalls, it's possible to isolate those applications in 496 + their own address space using seccomp. Once seccomp is 497 + enabled via prctl, it cannot be disabled and the task is only 498 + allowed to execute a few safe syscalls defined by each seccomp 499 + mode. 500 + 501 + If unsure, say N. 489 502 490 503 config SMP 491 504 bool "Symmetric multi-processing support"
+1 -1
arch/sh/Kconfig.debug
··· 182 182 183 183 config SH64_PROC_ASIDS 184 184 bool "Debug: report ASIDs through /proc/asids" 185 - depends on PROC_FS 185 + depends on PROC_FS && MMU 186 186 187 187 config SH64_SR_WATCH 188 188 bool "Debug: set SR.WATCH to enable hardware watchpoints and trace"
+8 -8
arch/sh/Makefile
··· 95 95 head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o 96 96 head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o 97 97 98 - LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 99 - 100 98 core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ 101 99 core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ 102 100 ··· 143 145 cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5 144 146 cpuincdir-y += cpu-common # Must be last 145 147 146 - libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) 147 - libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) 148 - libs-y += $(LIBGCC) 149 - 150 148 drivers-y += arch/sh/drivers/ 151 149 drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ 152 150 ··· 155 161 KBUILD_CPPFLAGS += $(cflags-y) 156 162 KBUILD_AFLAGS += $(cflags-y) 157 163 164 + LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 165 + 166 + libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) 167 + libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) 168 + libs-y += $(LIBGCC) 169 + 158 170 PHONY += maketools FORCE 159 171 160 172 maketools: include/linux/version.h FORCE 161 - $(Q)$(MAKE) $(build)=arch/sh/tools arch/sh/include/asm/machtypes.h 173 + $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h 162 174 163 175 all: $(KBUILD_IMAGE) 164 176 ··· 215 215 $(call filechk,gen-syscalltab) 216 216 217 217 CLEAN_FILES += arch/sh/lib64/syscalltab.h \ 218 - arch/sh/include/asm/machtypes.h 218 + include/asm-sh/machtypes.h
+1 -1
arch/sh/boards/Makefile
··· 5 5 obj-$(CONFIG_SH_MAGIC_PANEL_R2) += board-magicpanelr2.o 6 6 obj-$(CONFIG_SH_RSK7203) += board-rsk7203.o 7 7 obj-$(CONFIG_SH_SH7785LCR) += board-sh7785lcr.o 8 - obj-$(CONFIG_SH_SHMIN) += board-shmin..o 8 + obj-$(CONFIG_SH_SHMIN) += board-shmin.o
-1
arch/sh/boards/board-ap325rxa.c
··· 17 17 #include <linux/mtd/physmap.h> 18 18 #include <linux/delay.h> 19 19 #include <linux/i2c.h> 20 - #include <linux/delay.h> 21 20 #include <linux/smc911x.h> 22 21 #include <media/soc_camera_platform.h> 23 22 #include <media/sh_mobile_ceu.h>
-1
arch/sh/boards/mach-se/7343/irq.c
··· 13 13 #include <linux/init.h> 14 14 #include <linux/irq.h> 15 15 #include <linux/interrupt.h> 16 - #include <linux/irq.h> 17 16 #include <linux/io.h> 18 17 #include <mach-se/mach/se7343.h> 19 18
+6 -8
arch/sh/configs/dreamcast_defconfig
··· 1 1 # 2 2 # Automatically generated make config: don't edit 3 - # Linux kernel version: 2.6.26 4 - # Wed Jul 30 01:34:24 2008 3 + # Linux kernel version: 2.6.27-rc1 4 + # Mon Aug 4 16:49:13 2008 5 5 # 6 6 CONFIG_SUPERH=y 7 7 CONFIG_SUPERH32=y ··· 11 11 CONFIG_GENERIC_FIND_NEXT_BIT=y 12 12 CONFIG_GENERIC_HWEIGHT=y 13 13 CONFIG_GENERIC_HARDIRQS=y 14 + CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y 14 15 CONFIG_GENERIC_IRQ_PROBE=y 15 16 CONFIG_GENERIC_CALIBRATE_DELAY=y 16 17 CONFIG_GENERIC_TIME=y ··· 22 21 # CONFIG_ARCH_HAS_ILOG2_U32 is not set 23 22 # CONFIG_ARCH_HAS_ILOG2_U64 is not set 24 23 CONFIG_ARCH_NO_VIRT_TO_BUS=y 25 - CONFIG_ARCH_SUPPORTS_AOUT=y 26 24 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" 27 25 28 26 # ··· 87 87 # CONFIG_USE_GENERIC_SMP_HELPERS is not set 88 88 CONFIG_HAVE_CLK=y 89 89 CONFIG_PROC_PAGE_MONITOR=y 90 + CONFIG_HAVE_GENERIC_DMA_COHERENT=y 90 91 CONFIG_SLABINFO=y 91 92 CONFIG_RT_MUTEXES=y 92 93 # CONFIG_TINY_SHMEM is not set ··· 285 284 # CONFIG_SCHED_HRTICK is not set 286 285 # CONFIG_KEXEC is not set 287 286 # CONFIG_CRASH_DUMP is not set 287 + CONFIG_SECCOMP=y 288 288 # CONFIG_PREEMPT_NONE is not set 289 289 # CONFIG_PREEMPT_VOLUNTARY is not set 290 290 CONFIG_PREEMPT=y ··· 319 317 # 320 318 CONFIG_BINFMT_ELF=y 321 319 # CONFIG_BINFMT_MISC is not set 322 - 323 - # 324 - # Networking 325 - # 326 320 CONFIG_NET=y 327 321 328 322 # ··· 553 555 # CONFIG_KEYBOARD_XTKBD is not set 554 556 # CONFIG_KEYBOARD_NEWTON is not set 555 557 # CONFIG_KEYBOARD_STOWAWAY is not set 556 - # CONFIG_KEYBOARD_MAPLE is not set 558 + CONFIG_KEYBOARD_MAPLE=y 557 559 # CONFIG_KEYBOARD_SH_KEYSC is not set 558 560 CONFIG_INPUT_MOUSE=y 559 561 # CONFIG_MOUSE_PS2 is not set
-20
arch/sh/include/asm/a.out.h
··· 1 - #ifndef __ASM_SH_A_OUT_H 2 - #define __ASM_SH_A_OUT_H 3 - 4 - struct exec 5 - { 6 - unsigned long a_info; /* Use macros N_MAGIC, etc for access */ 7 - unsigned a_text; /* length of text, in bytes */ 8 - unsigned a_data; /* length of data, in bytes */ 9 - unsigned a_bss; /* length of uninitialized data area for file, in bytes */ 10 - unsigned a_syms; /* length of symbol table data in file, in bytes */ 11 - unsigned a_entry; /* start address */ 12 - unsigned a_trsize; /* length of relocation info for text, in bytes */ 13 - unsigned a_drsize; /* length of relocation info for data, in bytes */ 14 - }; 15 - 16 - #define N_TRSIZE(a) ((a).a_trsize) 17 - #define N_DRSIZE(a) ((a).a_drsize) 18 - #define N_SYMSIZE(a) ((a).a_syms) 19 - 20 - #endif /* __ASM_SH_A_OUT_H */
+9
arch/sh/include/asm/ptrace.h
··· 104 104 105 105 extern void show_regs(struct pt_regs *); 106 106 107 + /* 108 + * These are defined as per linux/ptrace.h. 109 + */ 110 + struct task_struct; 111 + 112 + #define arch_has_single_step() (1) 113 + extern void user_enable_single_step(struct task_struct *); 114 + extern void user_disable_single_step(struct task_struct *); 115 + 107 116 #ifdef CONFIG_SH_DSP 108 117 #define task_pt_regs(task) \ 109 118 ((struct pt_regs *) (task_stack_page(task) + THREAD_SIZE \
+10
arch/sh/include/asm/seccomp.h
··· 1 + #ifndef __ASM_SECCOMP_H 2 + 3 + #include <linux/unistd.h> 4 + 5 + #define __NR_seccomp_read __NR_read 6 + #define __NR_seccomp_write __NR_write 7 + #define __NR_seccomp_exit __NR_exit 8 + #define __NR_seccomp_sigreturn __NR_rt_sigreturn 9 + 10 + #endif /* __ASM_SECCOMP_H */
+34 -13
arch/sh/include/asm/thread_info.h
··· 117 117 #define TIF_NEED_RESCHED 2 /* rescheduling necessary */ 118 118 #define TIF_RESTORE_SIGMASK 3 /* restore signal mask in do_signal() */ 119 119 #define TIF_SINGLESTEP 4 /* singlestepping active */ 120 - #define TIF_SYSCALL_AUDIT 5 120 + #define TIF_SYSCALL_AUDIT 5 /* syscall auditing active */ 121 + #define TIF_SECCOMP 6 /* secure computing */ 122 + #define TIF_NOTIFY_RESUME 7 /* callback before returning to user */ 121 123 #define TIF_USEDFPU 16 /* FPU was used by this task this quantum (SMP) */ 122 124 #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ 123 125 #define TIF_MEMDIE 18 124 - #define TIF_FREEZE 19 126 + #define TIF_FREEZE 19 /* Freezing for suspend */ 125 127 126 - #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 127 - #define _TIF_SIGPENDING (1<<TIF_SIGPENDING) 128 - #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) 129 - #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK) 130 - #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) 131 - #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) 132 - #define _TIF_USEDFPU (1<<TIF_USEDFPU) 133 - #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) 134 - #define _TIF_FREEZE (1<<TIF_FREEZE) 128 + #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE) 129 + #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) 130 + #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) 131 + #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK) 132 + #define _TIF_SINGLESTEP (1 << TIF_SINGLESTEP) 133 + #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT) 134 + #define _TIF_SECCOMP (1 << TIF_SECCOMP) 135 + #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) 136 + #define _TIF_USEDFPU (1 << TIF_USEDFPU) 137 + #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG) 138 + #define _TIF_FREEZE (1 << TIF_FREEZE) 135 139 136 - #define _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */ 137 - #define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */ 140 + /* 141 + * _TIF_ALLWORK_MASK and _TIF_WORK_MASK need to fit within a byte, or we 142 + * blow the tst immediate size constraints and need to fix up 143 + * arch/sh/kernel/entry-common.S. 144 + */ 145 + 146 + /* work to do in syscall trace */ 147 + #define _TIF_WORK_SYSCALL_MASK (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | \ 148 + _TIF_SYSCALL_AUDIT | _TIF_SECCOMP) 149 + 150 + /* work to do on any return to u-space */ 151 + #define _TIF_ALLWORK_MASK (_TIF_SYSCALL_TRACE | _TIF_SIGPENDING | \ 152 + _TIF_NEED_RESCHED | _TIF_SYSCALL_AUDIT | \ 153 + _TIF_SINGLESTEP | _TIF_RESTORE_SIGMASK | \ 154 + _TIF_NOTIFY_RESUME) 155 + 156 + /* work to do on interrupt/exception return */ 157 + #define _TIF_WORK_MASK (_TIF_ALLWORK_MASK & ~(_TIF_SYSCALL_TRACE | \ 158 + _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP)) 138 159 139 160 #endif /* __KERNEL__ */ 140 161
+3 -9
arch/sh/include/asm/tlb_64.h
··· 21 21 #ifndef __ASSEMBLY__ 22 22 23 23 /** 24 - * for_each_dtlb_entry 24 + * for_each_dtlb_entry - Iterate over free (non-wired) DTLB entries 25 25 * 26 26 * @tlb: TLB entry 27 - * 28 - * Iterate over free (non-wired) DTLB entries 29 27 */ 30 28 #define for_each_dtlb_entry(tlb) \ 31 29 for (tlb = cpu_data->dtlb.first; \ ··· 31 33 tlb += cpu_data->dtlb.step) 32 34 33 35 /** 34 - * for_each_itlb_entry 36 + * for_each_itlb_entry - Iterate over free (non-wired) ITLB entries 35 37 * 36 38 * @tlb: TLB entry 37 - * 38 - * Iterate over free (non-wired) ITLB entries 39 39 */ 40 40 #define for_each_itlb_entry(tlb) \ 41 41 for (tlb = cpu_data->itlb.first; \ ··· 41 45 tlb += cpu_data->itlb.step) 42 46 43 47 /** 44 - * __flush_tlb_slot 48 + * __flush_tlb_slot - Flushes TLB slot @slot. 45 49 * 46 50 * @slot: Address of TLB slot. 47 - * 48 - * Flushes TLB slot @slot. 49 51 */ 50 52 static inline void __flush_tlb_slot(unsigned long long slot) 51 53 {
+4 -2
arch/sh/include/cpu-sh2/cpu/cache.h
··· 21 21 #define CCR 0xffffffec 22 22 23 23 #define CCR_CACHE_CE 0x01 /* Cache enable */ 24 - #define CCR_CACHE_WT 0x06 /* CCR[bit1=1,bit2=1] */ 24 + #define CCR_CACHE_WT 0x02 /* CCR[bit1=1,bit2=1] */ 25 25 /* 0x00000000-0x7fffffff: Write-through */ 26 26 /* 0x80000000-0x9fffffff: Write-back */ 27 27 /* 0xc0000000-0xdfffffff: Write-through */ 28 - #define CCR_CACHE_CB 0x00 /* CCR[bit1=0,bit2=0] */ 28 + #define CCR_CACHE_CB 0x04 /* CCR[bit1=0,bit2=0] */ 29 29 /* 0x00000000-0x7fffffff: Write-back */ 30 30 /* 0x80000000-0x9fffffff: Write-through */ 31 31 /* 0xc0000000-0xdfffffff: Write-back */ ··· 36 36 37 37 #define CCR_CACHE_ENABLE CCR_CACHE_CE 38 38 #define CCR_CACHE_INVALIDATE CCR_CACHE_CF 39 + #define CACHE_PHYSADDR_MASK 0x1ffffc00 40 + 39 41 #endif 40 42 41 43 #endif /* __ASM_CPU_SH2_CACHE_H */
+10
arch/sh/include/cpu-sh2a/cpu/addrspace.h
··· 1 + #ifndef __ASM_SH_CPU_SH2A_ADDRSPACE_H 2 + #define __ASM_SH_CPU_SH2A_ADDRSPACE_H 3 + 4 + #define P0SEG 0x00000000 5 + #define P1SEG 0x00000000 6 + #define P2SEG 0x20000000 7 + #define P3SEG 0x40000000 8 + #define P4SEG 0x60000000 9 + 10 + #endif /* __ASM_SH_CPU_SH2A_ADDRSPACE_H */
+3
arch/sh/include/cpu-sh2a/cpu/cache.h
··· 36 36 37 37 #define CCR_CACHE_ENABLE (CCR_CACHE_OCE | CCR_CACHE_ICE) 38 38 #define CCR_CACHE_INVALIDATE (CCR_CACHE_OCI | CCR_CACHE_ICI) 39 + #define CCR_ICACHE_INVALIDATE CCR_CACHE_ICI 40 + #define CCR_OCACHE_INVALIDATE CCR_CACHE_OCI 41 + #define CACHE_PHYSADDR_MASK 0x1ffffc00 39 42 40 43 #endif /* __ASM_CPU_SH2A_CACHE_H */
+34
arch/sh/include/cpu-sh2a/cpu/cacheflush.h
··· 1 + #ifndef __ASM_CPU_SH2A_CACHEFLUSH_H 2 + #define __ASM_CPU_SH2A_CACHEFLUSH_H 3 + 4 + /* 5 + * Cache flushing: 6 + * 7 + * - flush_cache_all() flushes entire cache 8 + * - flush_cache_mm(mm) flushes the specified mm context's cache lines 9 + * - flush_cache_dup mm(mm) handles cache flushing when forking 10 + * - flush_cache_page(mm, vmaddr, pfn) flushes a single page 11 + * - flush_cache_range(vma, start, end) flushes a range of pages 12 + * 13 + * - flush_dcache_page(pg) flushes(wback&invalidates) a page for dcache 14 + * - flush_icache_range(start, end) flushes(invalidates) a range for icache 15 + * - flush_icache_page(vma, pg) flushes(invalidates) a page for icache 16 + * 17 + * Caches are indexed (effectively) by physical address on SH-2, so 18 + * we don't need them. 19 + */ 20 + #define flush_cache_all() do { } while (0) 21 + #define flush_cache_mm(mm) do { } while (0) 22 + #define flush_cache_dup_mm(mm) do { } while (0) 23 + #define flush_cache_range(vma, start, end) do { } while (0) 24 + #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) 25 + #define flush_dcache_page(page) do { } while (0) 26 + #define flush_dcache_mmap_lock(mapping) do { } while (0) 27 + #define flush_dcache_mmap_unlock(mapping) do { } while (0) 28 + void flush_icache_range(unsigned long start, unsigned long end); 29 + #define flush_icache_page(vma,pg) do { } while (0) 30 + #define flush_icache_user_range(vma,pg,adr,len) do { } while (0) 31 + #define flush_cache_sigtramp(vaddr) do { } while (0) 32 + 33 + #define p3_cache_init() do { } while (0) 34 + #endif /* __ASM_CPU_SH2A_CACHEFLUSH_H */
+1 -1
arch/sh/kernel/cpu/sh4/sq.c
··· 199 199 200 200 /** 201 201 * sq_unmap - Unmap a Store Queue allocation 202 - * @map: Pre-allocated Store Queue mapping. 202 + * @vaddr: Pre-allocated Store Queue mapping. 203 203 * 204 204 * Unmaps the store queue allocation @map that was previously created by 205 205 * sq_remap(). Also frees up the pte that was previously inserted into
+10 -9
arch/sh/kernel/cpu/sh5/entry.S
··· 987 987 work_notifysig: 988 988 gettr tr1, LINK 989 989 990 - movi do_signal, r6 990 + movi do_notify_resume, r6 991 991 ptabs r6, tr0 992 992 or SP, ZERO, r2 993 - or ZERO, ZERO, r3 994 - blink tr0, LINK /* Call do_signal(regs, 0), return here */ 993 + or r7, ZERO, r3 994 + blink tr0, LINK /* Call do_notify_resume(regs, current_thread_info->flags), return here */ 995 995 996 996 restore_all: 997 997 /* Do prefetches */ ··· 1300 1300 1301 1301 getcon KCR0, r2 1302 1302 ld.l r2, TI_FLAGS, r4 1303 - movi (_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT), r6 1303 + movi _TIF_WORK_SYSCALL_MASK, r6 1304 1304 and r6, r4, r6 1305 1305 beq/l r6, ZERO, tr0 1306 1306 1307 1307 /* Trace it by calling syscall_trace before and after */ 1308 - movi syscall_trace, r4 1308 + movi do_syscall_trace_enter, r4 1309 1309 or SP, ZERO, r2 1310 - or ZERO, ZERO, r3 1311 1310 ptabs r4, tr0 1312 1311 blink tr0, LINK 1313 1312 1314 - /* Reload syscall number as r5 is trashed by syscall_trace */ 1313 + /* Save the retval */ 1314 + st.q SP, FRAME_R(2), r2 1315 + 1316 + /* Reload syscall number as r5 is trashed by do_syscall_trace_enter */ 1315 1317 ld.q SP, FRAME_S(FSYSCALL_ID), r5 1316 1318 andi r5, 0x1ff, r5 1317 1319 ··· 1345 1343 /* We get back here only if under trace */ 1346 1344 st.q SP, FRAME_R(9), r2 /* Save return value */ 1347 1345 1348 - movi syscall_trace, LINK 1346 + movi do_syscall_trace_leave, LINK 1349 1347 or SP, ZERO, r2 1350 - movi 1, r3 1351 1348 ptabs LINK, tr0 1352 1349 blink tr0, LINK 1353 1350
+7 -9
arch/sh/kernel/entry-common.S
··· 202 202 syscall_exit_work: 203 203 ! r0: current_thread_info->flags 204 204 ! r8: current_thread_info 205 - tst #_TIF_SYSCALL_TRACE | _TIF_SINGLESTEP | _TIF_SYSCALL_AUDIT, r0 205 + tst #_TIF_WORK_SYSCALL_MASK, r0 206 206 bt/s work_pending 207 207 tst #_TIF_NEED_RESCHED, r0 208 208 #ifdef CONFIG_TRACE_IRQFLAGS ··· 211 211 nop 212 212 #endif 213 213 sti 214 - ! XXX setup arguments... 215 214 mov r15, r4 216 - mov #1, r5 217 - mov.l 4f, r0 ! do_syscall_trace 215 + mov.l 8f, r0 ! do_syscall_trace_leave 218 216 jsr @r0 219 217 nop 220 218 bra resume_userspace ··· 221 223 .align 2 222 224 syscall_trace_entry: 223 225 ! Yes it is traced. 224 - ! XXX setup arguments... 225 226 mov r15, r4 226 - mov #0, r5 227 - mov.l 4f, r11 ! Call do_syscall_trace which notifies 227 + mov.l 7f, r11 ! Call do_syscall_trace_enter which notifies 228 228 jsr @r11 ! superior (will chomp R[0-7]) 229 229 nop 230 + mov.l r0, @(OFF_R0,r15) ! Save return value 230 231 ! Reload R0-R4 from kernel stack, where the 231 232 ! parent may have modified them using 232 233 ! ptrace(POKEUSR). (Note that R0-R2 are ··· 348 351 ! 349 352 get_current_thread_info r8, r10 350 353 mov.l @(TI_FLAGS,r8), r8 351 - mov #(_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT), r10 354 + mov #_TIF_WORK_SYSCALL_MASK, r10 352 355 tst r10, r8 353 356 bf syscall_trace_entry 354 357 ! ··· 386 389 #endif 387 390 2: .long NR_syscalls 388 391 3: .long sys_call_table 389 - 4: .long do_syscall_trace 390 392 #ifdef CONFIG_TRACE_IRQFLAGS 391 393 5: .long trace_hardirqs_on 392 394 6: .long trace_hardirqs_off 393 395 #endif 396 + 7: .long do_syscall_trace_enter 397 + 8: .long do_syscall_trace_leave
+8
arch/sh/kernel/machine_kexec.c
··· 13 13 #include <linux/kexec.h> 14 14 #include <linux/delay.h> 15 15 #include <linux/reboot.h> 16 + #include <linux/numa.h> 16 17 #include <asm/pgtable.h> 17 18 #include <asm/pgalloc.h> 18 19 #include <asm/mmu_context.h> ··· 105 104 (*rnk)(page_list, reboot_code_buffer, image->start, vbr_reg); 106 105 } 107 106 107 + void arch_crash_save_vmcoreinfo(void) 108 + { 109 + #ifdef CONFIG_NUMA 110 + VMCOREINFO_SYMBOL(node_data); 111 + VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); 112 + #endif 113 + }
+5 -2
arch/sh/kernel/module.c
··· 27 27 #include <linux/moduleloader.h> 28 28 #include <linux/elf.h> 29 29 #include <linux/vmalloc.h> 30 + #include <linux/bug.h> 30 31 #include <linux/fs.h> 31 32 #include <linux/string.h> 32 33 #include <linux/kernel.h> ··· 37 36 { 38 37 if (size == 0) 39 38 return NULL; 40 - return vmalloc(size); 39 + 40 + return vmalloc_exec(size); 41 41 } 42 42 43 43 ··· 147 145 const Elf_Shdr *sechdrs, 148 146 struct module *me) 149 147 { 150 - return 0; 148 + return module_bug_finalize(hdr, sechdrs, me); 151 149 } 152 150 153 151 void module_arch_cleanup(struct module *mod) 154 152 { 153 + module_bug_cleanup(mod); 155 154 }
+56 -101
arch/sh/kernel/ptrace_32.c
··· 20 20 #include <linux/signal.h> 21 21 #include <linux/io.h> 22 22 #include <linux/audit.h> 23 + #include <linux/seccomp.h> 24 + #include <linux/tracehook.h> 23 25 #include <asm/uaccess.h> 24 26 #include <asm/pgtable.h> 25 27 #include <asm/system.h> ··· 59 57 return 0; 60 58 } 61 59 62 - static void ptrace_disable_singlestep(struct task_struct *child) 60 + void user_enable_single_step(struct task_struct *child) 61 + { 62 + struct pt_regs *regs = task_pt_regs(child); 63 + long pc; 64 + 65 + pc = get_stack_long(child, (long)&regs->pc); 66 + 67 + /* Next scheduling will set up UBC */ 68 + if (child->thread.ubc_pc == 0) 69 + ubc_usercnt += 1; 70 + 71 + child->thread.ubc_pc = pc; 72 + 73 + set_tsk_thread_flag(child, TIF_SINGLESTEP); 74 + } 75 + 76 + void user_disable_single_step(struct task_struct *child) 63 77 { 64 78 clear_tsk_thread_flag(child, TIF_SINGLESTEP); 65 79 ··· 99 81 */ 100 82 void ptrace_disable(struct task_struct *child) 101 83 { 102 - ptrace_disable_singlestep(child); 84 + user_disable_single_step(child); 103 85 } 104 86 105 87 long arch_ptrace(struct task_struct *child, long request, long addr, long data) ··· 108 90 int ret; 109 91 110 92 switch (request) { 111 - /* when I and D space are separate, these will need to be fixed. */ 112 - case PTRACE_PEEKTEXT: /* read word at location addr. */ 113 - case PTRACE_PEEKDATA: 114 - ret = generic_ptrace_peekdata(child, addr, data); 115 - break; 116 - 117 93 /* read the word at location addr in the USER area. */ 118 94 case PTRACE_PEEKUSR: { 119 95 unsigned long tmp; ··· 137 125 break; 138 126 } 139 127 140 - /* when I and D space are separate, this will have to be fixed. */ 141 - case PTRACE_POKETEXT: /* write the word at location addr. */ 142 - case PTRACE_POKEDATA: 143 - ret = generic_ptrace_pokedata(child, addr, data); 144 - break; 145 - 146 128 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ 147 129 ret = -EIO; 148 130 if ((addr & 3) || addr < 0 || ··· 156 150 ret = 0; 157 151 } 158 152 break; 159 - 160 - case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 161 - case PTRACE_CONT: { /* restart after signal. */ 162 - ret = -EIO; 163 - if (!valid_signal(data)) 164 - break; 165 - if (request == PTRACE_SYSCALL) 166 - set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 167 - else 168 - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 169 - 170 - ptrace_disable_singlestep(child); 171 - 172 - child->exit_code = data; 173 - wake_up_process(child); 174 - ret = 0; 175 - break; 176 - } 177 - 178 - /* 179 - * make the child exit. Best I can do is send it a sigkill. 180 - * perhaps it should be put in the status that it wants to 181 - * exit. 182 - */ 183 - case PTRACE_KILL: { 184 - ret = 0; 185 - if (child->exit_state == EXIT_ZOMBIE) /* already dead */ 186 - break; 187 - ptrace_disable_singlestep(child); 188 - child->exit_code = SIGKILL; 189 - wake_up_process(child); 190 - break; 191 - } 192 - 193 - case PTRACE_SINGLESTEP: { /* set the trap flag. */ 194 - long pc; 195 - struct pt_regs *regs = NULL; 196 - 197 - ret = -EIO; 198 - if (!valid_signal(data)) 199 - break; 200 - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 201 - if ((child->ptrace & PT_DTRACE) == 0) { 202 - /* Spurious delayed TF traps may occur */ 203 - child->ptrace |= PT_DTRACE; 204 - } 205 - 206 - pc = get_stack_long(child, (long)&regs->pc); 207 - 208 - /* Next scheduling will set up UBC */ 209 - if (child->thread.ubc_pc == 0) 210 - ubc_usercnt += 1; 211 - child->thread.ubc_pc = pc; 212 - 213 - set_tsk_thread_flag(child, TIF_SINGLESTEP); 214 - child->exit_code = data; 215 - /* give it a chance to run. */ 216 - wake_up_process(child); 217 - ret = 0; 218 - break; 219 - } 220 153 221 154 #ifdef CONFIG_SH_DSP 222 155 case PTRACE_GETDSPREGS: { ··· 217 272 return ret; 218 273 } 219 274 220 - asmlinkage void do_syscall_trace(struct pt_regs *regs, int entryexit) 275 + static inline int audit_arch(void) 221 276 { 222 - struct task_struct *tsk = current; 277 + int arch = EM_SH; 223 278 224 - if (unlikely(current->audit_context) && entryexit) 225 - audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]), 226 - regs->regs[0]); 279 + #ifdef CONFIG_CPU_LITTLE_ENDIAN 280 + arch |= __AUDIT_ARCH_LE; 281 + #endif 227 282 228 - if (!test_thread_flag(TIF_SYSCALL_TRACE) && 229 - !test_thread_flag(TIF_SINGLESTEP)) 230 - goto out; 231 - if (!(tsk->ptrace & PT_PTRACED)) 232 - goto out; 283 + return arch; 284 + } 233 285 234 - /* the 0x80 provides a way for the tracing parent to distinguish 235 - between a syscall stop and SIGTRAP delivery */ 236 - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && 237 - !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); 286 + asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) 287 + { 288 + long ret = 0; 238 289 239 - /* 240 - * this isn't the same as continuing with a signal, but it will do 241 - * for normal use. strace only continues with a signal if the 242 - * stopping signal is not SIGTRAP. -brl 243 - */ 244 - if (tsk->exit_code) { 245 - send_sig(tsk->exit_code, tsk, 1); 246 - tsk->exit_code = 0; 247 - } 290 + secure_computing(regs->regs[0]); 248 291 249 - out: 250 - if (unlikely(current->audit_context) && !entryexit) 251 - audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[3], 292 + if (test_thread_flag(TIF_SYSCALL_TRACE) && 293 + tracehook_report_syscall_entry(regs)) 294 + /* 295 + * Tracing decided this syscall should not happen. 296 + * We'll return a bogus call number to get an ENOSYS 297 + * error, but leave the original number in regs->regs[0]. 298 + */ 299 + ret = -1L; 300 + 301 + if (unlikely(current->audit_context)) 302 + audit_syscall_entry(audit_arch(), regs->regs[3], 252 303 regs->regs[4], regs->regs[5], 253 304 regs->regs[6], regs->regs[7]); 254 305 306 + return ret ?: regs->regs[0]; 307 + } 308 + 309 + asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) 310 + { 311 + int step; 312 + 313 + if (unlikely(current->audit_context)) 314 + audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]), 315 + regs->regs[0]); 316 + 317 + step = test_thread_flag(TIF_SINGLESTEP); 318 + if (step || test_thread_flag(TIF_SYSCALL_TRACE)) 319 + tracehook_report_syscall_exit(regs, step); 255 320 }
+54 -92
arch/sh/kernel/ptrace_64.c
··· 27 27 #include <linux/signal.h> 28 28 #include <linux/syscalls.h> 29 29 #include <linux/audit.h> 30 + #include <linux/seccomp.h> 31 + #include <linux/tracehook.h> 30 32 #include <asm/io.h> 31 33 #include <asm/uaccess.h> 32 34 #include <asm/pgtable.h> ··· 122 120 return 0; 123 121 } 124 122 123 + void user_enable_single_step(struct task_struct *child) 124 + { 125 + struct pt_regs *regs = child->thread.uregs; 126 + 127 + regs->sr |= SR_SSTEP; /* auto-resetting upon exception */ 128 + } 129 + 130 + void user_disable_single_step(struct task_struct *child) 131 + { 132 + regs->sr &= ~SR_SSTEP; 133 + } 125 134 126 135 long arch_ptrace(struct task_struct *child, long request, long addr, long data) 127 136 { 128 137 int ret; 129 138 130 139 switch (request) { 131 - /* when I and D space are separate, these will need to be fixed. */ 132 - case PTRACE_PEEKTEXT: /* read word at location addr. */ 133 - case PTRACE_PEEKDATA: 134 - ret = generic_ptrace_peekdata(child, addr, data); 135 - break; 136 - 137 140 /* read the word at location addr in the USER area. */ 138 141 case PTRACE_PEEKUSR: { 139 142 unsigned long tmp; ··· 160 153 ret = put_user(tmp, (unsigned long *)data); 161 154 break; 162 155 } 163 - 164 - /* when I and D space are separate, this will have to be fixed. */ 165 - case PTRACE_POKETEXT: /* write the word at location addr. */ 166 - case PTRACE_POKEDATA: 167 - ret = generic_ptrace_pokedata(child, addr, data); 168 - break; 169 156 170 157 case PTRACE_POKEUSR: 171 158 /* write the word at location addr in the USER area. We must ··· 192 191 } 193 192 break; 194 193 195 - case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 196 - case PTRACE_CONT: { /* restart after signal. */ 197 - ret = -EIO; 198 - if (!valid_signal(data)) 199 - break; 200 - if (request == PTRACE_SYSCALL) 201 - set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 202 - else 203 - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 204 - child->exit_code = data; 205 - wake_up_process(child); 206 - ret = 0; 207 - break; 208 - } 209 - 210 - /* 211 - * make the child exit. Best I can do is send it a sigkill. 212 - * perhaps it should be put in the status that it wants to 213 - * exit. 214 - */ 215 - case PTRACE_KILL: { 216 - ret = 0; 217 - if (child->exit_state == EXIT_ZOMBIE) /* already dead */ 218 - break; 219 - child->exit_code = SIGKILL; 220 - wake_up_process(child); 221 - break; 222 - } 223 - 224 - case PTRACE_SINGLESTEP: { /* set the trap flag. */ 225 - struct pt_regs *regs; 226 - 227 - ret = -EIO; 228 - if (!valid_signal(data)) 229 - break; 230 - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 231 - if ((child->ptrace & PT_DTRACE) == 0) { 232 - /* Spurious delayed TF traps may occur */ 233 - child->ptrace |= PT_DTRACE; 234 - } 235 - 236 - regs = child->thread.uregs; 237 - 238 - regs->sr |= SR_SSTEP; /* auto-resetting upon exception */ 239 - 240 - child->exit_code = data; 241 - /* give it a chance to run. */ 242 - wake_up_process(child); 243 - ret = 0; 244 - break; 245 - } 246 - 247 194 default: 248 195 ret = ptrace_request(child, request, addr, data); 249 196 break; ··· 222 273 return sys_ptrace(request, pid, addr, data); 223 274 } 224 275 225 - asmlinkage void syscall_trace(struct pt_regs *regs, int entryexit) 276 + static inline int audit_arch(void) 226 277 { 227 - struct task_struct *tsk = current; 278 + int arch = EM_SH; 228 279 229 - if (unlikely(current->audit_context) && entryexit) 280 + #ifdef CONFIG_64BIT 281 + arch |= __AUDIT_ARCH_64BIT; 282 + #endif 283 + #ifdef CONFIG_CPU_LITTLE_ENDIAN 284 + arch |= __AUDIT_ARCH_LE; 285 + #endif 286 + 287 + return arch; 288 + } 289 + 290 + asmlinkage long long do_syscall_trace_enter(struct pt_regs *regs) 291 + { 292 + long long ret = 0; 293 + 294 + secure_computing(regs->regs[9]); 295 + 296 + if (test_thread_flag(TIF_SYSCALL_TRACE) && 297 + tracehook_report_syscall_entry(regs)) 298 + /* 299 + * Tracing decided this syscall should not happen. 300 + * We'll return a bogus call number to get an ENOSYS 301 + * error, but leave the original number in regs->regs[0]. 302 + */ 303 + ret = -1LL; 304 + 305 + if (unlikely(current->audit_context)) 306 + audit_syscall_entry(audit_arch(), regs->regs[1], 307 + regs->regs[2], regs->regs[3], 308 + regs->regs[4], regs->regs[5]); 309 + 310 + return ret ?: regs->regs[9]; 311 + } 312 + 313 + asmlinkage void do_syscall_trace_leave(struct pt_regs *regs) 314 + { 315 + if (unlikely(current->audit_context)) 230 316 audit_syscall_exit(AUDITSC_RESULT(regs->regs[9]), 231 317 regs->regs[9]); 232 318 233 - if (!test_thread_flag(TIF_SYSCALL_TRACE) && 234 - !test_thread_flag(TIF_SINGLESTEP)) 235 - goto out; 236 - if (!(tsk->ptrace & PT_PTRACED)) 237 - goto out; 238 - 239 - ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) && 240 - !test_thread_flag(TIF_SINGLESTEP) ? 0x80 : 0)); 241 - 242 - /* 243 - * this isn't the same as continuing with a signal, but it will do 244 - * for normal use. strace only continues with a signal if the 245 - * stopping signal is not SIGTRAP. -brl 246 - */ 247 - if (tsk->exit_code) { 248 - send_sig(tsk->exit_code, tsk, 1); 249 - tsk->exit_code = 0; 250 - } 251 - 252 - out: 253 - if (unlikely(current->audit_context) && !entryexit) 254 - audit_syscall_entry(AUDIT_ARCH_SH, regs->regs[1], 255 - regs->regs[2], regs->regs[3], 256 - regs->regs[4], regs->regs[5]); 319 + if (test_thread_flag(TIF_SYSCALL_TRACE)) 320 + tracehook_report_syscall_exit(regs, 0); 257 321 } 258 322 259 323 /* Called with interrupts disabled */ ··· 300 338 */ 301 339 void ptrace_disable(struct task_struct *child) 302 340 { 303 - /* nothing to do.. */ 341 + user_disable_single_step(child); 304 342 }
+20
arch/sh/kernel/setup.c
··· 25 25 #include <linux/smp.h> 26 26 #include <linux/err.h> 27 27 #include <linux/debugfs.h> 28 + #include <linux/crash_dump.h> 28 29 #include <asm/uaccess.h> 29 30 #include <asm/io.h> 30 31 #include <asm/page.h> ··· 285 284 } 286 285 #else 287 286 extern void __init setup_memory(void); 287 + #endif 288 + 289 + /* 290 + * Note: elfcorehdr_addr is not just limited to vmcore. It is also used by 291 + * is_kdump_kernel() to determine if we are booting after a panic. Hence 292 + * ifdef it under CONFIG_CRASH_DUMP and not CONFIG_PROC_VMCORE. 293 + */ 294 + #ifdef CONFIG_CRASH_DUMP 295 + /* elfcorehdr= specifies the location of elf core header 296 + * stored by the crashed kernel. 297 + */ 298 + static int __init parse_elfcorehdr(char *arg) 299 + { 300 + if (!arg) 301 + return -EINVAL; 302 + elfcorehdr_addr = memparse(arg, &arg); 303 + return 0; 304 + } 305 + early_param("elfcorehdr", parse_elfcorehdr); 288 306 #endif 289 307 290 308 void __init setup_arch(char **cmdline_p)
+15 -7
arch/sh/kernel/signal_32.c
··· 24 24 #include <linux/binfmts.h> 25 25 #include <linux/freezer.h> 26 26 #include <linux/io.h> 27 + #include <linux/tracehook.h> 27 28 #include <asm/system.h> 28 29 #include <asm/ucontext.h> 29 30 #include <asm/uaccess.h> ··· 508 507 switch (regs->regs[0]) { 509 508 case -ERESTART_RESTARTBLOCK: 510 509 case -ERESTARTNOHAND: 510 + no_system_call_restart: 511 511 regs->regs[0] = -EINTR; 512 512 break; 513 513 514 514 case -ERESTARTSYS: 515 - if (!(ka->sa.sa_flags & SA_RESTART)) { 516 - regs->regs[0] = -EINTR; 517 - break; 518 - } 515 + if (!(ka->sa.sa_flags & SA_RESTART)) 516 + goto no_system_call_restart; 519 517 /* fallthrough */ 520 518 case -ERESTARTNOINTR: 521 519 regs->regs[0] = save_r0; ··· 589 589 * clear the TIF_RESTORE_SIGMASK flag */ 590 590 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 591 591 clear_thread_flag(TIF_RESTORE_SIGMASK); 592 + 593 + tracehook_signal_handler(signr, &info, &ka, regs, 594 + test_thread_flag(TIF_SINGLESTEP)); 592 595 } 593 596 594 597 return; 595 598 } 596 599 597 - no_signal: 600 + no_signal: 598 601 /* Did we come from a system call? */ 599 602 if (regs->tra >= 0) { 600 603 /* Restart the system call - no handlers present */ ··· 621 618 } 622 619 623 620 asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, 624 - __u32 thread_info_flags) 621 + unsigned long thread_info_flags) 625 622 { 626 623 /* deal with pending signal delivery */ 627 - if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) 624 + if (thread_info_flags & _TIF_SIGPENDING) 628 625 do_signal(regs, save_r0); 626 + 627 + if (thread_info_flags & _TIF_NOTIFY_RESUME) { 628 + clear_thread_flag(TIF_NOTIFY_RESUME); 629 + tracehook_notify_resume(regs); 630 + } 629 631 }
+88 -78
arch/sh/kernel/signal_64.c
··· 22 22 #include <linux/ptrace.h> 23 23 #include <linux/unistd.h> 24 24 #include <linux/stddef.h> 25 + #include <linux/tracehook.h> 25 26 #include <asm/ucontext.h> 26 27 #include <asm/uaccess.h> 27 28 #include <asm/pgtable.h> ··· 43 42 44 43 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 45 44 46 - asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset); 45 + /* 46 + * Note that 'init' is a special process: it doesn't get signals it doesn't 47 + * want to handle. Thus you cannot kill init even with a SIGKILL even by 48 + * mistake. 49 + * 50 + * Note that we go through the signals twice: once to check the signals that 51 + * the kernel can handle, and then we build all the user-level signal handling 52 + * stack-frames in one go after that. 53 + */ 54 + static int do_signal(struct pt_regs *regs, sigset_t *oldset) 55 + { 56 + siginfo_t info; 57 + int signr; 58 + struct k_sigaction ka; 59 + 60 + /* 61 + * We want the common case to go fast, which 62 + * is why we may in certain cases get here from 63 + * kernel mode. Just return without doing anything 64 + * if so. 65 + */ 66 + if (!user_mode(regs)) 67 + return 1; 68 + 69 + if (try_to_freeze()) 70 + goto no_signal; 71 + 72 + if (test_thread_flag(TIF_RESTORE_SIGMASK)) 73 + oldset = &current->saved_sigmask; 74 + else if (!oldset) 75 + oldset = &current->blocked; 76 + 77 + signr = get_signal_to_deliver(&info, &ka, regs, 0); 78 + 79 + if (signr > 0) { 80 + /* Whee! Actually deliver the signal. */ 81 + handle_signal(signr, &info, &ka, oldset, regs); 82 + 83 + /* 84 + * If a signal was successfully delivered, the saved sigmask 85 + * is in its frame, and we can clear the TIF_RESTORE_SIGMASK 86 + * flag. 87 + */ 88 + if (test_thread_flag(TIF_RESTORE_SIGMASK)) 89 + clear_thread_flag(TIF_RESTORE_SIGMASK); 90 + 91 + tracehook_signal_handler(signr, &info, &ka, regs, 0); 92 + return 1; 93 + } 94 + 95 + no_signal: 96 + /* Did we come from a system call? */ 97 + if (regs->syscall_nr >= 0) { 98 + /* Restart the system call - no handlers present */ 99 + switch (regs->regs[REG_RET]) { 100 + case -ERESTARTNOHAND: 101 + case -ERESTARTSYS: 102 + case -ERESTARTNOINTR: 103 + /* Decode Syscall # */ 104 + regs->regs[REG_RET] = regs->syscall_nr; 105 + regs->pc -= 4; 106 + break; 107 + 108 + case -ERESTART_RESTARTBLOCK: 109 + regs->regs[REG_RET] = __NR_restart_syscall; 110 + regs->pc -= 4; 111 + break; 112 + } 113 + } 114 + 115 + /* No signal to deliver -- put the saved sigmask back */ 116 + if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 117 + clear_thread_flag(TIF_RESTORE_SIGMASK); 118 + sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 119 + } 120 + 121 + return 0; 122 + } 47 123 48 124 /* 49 125 * Atomically swap in the new signal mask, and wait for a signal. ··· 721 643 switch (regs->regs[REG_RET]) { 722 644 case -ERESTART_RESTARTBLOCK: 723 645 case -ERESTARTNOHAND: 646 + no_system_call_restart: 724 647 regs->regs[REG_RET] = -EINTR; 725 648 break; 726 649 727 650 case -ERESTARTSYS: 728 - if (!(ka->sa.sa_flags & SA_RESTART)) { 729 - regs->regs[REG_RET] = -EINTR; 730 - break; 731 - } 651 + if (!(ka->sa.sa_flags & SA_RESTART)) 652 + goto no_system_call_restart; 732 653 /* fallthrough */ 733 654 case -ERESTARTNOINTR: 734 655 /* Decode syscall # */ ··· 750 673 spin_unlock_irq(&current->sighand->siglock); 751 674 } 752 675 753 - /* 754 - * Note that 'init' is a special process: it doesn't get signals it doesn't 755 - * want to handle. Thus you cannot kill init even with a SIGKILL even by 756 - * mistake. 757 - * 758 - * Note that we go through the signals twice: once to check the signals that 759 - * the kernel can handle, and then we build all the user-level signal handling 760 - * stack-frames in one go after that. 761 - */ 762 - int do_signal(struct pt_regs *regs, sigset_t *oldset) 676 + asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) 763 677 { 764 - siginfo_t info; 765 - int signr; 766 - struct k_sigaction ka; 678 + if (thread_info_flags & _TIF_SIGPENDING) 679 + do_signal(regs, 0); 767 680 768 - /* 769 - * We want the common case to go fast, which 770 - * is why we may in certain cases get here from 771 - * kernel mode. Just return without doing anything 772 - * if so. 773 - */ 774 - if (!user_mode(regs)) 775 - return 1; 776 - 777 - if (try_to_freeze()) 778 - goto no_signal; 779 - 780 - if (test_thread_flag(TIF_RESTORE_SIGMASK)) 781 - oldset = &current->saved_sigmask; 782 - else if (!oldset) 783 - oldset = &current->blocked; 784 - 785 - signr = get_signal_to_deliver(&info, &ka, regs, 0); 786 - 787 - if (signr > 0) { 788 - /* Whee! Actually deliver the signal. */ 789 - handle_signal(signr, &info, &ka, oldset, regs); 790 - 791 - /* 792 - * If a signal was successfully delivered, the saved sigmask 793 - * is in its frame, and we can clear the TIF_RESTORE_SIGMASK 794 - * flag. 795 - */ 796 - if (test_thread_flag(TIF_RESTORE_SIGMASK)) 797 - clear_thread_flag(TIF_RESTORE_SIGMASK); 798 - 799 - return 1; 681 + if (thread_info_flags & _TIF_NOTIFY_RESUME) { 682 + clear_thread_flag(TIF_NOTIFY_RESUME); 683 + tracehook_notify_resume(regs); 800 684 } 801 - 802 - no_signal: 803 - /* Did we come from a system call? */ 804 - if (regs->syscall_nr >= 0) { 805 - /* Restart the system call - no handlers present */ 806 - switch (regs->regs[REG_RET]) { 807 - case -ERESTARTNOHAND: 808 - case -ERESTARTSYS: 809 - case -ERESTARTNOINTR: 810 - /* Decode Syscall # */ 811 - regs->regs[REG_RET] = regs->syscall_nr; 812 - regs->pc -= 4; 813 - break; 814 - 815 - case -ERESTART_RESTARTBLOCK: 816 - regs->regs[REG_RET] = __NR_restart_syscall; 817 - regs->pc -= 4; 818 - break; 819 - } 820 - } 821 - 822 - /* No signal to deliver -- put the saved sigmask back */ 823 - if (test_thread_flag(TIF_RESTORE_SIGMASK)) { 824 - clear_thread_flag(TIF_RESTORE_SIGMASK); 825 - sigprocmask(SIG_SETMASK, &current->saved_sigmask, NULL); 826 - } 827 - 828 - return 0; 829 685 }
-1
arch/sh/mm/Kconfig
··· 237 237 238 238 config CACHE_WRITEBACK 239 239 bool "Write-back" 240 - depends on CPU_SH2A || CPU_SH3 || CPU_SH4 || CPU_SH5 241 240 242 241 config CACHE_WRITETHROUGH 243 242 bool "Write-through"
+7 -4
arch/sh/mm/Makefile_32
··· 5 5 obj-y := init.o extable_32.o consistent.o 6 6 7 7 ifndef CONFIG_CACHE_OFF 8 - obj-$(CONFIG_CPU_SH2) += cache-sh2.o 9 - obj-$(CONFIG_CPU_SH3) += cache-sh3.o 10 - obj-$(CONFIG_CPU_SH4) += cache-sh4.o 11 - obj-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o 8 + cache-$(CONFIG_CPU_SH2) := cache-sh2.o 9 + cache-$(CONFIG_CPU_SH2A) := cache-sh2a.o 10 + cache-$(CONFIG_CPU_SH3) := cache-sh3.o 11 + cache-$(CONFIG_CPU_SH4) := cache-sh4.o 12 + cache-$(CONFIG_SH7705_CACHE_32KB) += cache-sh7705.o 12 13 endif 14 + 15 + obj-y += $(cache-y) 13 16 14 17 mmu-y := tlb-nommu.o pg-nommu.o 15 18 mmu-$(CONFIG_MMU) := fault_32.o tlbflush_32.o ioremap_32.o
+36 -9
arch/sh/mm/cache-sh2.c
··· 2 2 * arch/sh/mm/cache-sh2.c 3 3 * 4 4 * Copyright (C) 2002 Paul Mundt 5 + * Copyright (C) 2008 Yoshinori Sato 5 6 * 6 7 * Released under the terms of the GNU GPL v2.0. 7 8 */ ··· 25 24 end = ((unsigned long)start + size + L1_CACHE_BYTES-1) 26 25 & ~(L1_CACHE_BYTES-1); 27 26 for (v = begin; v < end; v+=L1_CACHE_BYTES) { 28 - /* FIXME cache purge */ 29 - ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); 27 + unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0); 28 + int way; 29 + for (way = 0; way < 4; way++) { 30 + unsigned long data = ctrl_inl(addr | (way << 12)); 31 + if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { 32 + data &= ~SH_CACHE_UPDATED; 33 + ctrl_outl(data, addr | (way << 12)); 34 + } 35 + } 30 36 } 31 37 } 32 38 ··· 45 37 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); 46 38 end = ((unsigned long)start + size + L1_CACHE_BYTES-1) 47 39 & ~(L1_CACHE_BYTES-1); 48 - for (v = begin; v < end; v+=L1_CACHE_BYTES) { 49 - ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); 50 - } 40 + 41 + for (v = begin; v < end; v+=L1_CACHE_BYTES) 42 + ctrl_outl((v & CACHE_PHYSADDR_MASK), 43 + CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); 51 44 } 52 45 53 46 void __flush_invalidate_region(void *start, int size) 54 47 { 48 + #ifdef CONFIG_CACHE_WRITEBACK 49 + /* 50 + * SH-2 does not support individual line invalidation, only a 51 + * global invalidate. 52 + */ 53 + unsigned long ccr; 54 + unsigned long flags; 55 + local_irq_save(flags); 56 + jump_to_uncached(); 57 + 58 + ccr = ctrl_inl(CCR); 59 + ccr |= CCR_CACHE_INVALIDATE; 60 + ctrl_outl(ccr, CCR); 61 + 62 + back_to_cached(); 63 + local_irq_restore(flags); 64 + #else 55 65 unsigned long v; 56 66 unsigned long begin, end; 57 67 58 68 begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); 59 69 end = ((unsigned long)start + size + L1_CACHE_BYTES-1) 60 70 & ~(L1_CACHE_BYTES-1); 61 - for (v = begin; v < end; v+=L1_CACHE_BYTES) { 62 - ctrl_outl((v & 0x1ffffc00), (v & 0x00000ff0) | 0x00000008); 63 - } 64 - } 65 71 72 + for (v = begin; v < end; v+=L1_CACHE_BYTES) 73 + ctrl_outl((v & CACHE_PHYSADDR_MASK), 74 + CACHE_OC_ADDRESS_ARRAY | (v & 0x00000ff0) | 0x00000008); 75 + #endif 76 + }
+129
arch/sh/mm/cache-sh2a.c
··· 1 + /* 2 + * arch/sh/mm/cache-sh2a.c 3 + * 4 + * Copyright (C) 2008 Yoshinori Sato 5 + * 6 + * Released under the terms of the GNU GPL v2.0. 7 + */ 8 + 9 + #include <linux/init.h> 10 + #include <linux/mm.h> 11 + 12 + #include <asm/cache.h> 13 + #include <asm/addrspace.h> 14 + #include <asm/processor.h> 15 + #include <asm/cacheflush.h> 16 + #include <asm/io.h> 17 + 18 + void __flush_wback_region(void *start, int size) 19 + { 20 + unsigned long v; 21 + unsigned long begin, end; 22 + unsigned long flags; 23 + 24 + begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); 25 + end = ((unsigned long)start + size + L1_CACHE_BYTES-1) 26 + & ~(L1_CACHE_BYTES-1); 27 + 28 + local_irq_save(flags); 29 + jump_to_uncached(); 30 + 31 + for (v = begin; v < end; v+=L1_CACHE_BYTES) { 32 + unsigned long addr = CACHE_OC_ADDRESS_ARRAY | (v & 0x000007f0); 33 + int way; 34 + for (way = 0; way < 4; way++) { 35 + unsigned long data = ctrl_inl(addr | (way << 11)); 36 + if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { 37 + data &= ~SH_CACHE_UPDATED; 38 + ctrl_outl(data, addr | (way << 11)); 39 + } 40 + } 41 + } 42 + 43 + back_to_cached(); 44 + local_irq_restore(flags); 45 + } 46 + 47 + void __flush_purge_region(void *start, int size) 48 + { 49 + unsigned long v; 50 + unsigned long begin, end; 51 + unsigned long flags; 52 + 53 + begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); 54 + end = ((unsigned long)start + size + L1_CACHE_BYTES-1) 55 + & ~(L1_CACHE_BYTES-1); 56 + 57 + local_irq_save(flags); 58 + jump_to_uncached(); 59 + 60 + for (v = begin; v < end; v+=L1_CACHE_BYTES) { 61 + ctrl_outl((v & CACHE_PHYSADDR_MASK), 62 + CACHE_OC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); 63 + } 64 + back_to_cached(); 65 + local_irq_restore(flags); 66 + } 67 + 68 + void __flush_invalidate_region(void *start, int size) 69 + { 70 + unsigned long v; 71 + unsigned long begin, end; 72 + unsigned long flags; 73 + 74 + begin = (unsigned long)start & ~(L1_CACHE_BYTES-1); 75 + end = ((unsigned long)start + size + L1_CACHE_BYTES-1) 76 + & ~(L1_CACHE_BYTES-1); 77 + local_irq_save(flags); 78 + jump_to_uncached(); 79 + 80 + #ifdef CONFIG_CACHE_WRITEBACK 81 + ctrl_outl(ctrl_inl(CCR) | CCR_OCACHE_INVALIDATE, CCR); 82 + /* I-cache invalidate */ 83 + for (v = begin; v < end; v+=L1_CACHE_BYTES) { 84 + ctrl_outl((v & CACHE_PHYSADDR_MASK), 85 + CACHE_IC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); 86 + } 87 + #else 88 + for (v = begin; v < end; v+=L1_CACHE_BYTES) { 89 + ctrl_outl((v & CACHE_PHYSADDR_MASK), 90 + CACHE_IC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); 91 + ctrl_outl((v & CACHE_PHYSADDR_MASK), 92 + CACHE_OC_ADDRESS_ARRAY | (v & 0x000003f0) | 0x00000008); 93 + } 94 + #endif 95 + back_to_cached(); 96 + local_irq_restore(flags); 97 + } 98 + 99 + /* WBack O-Cache and flush I-Cache */ 100 + void flush_icache_range(unsigned long start, unsigned long end) 101 + { 102 + unsigned long v; 103 + unsigned long flags; 104 + 105 + start = start & ~(L1_CACHE_BYTES-1); 106 + end = (end + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); 107 + 108 + local_irq_save(flags); 109 + jump_to_uncached(); 110 + 111 + for (v = start; v < end; v+=L1_CACHE_BYTES) { 112 + unsigned long addr = (v & 0x000007f0); 113 + int way; 114 + /* O-Cache writeback */ 115 + for (way = 0; way < 4; way++) { 116 + unsigned long data = ctrl_inl(CACHE_OC_ADDRESS_ARRAY | addr | (way << 11)); 117 + if ((data & CACHE_PHYSADDR_MASK) == (v & CACHE_PHYSADDR_MASK)) { 118 + data &= ~SH_CACHE_UPDATED; 119 + ctrl_outl(data, CACHE_OC_ADDRESS_ARRAY | addr | (way << 11)); 120 + } 121 + } 122 + /* I-Cache invalidate */ 123 + ctrl_outl(addr, 124 + CACHE_IC_ADDRESS_ARRAY | addr | 0x00000008); 125 + } 126 + 127 + back_to_cached(); 128 + local_irq_restore(flags); 129 + }
+6 -14
arch/sh/mm/tlb-sh5.c
··· 15 15 #include <asm/mmu_context.h> 16 16 17 17 /** 18 - * sh64_tlb_init 19 - * 20 - * Perform initial setup for the DTLB and ITLB. 18 + * sh64_tlb_init - Perform initial setup for the DTLB and ITLB. 21 19 */ 22 20 int __init sh64_tlb_init(void) 23 21 { ··· 44 46 } 45 47 46 48 /** 47 - * sh64_next_free_dtlb_entry 48 - * 49 - * Find the next available DTLB entry 49 + * sh64_next_free_dtlb_entry - Find the next available DTLB entry 50 50 */ 51 51 unsigned long long sh64_next_free_dtlb_entry(void) 52 52 { ··· 52 56 } 53 57 54 58 /** 55 - * sh64_get_wired_dtlb_entry 56 - * 57 - * Allocate a wired (locked-in) entry in the DTLB 59 + * sh64_get_wired_dtlb_entry - Allocate a wired (locked-in) entry in the DTLB 58 60 */ 59 61 unsigned long long sh64_get_wired_dtlb_entry(void) 60 62 { ··· 65 71 } 66 72 67 73 /** 68 - * sh64_put_wired_dtlb_entry 74 + * sh64_put_wired_dtlb_entry - Free a wired (locked-in) entry in the DTLB. 69 75 * 70 76 * @entry: Address of TLB slot. 71 - * 72 - * Free a wired (locked-in) entry in the DTLB. 73 77 * 74 78 * Works like a stack, last one to allocate must be first one to free. 75 79 */ ··· 107 115 } 108 116 109 117 /** 110 - * sh64_setup_tlb_slot 118 + * sh64_setup_tlb_slot - Load up a translation in a wired slot. 111 119 * 112 120 * @config_addr: Address of TLB slot. 113 121 * @eaddr: Virtual address. ··· 146 154 } 147 155 148 156 /** 149 - * sh64_teardown_tlb_slot 157 + * sh64_teardown_tlb_slot - Teardown a translation. 150 158 * 151 159 * @config_addr: Address of TLB slot. 152 160 *
+2 -2
arch/sh/tools/Makefile
··· 10 10 # Shamelessly cloned from ARM. 11 11 # 12 12 13 - arch/sh/include/asm/machtypes.h: $(src)/gen-mach-types $(src)/mach-types 13 + include/asm-sh/machtypes.h: $(src)/gen-mach-types $(src)/mach-types 14 14 @echo ' Generating $@' 15 - $(Q)if [ ! -d arch/sh/include/asm ]; then mkdir -p arch/sh/include/asm; fi 15 + $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi 16 16 $(Q)$(AWK) -f $^ > $@ || { rm -f $@; /bin/false; }
+87 -85
drivers/input/keyboard/maple_keyb.c
··· 2 2 * SEGA Dreamcast keyboard driver 3 3 * Based on drivers/usb/usbkbd.c 4 4 * Copyright YAEGASHI Takeshi, 2001 5 - * Porting to 2.6 Copyright Adrian McMenamin, 2007 5 + * Porting to 2.6 Copyright Adrian McMenamin, 2007, 2008 6 6 * 7 7 * This program is free software; you can redistribute it and/or modify 8 8 * it under the terms of the GNU General Public License as published by ··· 45 45 }; 46 46 47 47 static const unsigned short dc_kbd_keycode[NR_SCANCODES] = { 48 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_A, KEY_B, KEY_C, KEY_D, 49 - KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, 50 - KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, 51 - KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_1, KEY_2, 52 - KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, 53 - KEY_ENTER, KEY_ESC, KEY_BACKSPACE, KEY_TAB, KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE, 54 - KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON, KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA, 55 - KEY_DOT, KEY_SLASH, KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, 48 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_A, KEY_B, 49 + KEY_C, KEY_D, KEY_E, KEY_F, KEY_G, KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, 50 + KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, 51 + KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, 52 + KEY_7, KEY_8, KEY_9, KEY_0, KEY_ENTER, KEY_ESC, KEY_BACKSPACE, 53 + KEY_TAB, KEY_SPACE, KEY_MINUS, KEY_EQUAL, KEY_LEFTBRACE, 54 + KEY_RIGHTBRACE, KEY_BACKSLASH, KEY_BACKSLASH, KEY_SEMICOLON, 55 + KEY_APOSTROPHE, KEY_GRAVE, KEY_COMMA, KEY_DOT, KEY_SLASH, 56 + KEY_CAPSLOCK, KEY_F1, KEY_F2, KEY_F3, KEY_F4, KEY_F5, KEY_F6, 56 57 KEY_F7, KEY_F8, KEY_F9, KEY_F10, KEY_F11, KEY_F12, KEY_SYSRQ, 57 - KEY_SCROLLLOCK, KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, KEY_DELETE, 58 - KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN, KEY_UP, 59 - KEY_NUMLOCK, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS, KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2, 60 - KEY_KP3, KEY_KP4, KEY_KP5, KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT, 61 - KEY_102ND, KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, KEY_F13, KEY_F14, KEY_F15, 62 - KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20, 63 - KEY_F21, KEY_F22, KEY_F23, KEY_F24, KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT, 64 - KEY_STOP, KEY_AGAIN, KEY_UNDO, KEY_CUT, KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE, 65 - KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_KPCOMMA, KEY_RESERVED, KEY_RO, KEY_KATAKANAHIRAGANA , KEY_YEN, 66 - KEY_HENKAN, KEY_MUHENKAN, KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 67 - KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA, KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 68 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 69 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 70 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 71 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 72 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 73 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 74 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 75 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 76 - KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 77 - KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT, KEY_LEFTMETA, KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT, KEY_RIGHTMETA, 78 - KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG, KEY_NEXTSONG, KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE, 79 - KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, KEY_FIND, KEY_SCROLLUP, KEY_SCROLLDOWN, KEY_EDIT, KEY_SLEEP, 80 - KEY_SCREENLOCK, KEY_REFRESH, KEY_CALC, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED 58 + KEY_SCROLLLOCK, KEY_PAUSE, KEY_INSERT, KEY_HOME, KEY_PAGEUP, 59 + KEY_DELETE, KEY_END, KEY_PAGEDOWN, KEY_RIGHT, KEY_LEFT, KEY_DOWN, 60 + KEY_UP, KEY_NUMLOCK, KEY_KPSLASH, KEY_KPASTERISK, KEY_KPMINUS, 61 + KEY_KPPLUS, KEY_KPENTER, KEY_KP1, KEY_KP2, KEY_KP3, KEY_KP4, KEY_KP5, 62 + KEY_KP6, KEY_KP7, KEY_KP8, KEY_KP9, KEY_KP0, KEY_KPDOT, KEY_102ND, 63 + KEY_COMPOSE, KEY_POWER, KEY_KPEQUAL, KEY_F13, KEY_F14, KEY_F15, 64 + KEY_F16, KEY_F17, KEY_F18, KEY_F19, KEY_F20, KEY_F21, KEY_F22, 65 + KEY_F23, KEY_F24, KEY_OPEN, KEY_HELP, KEY_PROPS, KEY_FRONT, KEY_STOP, 66 + KEY_AGAIN, KEY_UNDO, KEY_CUT, KEY_COPY, KEY_PASTE, KEY_FIND, KEY_MUTE, 67 + KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 68 + KEY_KPCOMMA, KEY_RESERVED, KEY_RO, KEY_KATAKANAHIRAGANA , KEY_YEN, 69 + KEY_HENKAN, KEY_MUHENKAN, KEY_KPJPCOMMA, KEY_RESERVED, KEY_RESERVED, 70 + KEY_RESERVED, KEY_HANGEUL, KEY_HANJA, KEY_KATAKANA, KEY_HIRAGANA, 71 + KEY_ZENKAKUHANKAKU, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 72 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 73 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 74 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 75 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 76 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 77 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 78 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 79 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 80 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 81 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 82 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 83 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 84 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 85 + KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, 86 + KEY_RESERVED, KEY_RESERVED, KEY_LEFTCTRL, KEY_LEFTSHIFT, KEY_LEFTALT, 87 + KEY_LEFTMETA, KEY_RIGHTCTRL, KEY_RIGHTSHIFT, KEY_RIGHTALT, 88 + KEY_RIGHTMETA, KEY_PLAYPAUSE, KEY_STOPCD, KEY_PREVIOUSSONG, 89 + KEY_NEXTSONG, KEY_EJECTCD, KEY_VOLUMEUP, KEY_VOLUMEDOWN, KEY_MUTE, 90 + KEY_WWW, KEY_BACK, KEY_FORWARD, KEY_STOP, KEY_FIND, KEY_SCROLLUP, 91 + KEY_SCROLLDOWN, KEY_EDIT, KEY_SLEEP, KEY_SCREENLOCK, KEY_REFRESH, 92 + KEY_CALC, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED, KEY_RESERVED 81 93 }; 82 94 83 95 static void dc_scan_kbd(struct dc_kbd *kbd) ··· 139 127 static void dc_kbd_callback(struct mapleq *mq) 140 128 { 141 129 struct maple_device *mapledev = mq->dev; 142 - struct dc_kbd *kbd = mapledev->private_data; 130 + struct dc_kbd *kbd = maple_get_drvdata(mapledev); 143 131 unsigned long *buf = mq->recvbuf; 144 132 145 133 /* 146 - * We should always be getting the lock because the only 147 - * time it may be locked if driver is in cleanup phase. 134 + * We should always get the lock because the only 135 + * time it may be locked is if the driver is in the cleanup phase. 148 136 */ 149 137 if (likely(mutex_trylock(&maple_keyb_mutex))) { 150 138 ··· 157 145 } 158 146 } 159 147 160 - static int dc_kbd_connect(struct maple_device *mdev) 148 + static int probe_maple_kbd(struct device *dev) 161 149 { 150 + struct maple_device *mdev = to_maple_dev(dev); 151 + struct maple_driver *mdrv = to_maple_driver(dev->driver); 162 152 int i, error; 163 153 struct dc_kbd *kbd; 164 - struct input_dev *dev; 154 + struct input_dev *idev; 165 155 166 156 if (!(mdev->function & MAPLE_FUNC_KEYBOARD)) 167 157 return -EINVAL; 168 158 169 159 kbd = kzalloc(sizeof(struct dc_kbd), GFP_KERNEL); 170 - dev = input_allocate_device(); 171 - if (!kbd || !dev) { 160 + idev = input_allocate_device(); 161 + if (!kbd || !idev) { 172 162 error = -ENOMEM; 173 163 goto fail; 174 164 } 175 165 176 - mdev->private_data = kbd; 177 - 178 - kbd->dev = dev; 166 + kbd->dev = idev; 179 167 memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode)); 180 168 181 - dev->name = mdev->product_name; 182 - dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 183 - dev->keycode = kbd->keycode; 184 - dev->keycodesize = sizeof (unsigned short); 185 - dev->keycodemax = ARRAY_SIZE(kbd->keycode); 186 - dev->id.bustype = BUS_HOST; 187 - dev->dev.parent = &mdev->dev; 169 + idev->name = mdev->product_name; 170 + idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 171 + idev->keycode = kbd->keycode; 172 + idev->keycodesize = sizeof(unsigned short); 173 + idev->keycodemax = ARRAY_SIZE(kbd->keycode); 174 + idev->id.bustype = BUS_HOST; 175 + idev->dev.parent = &mdev->dev; 188 176 189 177 for (i = 0; i < NR_SCANCODES; i++) 190 - __set_bit(dc_kbd_keycode[i], dev->keybit); 191 - __clear_bit(KEY_RESERVED, dev->keybit); 178 + __set_bit(dc_kbd_keycode[i], idev->keybit); 179 + __clear_bit(KEY_RESERVED, idev->keybit); 192 180 193 - input_set_capability(dev, EV_MSC, MSC_SCAN); 194 - input_set_drvdata(dev, kbd); 181 + input_set_capability(idev, EV_MSC, MSC_SCAN); 182 + input_set_drvdata(idev, kbd); 195 183 196 - error = input_register_device(dev); 184 + error = input_register_device(idev); 197 185 if (error) 198 186 goto fail; 199 187 200 188 /* Maple polling is locked to VBLANK - which may be just 50/s */ 201 - maple_getcond_callback(mdev, dc_kbd_callback, HZ/50, MAPLE_FUNC_KEYBOARD); 202 - return 0; 189 + maple_getcond_callback(mdev, dc_kbd_callback, HZ/50, 190 + MAPLE_FUNC_KEYBOARD); 203 191 204 - fail: 205 - input_free_device(dev); 192 + mdev->driver = mdrv; 193 + 194 + maple_set_drvdata(mdev, kbd); 195 + 196 + return error; 197 + 198 + fail: 199 + input_free_device(idev); 206 200 kfree(kbd); 207 - mdev->private_data = NULL; 201 + maple_set_drvdata(mdev, NULL); 208 202 return error; 209 203 } 210 204 211 - static void dc_kbd_disconnect(struct maple_device *mdev) 205 + static int remove_maple_kbd(struct device *dev) 212 206 { 213 - struct dc_kbd *kbd; 207 + struct maple_device *mdev = to_maple_dev(dev); 208 + struct dc_kbd *kbd = maple_get_drvdata(mdev); 214 209 215 210 mutex_lock(&maple_keyb_mutex); 216 211 217 - kbd = mdev->private_data; 218 - mdev->private_data = NULL; 219 212 input_unregister_device(kbd->dev); 220 213 kfree(kbd); 221 214 215 + maple_set_drvdata(mdev, NULL); 216 + 222 217 mutex_unlock(&maple_keyb_mutex); 223 - } 224 - 225 - /* allow the keyboard to be used */ 226 - static int probe_maple_kbd(struct device *dev) 227 - { 228 - struct maple_device *mdev = to_maple_dev(dev); 229 - struct maple_driver *mdrv = to_maple_driver(dev->driver); 230 - int error; 231 - 232 - error = dc_kbd_connect(mdev); 233 - if (error) 234 - return error; 235 - 236 - mdev->driver = mdrv; 237 - mdev->registered = 1; 238 - 239 218 return 0; 240 219 } 241 220 242 221 static struct maple_driver dc_kbd_driver = { 243 222 .function = MAPLE_FUNC_KEYBOARD, 244 - .connect = dc_kbd_connect, 245 - .disconnect = dc_kbd_disconnect, 246 223 .drv = { 247 224 .name = "Dreamcast_keyboard", 248 225 .probe = probe_maple_kbd, 249 - }, 226 + .remove = remove_maple_kbd, 227 + }, 250 228 }; 251 229 252 230 static int __init dc_kbd_init(void) 253 231 { 254 - return maple_driver_register(&dc_kbd_driver.drv); 232 + return maple_driver_register(&dc_kbd_driver); 255 233 } 256 234 257 235 static void __exit dc_kbd_exit(void) 258 236 { 259 - driver_unregister(&dc_kbd_driver.drv); 237 + maple_driver_unregister(&dc_kbd_driver); 260 238 } 261 239 262 240 module_init(dc_kbd_init);
+1 -1
drivers/net/stnic.c
··· 19 19 20 20 #include <asm/system.h> 21 21 #include <asm/io.h> 22 - #include <asm/se.h> 22 + #include <mach-se/mach/se.h> 23 23 #include <asm/machvec.h> 24 24 #ifdef CONFIG_SH_STANDARD_BIOS 25 25 #include <asm/sh_bios.h>
+41 -24
drivers/sh/maple/maple.c
··· 2 2 * Core maple bus functionality 3 3 * 4 4 * Copyright (C) 2007, 2008 Adrian McMenamin 5 + * Copyright (C) 2001 - 2008 Paul Mundt 5 6 * 6 7 * Based on 2.4 code by: 7 8 * ··· 32 31 #include <mach/dma.h> 33 32 #include <mach/sysasic.h> 34 33 35 - MODULE_AUTHOR("Yaegshi Takeshi, Paul Mundt, M.R. Brown, Adrian McMenamin"); 34 + MODULE_AUTHOR("Yaegashi Takeshi, Paul Mundt, M. R. Brown, Adrian McMenamin"); 36 35 MODULE_DESCRIPTION("Maple bus driver for Dreamcast"); 37 36 MODULE_LICENSE("GPL v2"); 38 37 MODULE_SUPPORTED_DEVICE("{{SEGA, Dreamcast/Maple}}"); ··· 66 65 static struct maple_device *baseunits[4]; 67 66 68 67 /** 69 - * maple_driver_register - register a device driver 70 - * automatically makes the driver bus a maple bus 71 - * @drv: the driver to be registered 68 + * maple_driver_register - register a maple driver 69 + * @drv: maple driver to be registered. 70 + * 71 + * Registers the passed in @drv, while updating the bus type. 72 + * Devices with matching function IDs will be automatically probed. 72 73 */ 73 - int maple_driver_register(struct device_driver *drv) 74 + int maple_driver_register(struct maple_driver *drv) 74 75 { 75 76 if (!drv) 76 77 return -EINVAL; 77 - drv->bus = &maple_bus_type; 78 - return driver_register(drv); 78 + 79 + drv->drv.bus = &maple_bus_type; 80 + 81 + return driver_register(&drv->drv); 79 82 } 80 83 EXPORT_SYMBOL_GPL(maple_driver_register); 84 + 85 + /** 86 + * maple_driver_unregister - unregister a maple driver. 87 + * @drv: maple driver to unregister. 88 + * 89 + * Cleans up after maple_driver_register(). To be invoked in the exit 90 + * path of any module drivers. 91 + */ 92 + void maple_driver_unregister(struct maple_driver *drv) 93 + { 94 + driver_unregister(&drv->drv); 95 + } 96 + EXPORT_SYMBOL_GPL(maple_driver_unregister); 81 97 82 98 /* set hardware registers to enable next round of dma */ 83 99 static void maplebus_dma_reset(void) ··· 147 129 kfree(mdev); 148 130 } 149 131 150 - /* 132 + /** 151 133 * maple_add_packet - add a single instruction to the queue 152 - * @mdev - maple device 153 - * @function - function on device being queried 154 - * @command - maple command to add 155 - * @length - length of command string (in 32 bit words) 156 - * @data - remainder of command string 134 + * @mdev: maple device 135 + * @function: function on device being queried 136 + * @command: maple command to add 137 + * @length: length of command string (in 32 bit words) 138 + * @data: remainder of command string 157 139 */ 158 140 int maple_add_packet(struct maple_device *mdev, u32 function, u32 command, 159 141 size_t length, void *data) ··· 194 176 } 195 177 EXPORT_SYMBOL_GPL(maple_add_packet); 196 178 197 - /* 179 + /** 198 180 * maple_add_packet_sleeps - add a single instruction to the queue 199 - * - waits for lock to be free 200 - * @mdev - maple device 201 - * @function - function on device being queried 202 - * @command - maple command to add 203 - * @length - length of command string (in 32 bit words) 204 - * @data - remainder of command string 181 + * @mdev: maple device 182 + * @function: function on device being queried 183 + * @command: maple command to add 184 + * @length: length of command string (in 32 bit words) 185 + * @data: remainder of command string 186 + * 187 + * Same as maple_add_packet(), but waits for the lock to become free. 205 188 */ 206 189 int maple_add_packet_sleeps(struct maple_device *mdev, u32 function, 207 190 u32 command, size_t length, void *data) ··· 743 724 static int match_maple_bus_driver(struct device *devptr, 744 725 struct device_driver *drvptr) 745 726 { 746 - struct maple_driver *maple_drv; 747 - struct maple_device *maple_dev; 727 + struct maple_driver *maple_drv = to_maple_driver(drvptr); 728 + struct maple_device *maple_dev = to_maple_dev(devptr); 748 729 749 - maple_drv = container_of(drvptr, struct maple_driver, drv); 750 - maple_dev = container_of(devptr, struct maple_device, dev); 751 730 /* Trap empty port case */ 752 731 if (maple_dev->devinfo.function == 0xFFFFFFFF) 753 732 return 0;
+6 -2
include/linux/maple.h
··· 51 51 struct maple_device { 52 52 struct maple_driver *driver; 53 53 struct mapleq *mq; 54 - void *private_data; 55 54 void (*callback) (struct mapleq * mq); 56 55 unsigned long when, interval, function; 57 56 struct maple_devinfo devinfo; ··· 69 70 void (*callback) (struct mapleq * mq), 70 71 unsigned long interval, 71 72 unsigned long function); 72 - int maple_driver_register(struct device_driver *drv); 73 + int maple_driver_register(struct maple_driver *); 74 + void maple_driver_unregister(struct maple_driver *); 75 + 73 76 int maple_add_packet_sleeps(struct maple_device *mdev, u32 function, 74 77 u32 command, u32 length, void *data); 75 78 void maple_clear_dev(struct maple_device *mdev); 76 79 77 80 #define to_maple_dev(n) container_of(n, struct maple_device, dev) 78 81 #define to_maple_driver(n) container_of(n, struct maple_driver, drv) 82 + 83 + #define maple_get_drvdata(d) dev_get_drvdata(&(d)->dev) 84 + #define maple_set_drvdata(d,p) dev_set_drvdata(&(d)->dev, (p)) 79 85 80 86 #endif /* __LINUX_MAPLE_H */
+21
mm/nommu.c
··· 266 266 } 267 267 EXPORT_SYMBOL(vmalloc_node); 268 268 269 + #ifndef PAGE_KERNEL_EXEC 270 + # define PAGE_KERNEL_EXEC PAGE_KERNEL 271 + #endif 272 + 273 + /** 274 + * vmalloc_exec - allocate virtually contiguous, executable memory 275 + * @size: allocation size 276 + * 277 + * Kernel-internal function to allocate enough pages to cover @size 278 + * the page level allocator and map them into contiguous and 279 + * executable kernel virtual space. 280 + * 281 + * For tight control over page level allocator and protection flags 282 + * use __vmalloc() instead. 283 + */ 284 + 285 + void *vmalloc_exec(unsigned long size) 286 + { 287 + return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL_EXEC); 288 + } 289 + 269 290 /** 270 291 * vmalloc_32 - allocate virtually contiguous memory (32bit addressable) 271 292 * @size: allocation size