diff options
Diffstat (limited to 'arch/um')
-rw-r--r-- | arch/um/Makefile | 1 | ||||
-rw-r--r-- | arch/um/Makefile-i386 | 7 | ||||
-rw-r--r-- | arch/um/Makefile-x86_64 | 3 | ||||
-rw-r--r-- | arch/um/drivers/harddog_kern.c | 3 | ||||
-rw-r--r-- | arch/um/drivers/mmapper_kern.c | 2 | ||||
-rw-r--r-- | arch/um/drivers/random.c | 3 |
6 files changed, 18 insertions, 1 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile index dbeab15e7bb7..ca40397017b9 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -77,7 +77,6 @@ include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) | |||
77 | KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ | 77 | KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ |
78 | -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)) | 78 | -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)) |
79 | KBUILD_CFLAGS += $(KERNEL_DEFINES) | 79 | KBUILD_CFLAGS += $(KERNEL_DEFINES) |
80 | KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time,) | ||
81 | 80 | ||
82 | PHONY += linux | 81 | PHONY += linux |
83 | 82 | ||
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 561e373bd850..302cbe504543 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 | |||
@@ -32,4 +32,11 @@ cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) | |||
32 | # an unresolved reference. | 32 | # an unresolved reference. |
33 | cflags-y += -ffreestanding | 33 | cflags-y += -ffreestanding |
34 | 34 | ||
35 | # Disable unit-at-a-time mode on pre-gcc-4.0 compilers, it makes gcc use | ||
36 | # a lot more stack due to the lack of sharing of stacklots. Also, gcc | ||
37 | # 4.3.0 needs -funit-at-a-time for extern inline functions. | ||
38 | KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \ | ||
39 | echo $(call cc-option,-fno-unit-at-a-time); \ | ||
40 | else echo $(call cc-option,-funit-at-a-time); fi ;) | ||
41 | |||
35 | KBUILD_CFLAGS += $(cflags-y) | 42 | KBUILD_CFLAGS += $(cflags-y) |
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index 8ed362f93582..a9cd7e77a7ab 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 | |||
@@ -21,3 +21,6 @@ HEADER_ARCH := x86 | |||
21 | 21 | ||
22 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64 | 22 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib64 |
23 | LINK-y += -m64 | 23 | LINK-y += -m64 |
24 | |||
25 | # Do unit-at-a-time unconditionally on x86_64, following the host | ||
26 | KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) | ||
diff --git a/arch/um/drivers/harddog_kern.c b/arch/um/drivers/harddog_kern.c index a9ad4bd6d953..d332503fa1be 100644 --- a/arch/um/drivers/harddog_kern.c +++ b/arch/um/drivers/harddog_kern.c | |||
@@ -66,6 +66,7 @@ static int harddog_open(struct inode *inode, struct file *file) | |||
66 | int err = -EBUSY; | 66 | int err = -EBUSY; |
67 | char *sock = NULL; | 67 | char *sock = NULL; |
68 | 68 | ||
69 | lock_kernel(); | ||
69 | spin_lock(&lock); | 70 | spin_lock(&lock); |
70 | if(timer_alive) | 71 | if(timer_alive) |
71 | goto err; | 72 | goto err; |
@@ -82,9 +83,11 @@ static int harddog_open(struct inode *inode, struct file *file) | |||
82 | 83 | ||
83 | timer_alive = 1; | 84 | timer_alive = 1; |
84 | spin_unlock(&lock); | 85 | spin_unlock(&lock); |
86 | unlock_kernel(); | ||
85 | return nonseekable_open(inode, file); | 87 | return nonseekable_open(inode, file); |
86 | err: | 88 | err: |
87 | spin_unlock(&lock); | 89 | spin_unlock(&lock); |
90 | unlock_kernel(); | ||
88 | return err; | 91 | return err; |
89 | } | 92 | } |
90 | 93 | ||
diff --git a/arch/um/drivers/mmapper_kern.c b/arch/um/drivers/mmapper_kern.c index 67b2f55a602f..eb240323c40a 100644 --- a/arch/um/drivers/mmapper_kern.c +++ b/arch/um/drivers/mmapper_kern.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/miscdevice.h> | 16 | #include <linux/miscdevice.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/mm.h> | 18 | #include <linux/mm.h> |
19 | #include <linux/smp_lock.h> | ||
19 | #include <asm/uaccess.h> | 20 | #include <asm/uaccess.h> |
20 | #include "mem_user.h" | 21 | #include "mem_user.h" |
21 | 22 | ||
@@ -77,6 +78,7 @@ out: | |||
77 | 78 | ||
78 | static int mmapper_open(struct inode *inode, struct file *file) | 79 | static int mmapper_open(struct inode *inode, struct file *file) |
79 | { | 80 | { |
81 | cycle_kernel_lock(); | ||
80 | return 0; | 82 | return 0; |
81 | } | 83 | } |
82 | 84 | ||
diff --git a/arch/um/drivers/random.c b/arch/um/drivers/random.c index 4949044773ba..6eabb7022a2d 100644 --- a/arch/um/drivers/random.c +++ b/arch/um/drivers/random.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * of the GNU General Public License, incorporated herein by reference. | 7 | * of the GNU General Public License, incorporated herein by reference. |
8 | */ | 8 | */ |
9 | #include <linux/sched.h> | 9 | #include <linux/sched.h> |
10 | #include <linux/smp_lock.h> | ||
10 | #include <linux/module.h> | 11 | #include <linux/module.h> |
11 | #include <linux/fs.h> | 12 | #include <linux/fs.h> |
12 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
@@ -33,6 +34,8 @@ static DECLARE_WAIT_QUEUE_HEAD(host_read_wait); | |||
33 | 34 | ||
34 | static int rng_dev_open (struct inode *inode, struct file *filp) | 35 | static int rng_dev_open (struct inode *inode, struct file *filp) |
35 | { | 36 | { |
37 | cycle_kernel_lock(); | ||
38 | |||
36 | /* enforce read-only access to this chrdev */ | 39 | /* enforce read-only access to this chrdev */ |
37 | if ((filp->f_mode & FMODE_READ) == 0) | 40 | if ((filp->f_mode & FMODE_READ) == 0) |
38 | return -EINVAL; | 41 | return -EINVAL; |