aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68k
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-17 16:54:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-17 16:54:29 -0400
commitba2e1c5f25a99dec3873745031ad23ce3fd79bff (patch)
treeebcc8e9b0f395033e8ba1db8e30fb6ea78edc442 /arch/m68k
parent7d32c0aca4fbd0319c860d12af5fae3e88c760e6 (diff)
parent92183b346f02773dae09182c65f16b013f295d80 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k: amiga - Floppy platform device conversion m68k: amiga - Sound platform device conversion m68k: amiga - Frame buffer platform device conversion m68k: amiga - Zorro host bridge platform device conversion m68k: amiga - Zorro bus modalias support platform: Make platform resource input parameters const m68k: invoke oom-killer from page fault serial167: Kill unused variables m68k: Implement generic_find_next_{zero_,}le_bit() m68k: hp300 - Checkpatch cleanup m68k: Remove trailing spaces in messages m68k: Simplify param.h by using <asm-generic/param.h> m68k: Remove BKL from rtc implementations
Diffstat (limited to 'arch/m68k')
-rw-r--r--arch/m68k/amiga/Makefile2
-rw-r--r--arch/m68k/amiga/platform.c83
-rw-r--r--arch/m68k/bvme6000/rtc.c29
-rw-r--r--arch/m68k/hp300/time.h4
-rw-r--r--arch/m68k/include/asm/bitops_mm.h14
-rw-r--r--arch/m68k/include/asm/param.h16
-rw-r--r--arch/m68k/kernel/traps.c2
-rw-r--r--arch/m68k/mac/config.c10
-rw-r--r--arch/m68k/mm/fault.c14
-rw-r--r--arch/m68k/mvme16x/rtc.c19
-rw-r--r--arch/m68k/q40/config.c2
11 files changed, 119 insertions, 76 deletions
diff --git a/arch/m68k/amiga/Makefile b/arch/m68k/amiga/Makefile
index 6a0d7650f980..11dd30b16b3b 100644
--- a/arch/m68k/amiga/Makefile
+++ b/arch/m68k/amiga/Makefile
@@ -2,6 +2,6 @@
2# Makefile for Linux arch/m68k/amiga source directory 2# Makefile for Linux arch/m68k/amiga source directory
3# 3#
4 4
5obj-y := config.o amiints.o cia.o chipram.o amisound.o 5obj-y := config.o amiints.o cia.o chipram.o amisound.o platform.o
6 6
7obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o 7obj-$(CONFIG_AMIGA_PCMCIA) += pcmcia.o
diff --git a/arch/m68k/amiga/platform.c b/arch/m68k/amiga/platform.c
new file mode 100644
index 000000000000..38f18bf14737
--- /dev/null
+++ b/arch/m68k/amiga/platform.c
@@ -0,0 +1,83 @@
1/*
2 * Copyright (C) 2007-2009 Geert Uytterhoeven
3 *
4 * This file is subject to the terms and conditions of the GNU General Public
5 * License. See the file COPYING in the main directory of this archive
6 * for more details.
7 */
8
9#include <linux/init.h>
10#include <linux/platform_device.h>
11#include <linux/zorro.h>
12
13#include <asm/amigahw.h>
14
15
16#ifdef CONFIG_ZORRO
17
18static const struct resource zorro_resources[] __initconst = {
19 /* Zorro II regions (on Zorro II/III) */
20 {
21 .name = "Zorro II exp",
22 .start = 0x00e80000,
23 .end = 0x00efffff,
24 .flags = IORESOURCE_MEM,
25 }, {
26 .name = "Zorro II mem",
27 .start = 0x00200000,
28 .end = 0x009fffff,
29 .flags = IORESOURCE_MEM,
30 },
31 /* Zorro III regions (on Zorro III only) */
32 {
33 .name = "Zorro III exp",
34 .start = 0xff000000,
35 .end = 0xffffffff,
36 .flags = IORESOURCE_MEM,
37 }, {
38 .name = "Zorro III cfg",
39 .start = 0x40000000,
40 .end = 0x7fffffff,
41 .flags = IORESOURCE_MEM,
42 }
43};
44
45
46static int __init amiga_init_bus(void)
47{
48 if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
49 return -ENODEV;
50
51 platform_device_register_simple("amiga-zorro", -1, zorro_resources,
52 AMIGAHW_PRESENT(ZORRO3) ? 4 : 2);
53 return 0;
54}
55
56subsys_initcall(amiga_init_bus);
57
58#endif /* CONFIG_ZORRO */
59
60
61static int __init amiga_init_devices(void)
62{
63 if (!MACH_IS_AMIGA)
64 return -ENODEV;
65
66 /* video hardware */
67 if (AMIGAHW_PRESENT(AMI_VIDEO))
68 platform_device_register_simple("amiga-video", -1, NULL, 0);
69
70
71 /* sound hardware */
72 if (AMIGAHW_PRESENT(AMI_AUDIO))
73 platform_device_register_simple("amiga-audio", -1, NULL, 0);
74
75
76 /* storage interfaces */
77 if (AMIGAHW_PRESENT(AMI_FLOPPY))
78 platform_device_register_simple("amiga-floppy", -1, NULL, 0);
79
80 return 0;
81}
82
83device_initcall(amiga_init_devices);
diff --git a/arch/m68k/bvme6000/rtc.c b/arch/m68k/bvme6000/rtc.c
index b46ea1714a89..cb8617bb194b 100644
--- a/arch/m68k/bvme6000/rtc.c
+++ b/arch/m68k/bvme6000/rtc.c
@@ -9,7 +9,6 @@
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/miscdevice.h> 11#include <linux/miscdevice.h>
12#include <linux/smp_lock.h>
13#include <linux/ioport.h> 12#include <linux/ioport.h>
14#include <linux/capability.h> 13#include <linux/capability.h>
15#include <linux/fcntl.h> 14#include <linux/fcntl.h>
@@ -35,10 +34,9 @@
35static unsigned char days_in_mo[] = 34static unsigned char days_in_mo[] =
36{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 35{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
37 36
38static char rtc_status; 37static atomic_t rtc_status = ATOMIC_INIT(1);
39 38
40static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 39static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
41 unsigned long arg)
42{ 40{
43 volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE; 41 volatile RtcPtr_t rtc = (RtcPtr_t)BVME_RTC_BASE;
44 unsigned char msr; 42 unsigned char msr;
@@ -132,29 +130,20 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
132} 130}
133 131
134/* 132/*
135 * We enforce only one user at a time here with the open/close. 133 * We enforce only one user at a time here with the open/close.
136 * Also clear the previous interrupt data on an open, and clean
137 * up things on a close.
138 */ 134 */
139
140static int rtc_open(struct inode *inode, struct file *file) 135static int rtc_open(struct inode *inode, struct file *file)
141{ 136{
142 lock_kernel(); 137 if (!atomic_dec_and_test(&rtc_status)) {
143 if(rtc_status) { 138 atomic_inc(&rtc_status);
144 unlock_kernel();
145 return -EBUSY; 139 return -EBUSY;
146 } 140 }
147
148 rtc_status = 1;
149 unlock_kernel();
150 return 0; 141 return 0;
151} 142}
152 143
153static int rtc_release(struct inode *inode, struct file *file) 144static int rtc_release(struct inode *inode, struct file *file)
154{ 145{
155 lock_kernel(); 146 atomic_inc(&rtc_status);
156 rtc_status = 0;
157 unlock_kernel();
158 return 0; 147 return 0;
159} 148}
160 149
@@ -163,9 +152,9 @@ static int rtc_release(struct inode *inode, struct file *file)
163 */ 152 */
164 153
165static const struct file_operations rtc_fops = { 154static const struct file_operations rtc_fops = {
166 .ioctl = rtc_ioctl, 155 .unlocked_ioctl = rtc_ioctl,
167 .open = rtc_open, 156 .open = rtc_open,
168 .release = rtc_release, 157 .release = rtc_release,
169}; 158};
170 159
171static struct miscdevice rtc_dev = { 160static struct miscdevice rtc_dev = {
diff --git a/arch/m68k/hp300/time.h b/arch/m68k/hp300/time.h
index f5b3d098b0f5..7b98242960de 100644
--- a/arch/m68k/hp300/time.h
+++ b/arch/m68k/hp300/time.h
@@ -1,4 +1,2 @@
1extern void hp300_sched_init(irq_handler_t vector); 1extern void hp300_sched_init(irq_handler_t vector);
2extern unsigned long hp300_gettimeoffset (void); 2extern unsigned long hp300_gettimeoffset(void);
3
4
diff --git a/arch/m68k/include/asm/bitops_mm.h b/arch/m68k/include/asm/bitops_mm.h
index 9bde784e7bad..b4ecdaada520 100644
--- a/arch/m68k/include/asm/bitops_mm.h
+++ b/arch/m68k/include/asm/bitops_mm.h
@@ -365,6 +365,10 @@ static inline int minix_test_bit(int nr, const void *vaddr)
365#define ext2_set_bit_atomic(lock, nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr)) 365#define ext2_set_bit_atomic(lock, nr, addr) test_and_set_bit((nr) ^ 24, (unsigned long *)(addr))
366#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) 366#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
367#define ext2_clear_bit_atomic(lock, nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr)) 367#define ext2_clear_bit_atomic(lock, nr, addr) test_and_clear_bit((nr) ^ 24, (unsigned long *)(addr))
368#define ext2_find_next_zero_bit(addr, size, offset) \
369 generic_find_next_zero_le_bit((unsigned long *)addr, size, offset)
370#define ext2_find_next_bit(addr, size, offset) \
371 generic_find_next_le_bit((unsigned long *)addr, size, offset)
368 372
369static inline int ext2_test_bit(int nr, const void *vaddr) 373static inline int ext2_test_bit(int nr, const void *vaddr)
370{ 374{
@@ -394,10 +398,9 @@ static inline int ext2_find_first_zero_bit(const void *vaddr, unsigned size)
394 return (p - addr) * 32 + res; 398 return (p - addr) * 32 + res;
395} 399}
396 400
397static inline int ext2_find_next_zero_bit(const void *vaddr, unsigned size, 401static inline unsigned long generic_find_next_zero_le_bit(const unsigned long *addr,
398 unsigned offset) 402 unsigned long size, unsigned long offset)
399{ 403{
400 const unsigned long *addr = vaddr;
401 const unsigned long *p = addr + (offset >> 5); 404 const unsigned long *p = addr + (offset >> 5);
402 int bit = offset & 31UL, res; 405 int bit = offset & 31UL, res;
403 406
@@ -437,10 +440,9 @@ static inline int ext2_find_first_bit(const void *vaddr, unsigned size)
437 return (p - addr) * 32 + res; 440 return (p - addr) * 32 + res;
438} 441}
439 442
440static inline int ext2_find_next_bit(const void *vaddr, unsigned size, 443static inline unsigned long generic_find_next_le_bit(const unsigned long *addr,
441 unsigned offset) 444 unsigned long size, unsigned long offset)
442{ 445{
443 const unsigned long *addr = vaddr;
444 const unsigned long *p = addr + (offset >> 5); 446 const unsigned long *p = addr + (offset >> 5);
445 int bit = offset & 31UL, res; 447 int bit = offset & 31UL, res;
446 448
diff --git a/arch/m68k/include/asm/param.h b/arch/m68k/include/asm/param.h
index 85c41b75aa78..36265ccf5c7b 100644
--- a/arch/m68k/include/asm/param.h
+++ b/arch/m68k/include/asm/param.h
@@ -1,26 +1,12 @@
1#ifndef _M68K_PARAM_H 1#ifndef _M68K_PARAM_H
2#define _M68K_PARAM_H 2#define _M68K_PARAM_H
3 3
4#ifdef __KERNEL__
5# define HZ CONFIG_HZ /* Internal kernel timer frequency */
6# define USER_HZ 100 /* .. some user interfaces are in "ticks" */
7# define CLOCKS_PER_SEC (USER_HZ) /* like times() */
8#endif
9
10#ifndef HZ
11#define HZ 100
12#endif
13
14#ifdef __uClinux__ 4#ifdef __uClinux__
15#define EXEC_PAGESIZE 4096 5#define EXEC_PAGESIZE 4096
16#else 6#else
17#define EXEC_PAGESIZE 8192 7#define EXEC_PAGESIZE 8192
18#endif 8#endif
19 9
20#ifndef NOGROUP 10#include <asm-generic/param.h>
21#define NOGROUP (-1)
22#endif
23
24#define MAXHOSTNAMELEN 64 /* max length of hostname */
25 11
26#endif /* _M68K_PARAM_H */ 12#endif /* _M68K_PARAM_H */
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index aacd6d17b833..ada4f4cca811 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -455,7 +455,7 @@ static inline void access_error040(struct frame *fp)
455 455
456 if (do_page_fault(&fp->ptregs, addr, errorcode)) { 456 if (do_page_fault(&fp->ptregs, addr, errorcode)) {
457#ifdef DEBUG 457#ifdef DEBUG
458 printk("do_page_fault() !=0 \n"); 458 printk("do_page_fault() !=0\n");
459#endif 459#endif
460 if (user_mode(&fp->ptregs)){ 460 if (user_mode(&fp->ptregs)){
461 /* delay writebacks after signal delivery */ 461 /* delay writebacks after signal delivery */
diff --git a/arch/m68k/mac/config.c b/arch/m68k/mac/config.c
index 0356da9bf763..1c16b1baf8db 100644
--- a/arch/m68k/mac/config.c
+++ b/arch/m68k/mac/config.c
@@ -148,7 +148,7 @@ static void mac_cache_card_flush(int writeback)
148void __init config_mac(void) 148void __init config_mac(void)
149{ 149{
150 if (!MACH_IS_MAC) 150 if (!MACH_IS_MAC)
151 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n"); 151 printk(KERN_ERR "ERROR: no Mac, but config_mac() called!!\n");
152 152
153 mach_sched_init = mac_sched_init; 153 mach_sched_init = mac_sched_init;
154 mach_init_IRQ = mac_init_IRQ; 154 mach_init_IRQ = mac_init_IRQ;
@@ -867,7 +867,7 @@ static void __init mac_identify(void)
867 */ 867 */
868 iop_preinit(); 868 iop_preinit();
869 869
870 printk(KERN_INFO "Detected Macintosh model: %d \n", model); 870 printk(KERN_INFO "Detected Macintosh model: %d\n", model);
871 871
872 /* 872 /*
873 * Report booter data: 873 * Report booter data:
@@ -878,12 +878,12 @@ static void __init mac_identify(void)
878 mac_bi_data.videoaddr, mac_bi_data.videorow, 878 mac_bi_data.videoaddr, mac_bi_data.videorow,
879 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, 879 mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
880 mac_bi_data.dimensions >> 16); 880 mac_bi_data.dimensions >> 16);
881 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n", 881 printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx\n",
882 mac_bi_data.videological, mac_orig_videoaddr, 882 mac_bi_data.videological, mac_orig_videoaddr,
883 mac_bi_data.sccbase); 883 mac_bi_data.sccbase);
884 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n", 884 printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx\n",
885 mac_bi_data.boottime, mac_bi_data.gmtbias); 885 mac_bi_data.boottime, mac_bi_data.gmtbias);
886 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", 886 printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx\n",
887 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); 887 mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
888 888
889 iop_init(); 889 iop_init();
diff --git a/arch/m68k/mm/fault.c b/arch/m68k/mm/fault.c
index d0e35cf99fc6..a96394a0333d 100644
--- a/arch/m68k/mm/fault.c
+++ b/arch/m68k/mm/fault.c
@@ -154,7 +154,6 @@ good_area:
154 * the fault. 154 * the fault.
155 */ 155 */
156 156
157 survive:
158 fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); 157 fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0);
159#ifdef DEBUG 158#ifdef DEBUG
160 printk("handle_mm_fault returns %d\n",fault); 159 printk("handle_mm_fault returns %d\n",fault);
@@ -180,15 +179,10 @@ good_area:
180 */ 179 */
181out_of_memory: 180out_of_memory:
182 up_read(&mm->mmap_sem); 181 up_read(&mm->mmap_sem);
183 if (is_global_init(current)) { 182 if (!user_mode(regs))
184 yield(); 183 goto no_context;
185 down_read(&mm->mmap_sem); 184 pagefault_out_of_memory();
186 goto survive; 185 return 0;
187 }
188
189 printk("VM: killing process %s\n", current->comm);
190 if (user_mode(regs))
191 do_group_exit(SIGKILL);
192 186
193no_context: 187no_context:
194 current->thread.signo = SIGBUS; 188 current->thread.signo = SIGBUS;
diff --git a/arch/m68k/mvme16x/rtc.c b/arch/m68k/mvme16x/rtc.c
index 8da9c250d3e1..11ac6f63967a 100644
--- a/arch/m68k/mvme16x/rtc.c
+++ b/arch/m68k/mvme16x/rtc.c
@@ -9,7 +9,6 @@
9#include <linux/types.h> 9#include <linux/types.h>
10#include <linux/errno.h> 10#include <linux/errno.h>
11#include <linux/miscdevice.h> 11#include <linux/miscdevice.h>
12#include <linux/smp_lock.h>
13#include <linux/ioport.h> 12#include <linux/ioport.h>
14#include <linux/capability.h> 13#include <linux/capability.h>
15#include <linux/fcntl.h> 14#include <linux/fcntl.h>
@@ -36,8 +35,7 @@ static const unsigned char days_in_mo[] =
36 35
37static atomic_t rtc_ready = ATOMIC_INIT(1); 36static atomic_t rtc_ready = ATOMIC_INIT(1);
38 37
39static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 38static long rtc_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
40 unsigned long arg)
41{ 39{
42 volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE; 40 volatile MK48T08ptr_t rtc = (MK48T08ptr_t)MVME_RTC_BASE;
43 unsigned long flags; 41 unsigned long flags;
@@ -120,22 +118,15 @@ static int rtc_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
120} 118}
121 119
122/* 120/*
123 * We enforce only one user at a time here with the open/close. 121 * We enforce only one user at a time here with the open/close.
124 * Also clear the previous interrupt data on an open, and clean
125 * up things on a close.
126 */ 122 */
127
128static int rtc_open(struct inode *inode, struct file *file) 123static int rtc_open(struct inode *inode, struct file *file)
129{ 124{
130 lock_kernel();
131 if( !atomic_dec_and_test(&rtc_ready) ) 125 if( !atomic_dec_and_test(&rtc_ready) )
132 { 126 {
133 atomic_inc( &rtc_ready ); 127 atomic_inc( &rtc_ready );
134 unlock_kernel();
135 return -EBUSY; 128 return -EBUSY;
136 } 129 }
137 unlock_kernel();
138
139 return 0; 130 return 0;
140} 131}
141 132
@@ -150,9 +141,9 @@ static int rtc_release(struct inode *inode, struct file *file)
150 */ 141 */
151 142
152static const struct file_operations rtc_fops = { 143static const struct file_operations rtc_fops = {
153 .ioctl = rtc_ioctl, 144 .unlocked_ioctl = rtc_ioctl,
154 .open = rtc_open, 145 .open = rtc_open,
155 .release = rtc_release, 146 .release = rtc_release,
156}; 147};
157 148
158static struct miscdevice rtc_dev= 149static struct miscdevice rtc_dev=
diff --git a/arch/m68k/q40/config.c b/arch/m68k/q40/config.c
index 31ab3f08bbda..ad10fecec2fe 100644
--- a/arch/m68k/q40/config.c
+++ b/arch/m68k/q40/config.c
@@ -126,7 +126,7 @@ static void q40_reset(void)
126{ 126{
127 halted = 1; 127 halted = 1;
128 printk("\n\n*******************************************\n" 128 printk("\n\n*******************************************\n"
129 "Called q40_reset : press the RESET button!! \n" 129 "Called q40_reset : press the RESET button!!\n"
130 "*******************************************\n"); 130 "*******************************************\n");
131 Q40_LED_ON(); 131 Q40_LED_ON();
132 while (1) 132 while (1)