Commit f896c1c5 authored by Hirokazu Takata's avatar Hirokazu Takata Committed by Linus Torvalds

[PATCH] m32r: update to fix compile errors

  This patch updates code to fix compile errors, and so on.

	* arch/m32r/kernel/Makefile:
	Change linker script's name from vmlinux.lds.s to vmlinux.lds.

	* arch/m32r/kernel/process.c (sys_clone):
	Fix the first parameter of do_fork() call.

	* arch/m32r/kernel/signal.c: 
	(handle_signal): Add a new second argument, struct k_sigaction *ka.
	(do_signal): Change get_signal_to_deliver() interface.

	* include/asm-m32r/hardirq.h:
	Some declarations are moved to linux/hardirq.h.

	* include/asm-m32r/page.h:
	Add devmem_is_allowed() macro.
Signed-off-by: default avatarHirokazu Takata <takata@linux-m32r.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 28e749ba
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Makefile for the Linux/M32R kernel. # Makefile for the Linux/M32R kernel.
# #
extra-y := head.o init_task.o vmlinux.lds.s extra-y := head.o init_task.o vmlinux.lds
obj-y := process.o entry.o traps.o align.o irq.o setup.o time.o \ obj-y := process.o entry.o traps.o align.o irq.o setup.o time.o \
m32r_ksyms.o sys_m32r.o semaphore.o signal.o ptrace.o m32r_ksyms.o sys_m32r.o semaphore.o signal.o ptrace.o
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/unistd.h> #include <linux/unistd.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/hardirq.h>
#include <asm/hardirq.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
...@@ -298,8 +298,7 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp, ...@@ -298,8 +298,7 @@ asmlinkage int sys_clone(unsigned long clone_flags, unsigned long newsp,
if (!newsp) if (!newsp)
newsp = regs.spu; newsp = regs.spu;
return do_fork(clone_flags & ~CLONE_IDLETASK, newsp, &regs, 0, NULL, return do_fork(clone_flags, newsp, &regs, 0, NULL, NULL);
NULL);
} }
/* /*
......
/* /*
* linux/arch/m32r/kernel/signal.c * linux/arch/m32r/kernel/signal.c
* orig : i386 2.5.67
* *
* Copyright (c) 2003 Hitoshi Yamamoto * Copyright (c) 2003 Hitoshi Yamamoto
* *
...@@ -37,7 +36,8 @@ int do_signal(struct pt_regs *, sigset_t *); ...@@ -37,7 +36,8 @@ int do_signal(struct pt_regs *, sigset_t *);
/* /*
* Atomically swap in the new signal mask, and wait for a signal. * Atomically swap in the new signal mask, and wait for a signal.
*/ */
asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r1, asmlinkage int
sys_sigsuspend(old_sigset_t mask, unsigned long r1,
unsigned long r2, unsigned long r3, unsigned long r4, unsigned long r2, unsigned long r3, unsigned long r4,
unsigned long r5, unsigned long r6, struct pt_regs regs) unsigned long r5, unsigned long r6, struct pt_regs regs)
{ {
...@@ -59,7 +59,8 @@ asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r1, ...@@ -59,7 +59,8 @@ asmlinkage int sys_sigsuspend(old_sigset_t mask, unsigned long r1,
} }
} }
asmlinkage int sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, asmlinkage int
sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize,
unsigned long r2, unsigned long r3, unsigned long r4, unsigned long r2, unsigned long r3, unsigned long r4,
unsigned long r5, unsigned long r6, struct pt_regs regs) unsigned long r5, unsigned long r6, struct pt_regs regs)
{ {
...@@ -88,7 +89,8 @@ asmlinkage int sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, ...@@ -88,7 +89,8 @@ asmlinkage int sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize,
} }
} }
asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act, asmlinkage int
sys_sigaction(int sig, const struct old_sigaction __user *act,
struct old_sigaction __user *oact) struct old_sigaction __user *oact)
{ {
struct k_sigaction new_ka, old_ka; struct k_sigaction new_ka, old_ka;
...@@ -119,7 +121,8 @@ asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act, ...@@ -119,7 +121,8 @@ asmlinkage int sys_sigaction(int sig, const struct old_sigaction __user *act,
return ret; return ret;
} }
asmlinkage int sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, asmlinkage int
sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss,
unsigned long r2, unsigned long r3, unsigned long r4, unsigned long r2, unsigned long r3, unsigned long r4,
unsigned long r5, unsigned long r6, struct pt_regs regs) unsigned long r5, unsigned long r6, struct pt_regs regs)
{ {
...@@ -153,7 +156,8 @@ struct rt_sigframe ...@@ -153,7 +156,8 @@ struct rt_sigframe
char retcode[8]; char retcode[8];
}; };
static int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, static int
restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc,
int *r0_p) int *r0_p)
{ {
unsigned int err = 0; unsigned int err = 0;
...@@ -203,7 +207,8 @@ static int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc ...@@ -203,7 +207,8 @@ static int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc
return err; return err;
} }
asmlinkage int sys_sigreturn(unsigned long r0, unsigned long r1, asmlinkage int
sys_sigreturn(unsigned long r0, unsigned long r1,
unsigned long r2, unsigned long r3, unsigned long r4, unsigned long r2, unsigned long r3, unsigned long r4,
unsigned long r5, unsigned long r6, struct pt_regs regs) unsigned long r5, unsigned long r6, struct pt_regs regs)
{ {
...@@ -234,7 +239,8 @@ asmlinkage int sys_sigreturn(unsigned long r0, unsigned long r1, ...@@ -234,7 +239,8 @@ asmlinkage int sys_sigreturn(unsigned long r0, unsigned long r1,
return 0; return 0;
} }
asmlinkage int sys_rt_sigreturn(unsigned long r0, unsigned long r1, asmlinkage int
sys_rt_sigreturn(unsigned long r0, unsigned long r1,
unsigned long r2, unsigned long r3, unsigned long r4, unsigned long r2, unsigned long r3, unsigned long r4,
unsigned long r5, unsigned long r6, struct pt_regs regs) unsigned long r5, unsigned long r6, struct pt_regs regs)
{ {
...@@ -274,7 +280,8 @@ asmlinkage int sys_rt_sigreturn(unsigned long r0, unsigned long r1, ...@@ -274,7 +280,8 @@ asmlinkage int sys_rt_sigreturn(unsigned long r0, unsigned long r1,
* Set up a signal frame. * Set up a signal frame.
*/ */
static int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, static int
setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
unsigned long mask) unsigned long mask)
{ {
int err = 0; int err = 0;
...@@ -323,8 +330,8 @@ static int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, ...@@ -323,8 +330,8 @@ static int setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
/* /*
* Determine which stack to use.. * Determine which stack to use..
*/ */
static __inline__ void __user *get_sigframe(struct k_sigaction *ka, unsigned long sp, static inline void __user *
size_t frame_size) get_sigframe(struct k_sigaction *ka, unsigned long sp, size_t frame_size)
{ {
/* This is the X/Open sanctioned signal stack switching. */ /* This is the X/Open sanctioned signal stack switching. */
if (ka->sa.sa_flags & SA_ONSTACK) { if (ka->sa.sa_flags & SA_ONSTACK) {
...@@ -484,10 +491,10 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, ...@@ -484,10 +491,10 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
* OK, we're invoking a handler * OK, we're invoking a handler
*/ */
static void handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, static void
struct pt_regs *regs) handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *oldset, struct pt_regs *regs)
{ {
struct k_sigaction *ka = &current->sighand->action[sig-1];
unsigned short inst; unsigned short inst;
/* Are we from a system call? */ /* Are we from a system call? */
...@@ -542,6 +549,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -542,6 +549,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
{ {
siginfo_t info; siginfo_t info;
int signr; int signr;
struct k_sigaction ka;
unsigned short inst; unsigned short inst;
/* /*
...@@ -561,7 +569,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -561,7 +569,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
if (!oldset) if (!oldset)
oldset = &current->blocked; oldset = &current->blocked;
signr = get_signal_to_deliver(&info, regs, NULL); signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) { if (signr > 0) {
/* Reenable any watchpoints before delivering the /* Reenable any watchpoints before delivering the
* signal to user space. The processor register will * signal to user space. The processor register will
...@@ -570,7 +578,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) ...@@ -570,7 +578,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
*/ */
/* Whee! Actually deliver the signal. */ /* Whee! Actually deliver the signal. */
handle_signal(signr, &info, oldset, regs); handle_signal(signr, &ka, &info, oldset, regs);
return 1; return 1;
} }
......
#ifndef __ASM_HARDIRQ_H #ifndef __ASM_HARDIRQ_H
#define __ASM_HARDIRQ_H #define __ASM_HARDIRQ_H
/* $Id$ */
/* orig : i386 2.5.67 */
#include <linux/config.h> #include <linux/config.h>
#include <linux/threads.h> #include <linux/threads.h>
#include <linux/irq.h> #include <linux/irq.h>
...@@ -40,20 +36,6 @@ typedef struct { ...@@ -40,20 +36,6 @@ typedef struct {
#define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS) #define SOFTIRQ_SHIFT (PREEMPT_SHIFT + PREEMPT_BITS)
#define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS) #define HARDIRQ_SHIFT (SOFTIRQ_SHIFT + SOFTIRQ_BITS)
#define __MASK(x) ((1UL << (x))-1)
#define PREEMPT_MASK (__MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
#define HARDIRQ_MASK (__MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
#define SOFTIRQ_MASK (__MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
/* /*
* The hardirq mask has to be large enough to have * The hardirq mask has to be large enough to have
* space for potentially all IRQ sources in the system * space for potentially all IRQ sources in the system
......
#ifndef _ASM_M32R_PAGE_H #ifndef _ASM_M32R_PAGE_H
#define _ASM_M32R_PAGE_H #define _ASM_M32R_PAGE_H
/* $Id$ */
#include <linux/config.h> #include <linux/config.h>
/* PAGE_SHIFT determines the page size */ /* PAGE_SHIFT determines the page size */
...@@ -106,6 +104,8 @@ static __inline__ int get_order(unsigned long size) ...@@ -106,6 +104,8 @@ static __inline__ int get_order(unsigned long size)
#define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC ) VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC )
#define devmem_is_allowed(x) 1
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif /* _ASM_M32R_PAGE_H */ #endif /* _ASM_M32R_PAGE_H */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment