aboutsummaryrefslogtreecommitdiffstats
path: root/arch/h8300
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/h8300
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/h8300')
-rw-r--r--arch/h8300/Kconfig17
-rw-r--r--arch/h8300/Kconfig.cpu8
-rw-r--r--arch/h8300/Kconfig.debug2
-rw-r--r--arch/h8300/README1
-rw-r--r--arch/h8300/boot/compressed/Makefile2
-rw-r--r--arch/h8300/defconfig2
-rw-r--r--arch/h8300/include/asm/bitops.h3
-rw-r--r--arch/h8300/include/asm/ioctls.h81
-rw-r--r--arch/h8300/include/asm/irqflags.h43
-rw-r--r--arch/h8300/include/asm/system.h24
-rw-r--r--arch/h8300/include/asm/types.h4
-rw-r--r--arch/h8300/include/asm/unistd.h3
-rw-r--r--arch/h8300/kernel/irq.c79
-rw-r--r--arch/h8300/kernel/process.c1
-rw-r--r--arch/h8300/kernel/ptrace.c33
-rw-r--r--arch/h8300/kernel/syscalls.S1
-rw-r--r--arch/h8300/kernel/time.c4
-rw-r--r--arch/h8300/kernel/timer/timer8.c2
18 files changed, 97 insertions, 213 deletions
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 988b6ff34cc4..091ed6192ae8 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -1,14 +1,9 @@
1#
2# For a description of the syntax of this configuration file,
3# see Documentation/kbuild/kconfig-language.txt.
4#
5
6mainmenu "uClinux/h8300 (w/o MMU) Kernel Configuration"
7
8config H8300 1config H8300
9 bool 2 bool
10 default y 3 default y
11 select HAVE_IDE 4 select HAVE_IDE
5 select HAVE_GENERIC_HARDIRQS
6 select GENERIC_IRQ_SHOW
12 7
13config SYMBOL_PREFIX 8config SYMBOL_PREFIX
14 string 9 string
@@ -46,18 +41,10 @@ config ARCH_HAS_ILOG2_U64
46 bool 41 bool
47 default n 42 default n
48 43
49config GENERIC_FIND_NEXT_BIT
50 bool
51 default y
52
53config GENERIC_HWEIGHT 44config GENERIC_HWEIGHT
54 bool 45 bool
55 default y 46 default y
56 47
57config GENERIC_HARDIRQS
58 bool
59 default y
60
61config GENERIC_CALIBRATE_DELAY 48config GENERIC_CALIBRATE_DELAY
62 bool 49 bool
63 default y 50 default y
diff --git a/arch/h8300/Kconfig.cpu b/arch/h8300/Kconfig.cpu
index 6e2ecff199c5..d236ab4232ca 100644
--- a/arch/h8300/Kconfig.cpu
+++ b/arch/h8300/Kconfig.cpu
@@ -17,7 +17,7 @@ config H8300H_AKI3068NET
17 help 17 help
18 AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support 18 AKI-H8/3068F / AKI-H8/3069F Flashmicom LAN Board Support
19 More Information. (Japanese Only) 19 More Information. (Japanese Only)
20 <http://akizukidensi.com/catalog/h8.html> 20 <http://akizukidenshi.com/catalog/default.aspx>
21 AE-3068/69 Evaluation Board Support 21 AE-3068/69 Evaluation Board Support
22 More Information. 22 More Information.
23 <http://www.microtronique.com/ae3069lan.htm> 23 <http://www.microtronique.com/ae3069lan.htm>
@@ -36,7 +36,7 @@ config H8300H_SIM
36 help 36 help
37 GDB Simulator Support 37 GDB Simulator Support
38 More Information. 38 More Information.
39 arch/h8300/Doc/simulator.txt 39 <http://sourceware.org/sid/>
40 40
41config H8S_GENERIC 41config H8S_GENERIC
42 bool "H8S Generic" 42 bool "H8S Generic"
@@ -50,14 +50,14 @@ config H8S_EDOSK2674
50 Renesas EDOSK-2674 Evaluation Board Support 50 Renesas EDOSK-2674 Evaluation Board Support
51 More Information. 51 More Information.
52 <http://www.azpower.com/H8-uClinux/index.html> 52 <http://www.azpower.com/H8-uClinux/index.html>
53 <http://www.eu.renesas.com/tools/edk/support/edosk2674.html> 53 <http://www.renesas.eu/products/tools/introductory_evaluation_tools/evaluation_development_os_kits/edosk2674r/edosk2674r_software_tools_root.jsp>
54 54
55config H8S_SIM 55config H8S_SIM
56 bool "H8S Simulator" 56 bool "H8S Simulator"
57 help 57 help
58 GDB Simulator Support 58 GDB Simulator Support
59 More Information. 59 More Information.
60 arch/h8300/Doc/simulator.txt 60 <http://sourceware.org/sid/>
61 61
62endchoice 62endchoice
63 63
diff --git a/arch/h8300/Kconfig.debug b/arch/h8300/Kconfig.debug
index ee671c3f2c74..e8d1b236ad8c 100644
--- a/arch/h8300/Kconfig.debug
+++ b/arch/h8300/Kconfig.debug
@@ -48,7 +48,7 @@ config DEFAULT_CMDLINE
48 builtin kernel commandline enabled. 48 builtin kernel commandline enabled.
49 49
50config KERNEL_COMMAND 50config KERNEL_COMMAND
51 string "Buildin commmand string" 51 string "Buildin command string"
52 depends on DEFAULT_CMDLINE 52 depends on DEFAULT_CMDLINE
53 help 53 help
54 builtin kernel commandline strings. 54 builtin kernel commandline strings.
diff --git a/arch/h8300/README b/arch/h8300/README
index 2fd6f6d7a019..637f5a02f311 100644
--- a/arch/h8300/README
+++ b/arch/h8300/README
@@ -18,6 +18,7 @@ H8/300H and H8S
18 18
194.EDOSK2674 194.EDOSK2674
20 see http://www.eu.renesas.com/products/mpumcu/tool/edk/support/edosk2674.html 20 see http://www.eu.renesas.com/products/mpumcu/tool/edk/support/edosk2674.html
21 http://www.uclinux.org/pub/uClinux/ports/h8/HITACHI-EDOSK2674-HOWTO
21 http://www.azpower.com/H8-uClinux/ 22 http://www.azpower.com/H8-uClinux/
22 23
23* Toolchain Version 24* Toolchain Version
diff --git a/arch/h8300/boot/compressed/Makefile b/arch/h8300/boot/compressed/Makefile
index d6189e057ed3..6745cb1ffb4f 100644
--- a/arch/h8300/boot/compressed/Makefile
+++ b/arch/h8300/boot/compressed/Makefile
@@ -5,7 +5,7 @@
5# 5#
6 6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o 7targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
8EXTRA_AFLAGS := -traditional 8asflags-y := -traditional
9 9
10OBJECTS = $(obj)/head.o $(obj)/misc.o 10OBJECTS = $(obj)/head.o $(obj)/misc.o
11 11
diff --git a/arch/h8300/defconfig b/arch/h8300/defconfig
index 342f77765f02..042425a02645 100644
--- a/arch/h8300/defconfig
+++ b/arch/h8300/defconfig
@@ -1,7 +1,7 @@
1CONFIG_EXPERIMENTAL=y 1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set 2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_LOG_BUF_SHIFT=14 3CONFIG_LOG_BUF_SHIFT=14
4CONFIG_EMBEDDED=y 4CONFIG_EXPERT=y
5# CONFIG_UID16 is not set 5# CONFIG_UID16 is not set
6# CONFIG_SYSCTL_SYSCALL is not set 6# CONFIG_SYSCTL_SYSCALL is not set
7# CONFIG_KALLSYMS is not set 7# CONFIG_KALLSYMS is not set
diff --git a/arch/h8300/include/asm/bitops.h b/arch/h8300/include/asm/bitops.h
index cb9ddf5fc54f..e856c1bb3415 100644
--- a/arch/h8300/include/asm/bitops.h
+++ b/arch/h8300/include/asm/bitops.h
@@ -200,9 +200,8 @@ static __inline__ unsigned long __ffs(unsigned long word)
200#include <asm-generic/bitops/sched.h> 200#include <asm-generic/bitops/sched.h>
201#include <asm-generic/bitops/hweight.h> 201#include <asm-generic/bitops/hweight.h>
202#include <asm-generic/bitops/lock.h> 202#include <asm-generic/bitops/lock.h>
203#include <asm-generic/bitops/ext2-non-atomic.h> 203#include <asm-generic/bitops/le.h>
204#include <asm-generic/bitops/ext2-atomic.h> 204#include <asm-generic/bitops/ext2-atomic.h>
205#include <asm-generic/bitops/minix.h>
206 205
207#endif /* __KERNEL__ */ 206#endif /* __KERNEL__ */
208 207
diff --git a/arch/h8300/include/asm/ioctls.h b/arch/h8300/include/asm/ioctls.h
index b6b249f9f308..30eaed2facdb 100644
--- a/arch/h8300/include/asm/ioctls.h
+++ b/arch/h8300/include/asm/ioctls.h
@@ -1,87 +1,8 @@
1#ifndef __ARCH_H8300_IOCTLS_H__ 1#ifndef __ARCH_H8300_IOCTLS_H__
2#define __ARCH_H8300_IOCTLS_H__ 2#define __ARCH_H8300_IOCTLS_H__
3 3
4#include <asm/ioctl.h>
5
6/* 0x54 is just a magic number to make these relatively unique ('T') */
7
8#define TCGETS 0x5401
9#define TCSETS 0x5402
10#define TCSETSW 0x5403
11#define TCSETSF 0x5404
12#define TCGETA 0x5405
13#define TCSETA 0x5406
14#define TCSETAW 0x5407
15#define TCSETAF 0x5408
16#define TCSBRK 0x5409
17#define TCXONC 0x540A
18#define TCFLSH 0x540B
19#define TIOCEXCL 0x540C
20#define TIOCNXCL 0x540D
21#define TIOCSCTTY 0x540E
22#define TIOCGPGRP 0x540F
23#define TIOCSPGRP 0x5410
24#define TIOCOUTQ 0x5411
25#define TIOCSTI 0x5412
26#define TIOCGWINSZ 0x5413
27#define TIOCSWINSZ 0x5414
28#define TIOCMGET 0x5415
29#define TIOCMBIS 0x5416
30#define TIOCMBIC 0x5417
31#define TIOCMSET 0x5418
32#define TIOCGSOFTCAR 0x5419
33#define TIOCSSOFTCAR 0x541A
34#define FIONREAD 0x541B
35#define TIOCINQ FIONREAD
36#define TIOCLINUX 0x541C
37#define TIOCCONS 0x541D
38#define TIOCGSERIAL 0x541E
39#define TIOCSSERIAL 0x541F
40#define TIOCPKT 0x5420
41#define FIONBIO 0x5421
42#define TIOCNOTTY 0x5422
43#define TIOCSETD 0x5423
44#define TIOCGETD 0x5424
45#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
46#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
47#define TIOCSBRK 0x5427 /* BSD compatibility */
48#define TIOCCBRK 0x5428 /* BSD compatibility */
49#define TIOCGSID 0x5429 /* Return the session ID of FD */
50#define TCGETS2 _IOR('T',0x2A, struct termios2)
51#define TCSETS2 _IOW('T',0x2B, struct termios2)
52#define TCSETSW2 _IOW('T',0x2C, struct termios2)
53#define TCSETSF2 _IOW('T',0x2D, struct termios2)
54#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
55#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
56#define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */
57
58#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
59#define FIOCLEX 0x5451
60#define FIOASYNC 0x5452
61#define TIOCSERCONFIG 0x5453
62#define TIOCSERGWILD 0x5454
63#define TIOCSERSWILD 0x5455
64#define TIOCGLCKTRMIOS 0x5456
65#define TIOCSLCKTRMIOS 0x5457
66#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
67#define TIOCSERGETLSR 0x5459 /* Get line status register */
68#define TIOCSERGETMULTI 0x545A /* Get multiport config */
69#define TIOCSERSETMULTI 0x545B /* Set multiport config */
70
71#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
72#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
73#define FIOQSIZE 0x545E 4#define FIOQSIZE 0x545E
74 5
75/* Used for packet mode */ 6#include <asm-generic/ioctls.h>
76#define TIOCPKT_DATA 0
77#define TIOCPKT_FLUSHREAD 1
78#define TIOCPKT_FLUSHWRITE 2
79#define TIOCPKT_STOP 4
80#define TIOCPKT_START 8
81#define TIOCPKT_NOSTOP 16
82#define TIOCPKT_DOSTOP 32
83#define TIOCPKT_IOCTL 64
84
85#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
86 7
87#endif /* __ARCH_H8300_IOCTLS_H__ */ 8#endif /* __ARCH_H8300_IOCTLS_H__ */
diff --git a/arch/h8300/include/asm/irqflags.h b/arch/h8300/include/asm/irqflags.h
new file mode 100644
index 000000000000..9617cd57aebd
--- /dev/null
+++ b/arch/h8300/include/asm/irqflags.h
@@ -0,0 +1,43 @@
1#ifndef _H8300_IRQFLAGS_H
2#define _H8300_IRQFLAGS_H
3
4static inline unsigned long arch_local_save_flags(void)
5{
6 unsigned long flags;
7 asm volatile ("stc ccr,%w0" : "=r" (flags));
8 return flags;
9}
10
11static inline void arch_local_irq_disable(void)
12{
13 asm volatile ("orc #0x80,ccr" : : : "memory");
14}
15
16static inline void arch_local_irq_enable(void)
17{
18 asm volatile ("andc #0x7f,ccr" : : : "memory");
19}
20
21static inline unsigned long arch_local_irq_save(void)
22{
23 unsigned long flags = arch_local_save_flags();
24 arch_local_irq_disable();
25 return flags;
26}
27
28static inline void arch_local_irq_restore(unsigned long flags)
29{
30 asm volatile ("ldc %w0,ccr" : : "r" (flags) : "memory");
31}
32
33static inline bool arch_irqs_disabled_flags(unsigned long flags)
34{
35 return (flags & 0x80) == 0x80;
36}
37
38static inline bool arch_irqs_disabled(void)
39{
40 return arch_irqs_disabled_flags(arch_local_save_flags());
41}
42
43#endif /* _H8300_IRQFLAGS_H */
diff --git a/arch/h8300/include/asm/system.h b/arch/h8300/include/asm/system.h
index 16bf1560ff68..2c2382e50d93 100644
--- a/arch/h8300/include/asm/system.h
+++ b/arch/h8300/include/asm/system.h
@@ -2,6 +2,7 @@
2#define _H8300_SYSTEM_H 2#define _H8300_SYSTEM_H
3 3
4#include <linux/linkage.h> 4#include <linux/linkage.h>
5#include <linux/irqflags.h>
5 6
6struct pt_regs; 7struct pt_regs;
7 8
@@ -51,31 +52,8 @@ asmlinkage void resume(void);
51 (last) = _last; \ 52 (last) = _last; \
52} 53}
53 54
54#define __sti() asm volatile ("andc #0x7f,ccr")
55#define __cli() asm volatile ("orc #0x80,ccr")
56
57#define __save_flags(x) \
58 asm volatile ("stc ccr,%w0":"=r" (x))
59
60#define __restore_flags(x) \
61 asm volatile ("ldc %w0,ccr": :"r" (x))
62
63#define irqs_disabled() \
64({ \
65 unsigned char flags; \
66 __save_flags(flags); \
67 ((flags & 0x80) == 0x80); \
68})
69
70#define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc") 55#define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc")
71 56
72/* For spinlocks etc */
73#define local_irq_disable() __cli()
74#define local_irq_enable() __sti()
75#define local_irq_save(x) ({ __save_flags(x); local_irq_disable(); })
76#define local_irq_restore(x) __restore_flags(x)
77#define local_save_flags(x) __save_flags(x)
78
79/* 57/*
80 * Force strict CPU ordering. 58 * Force strict CPU ordering.
81 * Not really required on H8... 59 * Not really required on H8...
diff --git a/arch/h8300/include/asm/types.h b/arch/h8300/include/asm/types.h
index 12875190b156..bb2c91a3522e 100644
--- a/arch/h8300/include/asm/types.h
+++ b/arch/h8300/include/asm/types.h
@@ -22,10 +22,6 @@ typedef unsigned short umode_t;
22 22
23#define BITS_PER_LONG 32 23#define BITS_PER_LONG 32
24 24
25/* Dma addresses are 32-bits wide. */
26
27typedef u32 dma_addr_t;
28
29#endif /* __KERNEL__ */ 25#endif /* __KERNEL__ */
30 26
31#endif /* __ASSEMBLY__ */ 27#endif /* __ASSEMBLY__ */
diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h
index 50f2c5a36591..2c3f8e60b1e0 100644
--- a/arch/h8300/include/asm/unistd.h
+++ b/arch/h8300/include/asm/unistd.h
@@ -325,10 +325,11 @@
325#define __NR_move_pages 317 325#define __NR_move_pages 317
326#define __NR_getcpu 318 326#define __NR_getcpu 318
327#define __NR_epoll_pwait 319 327#define __NR_epoll_pwait 319
328#define __NR_setns 320
328 329
329#ifdef __KERNEL__ 330#ifdef __KERNEL__
330 331
331#define NR_syscalls 320 332#define NR_syscalls 321
332 333
333#define __ARCH_WANT_IPC_PARSE_VERSION 334#define __ARCH_WANT_IPC_PARSE_VERSION
334#define __ARCH_WANT_OLD_READDIR 335#define __ARCH_WANT_OLD_READDIR
diff --git a/arch/h8300/kernel/irq.c b/arch/h8300/kernel/irq.c
index c25dc2c2b1da..1f67fed476af 100644
--- a/arch/h8300/kernel/irq.c
+++ b/arch/h8300/kernel/irq.c
@@ -38,34 +38,30 @@ static inline int is_ext_irq(unsigned int irq)
38 return (irq >= EXT_IRQ0 && irq <= (EXT_IRQ0 + EXT_IRQS)); 38 return (irq >= EXT_IRQ0 && irq <= (EXT_IRQ0 + EXT_IRQS));
39} 39}
40 40
41static void h8300_enable_irq(unsigned int irq) 41static void h8300_enable_irq(struct irq_data *data)
42{ 42{
43 if (is_ext_irq(irq)) 43 if (is_ext_irq(data->irq))
44 IER_REGS |= 1 << (irq - EXT_IRQ0); 44 IER_REGS |= 1 << (data->irq - EXT_IRQ0);
45} 45}
46 46
47static void h8300_disable_irq(unsigned int irq) 47static void h8300_disable_irq(struct irq_data *data)
48{ 48{
49 if (is_ext_irq(irq)) 49 if (is_ext_irq(data->irq))
50 IER_REGS &= ~(1 << (irq - EXT_IRQ0)); 50 IER_REGS &= ~(1 << (data->irq - EXT_IRQ0));
51} 51}
52 52
53static void h8300_end_irq(unsigned int irq) 53static unsigned int h8300_startup_irq(struct irq_data *data)
54{ 54{
55} 55 if (is_ext_irq(data->irq))
56 56 return h8300_enable_irq_pin(data->irq);
57static unsigned int h8300_startup_irq(unsigned int irq)
58{
59 if (is_ext_irq(irq))
60 return h8300_enable_irq_pin(irq);
61 else 57 else
62 return 0; 58 return 0;
63} 59}
64 60
65static void h8300_shutdown_irq(unsigned int irq) 61static void h8300_shutdown_irq(struct irq_data *data)
66{ 62{
67 if (is_ext_irq(irq)) 63 if (is_ext_irq(data->irq))
68 h8300_disable_irq_pin(irq); 64 h8300_disable_irq_pin(data->irq);
69} 65}
70 66
71/* 67/*
@@ -73,12 +69,10 @@ static void h8300_shutdown_irq(unsigned int irq)
73 */ 69 */
74struct irq_chip h8300irq_chip = { 70struct irq_chip h8300irq_chip = {
75 .name = "H8300-INTC", 71 .name = "H8300-INTC",
76 .startup = h8300_startup_irq, 72 .irq_startup = h8300_startup_irq,
77 .shutdown = h8300_shutdown_irq, 73 .irq_shutdown = h8300_shutdown_irq,
78 .enable = h8300_enable_irq, 74 .irq_enable = h8300_enable_irq,
79 .disable = h8300_disable_irq, 75 .irq_disable = h8300_disable_irq,
80 .ack = NULL,
81 .end = h8300_end_irq,
82}; 76};
83 77
84#if defined(CONFIG_RAMKERNEL) 78#if defined(CONFIG_RAMKERNEL)
@@ -160,48 +154,13 @@ void __init init_IRQ(void)
160 154
161 setup_vector(); 155 setup_vector();
162 156
163 for (c = 0; c < NR_IRQS; c++) { 157 for (c = 0; c < NR_IRQS; c++)
164 irq_desc[c].status = IRQ_DISABLED; 158 irq_set_chip_and_handler(c, &h8300irq_chip, handle_simple_irq);
165 irq_desc[c].action = NULL;
166 irq_desc[c].depth = 1;
167 irq_desc[c].chip = &h8300irq_chip;
168 }
169} 159}
170 160
171asmlinkage void do_IRQ(int irq) 161asmlinkage void do_IRQ(int irq)
172{ 162{
173 irq_enter(); 163 irq_enter();
174 __do_IRQ(irq); 164 generic_handle_irq(irq);
175 irq_exit(); 165 irq_exit();
176} 166}
177
178#if defined(CONFIG_PROC_FS)
179int show_interrupts(struct seq_file *p, void *v)
180{
181 int i = *(loff_t *) v;
182 struct irqaction * action;
183 unsigned long flags;
184
185 if (i == 0)
186 seq_puts(p, " CPU0");
187
188 if (i < NR_IRQS) {
189 raw_spin_lock_irqsave(&irq_desc[i].lock, flags);
190 action = irq_desc[i].action;
191 if (!action)
192 goto unlock;
193 seq_printf(p, "%3d: ",i);
194 seq_printf(p, "%10u ", kstat_irqs(i));
195 seq_printf(p, " %14s", irq_desc[i].chip->name);
196 seq_printf(p, "-%-8s", irq_desc[i].name);
197 seq_printf(p, " %s", action->name);
198
199 for (action=action->next; action; action = action->next)
200 seq_printf(p, ", %s", action->name);
201 seq_putc(p, '\n');
202unlock:
203 raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags);
204 }
205 return 0;
206}
207#endif
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c
index 97478138e361..933bd388efb2 100644
--- a/arch/h8300/kernel/process.c
+++ b/arch/h8300/kernel/process.c
@@ -28,7 +28,6 @@
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/mm.h> 29#include <linux/mm.h>
30#include <linux/smp.h> 30#include <linux/smp.h>
31#include <linux/smp_lock.h>
32#include <linux/stddef.h> 31#include <linux/stddef.h>
33#include <linux/unistd.h> 32#include <linux/unistd.h>
34#include <linux/ptrace.h> 33#include <linux/ptrace.h>
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c
index df114122ebdf..497fa89b5df4 100644
--- a/arch/h8300/kernel/ptrace.c
+++ b/arch/h8300/kernel/ptrace.c
@@ -50,27 +50,29 @@ void ptrace_disable(struct task_struct *child)
50 user_disable_single_step(child); 50 user_disable_single_step(child);
51} 51}
52 52
53long arch_ptrace(struct task_struct *child, long request, long addr, long data) 53long arch_ptrace(struct task_struct *child, long request,
54 unsigned long addr, unsigned long data)
54{ 55{
55 int ret; 56 int ret;
57 int regno = addr >> 2;
58 unsigned long __user *datap = (unsigned long __user *) data;
56 59
57 switch (request) { 60 switch (request) {
58 /* read the word at location addr in the USER area. */ 61 /* read the word at location addr in the USER area. */
59 case PTRACE_PEEKUSR: { 62 case PTRACE_PEEKUSR: {
60 unsigned long tmp = 0; 63 unsigned long tmp = 0;
61 64
62 if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { 65 if ((addr & 3) || addr >= sizeof(struct user)) {
63 ret = -EIO; 66 ret = -EIO;
64 break ; 67 break ;
65 } 68 }
66 69
67 ret = 0; /* Default return condition */ 70 ret = 0; /* Default return condition */
68 addr = addr >> 2; /* temporary hack. */
69 71
70 if (addr < H8300_REGS_NO) 72 if (regno < H8300_REGS_NO)
71 tmp = h8300_get_reg(child, addr); 73 tmp = h8300_get_reg(child, regno);
72 else { 74 else {
73 switch(addr) { 75 switch (regno) {
74 case 49: 76 case 49:
75 tmp = child->mm->start_code; 77 tmp = child->mm->start_code;
76 break ; 78 break ;
@@ -88,24 +90,23 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
88 } 90 }
89 } 91 }
90 if (!ret) 92 if (!ret)
91 ret = put_user(tmp,(unsigned long *) data); 93 ret = put_user(tmp, datap);
92 break ; 94 break ;
93 } 95 }
94 96
95 /* when I and D space are separate, this will have to be fixed. */ 97 /* when I and D space are separate, this will have to be fixed. */
96 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ 98 case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
97 if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { 99 if ((addr & 3) || addr >= sizeof(struct user)) {
98 ret = -EIO; 100 ret = -EIO;
99 break ; 101 break ;
100 } 102 }
101 addr = addr >> 2; /* temporary hack. */
102 103
103 if (addr == PT_ORIG_ER0) { 104 if (regno == PT_ORIG_ER0) {
104 ret = -EIO; 105 ret = -EIO;
105 break ; 106 break ;
106 } 107 }
107 if (addr < H8300_REGS_NO) { 108 if (regno < H8300_REGS_NO) {
108 ret = h8300_put_reg(child, addr, data); 109 ret = h8300_put_reg(child, regno, data);
109 break ; 110 break ;
110 } 111 }
111 ret = -EIO; 112 ret = -EIO;
@@ -116,11 +117,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
116 unsigned long tmp; 117 unsigned long tmp;
117 for (i = 0; i < H8300_REGS_NO; i++) { 118 for (i = 0; i < H8300_REGS_NO; i++) {
118 tmp = h8300_get_reg(child, i); 119 tmp = h8300_get_reg(child, i);
119 if (put_user(tmp, (unsigned long *) data)) { 120 if (put_user(tmp, datap)) {
120 ret = -EFAULT; 121 ret = -EFAULT;
121 break; 122 break;
122 } 123 }
123 data += sizeof(long); 124 datap++;
124 } 125 }
125 ret = 0; 126 ret = 0;
126 break; 127 break;
@@ -130,12 +131,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
130 int i; 131 int i;
131 unsigned long tmp; 132 unsigned long tmp;
132 for (i = 0; i < H8300_REGS_NO; i++) { 133 for (i = 0; i < H8300_REGS_NO; i++) {
133 if (get_user(tmp, (unsigned long *) data)) { 134 if (get_user(tmp, datap)) {
134 ret = -EFAULT; 135 ret = -EFAULT;
135 break; 136 break;
136 } 137 }
137 h8300_put_reg(child, i, tmp); 138 h8300_put_reg(child, i, tmp);
138 data += sizeof(long); 139 datap++;
139 } 140 }
140 ret = 0; 141 ret = 0;
141 break; 142 break;
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S
index faefaff7d43d..f4b2e67bcc34 100644
--- a/arch/h8300/kernel/syscalls.S
+++ b/arch/h8300/kernel/syscalls.S
@@ -333,6 +333,7 @@ SYMBOL_NAME_LABEL(sys_call_table)
333 .long SYMBOL_NAME(sys_ni_syscall) /* sys_move_pages */ 333 .long SYMBOL_NAME(sys_ni_syscall) /* sys_move_pages */
334 .long SYMBOL_NAME(sys_getcpu) 334 .long SYMBOL_NAME(sys_getcpu)
335 .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_pwait */ 335 .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_pwait */
336 .long SYMBOL_NAME(sys_setns) /* 320 */
336 337
337 .macro call_sp addr 338 .macro call_sp addr
338 mov.l #SYMBOL_NAME(\addr),er6 339 mov.l #SYMBOL_NAME(\addr),er6
diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c
index 165005aff9df..32263a138aa6 100644
--- a/arch/h8300/kernel/time.c
+++ b/arch/h8300/kernel/time.c
@@ -35,9 +35,7 @@ void h8300_timer_tick(void)
35{ 35{
36 if (current->pid) 36 if (current->pid)
37 profile_tick(CPU_PROFILING); 37 profile_tick(CPU_PROFILING);
38 write_seqlock(&xtime_lock); 38 xtime_update(1);
39 do_timer(1);
40 write_sequnlock(&xtime_lock);
41 update_process_times(user_mode(get_irq_regs())); 39 update_process_times(user_mode(get_irq_regs()));
42} 40}
43 41
diff --git a/arch/h8300/kernel/timer/timer8.c b/arch/h8300/kernel/timer/timer8.c
index 3946c0fa8374..7a1533fad47d 100644
--- a/arch/h8300/kernel/timer/timer8.c
+++ b/arch/h8300/kernel/timer/timer8.c
@@ -61,7 +61,7 @@
61 61
62/* 62/*
63 * timer_interrupt() needs to keep up the real-time clock, 63 * timer_interrupt() needs to keep up the real-time clock,
64 * as well as call the "do_timer()" routine every clocktick 64 * as well as call the "xtime_update()" routine every clocktick
65 */ 65 */
66 66
67static irqreturn_t timer_interrupt(int irq, void *dev_id) 67static irqreturn_t timer_interrupt(int irq, void *dev_id)