aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 16:23:33 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-13 16:23:33 -0500
commit3127f23f013eabe9b58132c05061684c49146ba3 (patch)
treecc4e794e1ada48c196822c8a480271eb68d09d29
parent8863e092410c766ca52da3e95eb9f707c7864fc2 (diff)
parent5fec45a20db3656ce36fac24639aac76c6641215 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k
Pull m68k updates from Geert Uytterhoeven. Fix up trivial conflict (m68k switched to generic version of uapi/asm/socket.h, net tree updated the old one) as per Geert. * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: m68k/sun3: Fix instruction faults m68k/sun3: Get interrupts working again m68k: move to a single instance of free_initmem() m68k: merge MMU and non-MMU versions of mm/init.c m68k: switch to using the asm-generic termios.h m68k: switch to using the asm-generic termbits.h m68k: switch to using the asm-generic sockios.h m68k: switch to using the asm-generic socket.h m68k: switch to using the asm-generic shmbuf.h m68k: switch to using the asm-generic sembuf.h m68k: switch to using the asm-generic msgbuf.h m68k: switch to using the asm-generic auxvec.h m68k: switch to using the asm-generic shmparam.h m68k: switch to using the asm-generic spinlock.h m68k: switch to using the asm-generic hw_irq.h arch/m68k: remove CONFIG_EXPERIMENTAL
-rw-r--r--arch/m68k/Kconfig.bus4
-rw-r--r--arch/m68k/Kconfig.cpu3
-rw-r--r--arch/m68k/Kconfig.debug2
-rw-r--r--arch/m68k/Kconfig.devices6
-rw-r--r--arch/m68k/include/asm/Kbuild4
-rw-r--r--arch/m68k/include/asm/hw_irq.h6
-rw-r--r--arch/m68k/include/asm/shmparam.h6
-rw-r--r--arch/m68k/include/asm/spinlock.h6
-rw-r--r--arch/m68k/include/asm/termios.h50
-rw-r--r--arch/m68k/include/uapi/asm/Kbuild17
-rw-r--r--arch/m68k/include/uapi/asm/auxvec.h4
-rw-r--r--arch/m68k/include/uapi/asm/msgbuf.h31
-rw-r--r--arch/m68k/include/uapi/asm/sembuf.h25
-rw-r--r--arch/m68k/include/uapi/asm/shmbuf.h42
-rw-r--r--arch/m68k/include/uapi/asm/socket.h73
-rw-r--r--arch/m68k/include/uapi/asm/sockios.h13
-rw-r--r--arch/m68k/include/uapi/asm/termbits.h201
-rw-r--r--arch/m68k/include/uapi/asm/termios.h44
-rw-r--r--arch/m68k/kernel/traps.c2
-rw-r--r--arch/m68k/mm/init.c224
-rw-r--r--arch/m68k/mm/init_mm.c176
-rw-r--r--arch/m68k/mm/init_no.c145
-rw-r--r--arch/m68k/mm/mcfmmu.c4
-rw-r--r--arch/m68k/mm/motorola.c14
-rw-r--r--arch/m68k/mm/sun3mmu.c4
-rw-r--r--arch/m68k/sun3/sun3ints.c29
26 files changed, 247 insertions, 888 deletions
diff --git a/arch/m68k/Kconfig.bus b/arch/m68k/Kconfig.bus
index ffc0601a2a19..93ef0346b209 100644
--- a/arch/m68k/Kconfig.bus
+++ b/arch/m68k/Kconfig.bus
@@ -28,8 +28,8 @@ config ZORRO
28 Linux use these. 28 Linux use these.
29 29
30config AMIGA_PCMCIA 30config AMIGA_PCMCIA
31 bool "Amiga 1200/600 PCMCIA support (EXPERIMENTAL)" 31 bool "Amiga 1200/600 PCMCIA support"
32 depends on AMIGA && EXPERIMENTAL 32 depends on AMIGA
33 help 33 help
34 Include support in the kernel for pcmcia on Amiga 1200 and Amiga 34 Include support in the kernel for pcmcia on Amiga 1200 and Amiga
35 600. If you intend to use pcmcia cards say Y; otherwise say N. 35 600. If you intend to use pcmcia cards say Y; otherwise say N.
diff --git a/arch/m68k/Kconfig.cpu b/arch/m68k/Kconfig.cpu
index c4eb79edecec..2f2d87b40341 100644
--- a/arch/m68k/Kconfig.cpu
+++ b/arch/m68k/Kconfig.cpu
@@ -274,9 +274,8 @@ endif # COLDFIRE
274comment "Processor Specific Options" 274comment "Processor Specific Options"
275 275
276config M68KFPU_EMU 276config M68KFPU_EMU
277 bool "Math emulation support (EXPERIMENTAL)" 277 bool "Math emulation support"
278 depends on MMU 278 depends on MMU
279 depends on EXPERIMENTAL
280 help 279 help
281 At some point in the future, this will cause floating-point math 280 At some point in the future, this will cause floating-point math
282 instructions to be emulated by the kernel on machines that lack a 281 instructions to be emulated by the kernel on machines that lack a
diff --git a/arch/m68k/Kconfig.debug b/arch/m68k/Kconfig.debug
index 87233acef18b..fa12283d58fc 100644
--- a/arch/m68k/Kconfig.debug
+++ b/arch/m68k/Kconfig.debug
@@ -41,7 +41,7 @@ config NO_KERNEL_MSG
41 41
42config BDM_DISABLE 42config BDM_DISABLE
43 bool "Disable BDM signals" 43 bool "Disable BDM signals"
44 depends on (EXPERIMENTAL && COLDFIRE) 44 depends on COLDFIRE
45 help 45 help
46 Disable the ColdFire CPU's BDM signals. 46 Disable the ColdFire CPU's BDM signals.
47 47
diff --git a/arch/m68k/Kconfig.devices b/arch/m68k/Kconfig.devices
index 04a3d9be90e9..c4cdfe444c64 100644
--- a/arch/m68k/Kconfig.devices
+++ b/arch/m68k/Kconfig.devices
@@ -60,8 +60,8 @@ endmenu
60menu "Character devices" 60menu "Character devices"
61 61
62config ATARI_DSP56K 62config ATARI_DSP56K
63 tristate "Atari DSP56k support (EXPERIMENTAL)" 63 tristate "Atari DSP56k support"
64 depends on ATARI && EXPERIMENTAL 64 depends on ATARI
65 help 65 help
66 If you want to be able to use the DSP56001 in Falcons, say Y. This 66 If you want to be able to use the DSP56001 in Falcons, say Y. This
67 driver is still experimental, and if you don't know what it is, or 67 driver is still experimental, and if you don't know what it is, or
@@ -87,7 +87,7 @@ config HPDCA
87 87
88config HPAPCI 88config HPAPCI
89 tristate "HP APCI serial support" 89 tristate "HP APCI serial support"
90 depends on HP300 && SERIAL_8250 && EXPERIMENTAL 90 depends on HP300 && SERIAL_8250
91 help 91 help
92 If you want to use the internal "APCI" serial ports on an HP400 92 If you want to use the internal "APCI" serial ports on an HP400
93 machine, say Y here. 93 machine, say Y here.
diff --git a/arch/m68k/include/asm/Kbuild b/arch/m68k/include/asm/Kbuild
index 7f1949c0e089..c7933e41f10d 100644
--- a/arch/m68k/include/asm/Kbuild
+++ b/arch/m68k/include/asm/Kbuild
@@ -7,6 +7,7 @@ generic-y += emergency-restart.h
7generic-y += errno.h 7generic-y += errno.h
8generic-y += exec.h 8generic-y += exec.h
9generic-y += futex.h 9generic-y += futex.h
10generic-y += hw_irq.h
10generic-y += ioctl.h 11generic-y += ioctl.h
11generic-y += ipcbuf.h 12generic-y += ipcbuf.h
12generic-y += irq_regs.h 13generic-y += irq_regs.h
@@ -21,8 +22,11 @@ generic-y += percpu.h
21generic-y += resource.h 22generic-y += resource.h
22generic-y += scatterlist.h 23generic-y += scatterlist.h
23generic-y += sections.h 24generic-y += sections.h
25generic-y += shmparam.h
24generic-y += siginfo.h 26generic-y += siginfo.h
27generic-y += spinlock.h
25generic-y += statfs.h 28generic-y += statfs.h
29generic-y += termios.h
26generic-y += topology.h 30generic-y += topology.h
27generic-y += trace_clock.h 31generic-y += trace_clock.h
28generic-y += types.h 32generic-y += types.h
diff --git a/arch/m68k/include/asm/hw_irq.h b/arch/m68k/include/asm/hw_irq.h
deleted file mode 100644
index eacef0951fbf..000000000000
--- a/arch/m68k/include/asm/hw_irq.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_M68K_HW_IRQ_H
2#define __ASM_M68K_HW_IRQ_H
3
4/* Dummy include. */
5
6#endif
diff --git a/arch/m68k/include/asm/shmparam.h b/arch/m68k/include/asm/shmparam.h
deleted file mode 100644
index 558892a2efb3..000000000000
--- a/arch/m68k/include/asm/shmparam.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _M68K_SHMPARAM_H
2#define _M68K_SHMPARAM_H
3
4#define SHMLBA PAGE_SIZE /* attach addr a multiple of this */
5
6#endif /* _M68K_SHMPARAM_H */
diff --git a/arch/m68k/include/asm/spinlock.h b/arch/m68k/include/asm/spinlock.h
deleted file mode 100644
index 20f46e27b534..000000000000
--- a/arch/m68k/include/asm/spinlock.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __M68K_SPINLOCK_H
2#define __M68K_SPINLOCK_H
3
4#error "m68k doesn't do SMP yet"
5
6#endif
diff --git a/arch/m68k/include/asm/termios.h b/arch/m68k/include/asm/termios.h
deleted file mode 100644
index ad8efb098663..000000000000
--- a/arch/m68k/include/asm/termios.h
+++ /dev/null
@@ -1,50 +0,0 @@
1#ifndef _M68K_TERMIOS_H
2#define _M68K_TERMIOS_H
3
4#include <uapi/asm/termios.h>
5
6/* intr=^C quit=^| erase=del kill=^U
7 eof=^D vtime=\0 vmin=\1 sxtc=\0
8 start=^Q stop=^S susp=^Z eol=\0
9 reprint=^R discard=^U werase=^W lnext=^V
10 eol2=\0
11*/
12#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0"
13
14/*
15 * Translate a "termio" structure into a "termios". Ugh.
16 */
17#define user_termio_to_kernel_termios(termios, termio) \
18({ \
19 unsigned short tmp; \
20 get_user(tmp, &(termio)->c_iflag); \
21 (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \
22 get_user(tmp, &(termio)->c_oflag); \
23 (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \
24 get_user(tmp, &(termio)->c_cflag); \
25 (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \
26 get_user(tmp, &(termio)->c_lflag); \
27 (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \
28 get_user((termios)->c_line, &(termio)->c_line); \
29 copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \
30})
31
32/*
33 * Translate a "termios" structure into a "termio". Ugh.
34 */
35#define kernel_termios_to_user_termio(termio, termios) \
36({ \
37 put_user((termios)->c_iflag, &(termio)->c_iflag); \
38 put_user((termios)->c_oflag, &(termio)->c_oflag); \
39 put_user((termios)->c_cflag, &(termio)->c_cflag); \
40 put_user((termios)->c_lflag, &(termio)->c_lflag); \
41 put_user((termios)->c_line, &(termio)->c_line); \
42 copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \
43})
44
45#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2))
46#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2))
47#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios))
48#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios))
49
50#endif /* _M68K_TERMIOS_H */
diff --git a/arch/m68k/include/uapi/asm/Kbuild b/arch/m68k/include/uapi/asm/Kbuild
index 972bce120e1e..1fef45ada097 100644
--- a/arch/m68k/include/uapi/asm/Kbuild
+++ b/arch/m68k/include/uapi/asm/Kbuild
@@ -1,26 +1,27 @@
1# UAPI Header export list 1# UAPI Header export list
2include include/uapi/asm-generic/Kbuild.asm 2include include/uapi/asm-generic/Kbuild.asm
3 3
4generic-y += auxvec.h
5generic-y += msgbuf.h
6generic-y += sembuf.h
7generic-y += shmbuf.h
8generic-y += socket.h
9generic-y += sockios.h
10generic-y += termbits.h
11generic-y += termios.h
12
4header-y += a.out.h 13header-y += a.out.h
5header-y += auxvec.h
6header-y += byteorder.h 14header-y += byteorder.h
7header-y += cachectl.h 15header-y += cachectl.h
8header-y += fcntl.h 16header-y += fcntl.h
9header-y += ioctls.h 17header-y += ioctls.h
10header-y += msgbuf.h
11header-y += param.h 18header-y += param.h
12header-y += poll.h 19header-y += poll.h
13header-y += posix_types.h 20header-y += posix_types.h
14header-y += ptrace.h 21header-y += ptrace.h
15header-y += sembuf.h
16header-y += setup.h 22header-y += setup.h
17header-y += shmbuf.h
18header-y += sigcontext.h 23header-y += sigcontext.h
19header-y += signal.h 24header-y += signal.h
20header-y += socket.h
21header-y += sockios.h
22header-y += stat.h 25header-y += stat.h
23header-y += swab.h 26header-y += swab.h
24header-y += termbits.h
25header-y += termios.h
26header-y += unistd.h 27header-y += unistd.h
diff --git a/arch/m68k/include/uapi/asm/auxvec.h b/arch/m68k/include/uapi/asm/auxvec.h
deleted file mode 100644
index 844d6d52204b..000000000000
--- a/arch/m68k/include/uapi/asm/auxvec.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __ASMm68k_AUXVEC_H
2#define __ASMm68k_AUXVEC_H
3
4#endif
diff --git a/arch/m68k/include/uapi/asm/msgbuf.h b/arch/m68k/include/uapi/asm/msgbuf.h
deleted file mode 100644
index 243cb798de8f..000000000000
--- a/arch/m68k/include/uapi/asm/msgbuf.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _M68K_MSGBUF_H
2#define _M68K_MSGBUF_H
3
4/*
5 * The msqid64_ds structure for m68k architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct msqid64_ds {
15 struct ipc64_perm msg_perm;
16 __kernel_time_t msg_stime; /* last msgsnd time */
17 unsigned long __unused1;
18 __kernel_time_t msg_rtime; /* last msgrcv time */
19 unsigned long __unused2;
20 __kernel_time_t msg_ctime; /* last change time */
21 unsigned long __unused3;
22 unsigned long msg_cbytes; /* current number of bytes on queue */
23 unsigned long msg_qnum; /* number of messages in queue */
24 unsigned long msg_qbytes; /* max number of bytes on queue */
25 __kernel_pid_t msg_lspid; /* pid of last msgsnd */
26 __kernel_pid_t msg_lrpid; /* last receive pid */
27 unsigned long __unused4;
28 unsigned long __unused5;
29};
30
31#endif /* _M68K_MSGBUF_H */
diff --git a/arch/m68k/include/uapi/asm/sembuf.h b/arch/m68k/include/uapi/asm/sembuf.h
deleted file mode 100644
index 2308052a8c24..000000000000
--- a/arch/m68k/include/uapi/asm/sembuf.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef _M68K_SEMBUF_H
2#define _M68K_SEMBUF_H
3
4/*
5 * The semid64_ds structure for m68k architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct semid64_ds {
15 struct ipc64_perm sem_perm; /* permissions .. see ipc.h */
16 __kernel_time_t sem_otime; /* last semop time */
17 unsigned long __unused1;
18 __kernel_time_t sem_ctime; /* last change time */
19 unsigned long __unused2;
20 unsigned long sem_nsems; /* no. of semaphores in array */
21 unsigned long __unused3;
22 unsigned long __unused4;
23};
24
25#endif /* _M68K_SEMBUF_H */
diff --git a/arch/m68k/include/uapi/asm/shmbuf.h b/arch/m68k/include/uapi/asm/shmbuf.h
deleted file mode 100644
index f8928d62f1b7..000000000000
--- a/arch/m68k/include/uapi/asm/shmbuf.h
+++ /dev/null
@@ -1,42 +0,0 @@
1#ifndef _M68K_SHMBUF_H
2#define _M68K_SHMBUF_H
3
4/*
5 * The shmid64_ds structure for m68k architecture.
6 * Note extra padding because this structure is passed back and forth
7 * between kernel and user space.
8 *
9 * Pad space is left for:
10 * - 64-bit time_t to solve y2038 problem
11 * - 2 miscellaneous 32-bit values
12 */
13
14struct shmid64_ds {
15 struct ipc64_perm shm_perm; /* operation perms */
16 size_t shm_segsz; /* size of segment (bytes) */
17 __kernel_time_t shm_atime; /* last attach time */
18 unsigned long __unused1;
19 __kernel_time_t shm_dtime; /* last detach time */
20 unsigned long __unused2;
21 __kernel_time_t shm_ctime; /* last change time */
22 unsigned long __unused3;
23 __kernel_pid_t shm_cpid; /* pid of creator */
24 __kernel_pid_t shm_lpid; /* pid of last operator */
25 unsigned long shm_nattch; /* no. of current attaches */
26 unsigned long __unused4;
27 unsigned long __unused5;
28};
29
30struct shminfo64 {
31 unsigned long shmmax;
32 unsigned long shmmin;
33 unsigned long shmmni;
34 unsigned long shmseg;
35 unsigned long shmall;
36 unsigned long __unused1;
37 unsigned long __unused2;
38 unsigned long __unused3;
39 unsigned long __unused4;
40};
41
42#endif /* _M68K_SHMBUF_H */
diff --git a/arch/m68k/include/uapi/asm/socket.h b/arch/m68k/include/uapi/asm/socket.h
deleted file mode 100644
index 285da3b6ad92..000000000000
--- a/arch/m68k/include/uapi/asm/socket.h
+++ /dev/null
@@ -1,73 +0,0 @@
1#ifndef _ASM_SOCKET_H
2#define _ASM_SOCKET_H
3
4#include <asm/sockios.h>
5
6/* For setsockopt(2) */
7#define SOL_SOCKET 1
8
9#define SO_DEBUG 1
10#define SO_REUSEADDR 2
11#define SO_TYPE 3
12#define SO_ERROR 4
13#define SO_DONTROUTE 5
14#define SO_BROADCAST 6
15#define SO_SNDBUF 7
16#define SO_RCVBUF 8
17#define SO_SNDBUFFORCE 32
18#define SO_RCVBUFFORCE 33
19#define SO_KEEPALIVE 9
20#define SO_OOBINLINE 10
21#define SO_NO_CHECK 11
22#define SO_PRIORITY 12
23#define SO_LINGER 13
24#define SO_BSDCOMPAT 14
25/* To add :#define SO_REUSEPORT 15 */
26#define SO_PASSCRED 16
27#define SO_PEERCRED 17
28#define SO_RCVLOWAT 18
29#define SO_SNDLOWAT 19
30#define SO_RCVTIMEO 20
31#define SO_SNDTIMEO 21
32
33/* Security levels - as per NRL IPv6 - don't actually do anything */
34#define SO_SECURITY_AUTHENTICATION 22
35#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
36#define SO_SECURITY_ENCRYPTION_NETWORK 24
37
38#define SO_BINDTODEVICE 25
39
40/* Socket filtering */
41#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 27
43#define SO_GET_FILTER SO_ATTACH_FILTER
44
45#define SO_PEERNAME 28
46#define SO_TIMESTAMP 29
47#define SCM_TIMESTAMP SO_TIMESTAMP
48
49#define SO_ACCEPTCONN 30
50
51#define SO_PEERSEC 31
52#define SO_PASSSEC 34
53#define SO_TIMESTAMPNS 35
54#define SCM_TIMESTAMPNS SO_TIMESTAMPNS
55
56#define SO_MARK 36
57
58#define SO_TIMESTAMPING 37
59#define SCM_TIMESTAMPING SO_TIMESTAMPING
60
61#define SO_PROTOCOL 38
62#define SO_DOMAIN 39
63
64#define SO_RXQ_OVFL 40
65
66#define SO_WIFI_STATUS 41
67#define SCM_WIFI_STATUS SO_WIFI_STATUS
68#define SO_PEEK_OFF 42
69
70/* Instruct lower device to use last 4-bytes of skb data as FCS */
71#define SO_NOFCS 43
72
73#endif /* _ASM_SOCKET_H */
diff --git a/arch/m68k/include/uapi/asm/sockios.h b/arch/m68k/include/uapi/asm/sockios.h
deleted file mode 100644
index c04a23943cb7..000000000000
--- a/arch/m68k/include/uapi/asm/sockios.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __ARCH_M68K_SOCKIOS__
2#define __ARCH_M68K_SOCKIOS__
3
4/* Socket-level I/O control calls. */
5#define FIOSETOWN 0x8901
6#define SIOCSPGRP 0x8902
7#define FIOGETOWN 0x8903
8#define SIOCGPGRP 0x8904
9#define SIOCATMARK 0x8905
10#define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
11#define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
12
13#endif /* __ARCH_M68K_SOCKIOS__ */
diff --git a/arch/m68k/include/uapi/asm/termbits.h b/arch/m68k/include/uapi/asm/termbits.h
deleted file mode 100644
index aea1e37b765a..000000000000
--- a/arch/m68k/include/uapi/asm/termbits.h
+++ /dev/null
@@ -1,201 +0,0 @@
1#ifndef __ARCH_M68K_TERMBITS_H__
2#define __ARCH_M68K_TERMBITS_H__
3
4#include <linux/posix_types.h>
5
6typedef unsigned char cc_t;
7typedef unsigned int speed_t;
8typedef unsigned int tcflag_t;
9
10#define NCCS 19
11struct termios {
12 tcflag_t c_iflag; /* input mode flags */
13 tcflag_t c_oflag; /* output mode flags */
14 tcflag_t c_cflag; /* control mode flags */
15 tcflag_t c_lflag; /* local mode flags */
16 cc_t c_line; /* line discipline */
17 cc_t c_cc[NCCS]; /* control characters */
18};
19
20struct termios2 {
21 tcflag_t c_iflag; /* input mode flags */
22 tcflag_t c_oflag; /* output mode flags */
23 tcflag_t c_cflag; /* control mode flags */
24 tcflag_t c_lflag; /* local mode flags */
25 cc_t c_line; /* line discipline */
26 cc_t c_cc[NCCS]; /* control characters */
27 speed_t c_ispeed; /* input speed */
28 speed_t c_ospeed; /* output speed */
29};
30
31struct ktermios {
32 tcflag_t c_iflag; /* input mode flags */
33 tcflag_t c_oflag; /* output mode flags */
34 tcflag_t c_cflag; /* control mode flags */
35 tcflag_t c_lflag; /* local mode flags */
36 cc_t c_line; /* line discipline */
37 cc_t c_cc[NCCS]; /* control characters */
38 speed_t c_ispeed; /* input speed */
39 speed_t c_ospeed; /* output speed */
40};
41
42/* c_cc characters */
43#define VINTR 0
44#define VQUIT 1
45#define VERASE 2
46#define VKILL 3
47#define VEOF 4
48#define VTIME 5
49#define VMIN 6
50#define VSWTC 7
51#define VSTART 8
52#define VSTOP 9
53#define VSUSP 10
54#define VEOL 11
55#define VREPRINT 12
56#define VDISCARD 13
57#define VWERASE 14
58#define VLNEXT 15
59#define VEOL2 16
60
61
62/* c_iflag bits */
63#define IGNBRK 0000001
64#define BRKINT 0000002
65#define IGNPAR 0000004
66#define PARMRK 0000010
67#define INPCK 0000020
68#define ISTRIP 0000040
69#define INLCR 0000100
70#define IGNCR 0000200
71#define ICRNL 0000400
72#define IUCLC 0001000
73#define IXON 0002000
74#define IXANY 0004000
75#define IXOFF 0010000
76#define IMAXBEL 0020000
77#define IUTF8 0040000
78
79/* c_oflag bits */
80#define OPOST 0000001
81#define OLCUC 0000002
82#define ONLCR 0000004
83#define OCRNL 0000010
84#define ONOCR 0000020
85#define ONLRET 0000040
86#define OFILL 0000100
87#define OFDEL 0000200
88#define NLDLY 0000400
89#define NL0 0000000
90#define NL1 0000400
91#define CRDLY 0003000
92#define CR0 0000000
93#define CR1 0001000
94#define CR2 0002000
95#define CR3 0003000
96#define TABDLY 0014000
97#define TAB0 0000000
98#define TAB1 0004000
99#define TAB2 0010000
100#define TAB3 0014000
101#define XTABS 0014000
102#define BSDLY 0020000
103#define BS0 0000000
104#define BS1 0020000
105#define VTDLY 0040000
106#define VT0 0000000
107#define VT1 0040000
108#define FFDLY 0100000
109#define FF0 0000000
110#define FF1 0100000
111
112/* c_cflag bit meaning */
113#define CBAUD 0010017
114#define B0 0000000 /* hang up */
115#define B50 0000001
116#define B75 0000002
117#define B110 0000003
118#define B134 0000004
119#define B150 0000005
120#define B200 0000006
121#define B300 0000007
122#define B600 0000010
123#define B1200 0000011
124#define B1800 0000012
125#define B2400 0000013
126#define B4800 0000014
127#define B9600 0000015
128#define B19200 0000016
129#define B38400 0000017
130#define EXTA B19200
131#define EXTB B38400
132#define CSIZE 0000060
133#define CS5 0000000
134#define CS6 0000020
135#define CS7 0000040
136#define CS8 0000060
137#define CSTOPB 0000100
138#define CREAD 0000200
139#define PARENB 0000400
140#define PARODD 0001000
141#define HUPCL 0002000
142#define CLOCAL 0004000
143#define CBAUDEX 0010000
144#define BOTHER 0010000
145#define B57600 0010001
146#define B115200 0010002
147#define B230400 0010003
148#define B460800 0010004
149#define B500000 0010005
150#define B576000 0010006
151#define B921600 0010007
152#define B1000000 0010010
153#define B1152000 0010011
154#define B1500000 0010012
155#define B2000000 0010013
156#define B2500000 0010014
157#define B3000000 0010015
158#define B3500000 0010016
159#define B4000000 0010017
160#define CIBAUD 002003600000 /* input baud rate */
161#define CMSPAR 010000000000 /* mark or space (stick) parity */
162#define CRTSCTS 020000000000 /* flow control */
163
164#define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
165
166/* c_lflag bits */
167#define ISIG 0000001
168#define ICANON 0000002
169#define XCASE 0000004
170#define ECHO 0000010
171#define ECHOE 0000020
172#define ECHOK 0000040
173#define ECHONL 0000100
174#define NOFLSH 0000200
175#define TOSTOP 0000400
176#define ECHOCTL 0001000
177#define ECHOPRT 0002000
178#define ECHOKE 0004000
179#define FLUSHO 0010000
180#define PENDIN 0040000
181#define IEXTEN 0100000
182#define EXTPROC 0200000
183
184
185/* tcflow() and TCXONC use these */
186#define TCOOFF 0
187#define TCOON 1
188#define TCIOFF 2
189#define TCION 3
190
191/* tcflush() and TCFLSH use these */
192#define TCIFLUSH 0
193#define TCOFLUSH 1
194#define TCIOFLUSH 2
195
196/* tcsetattr uses these */
197#define TCSANOW 0
198#define TCSADRAIN 1
199#define TCSAFLUSH 2
200
201#endif /* __ARCH_M68K_TERMBITS_H__ */
diff --git a/arch/m68k/include/uapi/asm/termios.h b/arch/m68k/include/uapi/asm/termios.h
deleted file mode 100644
index ce2142c9ac1d..000000000000
--- a/arch/m68k/include/uapi/asm/termios.h
+++ /dev/null
@@ -1,44 +0,0 @@
1#ifndef _UAPI_M68K_TERMIOS_H
2#define _UAPI_M68K_TERMIOS_H
3
4#include <asm/termbits.h>
5#include <asm/ioctls.h>
6
7struct winsize {
8 unsigned short ws_row;
9 unsigned short ws_col;
10 unsigned short ws_xpixel;
11 unsigned short ws_ypixel;
12};
13
14#define NCC 8
15struct termio {
16 unsigned short c_iflag; /* input mode flags */
17 unsigned short c_oflag; /* output mode flags */
18 unsigned short c_cflag; /* control mode flags */
19 unsigned short c_lflag; /* local mode flags */
20 unsigned char c_line; /* line discipline */
21 unsigned char c_cc[NCC]; /* control characters */
22};
23
24
25/* modem lines */
26#define TIOCM_LE 0x001
27#define TIOCM_DTR 0x002
28#define TIOCM_RTS 0x004
29#define TIOCM_ST 0x008
30#define TIOCM_SR 0x010
31#define TIOCM_CTS 0x020
32#define TIOCM_CAR 0x040
33#define TIOCM_RNG 0x080
34#define TIOCM_DSR 0x100
35#define TIOCM_CD TIOCM_CAR
36#define TIOCM_RI TIOCM_RNG
37#define TIOCM_OUT1 0x2000
38#define TIOCM_OUT2 0x4000
39#define TIOCM_LOOP 0x8000
40
41/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
42
43
44#endif /* _UAPI_M68K_TERMIOS_H */
diff --git a/arch/m68k/kernel/traps.c b/arch/m68k/kernel/traps.c
index 388e5cc89599..cbc624af4494 100644
--- a/arch/m68k/kernel/traps.c
+++ b/arch/m68k/kernel/traps.c
@@ -506,7 +506,7 @@ static inline void bus_error030 (struct frame *fp)
506 addr -= 2; 506 addr -= 2;
507 507
508 if (buserr_type & SUN3_BUSERR_INVALID) { 508 if (buserr_type & SUN3_BUSERR_INVALID) {
509 if (!mmu_emu_handle_fault (fp->un.fmtb.daddr, 1, 0)) 509 if (!mmu_emu_handle_fault(addr, 1, 0))
510 do_page_fault (&fp->ptregs, addr, 0); 510 do_page_fault (&fp->ptregs, addr, 0);
511 } else { 511 } else {
512#ifdef DEBUG 512#ifdef DEBUG
diff --git a/arch/m68k/mm/init.c b/arch/m68k/mm/init.c
index 27b5ce089a34..f0e05bce92f2 100644
--- a/arch/m68k/mm/init.c
+++ b/arch/m68k/mm/init.c
@@ -1,5 +1,225 @@
1/*
2 * linux/arch/m68k/mm/init.c
3 *
4 * Copyright (C) 1995 Hamish Macdonald
5 *
6 * Contains common initialization routines, specific init code moved
7 * to motorola.c and sun3mmu.c
8 */
9
10#include <linux/module.h>
11#include <linux/signal.h>
12#include <linux/sched.h>
13#include <linux/mm.h>
14#include <linux/swap.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/types.h>
18#include <linux/init.h>
19#include <linux/bootmem.h>
20#include <linux/gfp.h>
21
22#include <asm/setup.h>
23#include <asm/uaccess.h>
24#include <asm/page.h>
25#include <asm/pgalloc.h>
26#include <asm/traps.h>
27#include <asm/machdep.h>
28#include <asm/io.h>
29#ifdef CONFIG_ATARI
30#include <asm/atari_stram.h>
31#endif
32#include <asm/sections.h>
33#include <asm/tlb.h>
34
35/*
36 * ZERO_PAGE is a special page that is used for zero-initialized
37 * data and COW.
38 */
39void *empty_zero_page;
40EXPORT_SYMBOL(empty_zero_page);
41
1#ifdef CONFIG_MMU 42#ifdef CONFIG_MMU
2#include "init_mm.c" 43
44pg_data_t pg_data_map[MAX_NUMNODES];
45EXPORT_SYMBOL(pg_data_map);
46
47int m68k_virt_to_node_shift;
48
49#ifndef CONFIG_SINGLE_MEMORY_CHUNK
50pg_data_t *pg_data_table[65];
51EXPORT_SYMBOL(pg_data_table);
52#endif
53
54void __init m68k_setup_node(int node)
55{
56#ifndef CONFIG_SINGLE_MEMORY_CHUNK
57 struct mem_info *info = m68k_memory + node;
58 int i, end;
59
60 i = (unsigned long)phys_to_virt(info->addr) >> __virt_to_node_shift();
61 end = (unsigned long)phys_to_virt(info->addr + info->size - 1) >> __virt_to_node_shift();
62 for (; i <= end; i++) {
63 if (pg_data_table[i])
64 printk("overlap at %u for chunk %u\n", i, node);
65 pg_data_table[i] = pg_data_map + node;
66 }
67#endif
68 pg_data_map[node].bdata = bootmem_node_data + node;
69 node_set_online(node);
70}
71
72extern void init_pointer_table(unsigned long ptable);
73extern pmd_t *zero_pgtable;
74
75#else /* CONFIG_MMU */
76
77/*
78 * paging_init() continues the virtual memory environment setup which
79 * was begun by the code in arch/head.S.
80 * The parameters are pointers to where to stick the starting and ending
81 * addresses of available kernel virtual memory.
82 */
83void __init paging_init(void)
84{
85 /*
86 * Make sure start_mem is page aligned, otherwise bootmem and
87 * page_alloc get different views of the world.
88 */
89 unsigned long end_mem = memory_end & PAGE_MASK;
90 unsigned long zones_size[MAX_NR_ZONES] = { 0, };
91
92 high_memory = (void *) end_mem;
93
94 empty_zero_page = alloc_bootmem_pages(PAGE_SIZE);
95 memset(empty_zero_page, 0, PAGE_SIZE);
96
97 /*
98 * Set up SFC/DFC registers (user data space).
99 */
100 set_fs (USER_DS);
101
102 zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
103 free_area_init(zones_size);
104}
105
106#endif /* CONFIG_MMU */
107
108void free_initmem(void)
109{
110#ifndef CONFIG_MMU_SUN3
111 unsigned long addr;
112
113 addr = (unsigned long) __init_begin;
114 for (; addr < ((unsigned long) __init_end); addr += PAGE_SIZE) {
115 ClearPageReserved(virt_to_page(addr));
116 init_page_count(virt_to_page(addr));
117 free_page(addr);
118 totalram_pages++;
119 }
120 pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n",
121 (addr - (unsigned long) __init_begin) >> 10,
122 (unsigned int) __init_begin, (unsigned int) __init_end);
123#endif /* CONFIG_MMU_SUN3 */
124}
125
126#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE)
127#define VECTORS &vectors[0]
3#else 128#else
4#include "init_no.c" 129#define VECTORS _ramvec
130#endif
131
132void __init print_memmap(void)
133{
134#define UL(x) ((unsigned long) (x))
135#define MLK(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 10
136#define MLM(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 20
137#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), 1024)
138
139 pr_notice("Virtual kernel memory layout:\n"
140 " vector : 0x%08lx - 0x%08lx (%4ld KiB)\n"
141 " kmap : 0x%08lx - 0x%08lx (%4ld MiB)\n"
142 " vmalloc : 0x%08lx - 0x%08lx (%4ld MiB)\n"
143 " lowmem : 0x%08lx - 0x%08lx (%4ld MiB)\n"
144 " .init : 0x%p" " - 0x%p" " (%4d KiB)\n"
145 " .text : 0x%p" " - 0x%p" " (%4d KiB)\n"
146 " .data : 0x%p" " - 0x%p" " (%4d KiB)\n"
147 " .bss : 0x%p" " - 0x%p" " (%4d KiB)\n",
148 MLK(VECTORS, VECTORS + 256),
149 MLM(KMAP_START, KMAP_END),
150 MLM(VMALLOC_START, VMALLOC_END),
151 MLM(PAGE_OFFSET, (unsigned long)high_memory),
152 MLK_ROUNDUP(__init_begin, __init_end),
153 MLK_ROUNDUP(_stext, _etext),
154 MLK_ROUNDUP(_sdata, _edata),
155 MLK_ROUNDUP(__bss_start, __bss_stop));
156}
157
158void __init mem_init(void)
159{
160 pg_data_t *pgdat;
161 int codepages = 0;
162 int datapages = 0;
163 int initpages = 0;
164 int i;
165
166 /* this will put all memory onto the freelists */
167 totalram_pages = num_physpages = 0;
168 for_each_online_pgdat(pgdat) {
169 num_physpages += pgdat->node_present_pages;
170
171 totalram_pages += free_all_bootmem_node(pgdat);
172 for (i = 0; i < pgdat->node_spanned_pages; i++) {
173 struct page *page = pgdat->node_mem_map + i;
174 char *addr = page_to_virt(page);
175
176 if (!PageReserved(page))
177 continue;
178 if (addr >= _text &&
179 addr < _etext)
180 codepages++;
181 else if (addr >= __init_begin &&
182 addr < __init_end)
183 initpages++;
184 else
185 datapages++;
186 }
187 }
188
189#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
190 /* insert pointer tables allocated so far into the tablelist */
191 init_pointer_table((unsigned long)kernel_pg_dir);
192 for (i = 0; i < PTRS_PER_PGD; i++) {
193 if (pgd_present(kernel_pg_dir[i]))
194 init_pointer_table(__pgd_page(kernel_pg_dir[i]));
195 }
196
197 /* insert also pointer table that we used to unmap the zero page */
198 if (zero_pgtable)
199 init_pointer_table((unsigned long)zero_pgtable);
200#endif
201
202 pr_info("Memory: %luk/%luk available (%dk kernel code, %dk data, %dk init)\n",
203 nr_free_pages() << (PAGE_SHIFT-10),
204 totalram_pages << (PAGE_SHIFT-10),
205 codepages << (PAGE_SHIFT-10),
206 datapages << (PAGE_SHIFT-10),
207 initpages << (PAGE_SHIFT-10));
208 print_memmap();
209}
210
211#ifdef CONFIG_BLK_DEV_INITRD
212void free_initrd_mem(unsigned long start, unsigned long end)
213{
214 int pages = 0;
215 for (; start < end; start += PAGE_SIZE) {
216 ClearPageReserved(virt_to_page(start));
217 init_page_count(virt_to_page(start));
218 free_page(start);
219 totalram_pages++;
220 pages++;
221 }
222 pr_notice("Freeing initrd memory: %dk freed\n",
223 pages << (PAGE_SHIFT - 10));
224}
5#endif 225#endif
diff --git a/arch/m68k/mm/init_mm.c b/arch/m68k/mm/init_mm.c
deleted file mode 100644
index 282f9de68966..000000000000
--- a/arch/m68k/mm/init_mm.c
+++ /dev/null
@@ -1,176 +0,0 @@
1/*
2 * linux/arch/m68k/mm/init.c
3 *
4 * Copyright (C) 1995 Hamish Macdonald
5 *
6 * Contains common initialization routines, specific init code moved
7 * to motorola.c and sun3mmu.c
8 */
9
10#include <linux/module.h>
11#include <linux/signal.h>
12#include <linux/sched.h>
13#include <linux/mm.h>
14#include <linux/swap.h>
15#include <linux/kernel.h>
16#include <linux/string.h>
17#include <linux/types.h>
18#include <linux/init.h>
19#include <linux/bootmem.h>
20#include <linux/gfp.h>
21
22#include <asm/setup.h>
23#include <asm/uaccess.h>
24#include <asm/page.h>
25#include <asm/pgalloc.h>
26#include <asm/traps.h>
27#include <asm/machdep.h>
28#include <asm/io.h>
29#ifdef CONFIG_ATARI
30#include <asm/atari_stram.h>
31#endif
32#include <asm/sections.h>
33#include <asm/tlb.h>
34
35pg_data_t pg_data_map[MAX_NUMNODES];
36EXPORT_SYMBOL(pg_data_map);
37
38int m68k_virt_to_node_shift;
39
40#ifndef CONFIG_SINGLE_MEMORY_CHUNK
41pg_data_t *pg_data_table[65];
42EXPORT_SYMBOL(pg_data_table);
43#endif
44
45void __init m68k_setup_node(int node)
46{
47#ifndef CONFIG_SINGLE_MEMORY_CHUNK
48 struct mem_info *info = m68k_memory + node;
49 int i, end;
50
51 i = (unsigned long)phys_to_virt(info->addr) >> __virt_to_node_shift();
52 end = (unsigned long)phys_to_virt(info->addr + info->size - 1) >> __virt_to_node_shift();
53 for (; i <= end; i++) {
54 if (pg_data_table[i])
55 printk("overlap at %u for chunk %u\n", i, node);
56 pg_data_table[i] = pg_data_map + node;
57 }
58#endif
59 pg_data_map[node].bdata = bootmem_node_data + node;
60 node_set_online(node);
61}
62
63
64/*
65 * ZERO_PAGE is a special page that is used for zero-initialized
66 * data and COW.
67 */
68
69void *empty_zero_page;
70EXPORT_SYMBOL(empty_zero_page);
71
72extern void init_pointer_table(unsigned long ptable);
73
74/* References to section boundaries */
75
76extern pmd_t *zero_pgtable;
77
78#if defined(CONFIG_MMU) && !defined(CONFIG_COLDFIRE)
79#define VECTORS &vectors[0]
80#else
81#define VECTORS _ramvec
82#endif
83
84void __init print_memmap(void)
85{
86#define UL(x) ((unsigned long) (x))
87#define MLK(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 10
88#define MLM(b, t) UL(b), UL(t), (UL(t) - UL(b)) >> 20
89#define MLK_ROUNDUP(b, t) b, t, DIV_ROUND_UP(((t) - (b)), 1024)
90
91 pr_notice("Virtual kernel memory layout:\n"
92 " vector : 0x%08lx - 0x%08lx (%4ld KiB)\n"
93 " kmap : 0x%08lx - 0x%08lx (%4ld MiB)\n"
94 " vmalloc : 0x%08lx - 0x%08lx (%4ld MiB)\n"
95 " lowmem : 0x%08lx - 0x%08lx (%4ld MiB)\n"
96 " .init : 0x%p" " - 0x%p" " (%4d KiB)\n"
97 " .text : 0x%p" " - 0x%p" " (%4d KiB)\n"
98 " .data : 0x%p" " - 0x%p" " (%4d KiB)\n"
99 " .bss : 0x%p" " - 0x%p" " (%4d KiB)\n",
100 MLK(VECTORS, VECTORS + 256),
101 MLM(KMAP_START, KMAP_END),
102 MLM(VMALLOC_START, VMALLOC_END),
103 MLM(PAGE_OFFSET, (unsigned long)high_memory),
104 MLK_ROUNDUP(__init_begin, __init_end),
105 MLK_ROUNDUP(_stext, _etext),
106 MLK_ROUNDUP(_sdata, _edata),
107 MLK_ROUNDUP(__bss_start, __bss_stop));
108}
109
110void __init mem_init(void)
111{
112 pg_data_t *pgdat;
113 int codepages = 0;
114 int datapages = 0;
115 int initpages = 0;
116 int i;
117
118 /* this will put all memory onto the freelists */
119 totalram_pages = num_physpages = 0;
120 for_each_online_pgdat(pgdat) {
121 num_physpages += pgdat->node_present_pages;
122
123 totalram_pages += free_all_bootmem_node(pgdat);
124 for (i = 0; i < pgdat->node_spanned_pages; i++) {
125 struct page *page = pgdat->node_mem_map + i;
126 char *addr = page_to_virt(page);
127
128 if (!PageReserved(page))
129 continue;
130 if (addr >= _text &&
131 addr < _etext)
132 codepages++;
133 else if (addr >= __init_begin &&
134 addr < __init_end)
135 initpages++;
136 else
137 datapages++;
138 }
139 }
140
141#if !defined(CONFIG_SUN3) && !defined(CONFIG_COLDFIRE)
142 /* insert pointer tables allocated so far into the tablelist */
143 init_pointer_table((unsigned long)kernel_pg_dir);
144 for (i = 0; i < PTRS_PER_PGD; i++) {
145 if (pgd_present(kernel_pg_dir[i]))
146 init_pointer_table(__pgd_page(kernel_pg_dir[i]));
147 }
148
149 /* insert also pointer table that we used to unmap the zero page */
150 if (zero_pgtable)
151 init_pointer_table((unsigned long)zero_pgtable);
152#endif
153
154 printk("Memory: %luk/%luk available (%dk kernel code, %dk data, %dk init)\n",
155 nr_free_pages() << (PAGE_SHIFT-10),
156 totalram_pages << (PAGE_SHIFT-10),
157 codepages << (PAGE_SHIFT-10),
158 datapages << (PAGE_SHIFT-10),
159 initpages << (PAGE_SHIFT-10));
160 print_memmap();
161}
162
163#ifdef CONFIG_BLK_DEV_INITRD
164void free_initrd_mem(unsigned long start, unsigned long end)
165{
166 int pages = 0;
167 for (; start < end; start += PAGE_SIZE) {
168 ClearPageReserved(virt_to_page(start));
169 init_page_count(virt_to_page(start));
170 free_page(start);
171 totalram_pages++;
172 pages++;
173 }
174 printk ("Freeing initrd memory: %dk freed\n", pages);
175}
176#endif
diff --git a/arch/m68k/mm/init_no.c b/arch/m68k/mm/init_no.c
deleted file mode 100644
index 688e3664aea0..000000000000
--- a/arch/m68k/mm/init_no.c
+++ /dev/null
@@ -1,145 +0,0 @@
1/*
2 * linux/arch/m68knommu/mm/init.c
3 *
4 * Copyright (C) 1998 D. Jeff Dionne <jeff@lineo.ca>,
5 * Kenneth Albanowski <kjahds@kjahds.com>,
6 * Copyright (C) 2000 Lineo, Inc. (www.lineo.com)
7 *
8 * Based on:
9 *
10 * linux/arch/m68k/mm/init.c
11 *
12 * Copyright (C) 1995 Hamish Macdonald
13 *
14 * JAN/1999 -- hacked to support ColdFire (gerg@snapgear.com)
15 * DEC/2000 -- linux 2.4 support <davidm@snapgear.com>
16 */
17
18#include <linux/signal.h>
19#include <linux/sched.h>
20#include <linux/kernel.h>
21#include <linux/errno.h>
22#include <linux/string.h>
23#include <linux/types.h>
24#include <linux/ptrace.h>
25#include <linux/mman.h>
26#include <linux/mm.h>
27#include <linux/swap.h>
28#include <linux/init.h>
29#include <linux/highmem.h>
30#include <linux/pagemap.h>
31#include <linux/bootmem.h>
32#include <linux/gfp.h>
33
34#include <asm/setup.h>
35#include <asm/sections.h>
36#include <asm/segment.h>
37#include <asm/page.h>
38#include <asm/pgtable.h>
39#include <asm/machdep.h>
40
41/*
42 * ZERO_PAGE is a special page that is used for zero-initialized
43 * data and COW.
44 */
45void *empty_zero_page;
46
47/*
48 * paging_init() continues the virtual memory environment setup which
49 * was begun by the code in arch/head.S.
50 * The parameters are pointers to where to stick the starting and ending
51 * addresses of available kernel virtual memory.
52 */
53void __init paging_init(void)
54{
55 /*
56 * Make sure start_mem is page aligned, otherwise bootmem and
57 * page_alloc get different views of the world.
58 */
59 unsigned long end_mem = memory_end & PAGE_MASK;
60 unsigned long zones_size[MAX_NR_ZONES] = {0, };
61
62 empty_zero_page = alloc_bootmem_pages(PAGE_SIZE);
63 memset(empty_zero_page, 0, PAGE_SIZE);
64
65 /*
66 * Set up SFC/DFC registers (user data space).
67 */
68 set_fs (USER_DS);
69
70 zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
71 free_area_init(zones_size);
72}
73
74void __init mem_init(void)
75{
76 int codek = 0, datak = 0, initk = 0;
77 unsigned long tmp;
78 unsigned long len = _ramend - _rambase;
79 unsigned long start_mem = memory_start; /* DAVIDM - these must start at end of kernel */
80 unsigned long end_mem = memory_end; /* DAVIDM - this must not include kernel stack at top */
81
82 pr_debug("Mem_init: start=%lx, end=%lx\n", start_mem, end_mem);
83
84 end_mem &= PAGE_MASK;
85 high_memory = (void *) end_mem;
86
87 start_mem = PAGE_ALIGN(start_mem);
88 max_mapnr = num_physpages = (((unsigned long) high_memory) - PAGE_OFFSET) >> PAGE_SHIFT;
89
90 /* this will put all memory onto the freelists */
91 totalram_pages = free_all_bootmem();
92
93 codek = (_etext - _stext) >> 10;
94 datak = (__bss_stop - _sdata) >> 10;
95 initk = (__init_begin - __init_end) >> 10;
96
97 tmp = nr_free_pages() << PAGE_SHIFT;
98 printk(KERN_INFO "Memory available: %luk/%luk RAM, (%dk kernel code, %dk data)\n",
99 tmp >> 10,
100 len >> 10,
101 codek,
102 datak
103 );
104}
105
106
107#ifdef CONFIG_BLK_DEV_INITRD
108void free_initrd_mem(unsigned long start, unsigned long end)
109{
110 int pages = 0;
111 for (; start < end; start += PAGE_SIZE) {
112 ClearPageReserved(virt_to_page(start));
113 init_page_count(virt_to_page(start));
114 free_page(start);
115 totalram_pages++;
116 pages++;
117 }
118 pr_notice("Freeing initrd memory: %luk freed\n",
119 pages * (PAGE_SIZE / 1024));
120}
121#endif
122
123void free_initmem(void)
124{
125#ifdef CONFIG_RAMKERNEL
126 unsigned long addr;
127 /*
128 * The following code should be cool even if these sections
129 * are not page aligned.
130 */
131 addr = PAGE_ALIGN((unsigned long) __init_begin);
132 /* next to check that the page we free is not a partial page */
133 for (; addr + PAGE_SIZE < ((unsigned long) __init_end); addr += PAGE_SIZE) {
134 ClearPageReserved(virt_to_page(addr));
135 init_page_count(virt_to_page(addr));
136 free_page(addr);
137 totalram_pages++;
138 }
139 pr_notice("Freeing unused kernel memory: %luk freed (0x%x - 0x%x)\n",
140 (addr - PAGE_ALIGN((unsigned long) __init_begin)) >> 10,
141 (int)(PAGE_ALIGN((unsigned long) __init_begin)),
142 (int)(addr - PAGE_SIZE));
143#endif
144}
145
diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
index 875b800ef0dd..f58fafe7e4c9 100644
--- a/arch/m68k/mm/mcfmmu.c
+++ b/arch/m68k/mm/mcfmmu.c
@@ -29,10 +29,6 @@ atomic_t nr_free_contexts;
29struct mm_struct *context_mm[LAST_CONTEXT+1]; 29struct mm_struct *context_mm[LAST_CONTEXT+1];
30extern unsigned long num_pages; 30extern unsigned long num_pages;
31 31
32void free_initmem(void)
33{
34}
35
36/* 32/*
37 * ColdFire paging_init derived from sun3. 33 * ColdFire paging_init derived from sun3.
38 */ 34 */
diff --git a/arch/m68k/mm/motorola.c b/arch/m68k/mm/motorola.c
index 0dafa693515b..251c5437787b 100644
--- a/arch/m68k/mm/motorola.c
+++ b/arch/m68k/mm/motorola.c
@@ -304,17 +304,3 @@ void __init paging_init(void)
304 } 304 }
305} 305}
306 306
307void free_initmem(void)
308{
309 unsigned long addr;
310
311 addr = (unsigned long)__init_begin;
312 for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
313 virt_to_page(addr)->flags &= ~(1 << PG_reserved);
314 init_page_count(virt_to_page(addr));
315 free_page(addr);
316 totalram_pages++;
317 }
318}
319
320
diff --git a/arch/m68k/mm/sun3mmu.c b/arch/m68k/mm/sun3mmu.c
index e0804060501e..269f81158a33 100644
--- a/arch/m68k/mm/sun3mmu.c
+++ b/arch/m68k/mm/sun3mmu.c
@@ -30,10 +30,6 @@ const char bad_pmd_string[] = "Bad pmd in pte_alloc: %08lx\n";
30 30
31extern unsigned long num_pages; 31extern unsigned long num_pages;
32 32
33void free_initmem(void)
34{
35}
36
37/* For the sun3 we try to follow the i386 paging_init() more closely */ 33/* For the sun3 we try to follow the i386 paging_init() more closely */
38/* start_mem and end_mem have PAGE_OFFSET added already */ 34/* start_mem and end_mem have PAGE_OFFSET added already */
39/* now sets up tables using sun3 PTEs rather than i386 as before. --m */ 35/* now sets up tables using sun3 PTEs rather than i386 as before. --m */
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c
index 78b60f53e90a..6bbca30c9188 100644
--- a/arch/m68k/sun3/sun3ints.c
+++ b/arch/m68k/sun3/sun3ints.c
@@ -66,6 +66,8 @@ static irqreturn_t sun3_int5(int irq, void *dev_id)
66#ifdef CONFIG_SUN3 66#ifdef CONFIG_SUN3
67 intersil_clear(); 67 intersil_clear();
68#endif 68#endif
69 sun3_disable_irq(5);
70 sun3_enable_irq(5);
69#ifdef CONFIG_SUN3 71#ifdef CONFIG_SUN3
70 intersil_clear(); 72 intersil_clear();
71#endif 73#endif
@@ -79,41 +81,18 @@ static irqreturn_t sun3_int5(int irq, void *dev_id)
79 81
80static irqreturn_t sun3_vec255(int irq, void *dev_id) 82static irqreturn_t sun3_vec255(int irq, void *dev_id)
81{ 83{
82// intersil_clear();
83 return IRQ_HANDLED; 84 return IRQ_HANDLED;
84} 85}
85 86
86static void sun3_irq_enable(struct irq_data *data)
87{
88 sun3_enable_irq(data->irq);
89};
90
91static void sun3_irq_disable(struct irq_data *data)
92{
93 sun3_disable_irq(data->irq);
94};
95
96static struct irq_chip sun3_irq_chip = {
97 .name = "sun3",
98 .irq_startup = m68k_irq_startup,
99 .irq_shutdown = m68k_irq_shutdown,
100 .irq_enable = sun3_irq_enable,
101 .irq_disable = sun3_irq_disable,
102 .irq_mask = sun3_irq_disable,
103 .irq_unmask = sun3_irq_enable,
104};
105
106void __init sun3_init_IRQ(void) 87void __init sun3_init_IRQ(void)
107{ 88{
108 *sun3_intreg = 1; 89 *sun3_intreg = 1;
109 90
110 m68k_setup_irq_controller(&sun3_irq_chip, handle_level_irq, IRQ_AUTO_1,
111 7);
112 m68k_setup_user_interrupt(VEC_USER, 128); 91 m68k_setup_user_interrupt(VEC_USER, 128);
113 92
114 if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL)) 93 if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "clock", NULL))
115 pr_err("Couldn't register %s interrupt\n", "int5"); 94 pr_err("Couldn't register %s interrupt\n", "int5");
116 if (request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL)) 95 if (request_irq(IRQ_AUTO_7, sun3_int7, 0, "nmi", NULL))
117 pr_err("Couldn't register %s interrupt\n", "int7"); 96 pr_err("Couldn't register %s interrupt\n", "int7");
118 if (request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL)) 97 if (request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL))
119 pr_err("Couldn't register %s interrupt\n", "vec255"); 98 pr_err("Couldn't register %s interrupt\n", "vec255");