aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m32r')
-rw-r--r--arch/m32r/Kconfig1
-rw-r--r--arch/m32r/include/asm/elf.h3
-rw-r--r--arch/m32r/include/asm/signal.h11
-rw-r--r--arch/m32r/include/asm/unistd.h2
-rw-r--r--arch/m32r/include/uapi/asm/socket.h4
-rw-r--r--arch/m32r/include/uapi/asm/stat.h4
-rw-r--r--arch/m32r/kernel/process.c51
-rw-r--r--arch/m32r/kernel/signal.c16
-rw-r--r--arch/m32r/kernel/time.c4
9 files changed, 14 insertions, 82 deletions
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig
index f807721e19a5..bcd17b206571 100644
--- a/arch/m32r/Kconfig
+++ b/arch/m32r/Kconfig
@@ -10,6 +10,7 @@ config M32R
10 select ARCH_WANT_IPC_PARSE_VERSION 10 select ARCH_WANT_IPC_PARSE_VERSION
11 select HAVE_DEBUG_BUGVERBOSE 11 select HAVE_DEBUG_BUGVERBOSE
12 select HAVE_GENERIC_HARDIRQS 12 select HAVE_GENERIC_HARDIRQS
13 select VIRT_TO_BUS
13 select GENERIC_IRQ_PROBE 14 select GENERIC_IRQ_PROBE
14 select GENERIC_IRQ_SHOW 15 select GENERIC_IRQ_SHOW
15 select GENERIC_ATOMIC64 16 select GENERIC_ATOMIC64
diff --git a/arch/m32r/include/asm/elf.h b/arch/m32r/include/asm/elf.h
index 70896161c636..8acc9da9a15e 100644
--- a/arch/m32r/include/asm/elf.h
+++ b/arch/m32r/include/asm/elf.h
@@ -128,7 +128,4 @@ typedef elf_fpreg_t elf_fpregset_t;
128 intent than poking at uname or /proc/cpuinfo. */ 128 intent than poking at uname or /proc/cpuinfo. */
129#define ELF_PLATFORM (NULL) 129#define ELF_PLATFORM (NULL)
130 130
131#define SET_PERSONALITY(ex) \
132 set_personality(PER_LINUX | (current->personality & (~PER_MASK)))
133
134#endif /* _ASM_M32R__ELF_H */ 131#endif /* _ASM_M32R__ELF_H */
diff --git a/arch/m32r/include/asm/signal.h b/arch/m32r/include/asm/signal.h
index a5ba4a217fb9..ed3ded6601e8 100644
--- a/arch/m32r/include/asm/signal.h
+++ b/arch/m32r/include/asm/signal.h
@@ -16,16 +16,7 @@ typedef struct {
16 unsigned long sig[_NSIG_WORDS]; 16 unsigned long sig[_NSIG_WORDS];
17} sigset_t; 17} sigset_t;
18 18
19struct sigaction { 19#define __ARCH_HAS_SA_RESTORER
20 __sighandler_t sa_handler;
21 unsigned long sa_flags;
22 __sigrestore_t sa_restorer;
23 sigset_t sa_mask; /* mask last for extensibility */
24};
25
26struct k_sigaction {
27 struct sigaction sa;
28};
29#include <asm/sigcontext.h> 20#include <asm/sigcontext.h>
30 21
31#undef __HAVE_ARCH_SIG_BITOPS 22#undef __HAVE_ARCH_SIG_BITOPS
diff --git a/arch/m32r/include/asm/unistd.h b/arch/m32r/include/asm/unistd.h
index 79b063caec85..555629b05267 100644
--- a/arch/m32r/include/asm/unistd.h
+++ b/arch/m32r/include/asm/unistd.h
@@ -20,8 +20,6 @@
20#define __ARCH_WANT_SYS_LLSEEK 20#define __ARCH_WANT_SYS_LLSEEK
21#define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/ 21#define __ARCH_WANT_SYS_OLD_GETRLIMIT /*will be unused*/
22#define __ARCH_WANT_SYS_OLDUMOUNT 22#define __ARCH_WANT_SYS_OLDUMOUNT
23#define __ARCH_WANT_SYS_RT_SIGACTION
24#define __ARCH_WANT_SYS_RT_SIGSUSPEND
25#define __ARCH_WANT_SYS_CLONE 23#define __ARCH_WANT_SYS_CLONE
26#define __ARCH_WANT_SYS_FORK 24#define __ARCH_WANT_SYS_FORK
27#define __ARCH_WANT_SYS_VFORK 25#define __ARCH_WANT_SYS_VFORK
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
index 5e7088a26726..519afa2755db 100644
--- a/arch/m32r/include/uapi/asm/socket.h
+++ b/arch/m32r/include/uapi/asm/socket.h
@@ -22,7 +22,7 @@
22#define SO_PRIORITY 12 22#define SO_PRIORITY 12
23#define SO_LINGER 13 23#define SO_LINGER 13
24#define SO_BSDCOMPAT 14 24#define SO_BSDCOMPAT 14
25/* To add :#define SO_REUSEPORT 15 */ 25#define SO_REUSEPORT 15
26#define SO_PASSCRED 16 26#define SO_PASSCRED 16
27#define SO_PEERCRED 17 27#define SO_PEERCRED 17
28#define SO_RCVLOWAT 18 28#define SO_RCVLOWAT 18
@@ -70,4 +70,6 @@
70/* Instruct lower device to use last 4-bytes of skb data as FCS */ 70/* Instruct lower device to use last 4-bytes of skb data as FCS */
71#define SO_NOFCS 43 71#define SO_NOFCS 43
72 72
73#define SO_LOCK_FILTER 44
74
73#endif /* _ASM_M32R_SOCKET_H */ 75#endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/m32r/include/uapi/asm/stat.h b/arch/m32r/include/uapi/asm/stat.h
index da4518f82d6d..98470fe483b6 100644
--- a/arch/m32r/include/uapi/asm/stat.h
+++ b/arch/m32r/include/uapi/asm/stat.h
@@ -63,10 +63,10 @@ struct stat64 {
63 long long st_size; 63 long long st_size;
64 unsigned long st_blksize; 64 unsigned long st_blksize;
65 65
66#if defined(__BIG_ENDIAN) 66#if defined(__BYTE_ORDER) ? __BYTE_ORDER == __BIG_ENDIAN : defined(__BIG_ENDIAN)
67 unsigned long __pad4; /* future possible st_blocks high bits */ 67 unsigned long __pad4; /* future possible st_blocks high bits */
68 unsigned long st_blocks; /* Number 512-byte blocks allocated. */ 68 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
69#elif defined(__LITTLE_ENDIAN) 69#elif defined(__BYTE_ORDER) ? __BYTE_ORDER == __LITTLE_ENDIAN : defined(__LITTLE_ENDIAN)
70 unsigned long st_blocks; /* Number 512-byte blocks allocated. */ 70 unsigned long st_blocks; /* Number 512-byte blocks allocated. */
71 unsigned long __pad4; /* future possible st_blocks high bits */ 71 unsigned long __pad4; /* future possible st_blocks high bits */
72#else 72#else
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index 765d0f57c787..bde899e155d3 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -44,36 +44,10 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
44 return tsk->thread.lr; 44 return tsk->thread.lr;
45} 45}
46 46
47/*
48 * Powermanagement idle function, if any..
49 */
50static void (*pm_idle)(void) = NULL;
51
52void (*pm_power_off)(void) = NULL; 47void (*pm_power_off)(void) = NULL;
53EXPORT_SYMBOL(pm_power_off); 48EXPORT_SYMBOL(pm_power_off);
54 49
55/* 50/*
56 * We use this is we don't have any better
57 * idle routine..
58 */
59static void default_idle(void)
60{
61 /* M32R_FIXME: Please use "cpu_sleep" mode. */
62 cpu_relax();
63}
64
65/*
66 * On SMP it's slightly faster (but much more power-consuming!)
67 * to poll the ->work.need_resched flag instead of waiting for the
68 * cross-CPU IPI to arrive. Use this option with caution.
69 */
70static void poll_idle (void)
71{
72 /* M32R_FIXME */
73 cpu_relax();
74}
75
76/*
77 * The idle thread. There's no useful work to be 51 * The idle thread. There's no useful work to be
78 * done, so just try to conserve power and have a 52 * done, so just try to conserve power and have a
79 * low exit latency (ie sit in a loop waiting for 53 * low exit latency (ie sit in a loop waiting for
@@ -84,14 +58,8 @@ void cpu_idle (void)
84 /* endless idle loop with no priority at all */ 58 /* endless idle loop with no priority at all */
85 while (1) { 59 while (1) {
86 rcu_idle_enter(); 60 rcu_idle_enter();
87 while (!need_resched()) { 61 while (!need_resched())
88 void (*idle)(void) = pm_idle; 62 cpu_relax();
89
90 if (!idle)
91 idle = default_idle;
92
93 idle();
94 }
95 rcu_idle_exit(); 63 rcu_idle_exit();
96 schedule_preempt_disabled(); 64 schedule_preempt_disabled();
97 } 65 }
@@ -120,21 +88,6 @@ void machine_power_off(void)
120 /* M32R_FIXME */ 88 /* M32R_FIXME */
121} 89}
122 90
123static int __init idle_setup (char *str)
124{
125 if (!strncmp(str, "poll", 4)) {
126 printk("using poll in idle threads.\n");
127 pm_idle = poll_idle;
128 } else if (!strncmp(str, "sleep", 4)) {
129 printk("using sleep in idle threads.\n");
130 pm_idle = default_idle;
131 }
132
133 return 1;
134}
135
136__setup("idle=", idle_setup);
137
138void show_regs(struct pt_regs * regs) 91void show_regs(struct pt_regs * regs)
139{ 92{
140 printk("\n"); 93 printk("\n");
diff --git a/arch/m32r/kernel/signal.c b/arch/m32r/kernel/signal.c
index 6e3c26a1607c..d503568cb753 100644
--- a/arch/m32r/kernel/signal.c
+++ b/arch/m32r/kernel/signal.c
@@ -27,15 +27,6 @@
27 27
28#define DEBUG_SIG 0 28#define DEBUG_SIG 0
29 29
30asmlinkage int
31sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
32 unsigned long r2, unsigned long r3, unsigned long r4,
33 unsigned long r5, unsigned long r6, struct pt_regs *regs)
34{
35 return do_sigaltstack(uss, uoss, regs->spu);
36}
37
38
39/* 30/*
40 * Do a signal return; undo the signal stack. 31 * Do a signal return; undo the signal stack.
41 */ 32 */
@@ -113,7 +104,7 @@ sys_rt_sigreturn(unsigned long r0, unsigned long r1,
113 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result)) 104 if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &result))
114 goto badframe; 105 goto badframe;
115 106
116 if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->spu) == -EFAULT) 107 if (restore_altstack(&frame->uc.uc_stack))
117 goto badframe; 108 goto badframe;
118 109
119 return result; 110 return result;
@@ -213,10 +204,7 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
213 /* Create the ucontext. */ 204 /* Create the ucontext. */
214 err |= __put_user(0, &frame->uc.uc_flags); 205 err |= __put_user(0, &frame->uc.uc_flags);
215 err |= __put_user(0, &frame->uc.uc_link); 206 err |= __put_user(0, &frame->uc.uc_link);
216 err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); 207 err |= __save_altstack(&frame->uc.uc_stack, regs->spu);
217 err |= __put_user(sas_ss_flags(regs->spu),
218 &frame->uc.uc_stack.ss_flags);
219 err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);
220 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]); 208 err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, set->sig[0]);
221 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); 209 err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
222 if (err) 210 if (err)
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c
index 84dd04048db9..1a15f81ea1bd 100644
--- a/arch/m32r/kernel/time.c
+++ b/arch/m32r/kernel/time.c
@@ -57,7 +57,7 @@ extern void smp_local_timer_interrupt(void);
57 57
58static unsigned long latch; 58static unsigned long latch;
59 59
60u32 arch_gettimeoffset(void) 60static u32 m32r_gettimeoffset(void)
61{ 61{
62 unsigned long elapsed_time = 0; /* [us] */ 62 unsigned long elapsed_time = 0; /* [us] */
63 63
@@ -165,6 +165,8 @@ void read_persistent_clock(struct timespec *ts)
165 165
166void __init time_init(void) 166void __init time_init(void)
167{ 167{
168 arch_gettimeoffset = m32r_gettimeoffset;
169
168#if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \ 170#if defined(CONFIG_CHIP_M32102) || defined(CONFIG_CHIP_XNUX2) \
169 || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \ 171 || defined(CONFIG_CHIP_VDEC2) || defined(CONFIG_CHIP_M32700) \
170 || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104) 172 || defined(CONFIG_CHIP_OPSP) || defined(CONFIG_CHIP_M32104)