aboutsummaryrefslogtreecommitdiff
path: root/arch/um
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/drivers/ubd_kern.c16
-rw-r--r--arch/um/include/init.h26
-rw-r--r--arch/um/kernel/dyn.lds.S4
-rw-r--r--arch/um/kernel/ksyms.c4
-rw-r--r--arch/um/kernel/uml.lds.S4
-rw-r--r--arch/um/sys-i386/signal.c50
-rw-r--r--arch/um/sys-x86_64/signal.c70
7 files changed, 83 insertions, 91 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index b1a77b11f08..99f9f9605e9 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -475,17 +475,9 @@ static void do_ubd_request(struct request_queue * q);
/* Only changed by ubd_init, which is an initcall. */
int thread_fd = -1;
-static void ubd_end_request(struct request *req, int bytes, int uptodate)
+static void ubd_end_request(struct request *req, int bytes, int error)
{
- if (!end_that_request_first(req, uptodate, bytes >> 9)) {
- struct ubd *dev = req->rq_disk->private_data;
- unsigned long flags;
-
- add_disk_randomness(req->rq_disk);
- spin_lock_irqsave(&dev->lock, flags);
- end_that_request_last(req, uptodate);
- spin_unlock_irqrestore(&dev->lock, flags);
- }
+ blk_end_request(req, error, bytes);
}
/* Callable only from interrupt context - otherwise you need to do
@@ -493,10 +485,10 @@ static void ubd_end_request(struct request *req, int bytes, int uptodate)
static inline void ubd_finish(struct request *req, int bytes)
{
if(bytes < 0){
- ubd_end_request(req, 0, 0);
+ ubd_end_request(req, 0, -EIO);
return;
}
- ubd_end_request(req, bytes, 1);
+ ubd_end_request(req, bytes, 0);
}
static LIST_HEAD(restart);
diff --git a/arch/um/include/init.h b/arch/um/include/init.h
index d4de7c0120c..cebc6cae919 100644
--- a/arch/um/include/init.h
+++ b/arch/um/include/init.h
@@ -42,15 +42,15 @@ typedef void (*exitcall_t)(void);
/* These are for everybody (although not all archs will actually
discard it in modules) */
-#define __init __attribute__ ((__section__ (".init.text")))
-#define __initdata __attribute__ ((__section__ (".init.data")))
-#define __exitdata __attribute__ ((__section__(".exit.data")))
-#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
+#define __init __section(.init.text)
+#define __initdata __section(.init.data)
+#define __exitdata __section(.exit.data)
+#define __exit_call __used __section(.exitcall.exit)
#ifdef MODULE
-#define __exit __attribute__ ((__section__(".exit.text")))
+#define __exit __section(.exit.text)
#else
-#define __exit __attribute_used__ __attribute__ ((__section__(".exit.text")))
+#define __exit __used __section(.exit.text)
#endif
#endif
@@ -103,16 +103,16 @@ extern struct uml_param __uml_setup_start, __uml_setup_end;
* Mark functions and data as being only used at initialization
* or exit time.
*/
-#define __uml_init_setup __attribute_used__ __attribute__ ((__section__ (".uml.setup.init")))
-#define __uml_setup_help __attribute_used__ __attribute__ ((__section__ (".uml.help.init")))
-#define __uml_init_call __attribute_used__ __attribute__ ((__section__ (".uml.initcall.init")))
-#define __uml_postsetup_call __attribute_used__ __attribute__ ((__section__ (".uml.postsetup.init")))
-#define __uml_exit_call __attribute_used__ __attribute__ ((__section__ (".uml.exitcall.exit")))
+#define __uml_init_setup __used __section(.uml.setup.init)
+#define __uml_setup_help __used __section(.uml.help.init)
+#define __uml_init_call __used __section(.uml.initcall.init)
+#define __uml_postsetup_call __used __section(.uml.postsetup.init)
+#define __uml_exit_call __used __section(.uml.exitcall.exit)
#ifndef __KERNEL__
#define __define_initcall(level,fn) \
- static initcall_t __initcall_##fn __attribute_used__ \
+ static initcall_t __initcall_##fn __used \
__attribute__((__section__(".initcall" level ".init"))) = fn
/* Userspace initcalls shouldn't depend on anything in the kernel, so we'll
@@ -122,7 +122,7 @@ extern struct uml_param __uml_setup_start, __uml_setup_end;
#define __exitcall(fn) static exitcall_t __exitcall_##fn __exit_call = fn
-#define __init_call __attribute_used__ __attribute__ ((__section__ (".initcall.init")))
+#define __init_call __used __section(.initcall.init)
#endif
diff --git a/arch/um/kernel/dyn.lds.S b/arch/um/kernel/dyn.lds.S
index 3866f4960f0..26090b7f323 100644
--- a/arch/um/kernel/dyn.lds.S
+++ b/arch/um/kernel/dyn.lds.S
@@ -17,7 +17,7 @@ SECTIONS
__init_begin = .;
.init.text : {
_sinittext = .;
- *(.init.text)
+ INIT_TEXT
_einittext = .;
}
@@ -84,7 +84,7 @@ SECTIONS
#include "asm/common.lds.S"
- init.data : { *(.init.data) }
+ init.data : { INIT_DATA }
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
diff --git a/arch/um/kernel/ksyms.c b/arch/um/kernel/ksyms.c
index 1b388b41d95..7c7142ba3bd 100644
--- a/arch/um/kernel/ksyms.c
+++ b/arch/um/kernel/ksyms.c
@@ -71,10 +71,10 @@ EXPORT_SYMBOL(dump_thread);
/* required for SMP */
-extern void FASTCALL( __write_lock_failed(rwlock_t *rw));
+extern void __write_lock_failed(rwlock_t *rw);
EXPORT_SYMBOL(__write_lock_failed);
-extern void FASTCALL( __read_lock_failed(rwlock_t *rw));
+extern void __read_lock_failed(rwlock_t *rw);
EXPORT_SYMBOL(__read_lock_failed);
#endif
diff --git a/arch/um/kernel/uml.lds.S b/arch/um/kernel/uml.lds.S
index 13df191e2b4..5828c1d5450 100644
--- a/arch/um/kernel/uml.lds.S
+++ b/arch/um/kernel/uml.lds.S
@@ -23,7 +23,7 @@ SECTIONS
__init_begin = .;
.init.text : {
_sinittext = .;
- *(.init.text)
+ INIT_TEXT
_einittext = .;
}
. = ALIGN(4096);
@@ -48,7 +48,7 @@ SECTIONS
#include "asm/common.lds.S"
- init.data : { *(init.data) }
+ init.data : { INIT_DATA }
.data :
{
. = ALIGN(KERNEL_STACK_SIZE); /* init_task */
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c
index 0147227ce18..19053d46cb6 100644
--- a/arch/um/sys-i386/signal.c
+++ b/arch/um/sys-i386/signal.c
@@ -3,10 +3,10 @@
* Licensed under the GPL
*/
-#include "linux/ptrace.h"
-#include "asm/unistd.h"
-#include "asm/uaccess.h"
-#include "asm/ucontext.h"
+#include <linux/ptrace.h>
+#include <asm/unistd.h>
+#include <asm/uaccess.h>
+#include <asm/ucontext.h>
#include "frame_kern.h"
#include "skas.h"
@@ -18,17 +18,17 @@ void copy_sc(struct uml_pt_regs *regs, void *from)
REGS_FS(regs->gp) = sc->fs;
REGS_ES(regs->gp) = sc->es;
REGS_DS(regs->gp) = sc->ds;
- REGS_EDI(regs->gp) = sc->edi;
- REGS_ESI(regs->gp) = sc->esi;
- REGS_EBP(regs->gp) = sc->ebp;
- REGS_SP(regs->gp) = sc->esp;
- REGS_EBX(regs->gp) = sc->ebx;
- REGS_EDX(regs->gp) = sc->edx;
- REGS_ECX(regs->gp) = sc->ecx;
- REGS_EAX(regs->gp) = sc->eax;
- REGS_IP(regs->gp) = sc->eip;
+ REGS_EDI(regs->gp) = sc->di;
+ REGS_ESI(regs->gp) = sc->si;
+ REGS_EBP(regs->gp) = sc->bp;
+ REGS_SP(regs->gp) = sc->sp;
+ REGS_EBX(regs->gp) = sc->bx;
+ REGS_EDX(regs->gp) = sc->dx;
+ REGS_ECX(regs->gp) = sc->cx;
+ REGS_EAX(regs->gp) = sc->ax;
+ REGS_IP(regs->gp) = sc->ip;
REGS_CS(regs->gp) = sc->cs;
- REGS_EFLAGS(regs->gp) = sc->eflags;
+ REGS_EFLAGS(regs->gp) = sc->flags;
REGS_SS(regs->gp) = sc->ss;
}
@@ -229,18 +229,18 @@ static int copy_sc_to_user(struct sigcontext __user *to,
sc.fs = REGS_FS(regs->regs.gp);
sc.es = REGS_ES(regs->regs.gp);
sc.ds = REGS_DS(regs->regs.gp);
- sc.edi = REGS_EDI(regs->regs.gp);
- sc.esi = REGS_ESI(regs->regs.gp);
- sc.ebp = REGS_EBP(regs->regs.gp);
- sc.esp = sp;
- sc.ebx = REGS_EBX(regs->regs.gp);
- sc.edx = REGS_EDX(regs->regs.gp);
- sc.ecx = REGS_ECX(regs->regs.gp);
- sc.eax = REGS_EAX(regs->regs.gp);
- sc.eip = REGS_IP(regs->regs.gp);
+ sc.di = REGS_EDI(regs->regs.gp);
+ sc.si = REGS_ESI(regs->regs.gp);
+ sc.bp = REGS_EBP(regs->regs.gp);
+ sc.sp = sp;
+ sc.bx = REGS_EBX(regs->regs.gp);
+ sc.dx = REGS_EDX(regs->regs.gp);
+ sc.cx = REGS_ECX(regs->regs.gp);
+ sc.ax = REGS_EAX(regs->regs.gp);
+ sc.ip = REGS_IP(regs->regs.gp);
sc.cs = REGS_CS(regs->regs.gp);
- sc.eflags = REGS_EFLAGS(regs->regs.gp);
- sc.esp_at_signal = regs->regs.gp[UESP];
+ sc.flags = REGS_EFLAGS(regs->regs.gp);
+ sc.sp_at_signal = regs->regs.gp[UESP];
sc.ss = regs->regs.gp[SS];
sc.cr2 = fi->cr2;
sc.err = fi->error_code;
diff --git a/arch/um/sys-x86_64/signal.c b/arch/um/sys-x86_64/signal.c
index 1778d33808f..7457436b433 100644
--- a/arch/um/sys-x86_64/signal.c
+++ b/arch/um/sys-x86_64/signal.c
@@ -4,11 +4,11 @@
* Licensed under the GPL
*/
-#include "linux/personality.h"
-#include "linux/ptrace.h"
-#include "asm/unistd.h"
-#include "asm/uaccess.h"
-#include "asm/ucontext.h"
+#include <linux/personality.h>
+#include <linux/ptrace.h>
+#include <asm/unistd.h>
+#include <asm/uaccess.h>
+#include <asm/ucontext.h>
#include "frame_kern.h"
#include "skas.h"
@@ -27,16 +27,16 @@ void copy_sc(struct uml_pt_regs *regs, void *from)
GETREG(regs, R13, sc, r13);
GETREG(regs, R14, sc, r14);
GETREG(regs, R15, sc, r15);
- GETREG(regs, RDI, sc, rdi);
- GETREG(regs, RSI, sc, rsi);
- GETREG(regs, RBP, sc, rbp);
- GETREG(regs, RBX, sc, rbx);
- GETREG(regs, RDX, sc, rdx);
- GETREG(regs, RAX, sc, rax);
- GETREG(regs, RCX, sc, rcx);
- GETREG(regs, RSP, sc, rsp);
- GETREG(regs, RIP, sc, rip);
- GETREG(regs, EFLAGS, sc, eflags);
+ GETREG(regs, RDI, sc, di);
+ GETREG(regs, RSI, sc, si);
+ GETREG(regs, RBP, sc, bp);
+ GETREG(regs, RBX, sc, bx);
+ GETREG(regs, RDX, sc, dx);
+ GETREG(regs, RAX, sc, ax);
+ GETREG(regs, RCX, sc, cx);
+ GETREG(regs, RSP, sc, sp);
+ GETREG(regs, RIP, sc, ip);
+ GETREG(regs, EFLAGS, sc, flags);
GETREG(regs, CS, sc, cs);
#undef GETREG
@@ -61,16 +61,16 @@ static int copy_sc_from_user(struct pt_regs *regs,
err |= GETREG(regs, R13, from, r13);
err |= GETREG(regs, R14, from, r14);
err |= GETREG(regs, R15, from, r15);
- err |= GETREG(regs, RDI, from, rdi);
- err |= GETREG(regs, RSI, from, rsi);
- err |= GETREG(regs, RBP, from, rbp);
- err |= GETREG(regs, RBX, from, rbx);
- err |= GETREG(regs, RDX, from, rdx);
- err |= GETREG(regs, RAX, from, rax);
- err |= GETREG(regs, RCX, from, rcx);
- err |= GETREG(regs, RSP, from, rsp);
- err |= GETREG(regs, RIP, from, rip);
- err |= GETREG(regs, EFLAGS, from, eflags);
+ err |= GETREG(regs, RDI, from, di);
+ err |= GETREG(regs, RSI, from, si);
+ err |= GETREG(regs, RBP, from, bp);
+ err |= GETREG(regs, RBX, from, bx);
+ err |= GETREG(regs, RDX, from, dx);
+ err |= GETREG(regs, RAX, from, ax);
+ err |= GETREG(regs, RCX, from, cx);
+ err |= GETREG(regs, RSP, from, sp);
+ err |= GETREG(regs, RIP, from, ip);
+ err |= GETREG(regs, EFLAGS, from, flags);
err |= GETREG(regs, CS, from, cs);
if (err)
return 1;
@@ -108,19 +108,19 @@ static int copy_sc_to_user(struct sigcontext __user *to,
__put_user((regs)->regs.gp[(regno) / sizeof(unsigned long)], \
&(sc)->regname)
- err |= PUTREG(regs, RDI, to, rdi);
- err |= PUTREG(regs, RSI, to, rsi);
- err |= PUTREG(regs, RBP, to, rbp);
+ err |= PUTREG(regs, RDI, to, di);
+ err |= PUTREG(regs, RSI, to, si);
+ err |= PUTREG(regs, RBP, to, bp);
/*
* Must use orignal RSP, which is passed in, rather than what's in
* the pt_regs, because that's already been updated to point at the
* signal frame.
*/
- err |= __put_user(sp, &to->rsp);
- err |= PUTREG(regs, RBX, to, rbx);
- err |= PUTREG(regs, RDX, to, rdx);
- err |= PUTREG(regs, RCX, to, rcx);
- err |= PUTREG(regs, RAX, to, rax);
+ err |= __put_user(sp, &to->sp);
+ err |= PUTREG(regs, RBX, to, bx);
+ err |= PUTREG(regs, RDX, to, dx);
+ err |= PUTREG(regs, RCX, to, cx);
+ err |= PUTREG(regs, RAX, to, ax);
err |= PUTREG(regs, R8, to, r8);
err |= PUTREG(regs, R9, to, r9);
err |= PUTREG(regs, R10, to, r10);
@@ -135,8 +135,8 @@ static int copy_sc_to_user(struct sigcontext __user *to,
err |= __put_user(fi->error_code, &to->err);
err |= __put_user(fi->trap_no, &to->trapno);
- err |= PUTREG(regs, RIP, to, rip);
- err |= PUTREG(regs, EFLAGS, to, eflags);
+ err |= PUTREG(regs, RIP, to, ip);
+ err |= PUTREG(regs, EFLAGS, to, flags);
#undef PUTREG
err |= __put_user(mask, &to->oldmask);