diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-01-09 14:18:33 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-01-09 14:18:33 -0500 |
commit | 0a3a98f6dd4e8f4d928a09302c0d1c56f2192ac3 (patch) | |
tree | 92f55e374a84d06ce8213a4540454760fdecf137 /arch | |
parent | 8ef12c9f01afba47c2d33bb939085111ca0d0f7d (diff) | |
parent | 5367f2d67c7d0bf1faae90e6e7b4e2ac3c9b5e0f (diff) |
Merge Linus' tree.
Diffstat (limited to 'arch')
123 files changed, 862 insertions, 987 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig index 153337ff1d7b..eedf41bf7057 100644 --- a/arch/alpha/Kconfig +++ b/arch/alpha/Kconfig | |||
@@ -18,9 +18,6 @@ config MMU | |||
18 | bool | 18 | bool |
19 | default y | 19 | default y |
20 | 20 | ||
21 | config UID16 | ||
22 | bool | ||
23 | |||
24 | config RWSEM_GENERIC_SPINLOCK | 21 | config RWSEM_GENERIC_SPINLOCK |
25 | bool | 22 | bool |
26 | 23 | ||
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index a8682612abc0..abb739b88ed1 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -43,6 +43,11 @@ | |||
43 | #include "proto.h" | 43 | #include "proto.h" |
44 | #include "pci_impl.h" | 44 | #include "pci_impl.h" |
45 | 45 | ||
46 | /* | ||
47 | * Power off function, if any | ||
48 | */ | ||
49 | void (*pm_power_off)(void) = machine_power_off; | ||
50 | |||
46 | void | 51 | void |
47 | cpu_idle(void) | 52 | cpu_idle(void) |
48 | { | 53 | { |
diff --git a/arch/alpha/kernel/ptrace.c b/arch/alpha/kernel/ptrace.c index bbd37536d14e..9969d212e94d 100644 --- a/arch/alpha/kernel/ptrace.c +++ b/arch/alpha/kernel/ptrace.c | |||
@@ -265,30 +265,16 @@ do_sys_ptrace(long request, long pid, long addr, long data, | |||
265 | lock_kernel(); | 265 | lock_kernel(); |
266 | DBG(DBG_MEM, ("request=%ld pid=%ld addr=0x%lx data=0x%lx\n", | 266 | DBG(DBG_MEM, ("request=%ld pid=%ld addr=0x%lx data=0x%lx\n", |
267 | request, pid, addr, data)); | 267 | request, pid, addr, data)); |
268 | ret = -EPERM; | ||
269 | if (request == PTRACE_TRACEME) { | 268 | if (request == PTRACE_TRACEME) { |
270 | /* are we already being traced? */ | 269 | ret = ptrace_traceme(); |
271 | if (current->ptrace & PT_PTRACED) | ||
272 | goto out_notsk; | ||
273 | ret = security_ptrace(current->parent, current); | ||
274 | if (ret) | ||
275 | goto out_notsk; | ||
276 | /* set the ptrace bit in the process ptrace flags. */ | ||
277 | current->ptrace |= PT_PTRACED; | ||
278 | ret = 0; | ||
279 | goto out_notsk; | 270 | goto out_notsk; |
280 | } | 271 | } |
281 | if (pid == 1) /* you may not mess with init */ | ||
282 | goto out_notsk; | ||
283 | 272 | ||
284 | ret = -ESRCH; | 273 | child = ptrace_get_task_struct(pid); |
285 | read_lock(&tasklist_lock); | 274 | if (IS_ERR(child)) { |
286 | child = find_task_by_pid(pid); | 275 | ret = PTR_ERR(child); |
287 | if (child) | ||
288 | get_task_struct(child); | ||
289 | read_unlock(&tasklist_lock); | ||
290 | if (!child) | ||
291 | goto out_notsk; | 276 | goto out_notsk; |
277 | } | ||
292 | 278 | ||
293 | if (request == PTRACE_ATTACH) { | 279 | if (request == PTRACE_ATTACH) { |
294 | ret = ptrace_attach(child); | 280 | ret = ptrace_attach(child); |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index e149f152e70b..50b9afa8ae6d 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -46,10 +46,6 @@ config MCA | |||
46 | <file:Documentation/mca.txt> (and especially the web page given | 46 | <file:Documentation/mca.txt> (and especially the web page given |
47 | there) before attempting to build an MCA bus kernel. | 47 | there) before attempting to build an MCA bus kernel. |
48 | 48 | ||
49 | config UID16 | ||
50 | bool | ||
51 | default y | ||
52 | |||
53 | config RWSEM_GENERIC_SPINLOCK | 49 | config RWSEM_GENERIC_SPINLOCK |
54 | bool | 50 | bool |
55 | default y | 51 | default y |
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index b6de43e73699..a2dfe0b0f1ec 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
16 | #include <linux/slab.h> | ||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | #include <asm/io.h> | 18 | #include <asm/io.h> |
18 | #include <asm/hardware/scoop.h> | 19 | #include <asm/hardware/scoop.h> |
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 04d3082a7b94..0abbce8c70bc 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c | |||
@@ -23,20 +23,15 @@ | |||
23 | #error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32 | 23 | #error Sorry, your compiler targets APCS-26 but this kernel requires APCS-32 |
24 | #endif | 24 | #endif |
25 | /* | 25 | /* |
26 | * GCC 2.95.1, 2.95.2: ignores register clobber list in asm(). | ||
27 | * GCC 3.0, 3.1: general bad code generation. | 26 | * GCC 3.0, 3.1: general bad code generation. |
28 | * GCC 3.2.0: incorrect function argument offset calculation. | 27 | * GCC 3.2.0: incorrect function argument offset calculation. |
29 | * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c | 28 | * GCC 3.2.x: miscompiles NEW_AUX_ENT in fs/binfmt_elf.c |
30 | * (http://gcc.gnu.org/PR8896) and incorrect structure | 29 | * (http://gcc.gnu.org/PR8896) and incorrect structure |
31 | * initialisation in fs/jffs2/erase.c | 30 | * initialisation in fs/jffs2/erase.c |
32 | */ | 31 | */ |
33 | #if __GNUC__ < 2 || \ | 32 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) |
34 | (__GNUC__ == 2 && __GNUC_MINOR__ < 95) || \ | ||
35 | (__GNUC__ == 2 && __GNUC_MINOR__ == 95 && __GNUC_PATCHLEVEL__ != 0 && \ | ||
36 | __GNUC_PATCHLEVEL__ < 3) || \ | ||
37 | (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | ||
38 | #error Your compiler is too buggy; it is known to miscompile kernels. | 33 | #error Your compiler is too buggy; it is known to miscompile kernels. |
39 | #error Known good compilers: 2.95.3, 2.95.4, 2.96, 3.3 | 34 | #error Known good compilers: 3.3 |
40 | #endif | 35 | #endif |
41 | 36 | ||
42 | /* Use marker if you need to separate the values later */ | 37 | /* Use marker if you need to separate the values later */ |
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 869c466e6258..b5645c4462cf 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c | |||
@@ -684,8 +684,12 @@ int setup_irq(unsigned int irq, struct irqaction *new) | |||
684 | spin_lock_irqsave(&irq_controller_lock, flags); | 684 | spin_lock_irqsave(&irq_controller_lock, flags); |
685 | p = &desc->action; | 685 | p = &desc->action; |
686 | if ((old = *p) != NULL) { | 686 | if ((old = *p) != NULL) { |
687 | /* Can't share interrupts unless both agree to */ | 687 | /* |
688 | if (!(old->flags & new->flags & SA_SHIRQ)) { | 688 | * Can't share interrupts unless both agree to and are |
689 | * the same type. | ||
690 | */ | ||
691 | if (!(old->flags & new->flags & SA_SHIRQ) || | ||
692 | (~old->flags & new->flags) & SA_TRIGGER_MASK) { | ||
689 | spin_unlock_irqrestore(&irq_controller_lock, flags); | 693 | spin_unlock_irqrestore(&irq_controller_lock, flags); |
690 | return -EBUSY; | 694 | return -EBUSY; |
691 | } | 695 | } |
@@ -705,6 +709,12 @@ int setup_irq(unsigned int irq, struct irqaction *new) | |||
705 | desc->running = 0; | 709 | desc->running = 0; |
706 | desc->pending = 0; | 710 | desc->pending = 0; |
707 | desc->disable_depth = 1; | 711 | desc->disable_depth = 1; |
712 | |||
713 | if (new->flags & SA_TRIGGER_MASK) { | ||
714 | unsigned int type = new->flags & SA_TRIGGER_MASK; | ||
715 | desc->chip->set_type(irq, type); | ||
716 | } | ||
717 | |||
708 | if (!desc->noautoenable) { | 718 | if (!desc->noautoenable) { |
709 | desc->disable_depth = 0; | 719 | desc->disable_depth = 0; |
710 | desc->chip->unmask(irq); | 720 | desc->chip->unmask(irq); |
diff --git a/arch/arm/mach-footbridge/netwinder-hw.c b/arch/arm/mach-footbridge/netwinder-hw.c index 775f85fc8513..9e563de465b5 100644 --- a/arch/arm/mach-footbridge/netwinder-hw.c +++ b/arch/arm/mach-footbridge/netwinder-hw.c | |||
@@ -601,6 +601,7 @@ EXPORT_SYMBOL(gpio_lock); | |||
601 | EXPORT_SYMBOL(gpio_modify_op); | 601 | EXPORT_SYMBOL(gpio_modify_op); |
602 | EXPORT_SYMBOL(gpio_modify_io); | 602 | EXPORT_SYMBOL(gpio_modify_io); |
603 | EXPORT_SYMBOL(cpld_modify); | 603 | EXPORT_SYMBOL(cpld_modify); |
604 | EXPORT_SYMBOL(gpio_read); | ||
604 | 605 | ||
605 | /* | 606 | /* |
606 | * Initialise any other hardware after we've got the PCI bus | 607 | * Initialise any other hardware after we've got the PCI bus |
diff --git a/arch/arm/mach-integrator/time.c b/arch/arm/mach-integrator/time.c index 9f46aaef8968..3c22c16b38bf 100644 --- a/arch/arm/mach-integrator/time.c +++ b/arch/arm/mach-integrator/time.c | |||
@@ -96,7 +96,8 @@ static struct rtc_ops rtc_ops = { | |||
96 | .set_alarm = rtc_set_alarm, | 96 | .set_alarm = rtc_set_alarm, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 99 | static irqreturn_t arm_rtc_interrupt(int irq, void *dev_id, |
100 | struct pt_regs *regs) | ||
100 | { | 101 | { |
101 | writel(0, rtc_base + RTC_EOI); | 102 | writel(0, rtc_base + RTC_EOI); |
102 | return IRQ_HANDLED; | 103 | return IRQ_HANDLED; |
@@ -124,7 +125,7 @@ static int rtc_probe(struct amba_device *dev, void *id) | |||
124 | 125 | ||
125 | xtime.tv_sec = __raw_readl(rtc_base + RTC_DR); | 126 | xtime.tv_sec = __raw_readl(rtc_base + RTC_DR); |
126 | 127 | ||
127 | ret = request_irq(dev->irq[0], rtc_interrupt, SA_INTERRUPT, | 128 | ret = request_irq(dev->irq[0], arm_rtc_interrupt, SA_INTERRUPT, |
128 | "rtc-pl030", dev); | 129 | "rtc-pl030", dev); |
129 | if (ret) | 130 | if (ret) |
130 | goto map_out; | 131 | goto map_out; |
diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c index fcfb81d13cfe..7a68f098a025 100644 --- a/arch/arm/mach-omap1/serial.c +++ b/arch/arm/mach-omap1/serial.c | |||
@@ -252,9 +252,8 @@ static void __init omap_serial_set_port_wakeup(int gpio_nr) | |||
252 | return; | 252 | return; |
253 | } | 253 | } |
254 | omap_set_gpio_direction(gpio_nr, 1); | 254 | omap_set_gpio_direction(gpio_nr, 1); |
255 | set_irq_type(OMAP_GPIO_IRQ(gpio_nr), IRQT_RISING); | ||
256 | ret = request_irq(OMAP_GPIO_IRQ(gpio_nr), &omap_serial_wake_interrupt, | 255 | ret = request_irq(OMAP_GPIO_IRQ(gpio_nr), &omap_serial_wake_interrupt, |
257 | 0, "serial wakeup", NULL); | 256 | SA_TRIGGER_RISING, "serial wakeup", NULL); |
258 | if (ret) { | 257 | if (ret) { |
259 | omap_free_gpio(gpio_nr); | 258 | omap_free_gpio(gpio_nr); |
260 | printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n", | 259 | printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n", |
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 100fb31b5156..5a7b873f29b3 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -213,15 +213,14 @@ static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(in | |||
213 | 213 | ||
214 | corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250); | 214 | corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250); |
215 | 215 | ||
216 | err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int, SA_INTERRUPT, | 216 | err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int, |
217 | "MMC card detect", data); | 217 | SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, |
218 | "MMC card detect", data); | ||
218 | if (err) { | 219 | if (err) { |
219 | printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); | 220 | printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); |
220 | return -1; | 221 | return -1; |
221 | } | 222 | } |
222 | 223 | ||
223 | set_irq_type(CORGI_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE); | ||
224 | |||
225 | return 0; | 224 | return 0; |
226 | } | 225 | } |
227 | 226 | ||
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index eef3de26ad37..663c95005985 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -146,15 +146,14 @@ static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)( | |||
146 | 146 | ||
147 | poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250); | 147 | poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250); |
148 | 148 | ||
149 | err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int, SA_INTERRUPT, | 149 | err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int, |
150 | "MMC card detect", data); | 150 | SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, |
151 | "MMC card detect", data); | ||
151 | if (err) { | 152 | if (err) { |
152 | printk(KERN_ERR "poodle_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); | 153 | printk(KERN_ERR "poodle_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); |
153 | return -1; | 154 | return -1; |
154 | } | 155 | } |
155 | 156 | ||
156 | set_irq_type(POODLE_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE); | ||
157 | |||
158 | return 0; | 157 | return 0; |
159 | } | 158 | } |
160 | 159 | ||
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index f2007db0cda5..a9eacc06555f 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -296,15 +296,14 @@ static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(in | |||
296 | 296 | ||
297 | spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250); | 297 | spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250); |
298 | 298 | ||
299 | err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int, SA_INTERRUPT, | 299 | err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int, |
300 | "MMC card detect", data); | 300 | SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING, |
301 | "MMC card detect", data); | ||
301 | if (err) { | 302 | if (err) { |
302 | printk(KERN_ERR "spitz_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); | 303 | printk(KERN_ERR "spitz_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); |
303 | return -1; | 304 | return -1; |
304 | } | 305 | } |
305 | 306 | ||
306 | set_irq_type(SPITZ_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE); | ||
307 | |||
308 | return 0; | 307 | return 0; |
309 | } | 308 | } |
310 | 309 | ||
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c index c9d7c596b200..caf6b8bb6c95 100644 --- a/arch/arm/mach-realview/localtimer.c +++ b/arch/arm/mach-realview/localtimer.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
14 | #include <linux/device.h> | 14 | #include <linux/device.h> |
15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <linux/jiffies.h> | ||
16 | 17 | ||
17 | #include <asm/mach/time.h> | 18 | #include <asm/mach/time.h> |
18 | #include <asm/hardware/arm_twd.h> | 19 | #include <asm/hardware/arm_twd.h> |
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c index 5098b50158a3..495f8c6ffcb6 100644 --- a/arch/arm/mach-s3c2410/usb-simtec.c +++ b/arch/arm/mach-s3c2410/usb-simtec.c | |||
@@ -84,13 +84,13 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on) | |||
84 | int ret; | 84 | int ret; |
85 | 85 | ||
86 | if (on) { | 86 | if (on) { |
87 | ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, SA_INTERRUPT, | 87 | ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, |
88 | SA_INTERRUPT | SA_TRIGGER_RISING | | ||
89 | SA_TRIGGER_FALLING, | ||
88 | "USB Over-current", info); | 90 | "USB Over-current", info); |
89 | if (ret != 0) { | 91 | if (ret != 0) { |
90 | printk(KERN_ERR "failed to request usb oc irq\n"); | 92 | printk(KERN_ERR "failed to request usb oc irq\n"); |
91 | } | 93 | } |
92 | |||
93 | set_irq_type(IRQ_USBOC, IRQT_BOTHEDGE); | ||
94 | } else { | 94 | } else { |
95 | free_irq(IRQ_USBOC, info); | 95 | free_irq(IRQ_USBOC, info); |
96 | } | 96 | } |
diff --git a/arch/arm26/Kconfig b/arch/arm26/Kconfig index 1f00b3d03a07..274e07019b46 100644 --- a/arch/arm26/Kconfig +++ b/arch/arm26/Kconfig | |||
@@ -34,10 +34,6 @@ config FORCE_MAX_ZONEORDER | |||
34 | int | 34 | int |
35 | default 9 | 35 | default 9 |
36 | 36 | ||
37 | config UID16 | ||
38 | bool | ||
39 | default y | ||
40 | |||
41 | config RWSEM_GENERIC_SPINLOCK | 37 | config RWSEM_GENERIC_SPINLOCK |
42 | bool | 38 | bool |
43 | default y | 39 | default y |
diff --git a/arch/arm26/kernel/asm-offsets.c b/arch/arm26/kernel/asm-offsets.c index 4ccacaef94df..ac682d5fd039 100644 --- a/arch/arm26/kernel/asm-offsets.c +++ b/arch/arm26/kernel/asm-offsets.c | |||
@@ -25,13 +25,6 @@ | |||
25 | #if defined(__APCS_32__) && defined(CONFIG_CPU_26) | 25 | #if defined(__APCS_32__) && defined(CONFIG_CPU_26) |
26 | #error Sorry, your compiler targets APCS-32 but this kernel requires APCS-26 | 26 | #error Sorry, your compiler targets APCS-32 but this kernel requires APCS-26 |
27 | #endif | 27 | #endif |
28 | #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 95) | ||
29 | #error Sorry, your compiler is known to miscompile kernels. Only use gcc 2.95.3 and later. | ||
30 | #endif | ||
31 | #if __GNUC__ == 2 && __GNUC_MINOR__ == 95 | ||
32 | /* shame we can't detect the .1 or .2 releases */ | ||
33 | #warning GCC 2.95.2 and earlier miscompiles kernels. | ||
34 | #endif | ||
35 | 28 | ||
36 | /* Use marker if you need to separate the values later */ | 29 | /* Use marker if you need to separate the values later */ |
37 | 30 | ||
diff --git a/arch/cris/Kconfig b/arch/cris/Kconfig index e5979d68e352..b83261949737 100644 --- a/arch/cris/Kconfig +++ b/arch/cris/Kconfig | |||
@@ -9,10 +9,6 @@ config MMU | |||
9 | bool | 9 | bool |
10 | default y | 10 | default y |
11 | 11 | ||
12 | config UID16 | ||
13 | bool | ||
14 | default y | ||
15 | |||
16 | config RWSEM_GENERIC_SPINLOCK | 12 | config RWSEM_GENERIC_SPINLOCK |
17 | bool | 13 | bool |
18 | default y | 14 | default y |
diff --git a/arch/frv/Kconfig b/arch/frv/Kconfig index ec85c0d6c6da..61261b78ced7 100644 --- a/arch/frv/Kconfig +++ b/arch/frv/Kconfig | |||
@@ -274,6 +274,11 @@ config GPREL_DATA_NONE | |||
274 | 274 | ||
275 | endchoice | 275 | endchoice |
276 | 276 | ||
277 | config FRV_ONCPU_SERIAL | ||
278 | bool "Use on-CPU serial ports" | ||
279 | select SERIAL_8250 | ||
280 | default y | ||
281 | |||
277 | config PCI | 282 | config PCI |
278 | bool "Use PCI" | 283 | bool "Use PCI" |
279 | depends on MB93090_MB00 | 284 | depends on MB93090_MB00 |
@@ -305,23 +310,7 @@ config RESERVE_DMA_COHERENT | |||
305 | 310 | ||
306 | source "drivers/pci/Kconfig" | 311 | source "drivers/pci/Kconfig" |
307 | 312 | ||
308 | config PCMCIA | 313 | source "drivers/pcmcia/Kconfig" |
309 | tristate "Use PCMCIA" | ||
310 | help | ||
311 | Say Y here if you want to attach PCMCIA- or PC-cards to your FR-V | ||
312 | board. These are credit-card size devices such as network cards, | ||
313 | modems or hard drives often used with laptops computers. There are | ||
314 | actually two varieties of these cards: the older 16 bit PCMCIA cards | ||
315 | and the newer 32 bit CardBus cards. If you want to use CardBus | ||
316 | cards, you need to say Y here and also to "CardBus support" below. | ||
317 | |||
318 | To use your PC-cards, you will need supporting software from David | ||
319 | Hinds pcmcia-cs package (see the file <file:Documentation/Changes> | ||
320 | for location). Please also read the PCMCIA-HOWTO, available from | ||
321 | <http://www.tldp.org/docs.html#howto>. | ||
322 | |||
323 | To compile this driver as modules, choose M here: the | ||
324 | modules will be called pcmcia_core and ds. | ||
325 | 314 | ||
326 | #config MATH_EMULATION | 315 | #config MATH_EMULATION |
327 | # bool "Math emulation support (EXPERIMENTAL)" | 316 | # bool "Math emulation support (EXPERIMENTAL)" |
diff --git a/arch/frv/Kconfig.debug b/arch/frv/Kconfig.debug index 0034b654995d..211f01bc4caa 100644 --- a/arch/frv/Kconfig.debug +++ b/arch/frv/Kconfig.debug | |||
@@ -2,32 +2,10 @@ menu "Kernel hacking" | |||
2 | 2 | ||
3 | source "lib/Kconfig.debug" | 3 | source "lib/Kconfig.debug" |
4 | 4 | ||
5 | config EARLY_PRINTK | ||
6 | bool "Early printk" | ||
7 | depends on EMBEDDED && DEBUG_KERNEL | ||
8 | default n | ||
9 | help | ||
10 | Write kernel log output directly into the VGA buffer or to a serial | ||
11 | port. | ||
12 | |||
13 | This is useful for kernel debugging when your machine crashes very | ||
14 | early before the console code is initialized. For normal operation | ||
15 | it is not recommended because it looks ugly and doesn't cooperate | ||
16 | with klogd/syslogd or the X server. You should normally N here, | ||
17 | unless you want to debug such a crash. | ||
18 | |||
19 | config DEBUG_STACKOVERFLOW | 5 | config DEBUG_STACKOVERFLOW |
20 | bool "Check for stack overflows" | 6 | bool "Check for stack overflows" |
21 | depends on DEBUG_KERNEL | 7 | depends on DEBUG_KERNEL |
22 | 8 | ||
23 | config DEBUG_PAGEALLOC | ||
24 | bool "Page alloc debugging" | ||
25 | depends on DEBUG_KERNEL | ||
26 | help | ||
27 | Unmap pages from the kernel linear mapping after free_pages(). | ||
28 | This results in a large slowdown, but helps to find certain types | ||
29 | of memory corruptions. | ||
30 | |||
31 | config GDBSTUB | 9 | config GDBSTUB |
32 | bool "Remote GDB kernel debugging" | 10 | bool "Remote GDB kernel debugging" |
33 | depends on DEBUG_KERNEL | 11 | depends on DEBUG_KERNEL |
diff --git a/arch/frv/Makefile b/arch/frv/Makefile index 54046d2386f5..90c0fb8d9dc3 100644 --- a/arch/frv/Makefile +++ b/arch/frv/Makefile | |||
@@ -109,10 +109,10 @@ bootstrap: | |||
109 | $(Q)$(MAKEBOOT) bootstrap | 109 | $(Q)$(MAKEBOOT) bootstrap |
110 | 110 | ||
111 | archmrproper: | 111 | archmrproper: |
112 | $(Q)$(MAKE) -C arch/frv/boot mrproper | 112 | $(Q)$(MAKE) $(build)=arch/frv/boot mrproper |
113 | 113 | ||
114 | archclean: | 114 | archclean: |
115 | $(Q)$(MAKE) -C arch/frv/boot clean | 115 | $(Q)$(MAKE) $(build)=arch/frv/boot clean |
116 | 116 | ||
117 | archdep: scripts/mkdep symlinks | 117 | archdep: scripts/mkdep symlinks |
118 | $(Q)$(MAKE) -C arch/frv/boot dep | 118 | $(Q)$(MAKE) $(build)=arch/frv/boot dep |
diff --git a/arch/frv/kernel/Makefile b/arch/frv/kernel/Makefile index 422f30ede575..5a827b349b5e 100644 --- a/arch/frv/kernel/Makefile +++ b/arch/frv/kernel/Makefile | |||
@@ -21,3 +21,4 @@ obj-$(CONFIG_PM) += pm.o cmode.o | |||
21 | obj-$(CONFIG_MB93093_PDK) += pm-mb93093.o | 21 | obj-$(CONFIG_MB93093_PDK) += pm-mb93093.o |
22 | obj-$(CONFIG_SYSCTL) += sysctl.o | 22 | obj-$(CONFIG_SYSCTL) += sysctl.o |
23 | obj-$(CONFIG_FUTEX) += futex.o | 23 | obj-$(CONFIG_FUTEX) += futex.o |
24 | obj-$(CONFIG_MODULES) += module.o | ||
diff --git a/arch/frv/kernel/frv_ksyms.c b/arch/frv/kernel/frv_ksyms.c index 1a76d5247190..5f118c89d091 100644 --- a/arch/frv/kernel/frv_ksyms.c +++ b/arch/frv/kernel/frv_ksyms.c | |||
@@ -16,10 +16,11 @@ | |||
16 | #include <asm/semaphore.h> | 16 | #include <asm/semaphore.h> |
17 | #include <asm/checksum.h> | 17 | #include <asm/checksum.h> |
18 | #include <asm/hardirq.h> | 18 | #include <asm/hardirq.h> |
19 | #include <asm/current.h> | 19 | #include <asm/cacheflush.h> |
20 | 20 | ||
21 | extern void dump_thread(struct pt_regs *, struct user *); | 21 | extern void dump_thread(struct pt_regs *, struct user *); |
22 | extern long __memcpy_user(void *dst, const void *src, size_t count); | 22 | extern long __memcpy_user(void *dst, const void *src, size_t count); |
23 | extern long __memset_user(void *dst, const void *src, size_t count); | ||
23 | 24 | ||
24 | /* platform dependent support */ | 25 | /* platform dependent support */ |
25 | 26 | ||
@@ -50,7 +51,11 @@ EXPORT_SYMBOL(disable_irq); | |||
50 | EXPORT_SYMBOL(__res_bus_clock_speed_HZ); | 51 | EXPORT_SYMBOL(__res_bus_clock_speed_HZ); |
51 | EXPORT_SYMBOL(__page_offset); | 52 | EXPORT_SYMBOL(__page_offset); |
52 | EXPORT_SYMBOL(__memcpy_user); | 53 | EXPORT_SYMBOL(__memcpy_user); |
53 | EXPORT_SYMBOL(flush_dcache_page); | 54 | EXPORT_SYMBOL(__memset_user); |
55 | EXPORT_SYMBOL(frv_dcache_writeback); | ||
56 | EXPORT_SYMBOL(frv_cache_invalidate); | ||
57 | EXPORT_SYMBOL(frv_icache_invalidate); | ||
58 | EXPORT_SYMBOL(frv_cache_wback_inv); | ||
54 | 59 | ||
55 | #ifndef CONFIG_MMU | 60 | #ifndef CONFIG_MMU |
56 | EXPORT_SYMBOL(memory_start); | 61 | EXPORT_SYMBOL(memory_start); |
@@ -72,6 +77,9 @@ EXPORT_SYMBOL(memcmp); | |||
72 | EXPORT_SYMBOL(memscan); | 77 | EXPORT_SYMBOL(memscan); |
73 | EXPORT_SYMBOL(memmove); | 78 | EXPORT_SYMBOL(memmove); |
74 | 79 | ||
80 | EXPORT_SYMBOL(__outsl_ns); | ||
81 | EXPORT_SYMBOL(__insl_ns); | ||
82 | |||
75 | EXPORT_SYMBOL(get_wchan); | 83 | EXPORT_SYMBOL(get_wchan); |
76 | 84 | ||
77 | #ifdef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS | 85 | #ifdef CONFIG_FRV_OUTOFLINE_ATOMIC_OPS |
@@ -80,14 +88,13 @@ EXPORT_SYMBOL(atomic_test_and_OR_mask); | |||
80 | EXPORT_SYMBOL(atomic_test_and_XOR_mask); | 88 | EXPORT_SYMBOL(atomic_test_and_XOR_mask); |
81 | EXPORT_SYMBOL(atomic_add_return); | 89 | EXPORT_SYMBOL(atomic_add_return); |
82 | EXPORT_SYMBOL(atomic_sub_return); | 90 | EXPORT_SYMBOL(atomic_sub_return); |
83 | EXPORT_SYMBOL(__xchg_8); | ||
84 | EXPORT_SYMBOL(__xchg_16); | ||
85 | EXPORT_SYMBOL(__xchg_32); | 91 | EXPORT_SYMBOL(__xchg_32); |
86 | EXPORT_SYMBOL(__cmpxchg_8); | ||
87 | EXPORT_SYMBOL(__cmpxchg_16); | ||
88 | EXPORT_SYMBOL(__cmpxchg_32); | 92 | EXPORT_SYMBOL(__cmpxchg_32); |
89 | #endif | 93 | #endif |
90 | 94 | ||
95 | EXPORT_SYMBOL(__debug_bug_printk); | ||
96 | EXPORT_SYMBOL(__delay_loops_MHz); | ||
97 | |||
91 | /* | 98 | /* |
92 | * libgcc functions - functions that are used internally by the | 99 | * libgcc functions - functions that are used internally by the |
93 | * compiler... (prototypes are not correct though, but that | 100 | * compiler... (prototypes are not correct though, but that |
@@ -101,6 +108,8 @@ extern void __divdi3(void); | |||
101 | extern void __lshrdi3(void); | 108 | extern void __lshrdi3(void); |
102 | extern void __moddi3(void); | 109 | extern void __moddi3(void); |
103 | extern void __muldi3(void); | 110 | extern void __muldi3(void); |
111 | extern void __mulll(void); | ||
112 | extern void __umulll(void); | ||
104 | extern void __negdi2(void); | 113 | extern void __negdi2(void); |
105 | extern void __ucmpdi2(void); | 114 | extern void __ucmpdi2(void); |
106 | extern void __udivdi3(void); | 115 | extern void __udivdi3(void); |
@@ -116,8 +125,10 @@ EXPORT_SYMBOL(__ashrdi3); | |||
116 | EXPORT_SYMBOL(__lshrdi3); | 125 | EXPORT_SYMBOL(__lshrdi3); |
117 | //EXPORT_SYMBOL(__moddi3); | 126 | //EXPORT_SYMBOL(__moddi3); |
118 | EXPORT_SYMBOL(__muldi3); | 127 | EXPORT_SYMBOL(__muldi3); |
128 | EXPORT_SYMBOL(__mulll); | ||
129 | EXPORT_SYMBOL(__umulll); | ||
119 | EXPORT_SYMBOL(__negdi2); | 130 | EXPORT_SYMBOL(__negdi2); |
120 | //EXPORT_SYMBOL(__ucmpdi2); | 131 | EXPORT_SYMBOL(__ucmpdi2); |
121 | //EXPORT_SYMBOL(__udivdi3); | 132 | //EXPORT_SYMBOL(__udivdi3); |
122 | //EXPORT_SYMBOL(__udivmoddi4); | 133 | //EXPORT_SYMBOL(__udivmoddi4); |
123 | //EXPORT_SYMBOL(__umoddi3); | 134 | //EXPORT_SYMBOL(__umoddi3); |
diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c index 8c524cdd2717..59580c59c62c 100644 --- a/arch/frv/kernel/irq.c +++ b/arch/frv/kernel/irq.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/irq.h> | 32 | #include <linux/irq.h> |
33 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
34 | #include <linux/seq_file.h> | 34 | #include <linux/seq_file.h> |
35 | #include <linux/module.h> | ||
35 | 36 | ||
36 | #include <asm/atomic.h> | 37 | #include <asm/atomic.h> |
37 | #include <asm/io.h> | 38 | #include <asm/io.h> |
@@ -178,6 +179,8 @@ void disable_irq_nosync(unsigned int irq) | |||
178 | spin_unlock_irqrestore(&level->lock, flags); | 179 | spin_unlock_irqrestore(&level->lock, flags); |
179 | } | 180 | } |
180 | 181 | ||
182 | EXPORT_SYMBOL(disable_irq_nosync); | ||
183 | |||
181 | /** | 184 | /** |
182 | * disable_irq - disable an irq and wait for completion | 185 | * disable_irq - disable an irq and wait for completion |
183 | * @irq: Interrupt to disable | 186 | * @irq: Interrupt to disable |
@@ -204,6 +207,8 @@ void disable_irq(unsigned int irq) | |||
204 | #endif | 207 | #endif |
205 | } | 208 | } |
206 | 209 | ||
210 | EXPORT_SYMBOL(disable_irq); | ||
211 | |||
207 | /** | 212 | /** |
208 | * enable_irq - enable handling of an irq | 213 | * enable_irq - enable handling of an irq |
209 | * @irq: Interrupt to enable | 214 | * @irq: Interrupt to enable |
@@ -268,6 +273,8 @@ void enable_irq(unsigned int irq) | |||
268 | spin_unlock_irqrestore(&level->lock, flags); | 273 | spin_unlock_irqrestore(&level->lock, flags); |
269 | } | 274 | } |
270 | 275 | ||
276 | EXPORT_SYMBOL(enable_irq); | ||
277 | |||
271 | /*****************************************************************************/ | 278 | /*****************************************************************************/ |
272 | /* | 279 | /* |
273 | * handles all normal device IRQ's | 280 | * handles all normal device IRQ's |
@@ -425,6 +432,8 @@ int request_irq(unsigned int irq, | |||
425 | return retval; | 432 | return retval; |
426 | } | 433 | } |
427 | 434 | ||
435 | EXPORT_SYMBOL(request_irq); | ||
436 | |||
428 | /** | 437 | /** |
429 | * free_irq - free an interrupt | 438 | * free_irq - free an interrupt |
430 | * @irq: Interrupt line to free | 439 | * @irq: Interrupt line to free |
@@ -496,6 +505,8 @@ void free_irq(unsigned int irq, void *dev_id) | |||
496 | } | 505 | } |
497 | } | 506 | } |
498 | 507 | ||
508 | EXPORT_SYMBOL(free_irq); | ||
509 | |||
499 | /* | 510 | /* |
500 | * IRQ autodetection code.. | 511 | * IRQ autodetection code.. |
501 | * | 512 | * |
@@ -519,6 +530,8 @@ unsigned long probe_irq_on(void) | |||
519 | return 0; | 530 | return 0; |
520 | } | 531 | } |
521 | 532 | ||
533 | EXPORT_SYMBOL(probe_irq_on); | ||
534 | |||
522 | /* | 535 | /* |
523 | * Return a mask of triggered interrupts (this | 536 | * Return a mask of triggered interrupts (this |
524 | * can handle only legacy ISA interrupts). | 537 | * can handle only legacy ISA interrupts). |
@@ -542,6 +555,8 @@ unsigned int probe_irq_mask(unsigned long xmask) | |||
542 | return 0; | 555 | return 0; |
543 | } | 556 | } |
544 | 557 | ||
558 | EXPORT_SYMBOL(probe_irq_mask); | ||
559 | |||
545 | /* | 560 | /* |
546 | * Return the one interrupt that triggered (this can | 561 | * Return the one interrupt that triggered (this can |
547 | * handle any interrupt source). | 562 | * handle any interrupt source). |
@@ -571,6 +586,8 @@ int probe_irq_off(unsigned long xmask) | |||
571 | return -1; | 586 | return -1; |
572 | } | 587 | } |
573 | 588 | ||
589 | EXPORT_SYMBOL(probe_irq_off); | ||
590 | |||
574 | /* this was setup_x86_irq but it seems pretty generic */ | 591 | /* this was setup_x86_irq but it seems pretty generic */ |
575 | int setup_irq(unsigned int irq, struct irqaction *new) | 592 | int setup_irq(unsigned int irq, struct irqaction *new) |
576 | { | 593 | { |
diff --git a/arch/frv/kernel/module.c b/arch/frv/kernel/module.c new file mode 100644 index 000000000000..850d168f69fc --- /dev/null +++ b/arch/frv/kernel/module.c | |||
@@ -0,0 +1,80 @@ | |||
1 | /* module.c: FRV specific module loading bits | ||
2 | * | ||
3 | * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * - Derived from arch/i386/kernel/module.c, Copyright (C) 2001 Rusty Russell. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | */ | ||
12 | #include <linux/moduleloader.h> | ||
13 | #include <linux/elf.h> | ||
14 | #include <linux/vmalloc.h> | ||
15 | #include <linux/fs.h> | ||
16 | #include <linux/string.h> | ||
17 | #include <linux/kernel.h> | ||
18 | |||
19 | #if 0 | ||
20 | #define DEBUGP printk | ||
21 | #else | ||
22 | #define DEBUGP(fmt...) | ||
23 | #endif | ||
24 | |||
25 | void *module_alloc(unsigned long size) | ||
26 | { | ||
27 | if (size == 0) | ||
28 | return NULL; | ||
29 | |||
30 | return vmalloc_exec(size); | ||
31 | } | ||
32 | |||
33 | |||
34 | /* Free memory returned from module_alloc */ | ||
35 | void module_free(struct module *mod, void *module_region) | ||
36 | { | ||
37 | vfree(module_region); | ||
38 | /* FIXME: If module_region == mod->init_region, trim exception | ||
39 | table entries. */ | ||
40 | } | ||
41 | |||
42 | /* We don't need anything special. */ | ||
43 | int module_frob_arch_sections(Elf_Ehdr *hdr, | ||
44 | Elf_Shdr *sechdrs, | ||
45 | char *secstrings, | ||
46 | struct module *mod) | ||
47 | { | ||
48 | return 0; | ||
49 | } | ||
50 | |||
51 | int apply_relocate(Elf32_Shdr *sechdrs, | ||
52 | const char *strtab, | ||
53 | unsigned int symindex, | ||
54 | unsigned int relsec, | ||
55 | struct module *me) | ||
56 | { | ||
57 | printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name); | ||
58 | return -ENOEXEC; | ||
59 | } | ||
60 | |||
61 | int apply_relocate_add(Elf32_Shdr *sechdrs, | ||
62 | const char *strtab, | ||
63 | unsigned int symindex, | ||
64 | unsigned int relsec, | ||
65 | struct module *me) | ||
66 | { | ||
67 | printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n", me->name); | ||
68 | return -ENOEXEC; | ||
69 | } | ||
70 | |||
71 | int module_finalize(const Elf_Ehdr *hdr, | ||
72 | const Elf_Shdr *sechdrs, | ||
73 | struct module *me) | ||
74 | { | ||
75 | return 0; | ||
76 | } | ||
77 | |||
78 | void module_arch_cleanup(struct module *mod) | ||
79 | { | ||
80 | } | ||
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c index 712c3c24c954..f0b8fff3e733 100644 --- a/arch/frv/kernel/pm.c +++ b/arch/frv/kernel/pm.c | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/config.h> | 14 | #include <linux/config.h> |
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/module.h> | ||
16 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
17 | #include <linux/pm_legacy.h> | 18 | #include <linux/pm_legacy.h> |
18 | #include <linux/sched.h> | 19 | #include <linux/sched.h> |
@@ -27,6 +28,7 @@ | |||
27 | #include "local.h" | 28 | #include "local.h" |
28 | 29 | ||
29 | void (*pm_power_off)(void); | 30 | void (*pm_power_off)(void); |
31 | EXPORT_SYMBOL(pm_power_off); | ||
30 | 32 | ||
31 | extern void frv_change_cmode(int); | 33 | extern void frv_change_cmode(int); |
32 | 34 | ||
diff --git a/arch/frv/kernel/setup.c b/arch/frv/kernel/setup.c index 767ebb55bd83..5908deae9607 100644 --- a/arch/frv/kernel/setup.c +++ b/arch/frv/kernel/setup.c | |||
@@ -787,6 +787,7 @@ void __init setup_arch(char **cmdline_p) | |||
787 | #endif | 787 | #endif |
788 | 788 | ||
789 | /* register those serial ports that are available */ | 789 | /* register those serial ports that are available */ |
790 | #ifdef CONFIG_FRV_ONCPU_SERIAL | ||
790 | #ifndef CONFIG_GDBSTUB_UART0 | 791 | #ifndef CONFIG_GDBSTUB_UART0 |
791 | __reg(UART0_BASE + UART_IER * 8) = 0; | 792 | __reg(UART0_BASE + UART_IER * 8) = 0; |
792 | early_serial_setup(&__frv_uart0); | 793 | early_serial_setup(&__frv_uart0); |
@@ -795,6 +796,7 @@ void __init setup_arch(char **cmdline_p) | |||
795 | __reg(UART1_BASE + UART_IER * 8) = 0; | 796 | __reg(UART1_BASE + UART_IER * 8) = 0; |
796 | early_serial_setup(&__frv_uart1); | 797 | early_serial_setup(&__frv_uart1); |
797 | #endif | 798 | #endif |
799 | #endif | ||
798 | 800 | ||
799 | #if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH) | 801 | #if defined(CONFIG_CHR_DEV_FLASH) || defined(CONFIG_BLK_DEV_FLASH) |
800 | /* we need to initialize the Flashrom device here since we might | 802 | /* we need to initialize the Flashrom device here since we might |
diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c index 2e9741227b73..24cf85f89e40 100644 --- a/arch/frv/kernel/time.c +++ b/arch/frv/kernel/time.c | |||
@@ -189,6 +189,8 @@ void do_gettimeofday(struct timeval *tv) | |||
189 | tv->tv_usec = usec; | 189 | tv->tv_usec = usec; |
190 | } | 190 | } |
191 | 191 | ||
192 | EXPORT_SYMBOL(do_gettimeofday); | ||
193 | |||
192 | int do_settimeofday(struct timespec *tv) | 194 | int do_settimeofday(struct timespec *tv) |
193 | { | 195 | { |
194 | time_t wtm_sec, sec = tv->tv_sec; | 196 | time_t wtm_sec, sec = tv->tv_sec; |
@@ -218,6 +220,7 @@ int do_settimeofday(struct timespec *tv) | |||
218 | clock_was_set(); | 220 | clock_was_set(); |
219 | return 0; | 221 | return 0; |
220 | } | 222 | } |
223 | |||
221 | EXPORT_SYMBOL(do_settimeofday); | 224 | EXPORT_SYMBOL(do_settimeofday); |
222 | 225 | ||
223 | /* | 226 | /* |
diff --git a/arch/frv/kernel/traps.c b/arch/frv/kernel/traps.c index 89073cae4b5d..9eb84b2e6abc 100644 --- a/arch/frv/kernel/traps.c +++ b/arch/frv/kernel/traps.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
20 | #include <linux/linkage.h> | 20 | #include <linux/linkage.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/module.h> | ||
22 | 23 | ||
23 | #include <asm/setup.h> | 24 | #include <asm/setup.h> |
24 | #include <asm/fpu.h> | 25 | #include <asm/fpu.h> |
@@ -250,6 +251,8 @@ void dump_stack(void) | |||
250 | show_stack(NULL, NULL); | 251 | show_stack(NULL, NULL); |
251 | } | 252 | } |
252 | 253 | ||
254 | EXPORT_SYMBOL(dump_stack); | ||
255 | |||
253 | void show_stack(struct task_struct *task, unsigned long *sp) | 256 | void show_stack(struct task_struct *task, unsigned long *sp) |
254 | { | 257 | { |
255 | } | 258 | } |
diff --git a/arch/frv/kernel/uaccess.c b/arch/frv/kernel/uaccess.c index f3fd58a5bc4a..9b751c0f0e84 100644 --- a/arch/frv/kernel/uaccess.c +++ b/arch/frv/kernel/uaccess.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
13 | #include <linux/module.h> | ||
13 | #include <asm/uaccess.h> | 14 | #include <asm/uaccess.h> |
14 | 15 | ||
15 | /*****************************************************************************/ | 16 | /*****************************************************************************/ |
@@ -58,8 +59,11 @@ long strncpy_from_user(char *dst, const char *src, long count) | |||
58 | memset(p, 0, count); /* clear remainder of buffer [security] */ | 59 | memset(p, 0, count); /* clear remainder of buffer [security] */ |
59 | 60 | ||
60 | return err; | 61 | return err; |
62 | |||
61 | } /* end strncpy_from_user() */ | 63 | } /* end strncpy_from_user() */ |
62 | 64 | ||
65 | EXPORT_SYMBOL(strncpy_from_user); | ||
66 | |||
63 | /*****************************************************************************/ | 67 | /*****************************************************************************/ |
64 | /* | 68 | /* |
65 | * Return the size of a string (including the ending 0) | 69 | * Return the size of a string (including the ending 0) |
@@ -92,4 +96,7 @@ long strnlen_user(const char *src, long count) | |||
92 | } | 96 | } |
93 | 97 | ||
94 | return p - src + 1; /* return length including NUL */ | 98 | return p - src + 1; /* return length including NUL */ |
99 | |||
95 | } /* end strnlen_user() */ | 100 | } /* end strnlen_user() */ |
101 | |||
102 | EXPORT_SYMBOL(strnlen_user); | ||
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S index fceafd2cc202..f474534ba78a 100644 --- a/arch/frv/kernel/vmlinux.lds.S +++ b/arch/frv/kernel/vmlinux.lds.S | |||
@@ -112,6 +112,7 @@ SECTIONS | |||
112 | #endif | 112 | #endif |
113 | ) | 113 | ) |
114 | SCHED_TEXT | 114 | SCHED_TEXT |
115 | LOCK_TEXT | ||
115 | *(.fixup) | 116 | *(.fixup) |
116 | *(.gnu.warning) | 117 | *(.gnu.warning) |
117 | *(.exitcall.exit) | 118 | *(.exitcall.exit) |
diff --git a/arch/frv/lib/Makefile b/arch/frv/lib/Makefile index 19be2626d5e6..08be305c9f44 100644 --- a/arch/frv/lib/Makefile +++ b/arch/frv/lib/Makefile | |||
@@ -3,6 +3,6 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y := \ | 5 | lib-y := \ |
6 | __ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o \ | 6 | __ashldi3.o __lshrdi3.o __muldi3.o __ashrdi3.o __negdi2.o __ucmpdi2.o \ |
7 | checksum.o memcpy.o memset.o atomic-ops.o \ | 7 | checksum.o memcpy.o memset.o atomic-ops.o \ |
8 | outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o | 8 | outsl_ns.o outsl_sw.o insl_ns.o insl_sw.o cache.o |
diff --git a/arch/frv/lib/__ucmpdi2.S b/arch/frv/lib/__ucmpdi2.S new file mode 100644 index 000000000000..d892f16ffaa9 --- /dev/null +++ b/arch/frv/lib/__ucmpdi2.S | |||
@@ -0,0 +1,45 @@ | |||
1 | /* __ucmpdi2.S: 64-bit unsigned compare | ||
2 | * | ||
3 | * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | |||
13 | .text | ||
14 | .p2align 4 | ||
15 | |||
16 | ############################################################################### | ||
17 | # | ||
18 | # int __ucmpdi2(unsigned long long a [GR8:GR9], | ||
19 | # unsigned long long b [GR10:GR11]) | ||
20 | # | ||
21 | # - returns 0, 1, or 2 as a <, =, > b respectively. | ||
22 | # | ||
23 | ############################################################################### | ||
24 | .globl __ucmpdi2 | ||
25 | .type __ucmpdi2,@function | ||
26 | __ucmpdi2: | ||
27 | or.p gr8,gr0,gr4 | ||
28 | subcc gr8,gr10,gr0,icc0 | ||
29 | setlos.p #0,gr8 | ||
30 | bclr icc0,#2 ; a.msw < b.msw | ||
31 | |||
32 | setlos.p #2,gr8 | ||
33 | bhilr icc0,#0 ; a.msw > b.msw | ||
34 | |||
35 | subcc.p gr9,gr11,gr0,icc1 | ||
36 | setlos #0,gr8 | ||
37 | setlos.p #2,gr9 | ||
38 | setlos #1,gr7 | ||
39 | cknc icc1,cc6 | ||
40 | cor.p gr9,gr0,gr8, cc6,#1 | ||
41 | cckls icc1,cc4, cc6,#1 | ||
42 | andcr cc6,cc4,cc4 | ||
43 | cor gr7,gr0,gr8, cc4,#1 | ||
44 | bralr | ||
45 | .size __ucmpdi2, .-__ucmpdi2 | ||
diff --git a/arch/frv/lib/atomic-ops.S b/arch/frv/lib/atomic-ops.S index b03d510a89e4..545cd325ac57 100644 --- a/arch/frv/lib/atomic-ops.S +++ b/arch/frv/lib/atomic-ops.S | |||
@@ -129,48 +129,6 @@ atomic_sub_return: | |||
129 | 129 | ||
130 | ############################################################################### | 130 | ############################################################################### |
131 | # | 131 | # |
132 | # uint8_t __xchg_8(uint8_t i, uint8_t *v) | ||
133 | # | ||
134 | ############################################################################### | ||
135 | .globl __xchg_8 | ||
136 | .type __xchg_8,@function | ||
137 | __xchg_8: | ||
138 | or.p gr8,gr8,gr10 | ||
139 | 0: | ||
140 | orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */ | ||
141 | ckeq icc3,cc7 | ||
142 | ldub.p @(gr9,gr0),gr8 /* LD.P/ORCR must be atomic */ | ||
143 | orcr cc7,cc7,cc3 /* set CC3 to true */ | ||
144 | cstb.p gr10,@(gr9,gr0) ,cc3,#1 | ||
145 | corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */ | ||
146 | beq icc3,#0,0b | ||
147 | bralr | ||
148 | |||
149 | .size __xchg_8, .-__xchg_8 | ||
150 | |||
151 | ############################################################################### | ||
152 | # | ||
153 | # uint16_t __xchg_16(uint16_t i, uint16_t *v) | ||
154 | # | ||
155 | ############################################################################### | ||
156 | .globl __xchg_16 | ||
157 | .type __xchg_16,@function | ||
158 | __xchg_16: | ||
159 | or.p gr8,gr8,gr10 | ||
160 | 0: | ||
161 | orcc gr0,gr0,gr0,icc3 /* set ICC3.Z */ | ||
162 | ckeq icc3,cc7 | ||
163 | lduh.p @(gr9,gr0),gr8 /* LD.P/ORCR must be atomic */ | ||
164 | orcr cc7,cc7,cc3 /* set CC3 to true */ | ||
165 | csth.p gr10,@(gr9,gr0) ,cc3,#1 | ||
166 | corcc gr29,gr29,gr0 ,cc3,#1 /* clear ICC3.Z if store happens */ | ||
167 | beq icc3,#0,0b | ||
168 | bralr | ||
169 | |||
170 | .size __xchg_16, .-__xchg_16 | ||
171 | |||
172 | ############################################################################### | ||
173 | # | ||
174 | # uint32_t __xchg_32(uint32_t i, uint32_t *v) | 132 | # uint32_t __xchg_32(uint32_t i, uint32_t *v) |
175 | # | 133 | # |
176 | ############################################################################### | 134 | ############################################################################### |
@@ -192,56 +150,6 @@ __xchg_32: | |||
192 | 150 | ||
193 | ############################################################################### | 151 | ############################################################################### |
194 | # | 152 | # |
195 | # uint8_t __cmpxchg_8(uint8_t *v, uint8_t test, uint8_t new) | ||
196 | # | ||
197 | ############################################################################### | ||
198 | .globl __cmpxchg_8 | ||
199 | .type __cmpxchg_8,@function | ||
200 | __cmpxchg_8: | ||
201 | or.p gr8,gr8,gr11 | ||
202 | 0: | ||
203 | orcc gr0,gr0,gr0,icc3 | ||
204 | ckeq icc3,cc7 | ||
205 | ldub.p @(gr11,gr0),gr8 | ||
206 | orcr cc7,cc7,cc3 | ||
207 | sub gr8,gr9,gr7 | ||
208 | sllicc gr7,#24,gr0,icc0 | ||
209 | bne icc0,#0,1f | ||
210 | cstb.p gr10,@(gr11,gr0) ,cc3,#1 | ||
211 | corcc gr29,gr29,gr0 ,cc3,#1 | ||
212 | beq icc3,#0,0b | ||
213 | 1: | ||
214 | bralr | ||
215 | |||
216 | .size __cmpxchg_8, .-__cmpxchg_8 | ||
217 | |||
218 | ############################################################################### | ||
219 | # | ||
220 | # uint16_t __cmpxchg_16(uint16_t *v, uint16_t test, uint16_t new) | ||
221 | # | ||
222 | ############################################################################### | ||
223 | .globl __cmpxchg_16 | ||
224 | .type __cmpxchg_16,@function | ||
225 | __cmpxchg_16: | ||
226 | or.p gr8,gr8,gr11 | ||
227 | 0: | ||
228 | orcc gr0,gr0,gr0,icc3 | ||
229 | ckeq icc3,cc7 | ||
230 | lduh.p @(gr11,gr0),gr8 | ||
231 | orcr cc7,cc7,cc3 | ||
232 | sub gr8,gr9,gr7 | ||
233 | sllicc gr7,#16,gr0,icc0 | ||
234 | bne icc0,#0,1f | ||
235 | csth.p gr10,@(gr11,gr0) ,cc3,#1 | ||
236 | corcc gr29,gr29,gr0 ,cc3,#1 | ||
237 | beq icc3,#0,0b | ||
238 | 1: | ||
239 | bralr | ||
240 | |||
241 | .size __cmpxchg_16, .-__cmpxchg_16 | ||
242 | |||
243 | ############################################################################### | ||
244 | # | ||
245 | # uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new) | 153 | # uint32_t __cmpxchg_32(uint32_t *v, uint32_t test, uint32_t new) |
246 | # | 154 | # |
247 | ############################################################################### | 155 | ############################################################################### |
diff --git a/arch/frv/lib/checksum.c b/arch/frv/lib/checksum.c index 7bf5bd6cac8a..20e7dfc474ef 100644 --- a/arch/frv/lib/checksum.c +++ b/arch/frv/lib/checksum.c | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include <net/checksum.h> | 34 | #include <net/checksum.h> |
35 | #include <asm/checksum.h> | 35 | #include <asm/checksum.h> |
36 | #include <linux/module.h> | ||
36 | 37 | ||
37 | static inline unsigned short from32to16(unsigned long x) | 38 | static inline unsigned short from32to16(unsigned long x) |
38 | { | 39 | { |
@@ -115,34 +116,52 @@ unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum) | |||
115 | return result; | 116 | return result; |
116 | } | 117 | } |
117 | 118 | ||
119 | EXPORT_SYMBOL(csum_partial); | ||
120 | |||
118 | /* | 121 | /* |
119 | * this routine is used for miscellaneous IP-like checksums, mainly | 122 | * this routine is used for miscellaneous IP-like checksums, mainly |
120 | * in icmp.c | 123 | * in icmp.c |
121 | */ | 124 | */ |
122 | unsigned short ip_compute_csum(const unsigned char * buff, int len) | 125 | unsigned short ip_compute_csum(const unsigned char * buff, int len) |
123 | { | 126 | { |
124 | return ~do_csum(buff,len); | 127 | return ~do_csum(buff, len); |
125 | } | 128 | } |
126 | 129 | ||
130 | EXPORT_SYMBOL(ip_compute_csum); | ||
131 | |||
127 | /* | 132 | /* |
128 | * copy from fs while checksumming, otherwise like csum_partial | 133 | * copy from fs while checksumming, otherwise like csum_partial |
129 | */ | 134 | */ |
130 | |||
131 | unsigned int | 135 | unsigned int |
132 | csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *csum_err) | 136 | csum_partial_copy_from_user(const char __user *src, char *dst, |
137 | int len, int sum, int *csum_err) | ||
133 | { | 138 | { |
134 | if (csum_err) *csum_err = 0; | 139 | int rem; |
135 | memcpy(dst, src, len); | 140 | |
141 | if (csum_err) | ||
142 | *csum_err = 0; | ||
143 | |||
144 | rem = copy_from_user(dst, src, len); | ||
145 | if (rem != 0) { | ||
146 | if (csum_err) | ||
147 | *csum_err = -EFAULT; | ||
148 | memset(dst + len - rem, 0, rem); | ||
149 | len = rem; | ||
150 | } | ||
151 | |||
136 | return csum_partial(dst, len, sum); | 152 | return csum_partial(dst, len, sum); |
137 | } | 153 | } |
138 | 154 | ||
155 | EXPORT_SYMBOL(csum_partial_copy_from_user); | ||
156 | |||
139 | /* | 157 | /* |
140 | * copy from ds while checksumming, otherwise like csum_partial | 158 | * copy from ds while checksumming, otherwise like csum_partial |
141 | */ | 159 | */ |
142 | |||
143 | unsigned int | 160 | unsigned int |
144 | csum_partial_copy(const char *src, char *dst, int len, int sum) | 161 | csum_partial_copy(const char *src, char *dst, int len, int sum) |
145 | { | 162 | { |
146 | memcpy(dst, src, len); | 163 | memcpy(dst, src, len); |
147 | return csum_partial(dst, len, sum); | 164 | return csum_partial(dst, len, sum); |
148 | } | 165 | } |
166 | |||
167 | EXPORT_SYMBOL(csum_partial_copy); | ||
diff --git a/arch/frv/mb93090-mb00/Makefile b/arch/frv/mb93090-mb00/Makefile index 3faf0f8cf9b5..76595e870733 100644 --- a/arch/frv/mb93090-mb00/Makefile +++ b/arch/frv/mb93090-mb00/Makefile | |||
@@ -3,7 +3,7 @@ | |||
3 | # | 3 | # |
4 | 4 | ||
5 | ifeq "$(CONFIG_PCI)" "y" | 5 | ifeq "$(CONFIG_PCI)" "y" |
6 | obj-y := pci-frv.o pci-irq.o pci-vdk.o | 6 | obj-y := pci-frv.o pci-irq.o pci-vdk.o pci-iomap.o |
7 | 7 | ||
8 | ifeq "$(CONFIG_MMU)" "y" | 8 | ifeq "$(CONFIG_MMU)" "y" |
9 | obj-y += pci-dma.o | 9 | obj-y += pci-dma.o |
diff --git a/arch/frv/mb93090-mb00/pci-dma-nommu.c b/arch/frv/mb93090-mb00/pci-dma-nommu.c index 2082a9647f4f..4985466b1a7c 100644 --- a/arch/frv/mb93090-mb00/pci-dma-nommu.c +++ b/arch/frv/mb93090-mb00/pci-dma-nommu.c | |||
@@ -83,6 +83,8 @@ void *dma_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_hand | |||
83 | return NULL; | 83 | return NULL; |
84 | } | 84 | } |
85 | 85 | ||
86 | EXPORT_SYMBOL(dma_alloc_coherent); | ||
87 | |||
86 | void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) | 88 | void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) |
87 | { | 89 | { |
88 | struct dma_alloc_record *rec; | 90 | struct dma_alloc_record *rec; |
@@ -102,6 +104,8 @@ void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_ | |||
102 | BUG(); | 104 | BUG(); |
103 | } | 105 | } |
104 | 106 | ||
107 | EXPORT_SYMBOL(dma_free_coherent); | ||
108 | |||
105 | /* | 109 | /* |
106 | * Map a single buffer of the indicated size for DMA in streaming mode. | 110 | * Map a single buffer of the indicated size for DMA in streaming mode. |
107 | * The 32-bit bus address to use is returned. | 111 | * The 32-bit bus address to use is returned. |
@@ -120,6 +124,8 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, | |||
120 | return virt_to_bus(ptr); | 124 | return virt_to_bus(ptr); |
121 | } | 125 | } |
122 | 126 | ||
127 | EXPORT_SYMBOL(dma_map_single); | ||
128 | |||
123 | /* | 129 | /* |
124 | * Map a set of buffers described by scatterlist in streaming | 130 | * Map a set of buffers described by scatterlist in streaming |
125 | * mode for DMA. This is the scather-gather version of the | 131 | * mode for DMA. This is the scather-gather version of the |
@@ -150,3 +156,5 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
150 | 156 | ||
151 | return nents; | 157 | return nents; |
152 | } | 158 | } |
159 | |||
160 | EXPORT_SYMBOL(dma_map_sg); | ||
diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c index 86fbdadc51b6..671ce1e8434f 100644 --- a/arch/frv/mb93090-mb00/pci-dma.c +++ b/arch/frv/mb93090-mb00/pci-dma.c | |||
@@ -28,11 +28,15 @@ void *dma_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_hand | |||
28 | return ret; | 28 | return ret; |
29 | } | 29 | } |
30 | 30 | ||
31 | EXPORT_SYMBOL(dma_alloc_coherent); | ||
32 | |||
31 | void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) | 33 | void dma_free_coherent(struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) |
32 | { | 34 | { |
33 | consistent_free(vaddr); | 35 | consistent_free(vaddr); |
34 | } | 36 | } |
35 | 37 | ||
38 | EXPORT_SYMBOL(dma_free_coherent); | ||
39 | |||
36 | /* | 40 | /* |
37 | * Map a single buffer of the indicated size for DMA in streaming mode. | 41 | * Map a single buffer of the indicated size for DMA in streaming mode. |
38 | * The 32-bit bus address to use is returned. | 42 | * The 32-bit bus address to use is returned. |
@@ -51,6 +55,8 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, | |||
51 | return virt_to_bus(ptr); | 55 | return virt_to_bus(ptr); |
52 | } | 56 | } |
53 | 57 | ||
58 | EXPORT_SYMBOL(dma_map_single); | ||
59 | |||
54 | /* | 60 | /* |
55 | * Map a set of buffers described by scatterlist in streaming | 61 | * Map a set of buffers described by scatterlist in streaming |
56 | * mode for DMA. This is the scather-gather version of the | 62 | * mode for DMA. This is the scather-gather version of the |
@@ -96,6 +102,8 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | |||
96 | return nents; | 102 | return nents; |
97 | } | 103 | } |
98 | 104 | ||
105 | EXPORT_SYMBOL(dma_map_sg); | ||
106 | |||
99 | dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, | 107 | dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long offset, |
100 | size_t size, enum dma_data_direction direction) | 108 | size_t size, enum dma_data_direction direction) |
101 | { | 109 | { |
@@ -103,3 +111,5 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page, unsigned long off | |||
103 | flush_dcache_page(page); | 111 | flush_dcache_page(page); |
104 | return (dma_addr_t) page_to_phys(page) + offset; | 112 | return (dma_addr_t) page_to_phys(page) + offset; |
105 | } | 113 | } |
114 | |||
115 | EXPORT_SYMBOL(dma_map_page); | ||
diff --git a/arch/frv/mb93090-mb00/pci-iomap.c b/arch/frv/mb93090-mb00/pci-iomap.c new file mode 100644 index 000000000000..068fa04bd527 --- /dev/null +++ b/arch/frv/mb93090-mb00/pci-iomap.c | |||
@@ -0,0 +1,29 @@ | |||
1 | /* pci-iomap.c: description | ||
2 | * | ||
3 | * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | #include <linux/pci.h> | ||
12 | #include <linux/module.h> | ||
13 | |||
14 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
15 | { | ||
16 | unsigned long start = pci_resource_start(dev, bar); | ||
17 | unsigned long len = pci_resource_len(dev, bar); | ||
18 | unsigned long flags = pci_resource_flags(dev, bar); | ||
19 | |||
20 | if (!len || !start) | ||
21 | return NULL; | ||
22 | |||
23 | if ((flags & IORESOURCE_IO) || (flags & IORESOURCE_MEM)) | ||
24 | return (void __iomem *) start; | ||
25 | |||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | EXPORT_SYMBOL(pci_iomap); | ||
diff --git a/arch/frv/mm/cache-page.c b/arch/frv/mm/cache-page.c index 683b5e344318..0261cbe153b5 100644 --- a/arch/frv/mm/cache-page.c +++ b/arch/frv/mm/cache-page.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/mm.h> | 12 | #include <linux/mm.h> |
13 | #include <linux/highmem.h> | 13 | #include <linux/highmem.h> |
14 | #include <linux/module.h> | ||
14 | #include <asm/pgalloc.h> | 15 | #include <asm/pgalloc.h> |
15 | 16 | ||
16 | /*****************************************************************************/ | 17 | /*****************************************************************************/ |
@@ -38,6 +39,8 @@ void flush_dcache_page(struct page *page) | |||
38 | 39 | ||
39 | } /* end flush_dcache_page() */ | 40 | } /* end flush_dcache_page() */ |
40 | 41 | ||
42 | EXPORT_SYMBOL(flush_dcache_page); | ||
43 | |||
41 | /*****************************************************************************/ | 44 | /*****************************************************************************/ |
42 | /* | 45 | /* |
43 | * ICI takes a virtual address and the page may not currently have one | 46 | * ICI takes a virtual address and the page may not currently have one |
@@ -64,3 +67,5 @@ void flush_icache_user_range(struct vm_area_struct *vma, struct page *page, | |||
64 | } | 67 | } |
65 | 68 | ||
66 | } /* end flush_icache_user_range() */ | 69 | } /* end flush_icache_user_range() */ |
70 | |||
71 | EXPORT_SYMBOL(flush_icache_user_range); | ||
diff --git a/arch/frv/mm/extable.c b/arch/frv/mm/extable.c index 41be1128dc64..caacf030ac75 100644 --- a/arch/frv/mm/extable.c +++ b/arch/frv/mm/extable.c | |||
@@ -43,7 +43,7 @@ static inline unsigned long search_one_table(const struct exception_table_entry | |||
43 | */ | 43 | */ |
44 | unsigned long search_exception_table(unsigned long pc) | 44 | unsigned long search_exception_table(unsigned long pc) |
45 | { | 45 | { |
46 | unsigned long ret = 0; | 46 | const struct exception_table_entry *extab; |
47 | 47 | ||
48 | /* determine if the fault lay during a memcpy_user or a memset_user */ | 48 | /* determine if the fault lay during a memcpy_user or a memset_user */ |
49 | if (__frame->lr == (unsigned long) &__memset_user_error_lr && | 49 | if (__frame->lr == (unsigned long) &__memset_user_error_lr && |
@@ -55,9 +55,10 @@ unsigned long search_exception_table(unsigned long pc) | |||
55 | */ | 55 | */ |
56 | return (unsigned long) &__memset_user_error_handler; | 56 | return (unsigned long) &__memset_user_error_handler; |
57 | } | 57 | } |
58 | else if (__frame->lr == (unsigned long) &__memcpy_user_error_lr && | 58 | |
59 | (unsigned long) &memcpy <= pc && pc < (unsigned long) &__memcpy_end | 59 | if (__frame->lr == (unsigned long) &__memcpy_user_error_lr && |
60 | ) { | 60 | (unsigned long) &memcpy <= pc && pc < (unsigned long) &__memcpy_end |
61 | ) { | ||
61 | /* the fault occurred in a protected memset | 62 | /* the fault occurred in a protected memset |
62 | * - we search for the return address (in LR) instead of the program counter | 63 | * - we search for the return address (in LR) instead of the program counter |
63 | * - it was probably during a copy_to/from_user() | 64 | * - it was probably during a copy_to/from_user() |
@@ -65,27 +66,10 @@ unsigned long search_exception_table(unsigned long pc) | |||
65 | return (unsigned long) &__memcpy_user_error_handler; | 66 | return (unsigned long) &__memcpy_user_error_handler; |
66 | } | 67 | } |
67 | 68 | ||
68 | #ifndef CONFIG_MODULES | 69 | extab = search_exception_tables(pc); |
69 | /* there is only the kernel to search. */ | 70 | if (extab) |
70 | ret = search_one_table(__start___ex_table, __stop___ex_table - 1, pc); | 71 | return extab->fixup; |
71 | return ret; | ||
72 | |||
73 | #else | ||
74 | /* the kernel is the last "module" -- no need to treat it special */ | ||
75 | unsigned long flags; | ||
76 | struct module *mp; | ||
77 | 72 | ||
78 | spin_lock_irqsave(&modlist_lock, flags); | 73 | return 0; |
79 | |||
80 | for (mp = module_list; mp != NULL; mp = mp->next) { | ||
81 | if (mp->ex_table_start == NULL || !(mp->flags & (MOD_RUNNING | MOD_INITIALIZING))) | ||
82 | continue; | ||
83 | ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, pc); | ||
84 | if (ret) | ||
85 | break; | ||
86 | } | ||
87 | 74 | ||
88 | spin_unlock_irqrestore(&modlist_lock, flags); | ||
89 | return ret; | ||
90 | #endif | ||
91 | } /* end search_exception_table() */ | 75 | } /* end search_exception_table() */ |
diff --git a/arch/frv/mm/highmem.c b/arch/frv/mm/highmem.c index 7dc8fbf3af97..7f77db7fabc7 100644 --- a/arch/frv/mm/highmem.c +++ b/arch/frv/mm/highmem.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | #include <linux/highmem.h> | 11 | #include <linux/highmem.h> |
12 | #include <linux/module.h> | ||
12 | 13 | ||
13 | void *kmap(struct page *page) | 14 | void *kmap(struct page *page) |
14 | { | 15 | { |
@@ -18,6 +19,8 @@ void *kmap(struct page *page) | |||
18 | return kmap_high(page); | 19 | return kmap_high(page); |
19 | } | 20 | } |
20 | 21 | ||
22 | EXPORT_SYMBOL(kmap); | ||
23 | |||
21 | void kunmap(struct page *page) | 24 | void kunmap(struct page *page) |
22 | { | 25 | { |
23 | if (in_interrupt()) | 26 | if (in_interrupt()) |
@@ -27,7 +30,12 @@ void kunmap(struct page *page) | |||
27 | kunmap_high(page); | 30 | kunmap_high(page); |
28 | } | 31 | } |
29 | 32 | ||
33 | EXPORT_SYMBOL(kunmap); | ||
34 | |||
30 | struct page *kmap_atomic_to_page(void *ptr) | 35 | struct page *kmap_atomic_to_page(void *ptr) |
31 | { | 36 | { |
32 | return virt_to_page(ptr); | 37 | return virt_to_page(ptr); |
33 | } | 38 | } |
39 | |||
40 | |||
41 | EXPORT_SYMBOL(kmap_atomic_to_page); | ||
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 26698a49f153..80940d712acf 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig | |||
@@ -21,10 +21,6 @@ config FPU | |||
21 | bool | 21 | bool |
22 | default n | 22 | default n |
23 | 23 | ||
24 | config UID16 | ||
25 | bool | ||
26 | default y | ||
27 | |||
28 | config RWSEM_GENERIC_SPINLOCK | 24 | config RWSEM_GENERIC_SPINLOCK |
29 | bool | 25 | bool |
30 | default y | 26 | default y |
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 968fabd8723f..d849c6870e3a 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -29,10 +29,6 @@ config MMU | |||
29 | config SBUS | 29 | config SBUS |
30 | bool | 30 | bool |
31 | 31 | ||
32 | config UID16 | ||
33 | bool | ||
34 | default y | ||
35 | |||
36 | config GENERIC_ISA_DMA | 32 | config GENERIC_ISA_DMA |
37 | bool | 33 | bool |
38 | default y | 34 | default y |
@@ -630,10 +626,6 @@ config REGPARM | |||
630 | and passes the first three arguments of a function call in registers. | 626 | and passes the first three arguments of a function call in registers. |
631 | This will probably break binary only modules. | 627 | This will probably break binary only modules. |
632 | 628 | ||
633 | This feature is only enabled for gcc-3.0 and later - earlier compilers | ||
634 | generate incorrect output with certain kernel constructs when | ||
635 | -mregparm=3 is used. | ||
636 | |||
637 | config SECCOMP | 629 | config SECCOMP |
638 | bool "Enable seccomp to safely compute untrusted bytecode" | 630 | bool "Enable seccomp to safely compute untrusted bytecode" |
639 | depends on PROC_FS | 631 | depends on PROC_FS |
@@ -703,7 +695,7 @@ depends on PM && !X86_VISWS | |||
703 | 695 | ||
704 | config APM | 696 | config APM |
705 | tristate "APM (Advanced Power Management) BIOS support" | 697 | tristate "APM (Advanced Power Management) BIOS support" |
706 | depends on PM && PM_LEGACY | 698 | depends on PM |
707 | ---help--- | 699 | ---help--- |
708 | APM is a BIOS specification for saving power using several different | 700 | APM is a BIOS specification for saving power using several different |
709 | techniques. This is mostly useful for battery powered laptops with | 701 | techniques. This is mostly useful for battery powered laptops with |
diff --git a/arch/i386/Makefile b/arch/i386/Makefile index d121ea18460f..b84119f9cc63 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile | |||
@@ -37,10 +37,7 @@ CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) | |||
37 | # CPU-specific tuning. Anything which can be shared with UML should go here. | 37 | # CPU-specific tuning. Anything which can be shared with UML should go here. |
38 | include $(srctree)/arch/i386/Makefile.cpu | 38 | include $(srctree)/arch/i386/Makefile.cpu |
39 | 39 | ||
40 | # -mregparm=3 works ok on gcc-3.0 and later | 40 | cflags-$(CONFIG_REGPARM) += -mregparm=3 |
41 | # | ||
42 | GCC_VERSION := $(call cc-version) | ||
43 | cflags-$(CONFIG_REGPARM) += $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;) | ||
44 | 41 | ||
45 | # Disable unit-at-a-time mode, it makes gcc use a lot more stack | 42 | # Disable unit-at-a-time mode, it makes gcc use a lot more stack |
46 | # due to the lack of sharing of stacklots. | 43 | # due to the lack of sharing of stacklots. |
diff --git a/arch/i386/Makefile.cpu b/arch/i386/Makefile.cpu index 8e51456df23d..dcd936ef45db 100644 --- a/arch/i386/Makefile.cpu +++ b/arch/i386/Makefile.cpu | |||
@@ -1,7 +1,7 @@ | |||
1 | # CPU tuning section - shared with UML. | 1 | # CPU tuning section - shared with UML. |
2 | # Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML. | 2 | # Must change only cflags-y (or [yn]), not CFLAGS! That makes a difference for UML. |
3 | 3 | ||
4 | #-mtune exists since gcc 3.4, and some -mcpu flavors didn't exist in gcc 2.95. | 4 | #-mtune exists since gcc 3.4 |
5 | HAS_MTUNE := $(call cc-option-yn, -mtune=i386) | 5 | HAS_MTUNE := $(call cc-option-yn, -mtune=i386) |
6 | ifeq ($(HAS_MTUNE),y) | 6 | ifeq ($(HAS_MTUNE),y) |
7 | tune = $(call cc-option,-mtune=$(1),) | 7 | tune = $(call cc-option,-mtune=$(1),) |
@@ -14,7 +14,7 @@ cflags-$(CONFIG_M386) += -march=i386 | |||
14 | cflags-$(CONFIG_M486) += -march=i486 | 14 | cflags-$(CONFIG_M486) += -march=i486 |
15 | cflags-$(CONFIG_M586) += -march=i586 | 15 | cflags-$(CONFIG_M586) += -march=i586 |
16 | cflags-$(CONFIG_M586TSC) += -march=i586 | 16 | cflags-$(CONFIG_M586TSC) += -march=i586 |
17 | cflags-$(CONFIG_M586MMX) += $(call cc-option,-march=pentium-mmx,-march=i586) | 17 | cflags-$(CONFIG_M586MMX) += -march=pentium-mmx |
18 | cflags-$(CONFIG_M686) += -march=i686 | 18 | cflags-$(CONFIG_M686) += -march=i686 |
19 | cflags-$(CONFIG_MPENTIUMII) += -march=i686 $(call tune,pentium2) | 19 | cflags-$(CONFIG_MPENTIUMII) += -march=i686 $(call tune,pentium2) |
20 | cflags-$(CONFIG_MPENTIUMIII) += -march=i686 $(call tune,pentium3) | 20 | cflags-$(CONFIG_MPENTIUMIII) += -march=i686 $(call tune,pentium3) |
@@ -23,8 +23,8 @@ cflags-$(CONFIG_MPENTIUM4) += -march=i686 $(call tune,pentium4) | |||
23 | cflags-$(CONFIG_MK6) += -march=k6 | 23 | cflags-$(CONFIG_MK6) += -march=k6 |
24 | # Please note, that patches that add -march=athlon-xp and friends are pointless. | 24 | # Please note, that patches that add -march=athlon-xp and friends are pointless. |
25 | # They make zero difference whatsosever to performance at this time. | 25 | # They make zero difference whatsosever to performance at this time. |
26 | cflags-$(CONFIG_MK7) += $(call cc-option,-march=athlon,-march=i686 $(align)-functions=4) | 26 | cflags-$(CONFIG_MK7) += -march=athlon |
27 | cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,$(call cc-option,-march=athlon,-march=i686 $(align)-functions=4)) | 27 | cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,-march=athlon) |
28 | cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 | 28 | cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 |
29 | cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 | 29 | cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call tune,pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0 |
30 | cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) | 30 | cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586) |
@@ -37,5 +37,5 @@ cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686) | |||
37 | cflags-$(CONFIG_X86_ELAN) += -march=i486 | 37 | cflags-$(CONFIG_X86_ELAN) += -march=i486 |
38 | 38 | ||
39 | # Geode GX1 support | 39 | # Geode GX1 support |
40 | cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486) | 40 | cflags-$(CONFIG_MGEODEGX1) += -march=pentium-mmx |
41 | 41 | ||
diff --git a/arch/i386/boot/compressed/misc.c b/arch/i386/boot/compressed/misc.c index 82a807f9f5e6..f19f3a7492a5 100644 --- a/arch/i386/boot/compressed/misc.c +++ b/arch/i386/boot/compressed/misc.c | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/linkage.h> | 12 | #include <linux/linkage.h> |
13 | #include <linux/vmalloc.h> | 13 | #include <linux/vmalloc.h> |
14 | #include <linux/tty.h> | 14 | #include <linux/screen_info.h> |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | 17 | ||
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile index f10de0f2c5e6..be1880bb75b4 100644 --- a/arch/i386/kernel/Makefile +++ b/arch/i386/kernel/Makefile | |||
@@ -4,10 +4,10 @@ | |||
4 | 4 | ||
5 | extra-y := head.o init_task.o vmlinux.lds | 5 | extra-y := head.o init_task.o vmlinux.lds |
6 | 6 | ||
7 | obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ | 7 | obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ |
8 | ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ | 8 | ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ |
9 | pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ | 9 | pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ |
10 | doublefault.o quirks.o i8237.o | 10 | quirks.o i8237.o |
11 | 11 | ||
12 | obj-y += cpu/ | 12 | obj-y += cpu/ |
13 | obj-y += timers/ | 13 | obj-y += timers/ |
@@ -33,6 +33,8 @@ obj-y += sysenter.o vsyscall.o | |||
33 | obj-$(CONFIG_ACPI_SRAT) += srat.o | 33 | obj-$(CONFIG_ACPI_SRAT) += srat.o |
34 | obj-$(CONFIG_HPET_TIMER) += time_hpet.o | 34 | obj-$(CONFIG_HPET_TIMER) += time_hpet.o |
35 | obj-$(CONFIG_EFI) += efi.o efi_stub.o | 35 | obj-$(CONFIG_EFI) += efi.o efi_stub.o |
36 | obj-$(CONFIG_DOUBLEFAULT) += doublefault.o | ||
37 | obj-$(CONFIG_VM86) += vm86.o | ||
36 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o | 38 | obj-$(CONFIG_EARLY_PRINTK) += early_printk.o |
37 | 39 | ||
38 | EXTRA_AFLAGS := -traditional | 40 | EXTRA_AFLAGS := -traditional |
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index 2d793d4aef1a..9d8827156e54 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -2291,7 +2291,9 @@ static int __init apm_init(void) | |||
2291 | apm_info.disabled = 1; | 2291 | apm_info.disabled = 1; |
2292 | return -ENODEV; | 2292 | return -ENODEV; |
2293 | } | 2293 | } |
2294 | #ifdef CONFIG_PM_LEGACY | ||
2294 | pm_active = 1; | 2295 | pm_active = 1; |
2296 | #endif | ||
2295 | 2297 | ||
2296 | /* | 2298 | /* |
2297 | * Set up a segment that references the real mode segment 0x40 | 2299 | * Set up a segment that references the real mode segment 0x40 |
@@ -2382,7 +2384,9 @@ static void __exit apm_exit(void) | |||
2382 | exit_kapmd = 1; | 2384 | exit_kapmd = 1; |
2383 | while (kapmd_running) | 2385 | while (kapmd_running) |
2384 | schedule(); | 2386 | schedule(); |
2387 | #ifdef CONFIG_PM_LEGACY | ||
2385 | pm_active = 0; | 2388 | pm_active = 0; |
2389 | #endif | ||
2386 | } | 2390 | } |
2387 | 2391 | ||
2388 | module_init(apm_init); | 2392 | module_init(apm_init); |
diff --git a/arch/i386/kernel/cpu/common.c b/arch/i386/kernel/cpu/common.c index cca655688ffc..170400879f44 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/i386/kernel/cpu/common.c | |||
@@ -609,8 +609,10 @@ void __devinit cpu_init(void) | |||
609 | load_TR_desc(); | 609 | load_TR_desc(); |
610 | load_LDT(&init_mm.context); | 610 | load_LDT(&init_mm.context); |
611 | 611 | ||
612 | #ifdef CONFIG_DOUBLEFAULT | ||
612 | /* Set up doublefault TSS pointer in the GDT */ | 613 | /* Set up doublefault TSS pointer in the GDT */ |
613 | __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); | 614 | __set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss); |
615 | #endif | ||
614 | 616 | ||
615 | /* Clear %fs and %gs. */ | 617 | /* Clear %fs and %gs. */ |
616 | asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs"); | 618 | asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs"); |
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index 607c06007508..4d704724b2f5 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S | |||
@@ -323,6 +323,7 @@ work_notifysig: # deal with pending signals and | |||
323 | 323 | ||
324 | ALIGN | 324 | ALIGN |
325 | work_notifysig_v86: | 325 | work_notifysig_v86: |
326 | #ifdef CONFIG_VM86 | ||
326 | pushl %ecx # save ti_flags for do_notify_resume | 327 | pushl %ecx # save ti_flags for do_notify_resume |
327 | call save_v86_state # %eax contains pt_regs pointer | 328 | call save_v86_state # %eax contains pt_regs pointer |
328 | popl %ecx | 329 | popl %ecx |
@@ -330,6 +331,7 @@ work_notifysig_v86: | |||
330 | xorl %edx, %edx | 331 | xorl %edx, %edx |
331 | call do_notify_resume | 332 | call do_notify_resume |
332 | jmp resume_userspace | 333 | jmp resume_userspace |
334 | #endif | ||
333 | 335 | ||
334 | # perform syscall exit tracing | 336 | # perform syscall exit tracing |
335 | ALIGN | 337 | ALIGN |
diff --git a/arch/i386/kernel/init_task.c b/arch/i386/kernel/init_task.c index 9caa8e8db80c..cff95d10a4d8 100644 --- a/arch/i386/kernel/init_task.c +++ b/arch/i386/kernel/init_task.c | |||
@@ -42,5 +42,5 @@ EXPORT_SYMBOL(init_task); | |||
42 | * per-CPU TSS segments. Threads are completely 'soft' on Linux, | 42 | * per-CPU TSS segments. Threads are completely 'soft' on Linux, |
43 | * no more per-task TSS's. | 43 | * no more per-task TSS's. |
44 | */ | 44 | */ |
45 | DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_maxaligned_in_smp = INIT_TSS; | 45 | DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_internodealigned_in_smp = INIT_TSS; |
46 | 46 | ||
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index 1a201a932865..f3a9c78c4a24 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <linux/cpu.h> | 19 | #include <linux/cpu.h> |
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | 21 | ||
22 | DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_maxaligned_in_smp; | 22 | DEFINE_PER_CPU(irq_cpustat_t, irq_stat) ____cacheline_internodealigned_in_smp; |
23 | EXPORT_PER_CPU_SYMBOL(irq_stat); | 23 | EXPORT_PER_CPU_SYMBOL(irq_stat); |
24 | 24 | ||
25 | #ifndef CONFIG_X86_LOCAL_APIC | 25 | #ifndef CONFIG_X86_LOCAL_APIC |
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 45e7f0ac4b04..035928f3f6c1 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <asm/processor.h> | 48 | #include <asm/processor.h> |
49 | #include <asm/i387.h> | 49 | #include <asm/i387.h> |
50 | #include <asm/desc.h> | 50 | #include <asm/desc.h> |
51 | #include <asm/vm86.h> | ||
51 | #ifdef CONFIG_MATH_EMULATION | 52 | #ifdef CONFIG_MATH_EMULATION |
52 | #include <asm/math_emu.h> | 53 | #include <asm/math_emu.h> |
53 | #endif | 54 | #endif |
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S index f7ba4acc20ec..6ff3e5243226 100644 --- a/arch/i386/kernel/syscall_table.S +++ b/arch/i386/kernel/syscall_table.S | |||
@@ -293,3 +293,4 @@ ENTRY(sys_call_table) | |||
293 | .long sys_inotify_init | 293 | .long sys_inotify_init |
294 | .long sys_inotify_add_watch | 294 | .long sys_inotify_add_watch |
295 | .long sys_inotify_rm_watch | 295 | .long sys_inotify_rm_watch |
296 | .long sys_migrate_pages | ||
diff --git a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c index 9caeaa315cd7..a529f0cdce17 100644 --- a/arch/i386/kernel/time_hpet.c +++ b/arch/i386/kernel/time_hpet.c | |||
@@ -259,8 +259,6 @@ __setup("hpet=", hpet_setup); | |||
259 | #include <linux/mc146818rtc.h> | 259 | #include <linux/mc146818rtc.h> |
260 | #include <linux/rtc.h> | 260 | #include <linux/rtc.h> |
261 | 261 | ||
262 | extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs); | ||
263 | |||
264 | #define DEFAULT_RTC_INT_FREQ 64 | 262 | #define DEFAULT_RTC_INT_FREQ 64 |
265 | #define RTC_NUM_INTS 1 | 263 | #define RTC_NUM_INTS 1 |
266 | 264 | ||
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index 67932ad53082..57b047c27e46 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile | |||
@@ -37,10 +37,6 @@ $(error Sorry, you need a newer version of the assember, one that is built from | |||
37 | ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz) | 37 | ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz) |
38 | endif | 38 | endif |
39 | 39 | ||
40 | ifneq ($(shell if [ $(GCC_VERSION) -lt 0300 ] ; then echo "bad"; fi ;),) | ||
41 | $(error Sorry, your compiler is too old. GCC v2.96 is known to generate bad code.) | ||
42 | endif | ||
43 | |||
44 | ifeq ($(GCC_VERSION),0304) | 40 | ifeq ($(GCC_VERSION),0304) |
45 | cflags-$(CONFIG_ITANIUM) += -mtune=merced | 41 | cflags-$(CONFIG_ITANIUM) += -mtune=merced |
46 | cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley | 42 | cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley |
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c index dc282710421a..9f8e8d558873 100644 --- a/arch/ia64/ia32/sys_ia32.c +++ b/arch/ia64/ia32/sys_ia32.c | |||
@@ -1761,21 +1761,15 @@ sys32_ptrace (int request, pid_t pid, unsigned int addr, unsigned int data) | |||
1761 | 1761 | ||
1762 | lock_kernel(); | 1762 | lock_kernel(); |
1763 | if (request == PTRACE_TRACEME) { | 1763 | if (request == PTRACE_TRACEME) { |
1764 | ret = sys_ptrace(request, pid, addr, data); | 1764 | ret = ptrace_traceme(); |
1765 | goto out; | 1765 | goto out; |
1766 | } | 1766 | } |
1767 | 1767 | ||
1768 | ret = -ESRCH; | 1768 | child = ptrace_get_task_struct(pid); |
1769 | read_lock(&tasklist_lock); | 1769 | if (IS_ERR(child)) { |
1770 | child = find_task_by_pid(pid); | 1770 | ret = PTR_ERR(child); |
1771 | if (child) | ||
1772 | get_task_struct(child); | ||
1773 | read_unlock(&tasklist_lock); | ||
1774 | if (!child) | ||
1775 | goto out; | 1771 | goto out; |
1776 | ret = -EPERM; | 1772 | } |
1777 | if (pid == 1) /* no messing around with init! */ | ||
1778 | goto out_tsk; | ||
1779 | 1773 | ||
1780 | if (request == PTRACE_ATTACH) { | 1774 | if (request == PTRACE_ATTACH) { |
1781 | ret = sys_ptrace(request, pid, addr, data); | 1775 | ret = sys_ptrace(request, pid, addr, data); |
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index a3aa45cbcfa0..c485a3b32ba8 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c | |||
@@ -247,6 +247,32 @@ typedef struct kern_memdesc { | |||
247 | 247 | ||
248 | static kern_memdesc_t *kern_memmap; | 248 | static kern_memdesc_t *kern_memmap; |
249 | 249 | ||
250 | #define efi_md_size(md) (md->num_pages << EFI_PAGE_SHIFT) | ||
251 | |||
252 | static inline u64 | ||
253 | kmd_end(kern_memdesc_t *kmd) | ||
254 | { | ||
255 | return (kmd->start + (kmd->num_pages << EFI_PAGE_SHIFT)); | ||
256 | } | ||
257 | |||
258 | static inline u64 | ||
259 | efi_md_end(efi_memory_desc_t *md) | ||
260 | { | ||
261 | return (md->phys_addr + efi_md_size(md)); | ||
262 | } | ||
263 | |||
264 | static inline int | ||
265 | efi_wb(efi_memory_desc_t *md) | ||
266 | { | ||
267 | return (md->attribute & EFI_MEMORY_WB); | ||
268 | } | ||
269 | |||
270 | static inline int | ||
271 | efi_uc(efi_memory_desc_t *md) | ||
272 | { | ||
273 | return (md->attribute & EFI_MEMORY_UC); | ||
274 | } | ||
275 | |||
250 | static void | 276 | static void |
251 | walk (efi_freemem_callback_t callback, void *arg, u64 attr) | 277 | walk (efi_freemem_callback_t callback, void *arg, u64 attr) |
252 | { | 278 | { |
@@ -595,8 +621,8 @@ efi_get_iobase (void) | |||
595 | return 0; | 621 | return 0; |
596 | } | 622 | } |
597 | 623 | ||
598 | u32 | 624 | static efi_memory_desc_t * |
599 | efi_mem_type (unsigned long phys_addr) | 625 | efi_memory_descriptor (unsigned long phys_addr) |
600 | { | 626 | { |
601 | void *efi_map_start, *efi_map_end, *p; | 627 | void *efi_map_start, *efi_map_end, *p; |
602 | efi_memory_desc_t *md; | 628 | efi_memory_desc_t *md; |
@@ -610,13 +636,13 @@ efi_mem_type (unsigned long phys_addr) | |||
610 | md = p; | 636 | md = p; |
611 | 637 | ||
612 | if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) | 638 | if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) |
613 | return md->type; | 639 | return md; |
614 | } | 640 | } |
615 | return 0; | 641 | return 0; |
616 | } | 642 | } |
617 | 643 | ||
618 | u64 | 644 | static int |
619 | efi_mem_attributes (unsigned long phys_addr) | 645 | efi_memmap_has_mmio (void) |
620 | { | 646 | { |
621 | void *efi_map_start, *efi_map_end, *p; | 647 | void *efi_map_start, *efi_map_end, *p; |
622 | efi_memory_desc_t *md; | 648 | efi_memory_desc_t *md; |
@@ -629,36 +655,98 @@ efi_mem_attributes (unsigned long phys_addr) | |||
629 | for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { | 655 | for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { |
630 | md = p; | 656 | md = p; |
631 | 657 | ||
632 | if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) | 658 | if (md->type == EFI_MEMORY_MAPPED_IO) |
633 | return md->attribute; | 659 | return 1; |
634 | } | 660 | } |
635 | return 0; | 661 | return 0; |
636 | } | 662 | } |
663 | |||
664 | u32 | ||
665 | efi_mem_type (unsigned long phys_addr) | ||
666 | { | ||
667 | efi_memory_desc_t *md = efi_memory_descriptor(phys_addr); | ||
668 | |||
669 | if (md) | ||
670 | return md->type; | ||
671 | return 0; | ||
672 | } | ||
673 | |||
674 | u64 | ||
675 | efi_mem_attributes (unsigned long phys_addr) | ||
676 | { | ||
677 | efi_memory_desc_t *md = efi_memory_descriptor(phys_addr); | ||
678 | |||
679 | if (md) | ||
680 | return md->attribute; | ||
681 | return 0; | ||
682 | } | ||
637 | EXPORT_SYMBOL(efi_mem_attributes); | 683 | EXPORT_SYMBOL(efi_mem_attributes); |
638 | 684 | ||
685 | /* | ||
686 | * Determines whether the memory at phys_addr supports the desired | ||
687 | * attribute (WB, UC, etc). If this returns 1, the caller can safely | ||
688 | * access *size bytes at phys_addr with the specified attribute. | ||
689 | */ | ||
690 | static int | ||
691 | efi_mem_attribute_range (unsigned long phys_addr, unsigned long *size, u64 attr) | ||
692 | { | ||
693 | efi_memory_desc_t *md = efi_memory_descriptor(phys_addr); | ||
694 | unsigned long md_end; | ||
695 | |||
696 | if (!md || (md->attribute & attr) != attr) | ||
697 | return 0; | ||
698 | |||
699 | do { | ||
700 | md_end = efi_md_end(md); | ||
701 | if (phys_addr + *size <= md_end) | ||
702 | return 1; | ||
703 | |||
704 | md = efi_memory_descriptor(md_end); | ||
705 | if (!md || (md->attribute & attr) != attr) { | ||
706 | *size = md_end - phys_addr; | ||
707 | return 1; | ||
708 | } | ||
709 | } while (md); | ||
710 | return 0; | ||
711 | } | ||
712 | |||
713 | /* | ||
714 | * For /dev/mem, we only allow read & write system calls to access | ||
715 | * write-back memory, because read & write don't allow the user to | ||
716 | * control access size. | ||
717 | */ | ||
639 | int | 718 | int |
640 | valid_phys_addr_range (unsigned long phys_addr, unsigned long *size) | 719 | valid_phys_addr_range (unsigned long phys_addr, unsigned long *size) |
641 | { | 720 | { |
642 | void *efi_map_start, *efi_map_end, *p; | 721 | return efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_WB); |
643 | efi_memory_desc_t *md; | 722 | } |
644 | u64 efi_desc_size; | ||
645 | 723 | ||
646 | efi_map_start = __va(ia64_boot_param->efi_memmap); | 724 | /* |
647 | efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; | 725 | * We allow mmap of anything in the EFI memory map that supports |
648 | efi_desc_size = ia64_boot_param->efi_memdesc_size; | 726 | * either write-back or uncacheable access. For uncacheable regions, |
727 | * the supported access sizes are system-dependent, and the user is | ||
728 | * responsible for using the correct size. | ||
729 | * | ||
730 | * Note that this doesn't currently allow access to hot-added memory, | ||
731 | * because that doesn't appear in the boot-time EFI memory map. | ||
732 | */ | ||
733 | int | ||
734 | valid_mmap_phys_addr_range (unsigned long phys_addr, unsigned long *size) | ||
735 | { | ||
736 | if (efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_WB)) | ||
737 | return 1; | ||
649 | 738 | ||
650 | for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { | 739 | if (efi_mem_attribute_range(phys_addr, size, EFI_MEMORY_UC)) |
651 | md = p; | 740 | return 1; |
652 | 741 | ||
653 | if (phys_addr - md->phys_addr < (md->num_pages << EFI_PAGE_SHIFT)) { | 742 | /* |
654 | if (!(md->attribute & EFI_MEMORY_WB)) | 743 | * Some firmware doesn't report MMIO regions in the EFI memory map. |
655 | return 0; | 744 | * The Intel BigSur (a.k.a. HP i2000) has this problem. In this |
745 | * case, we can't use the EFI memory map to validate mmap requests. | ||
746 | */ | ||
747 | if (!efi_memmap_has_mmio()) | ||
748 | return 1; | ||
656 | 749 | ||
657 | if (*size > md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - phys_addr) | ||
658 | *size = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT) - phys_addr; | ||
659 | return 1; | ||
660 | } | ||
661 | } | ||
662 | return 0; | 750 | return 0; |
663 | } | 751 | } |
664 | 752 | ||
@@ -707,32 +795,6 @@ efi_uart_console_only(void) | |||
707 | return 0; | 795 | return 0; |
708 | } | 796 | } |
709 | 797 | ||
710 | #define efi_md_size(md) (md->num_pages << EFI_PAGE_SHIFT) | ||
711 | |||
712 | static inline u64 | ||
713 | kmd_end(kern_memdesc_t *kmd) | ||
714 | { | ||
715 | return (kmd->start + (kmd->num_pages << EFI_PAGE_SHIFT)); | ||
716 | } | ||
717 | |||
718 | static inline u64 | ||
719 | efi_md_end(efi_memory_desc_t *md) | ||
720 | { | ||
721 | return (md->phys_addr + efi_md_size(md)); | ||
722 | } | ||
723 | |||
724 | static inline int | ||
725 | efi_wb(efi_memory_desc_t *md) | ||
726 | { | ||
727 | return (md->attribute & EFI_MEMORY_WB); | ||
728 | } | ||
729 | |||
730 | static inline int | ||
731 | efi_uc(efi_memory_desc_t *md) | ||
732 | { | ||
733 | return (md->attribute & EFI_MEMORY_UC); | ||
734 | } | ||
735 | |||
736 | /* | 798 | /* |
737 | * Look for the first granule aligned memory descriptor memory | 799 | * Look for the first granule aligned memory descriptor memory |
738 | * that is big enough to hold EFI memory map. Make sure this | 800 | * that is big enough to hold EFI memory map. Make sure this |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index 0741b066b98f..7a6ffd613789 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1600,5 +1600,6 @@ sys_call_table: | |||
1600 | data8 sys_inotify_init | 1600 | data8 sys_inotify_init |
1601 | data8 sys_inotify_add_watch | 1601 | data8 sys_inotify_add_watch |
1602 | data8 sys_inotify_rm_watch | 1602 | data8 sys_inotify_rm_watch |
1603 | data8 sys_migrate_pages // 1280 | ||
1603 | 1604 | ||
1604 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls | 1605 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls |
diff --git a/arch/ia64/kernel/head.S b/arch/ia64/kernel/head.S index bfe65b2e8621..fbc7ea35dd57 100644 --- a/arch/ia64/kernel/head.S +++ b/arch/ia64/kernel/head.S | |||
@@ -1060,7 +1060,7 @@ SET_REG(b5); | |||
1060 | * the clobber lists for spin_lock() in include/asm-ia64/spinlock.h. | 1060 | * the clobber lists for spin_lock() in include/asm-ia64/spinlock.h. |
1061 | */ | 1061 | */ |
1062 | 1062 | ||
1063 | #if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | 1063 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) |
1064 | 1064 | ||
1065 | GLOBAL_ENTRY(ia64_spinlock_contention_pre3_4) | 1065 | GLOBAL_ENTRY(ia64_spinlock_contention_pre3_4) |
1066 | .prologue | 1066 | .prologue |
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c index 5db9d3bcbbcb..e72de580ebbf 100644 --- a/arch/ia64/kernel/ia64_ksyms.c +++ b/arch/ia64/kernel/ia64_ksyms.c | |||
@@ -103,7 +103,7 @@ EXPORT_SYMBOL(unw_init_running); | |||
103 | 103 | ||
104 | #ifdef ASM_SUPPORTED | 104 | #ifdef ASM_SUPPORTED |
105 | # ifdef CONFIG_SMP | 105 | # ifdef CONFIG_SMP |
106 | # if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | 106 | # if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) |
107 | /* | 107 | /* |
108 | * This is not a normal routine and we don't want a function descriptor for it, so we use | 108 | * This is not a normal routine and we don't want a function descriptor for it, so we use |
109 | * a fake declaration here. | 109 | * a fake declaration here. |
diff --git a/arch/ia64/kernel/ptrace.c b/arch/ia64/kernel/ptrace.c index 4b19d0410632..8d88eeea02d1 100644 --- a/arch/ia64/kernel/ptrace.c +++ b/arch/ia64/kernel/ptrace.c | |||
@@ -1422,14 +1422,7 @@ sys_ptrace (long request, pid_t pid, unsigned long addr, unsigned long data) | |||
1422 | lock_kernel(); | 1422 | lock_kernel(); |
1423 | ret = -EPERM; | 1423 | ret = -EPERM; |
1424 | if (request == PTRACE_TRACEME) { | 1424 | if (request == PTRACE_TRACEME) { |
1425 | /* are we already being traced? */ | 1425 | ret = ptrace_traceme(); |
1426 | if (current->ptrace & PT_PTRACED) | ||
1427 | goto out; | ||
1428 | ret = security_ptrace(current->parent, current); | ||
1429 | if (ret) | ||
1430 | goto out; | ||
1431 | current->ptrace |= PT_PTRACED; | ||
1432 | ret = 0; | ||
1433 | goto out; | 1426 | goto out; |
1434 | } | 1427 | } |
1435 | 1428 | ||
diff --git a/arch/ia64/oprofile/backtrace.c b/arch/ia64/oprofile/backtrace.c index b7dabbfb0d61..adb01566bd57 100644 --- a/arch/ia64/oprofile/backtrace.c +++ b/arch/ia64/oprofile/backtrace.c | |||
@@ -32,7 +32,7 @@ typedef struct | |||
32 | u64 *prev_pfs_loc; /* state for WAR for old spinlock ool code */ | 32 | u64 *prev_pfs_loc; /* state for WAR for old spinlock ool code */ |
33 | } ia64_backtrace_t; | 33 | } ia64_backtrace_t; |
34 | 34 | ||
35 | #if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) | 35 | #if (__GNUC__ == 3 && __GNUC_MINOR__ < 3) |
36 | /* | 36 | /* |
37 | * Returns non-zero if the PC is in the spinlock contention out-of-line code | 37 | * Returns non-zero if the PC is in the spinlock contention out-of-line code |
38 | * with non-standard calling sequence (on older compilers). | 38 | * with non-standard calling sequence (on older compilers). |
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index cc4b571e5db7..3bf55d92933f 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c | |||
@@ -50,6 +50,10 @@ unsigned long thread_saved_pc(struct task_struct *tsk) | |||
50 | * Powermanagement idle function, if any.. | 50 | * Powermanagement idle function, if any.. |
51 | */ | 51 | */ |
52 | void (*pm_idle)(void) = NULL; | 52 | void (*pm_idle)(void) = NULL; |
53 | EXPORT_SYMBOL(pm_idle); | ||
54 | |||
55 | void (*pm_power_off)(void) = NULL; | ||
56 | EXPORT_SYMBOL(pm_power_off); | ||
53 | 57 | ||
54 | void disable_hlt(void) | 58 | void disable_hlt(void) |
55 | { | 59 | { |
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c index 078d2a0e71c2..9b75caaf5cec 100644 --- a/arch/m32r/kernel/ptrace.c +++ b/arch/m32r/kernel/ptrace.c | |||
@@ -762,28 +762,16 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data) | |||
762 | int ret; | 762 | int ret; |
763 | 763 | ||
764 | lock_kernel(); | 764 | lock_kernel(); |
765 | ret = -EPERM; | ||
766 | if (request == PTRACE_TRACEME) { | 765 | if (request == PTRACE_TRACEME) { |
767 | /* are we already being traced? */ | 766 | ret = ptrace_traceme(); |
768 | if (current->ptrace & PT_PTRACED) | ||
769 | goto out; | ||
770 | /* set the ptrace bit in the process flags. */ | ||
771 | current->ptrace |= PT_PTRACED; | ||
772 | ret = 0; | ||
773 | goto out; | 767 | goto out; |
774 | } | 768 | } |
775 | ret = -ESRCH; | ||
776 | read_lock(&tasklist_lock); | ||
777 | child = find_task_by_pid(pid); | ||
778 | if (child) | ||
779 | get_task_struct(child); | ||
780 | read_unlock(&tasklist_lock); | ||
781 | if (!child) | ||
782 | goto out; | ||
783 | 769 | ||
784 | ret = -EPERM; | 770 | child = ptrace_get_task_struct(pid); |
785 | if (pid == 1) /* you may not mess with init */ | 771 | if (IS_ERR(child)) { |
772 | ret = PTR_ERR(child); | ||
786 | goto out; | 773 | goto out; |
774 | } | ||
787 | 775 | ||
788 | if (request == PTRACE_ATTACH) { | 776 | if (request == PTRACE_ATTACH) { |
789 | ret = ptrace_attach(child); | 777 | ret = ptrace_attach(child); |
diff --git a/arch/m68k/Kconfig b/arch/m68k/Kconfig index 1dd5d18b2201..96b919828053 100644 --- a/arch/m68k/Kconfig +++ b/arch/m68k/Kconfig | |||
@@ -10,10 +10,6 @@ config MMU | |||
10 | bool | 10 | bool |
11 | default y | 11 | default y |
12 | 12 | ||
13 | config UID16 | ||
14 | bool | ||
15 | default y | ||
16 | |||
17 | config RWSEM_GENERIC_SPINLOCK | 13 | config RWSEM_GENERIC_SPINLOCK |
18 | bool | 14 | bool |
19 | default y | 15 | default y |
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index b96498120fe9..e2a6e8648960 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig | |||
@@ -17,10 +17,6 @@ config FPU | |||
17 | bool | 17 | bool |
18 | default n | 18 | default n |
19 | 19 | ||
20 | config UID16 | ||
21 | bool | ||
22 | default y | ||
23 | |||
24 | config RWSEM_GENERIC_SPINLOCK | 20 | config RWSEM_GENERIC_SPINLOCK |
25 | bool | 21 | bool |
26 | default y | 22 | default y |
diff --git a/arch/mips/kernel/ptrace32.c b/arch/mips/kernel/ptrace32.c index 9a9b04972132..7e55457a491f 100644 --- a/arch/mips/kernel/ptrace32.c +++ b/arch/mips/kernel/ptrace32.c | |||
@@ -57,30 +57,16 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data) | |||
57 | (unsigned long) data); | 57 | (unsigned long) data); |
58 | #endif | 58 | #endif |
59 | lock_kernel(); | 59 | lock_kernel(); |
60 | ret = -EPERM; | ||
61 | if (request == PTRACE_TRACEME) { | 60 | if (request == PTRACE_TRACEME) { |
62 | /* are we already being traced? */ | 61 | ret = ptrace_traceme(); |
63 | if (current->ptrace & PT_PTRACED) | ||
64 | goto out; | ||
65 | if ((ret = security_ptrace(current->parent, current))) | ||
66 | goto out; | ||
67 | /* set the ptrace bit in the process flags. */ | ||
68 | current->ptrace |= PT_PTRACED; | ||
69 | ret = 0; | ||
70 | goto out; | 62 | goto out; |
71 | } | 63 | } |
72 | ret = -ESRCH; | ||
73 | read_lock(&tasklist_lock); | ||
74 | child = find_task_by_pid(pid); | ||
75 | if (child) | ||
76 | get_task_struct(child); | ||
77 | read_unlock(&tasklist_lock); | ||
78 | if (!child) | ||
79 | goto out; | ||
80 | 64 | ||
81 | ret = -EPERM; | 65 | child = ptrace_get_task_struct(pid); |
82 | if (pid == 1) /* you may not mess with init */ | 66 | if (IS_ERR(child)) { |
83 | goto out_tsk; | 67 | ret = PTR_ERR(child); |
68 | goto out; | ||
69 | } | ||
84 | 70 | ||
85 | if (request == PTRACE_ATTACH) { | 71 | if (request == PTRACE_ATTACH) { |
86 | ret = ptrace_attach(child); | 72 | ret = ptrace_attach(child); |
diff --git a/arch/mips/sgi-ip27/ip27-berr.c b/arch/mips/sgi-ip27/ip27-berr.c index 07631a97670b..ce907eda221b 100644 --- a/arch/mips/sgi-ip27/ip27-berr.c +++ b/arch/mips/sgi-ip27/ip27-berr.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/signal.h> /* for SIGBUS */ | 13 | #include <linux/signal.h> /* for SIGBUS */ |
14 | #include <linux/sched.h> /* schow_regs(), force_sig() */ | ||
14 | 15 | ||
15 | #include <asm/module.h> | 16 | #include <asm/module.h> |
16 | #include <asm/sn/addrs.h> | 17 | #include <asm/sn/addrs.h> |
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig index 874a283edb95..e77a06e9621e 100644 --- a/arch/parisc/Kconfig +++ b/arch/parisc/Kconfig | |||
@@ -19,9 +19,6 @@ config MMU | |||
19 | config STACK_GROWSUP | 19 | config STACK_GROWSUP |
20 | def_bool y | 20 | def_bool y |
21 | 21 | ||
22 | config UID16 | ||
23 | bool | ||
24 | |||
25 | config RWSEM_GENERIC_SPINLOCK | 22 | config RWSEM_GENERIC_SPINLOCK |
26 | def_bool y | 23 | def_bool y |
27 | 24 | ||
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index db93dbc0e21a..331483ace0d9 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig | |||
@@ -26,9 +26,6 @@ config MMU | |||
26 | bool | 26 | bool |
27 | default y | 27 | default y |
28 | 28 | ||
29 | config UID16 | ||
30 | bool | ||
31 | |||
32 | config GENERIC_HARDIRQS | 29 | config GENERIC_HARDIRQS |
33 | bool | 30 | bool |
34 | default y | 31 | default y |
diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c index 61762640b877..826ee3d056de 100644 --- a/arch/powerpc/kernel/ptrace32.c +++ b/arch/powerpc/kernel/ptrace32.c | |||
@@ -45,33 +45,19 @@ long compat_sys_ptrace(int request, int pid, unsigned long addr, | |||
45 | unsigned long data) | 45 | unsigned long data) |
46 | { | 46 | { |
47 | struct task_struct *child; | 47 | struct task_struct *child; |
48 | int ret = -EPERM; | 48 | int ret; |
49 | 49 | ||
50 | lock_kernel(); | 50 | lock_kernel(); |
51 | if (request == PTRACE_TRACEME) { | 51 | if (request == PTRACE_TRACEME) { |
52 | /* are we already being traced? */ | 52 | ret = ptrace_traceme(); |
53 | if (current->ptrace & PT_PTRACED) | ||
54 | goto out; | ||
55 | ret = security_ptrace(current->parent, current); | ||
56 | if (ret) | ||
57 | goto out; | ||
58 | /* set the ptrace bit in the process flags. */ | ||
59 | current->ptrace |= PT_PTRACED; | ||
60 | ret = 0; | ||
61 | goto out; | 53 | goto out; |
62 | } | 54 | } |
63 | ret = -ESRCH; | ||
64 | read_lock(&tasklist_lock); | ||
65 | child = find_task_by_pid(pid); | ||
66 | if (child) | ||
67 | get_task_struct(child); | ||
68 | read_unlock(&tasklist_lock); | ||
69 | if (!child) | ||
70 | goto out; | ||
71 | 55 | ||
72 | ret = -EPERM; | 56 | child = ptrace_get_task_struct(pid); |
73 | if (pid == 1) /* you may not mess with init */ | 57 | if (IS_ERR(child)) { |
74 | goto out_tsk; | 58 | ret = PTR_ERR(child); |
59 | goto out; | ||
60 | } | ||
75 | 61 | ||
76 | if (request == PTRACE_ATTACH) { | 62 | if (request == PTRACE_ATTACH) { |
77 | ret = ptrace_attach(child); | 63 | ret = ptrace_attach(child); |
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index cc3f64c084c5..e396f4591d59 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -8,9 +8,6 @@ config MMU | |||
8 | bool | 8 | bool |
9 | default y | 9 | default y |
10 | 10 | ||
11 | config UID16 | ||
12 | bool | ||
13 | |||
14 | config GENERIC_HARDIRQS | 11 | config GENERIC_HARDIRQS |
15 | bool | 12 | bool |
16 | default y | 13 | default y |
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c index 8ecda6d66de4..cc02232aa96e 100644 --- a/arch/s390/kernel/ptrace.c +++ b/arch/s390/kernel/ptrace.c | |||
@@ -712,35 +712,18 @@ sys_ptrace(long request, long pid, long addr, long data) | |||
712 | int ret; | 712 | int ret; |
713 | 713 | ||
714 | lock_kernel(); | 714 | lock_kernel(); |
715 | |||
716 | if (request == PTRACE_TRACEME) { | 715 | if (request == PTRACE_TRACEME) { |
717 | /* are we already being traced? */ | 716 | ret = ptrace_traceme(); |
718 | ret = -EPERM; | 717 | goto out; |
719 | if (current->ptrace & PT_PTRACED) | ||
720 | goto out; | ||
721 | ret = security_ptrace(current->parent, current); | ||
722 | if (ret) | ||
723 | goto out; | ||
724 | /* set the ptrace bit in the process flags. */ | ||
725 | current->ptrace |= PT_PTRACED; | ||
726 | goto out; | ||
727 | } | 718 | } |
728 | 719 | ||
729 | ret = -EPERM; | 720 | child = ptrace_get_task_struct(pid); |
730 | if (pid == 1) /* you may not mess with init */ | 721 | if (IS_ERR(child)) { |
731 | goto out; | 722 | ret = PTR_ERR(child); |
732 | |||
733 | ret = -ESRCH; | ||
734 | read_lock(&tasklist_lock); | ||
735 | child = find_task_by_pid(pid); | ||
736 | if (child) | ||
737 | get_task_struct(child); | ||
738 | read_unlock(&tasklist_lock); | ||
739 | if (!child) | ||
740 | goto out; | 723 | goto out; |
724 | } | ||
741 | 725 | ||
742 | ret = do_ptrace(child, request, addr, data); | 726 | ret = do_ptrace(child, request, addr, data); |
743 | |||
744 | put_task_struct(child); | 727 | put_task_struct(child); |
745 | out: | 728 | out: |
746 | unlock_kernel(); | 729 | unlock_kernel(); |
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 64f5ae0ff96d..8cf6d437a630 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -14,10 +14,6 @@ config SUPERH | |||
14 | gaming console. The SuperH port has a home page at | 14 | gaming console. The SuperH port has a home page at |
15 | <http://www.linux-sh.org/>. | 15 | <http://www.linux-sh.org/>. |
16 | 16 | ||
17 | config UID16 | ||
18 | bool | ||
19 | default y | ||
20 | |||
21 | config RWSEM_GENERIC_SPINLOCK | 17 | config RWSEM_GENERIC_SPINLOCK |
22 | bool | 18 | bool |
23 | default y | 19 | default y |
diff --git a/arch/sh64/kernel/time.c b/arch/sh64/kernel/time.c index 870fe5327e09..1195af37ee5a 100644 --- a/arch/sh64/kernel/time.c +++ b/arch/sh64/kernel/time.c | |||
@@ -417,7 +417,7 @@ static __init unsigned int get_cpu_hz(void) | |||
417 | /* | 417 | /* |
418 | ** Regardless the toolchain, force the compiler to use the | 418 | ** Regardless the toolchain, force the compiler to use the |
419 | ** arbitrary register r3 as a clock tick counter. | 419 | ** arbitrary register r3 as a clock tick counter. |
420 | ** NOTE: r3 must be in accordance with rtc_interrupt() | 420 | ** NOTE: r3 must be in accordance with sh64_rtc_interrupt() |
421 | */ | 421 | */ |
422 | register unsigned long long __rtc_irq_flag __asm__ ("r3"); | 422 | register unsigned long long __rtc_irq_flag __asm__ ("r3"); |
423 | 423 | ||
@@ -482,7 +482,8 @@ static __init unsigned int get_cpu_hz(void) | |||
482 | #endif | 482 | #endif |
483 | } | 483 | } |
484 | 484 | ||
485 | static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) | 485 | static irqreturn_t sh64_rtc_interrupt(int irq, void *dev_id, |
486 | struct pt_regs *regs) | ||
486 | { | 487 | { |
487 | ctrl_outb(0, RCR1); /* Disable Carry Interrupts */ | 488 | ctrl_outb(0, RCR1); /* Disable Carry Interrupts */ |
488 | regs->regs[3] = 1; /* Using r3 */ | 489 | regs->regs[3] = 1; /* Using r3 */ |
@@ -491,7 +492,7 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
491 | } | 492 | } |
492 | 493 | ||
493 | static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL}; | 494 | static struct irqaction irq0 = { timer_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "timer", NULL, NULL}; |
494 | static struct irqaction irq1 = { rtc_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "rtc", NULL, NULL}; | 495 | static struct irqaction irq1 = { sh64_rtc_interrupt, SA_INTERRUPT, CPU_MASK_NONE, "rtc", NULL, NULL}; |
495 | 496 | ||
496 | void __init time_init(void) | 497 | void __init time_init(void) |
497 | { | 498 | { |
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 56c34e7fd4ee..f944b58cdfe7 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig | |||
@@ -9,10 +9,6 @@ config MMU | |||
9 | bool | 9 | bool |
10 | default y | 10 | default y |
11 | 11 | ||
12 | config UID16 | ||
13 | bool | ||
14 | default y | ||
15 | |||
16 | config HIGHMEM | 12 | config HIGHMEM |
17 | bool | 13 | bool |
18 | default y | 14 | default y |
diff --git a/arch/sparc/kernel/ptrace.c b/arch/sparc/kernel/ptrace.c index 475c4c13462c..fc470c0e9dc6 100644 --- a/arch/sparc/kernel/ptrace.c +++ b/arch/sparc/kernel/ptrace.c | |||
@@ -286,40 +286,17 @@ asmlinkage void do_ptrace(struct pt_regs *regs) | |||
286 | s, (int) request, (int) pid, addr, data, addr2); | 286 | s, (int) request, (int) pid, addr, data, addr2); |
287 | } | 287 | } |
288 | #endif | 288 | #endif |
289 | if (request == PTRACE_TRACEME) { | ||
290 | int my_ret; | ||
291 | |||
292 | /* are we already being traced? */ | ||
293 | if (current->ptrace & PT_PTRACED) { | ||
294 | pt_error_return(regs, EPERM); | ||
295 | goto out; | ||
296 | } | ||
297 | my_ret = security_ptrace(current->parent, current); | ||
298 | if (my_ret) { | ||
299 | pt_error_return(regs, -my_ret); | ||
300 | goto out; | ||
301 | } | ||
302 | 289 | ||
303 | /* set the ptrace bit in the process flags. */ | 290 | if (request == PTRACE_TRACEME) { |
304 | current->ptrace |= PT_PTRACED; | 291 | ret = ptrace_traceme(); |
305 | pt_succ_return(regs, 0); | 292 | pt_succ_return(regs, 0); |
306 | goto out; | 293 | goto out; |
307 | } | 294 | } |
308 | #ifndef ALLOW_INIT_TRACING | ||
309 | if (pid == 1) { | ||
310 | /* Can't dork with init. */ | ||
311 | pt_error_return(regs, EPERM); | ||
312 | goto out; | ||
313 | } | ||
314 | #endif | ||
315 | read_lock(&tasklist_lock); | ||
316 | child = find_task_by_pid(pid); | ||
317 | if (child) | ||
318 | get_task_struct(child); | ||
319 | read_unlock(&tasklist_lock); | ||
320 | 295 | ||
321 | if (!child) { | 296 | child = ptrace_get_task_struct(pid); |
322 | pt_error_return(regs, ESRCH); | 297 | if (IS_ERR(child)) { |
298 | ret = PTR_ERR(child); | ||
299 | pt_error_return(regs, -ret); | ||
323 | goto out; | 300 | goto out; |
324 | } | 301 | } |
325 | 302 | ||
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index c4b7ad70cd7c..b775ceb4cf98 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig | |||
@@ -309,11 +309,6 @@ config COMPAT | |||
309 | depends on SPARC32_COMPAT | 309 | depends on SPARC32_COMPAT |
310 | default y | 310 | default y |
311 | 311 | ||
312 | config UID16 | ||
313 | bool | ||
314 | depends on SPARC32_COMPAT | ||
315 | default y | ||
316 | |||
317 | config BINFMT_ELF32 | 312 | config BINFMT_ELF32 |
318 | tristate "Kernel support for 32-bit ELF binaries" | 313 | tristate "Kernel support for 32-bit ELF binaries" |
319 | depends on SPARC32_COMPAT | 314 | depends on SPARC32_COMPAT |
diff --git a/arch/sparc64/kernel/ptrace.c b/arch/sparc64/kernel/ptrace.c index 774ecbb8a031..84d3df2264cb 100644 --- a/arch/sparc64/kernel/ptrace.c +++ b/arch/sparc64/kernel/ptrace.c | |||
@@ -198,39 +198,15 @@ asmlinkage void do_ptrace(struct pt_regs *regs) | |||
198 | } | 198 | } |
199 | #endif | 199 | #endif |
200 | if (request == PTRACE_TRACEME) { | 200 | if (request == PTRACE_TRACEME) { |
201 | int ret; | 201 | ret = ptrace_traceme(); |
202 | |||
203 | /* are we already being traced? */ | ||
204 | if (current->ptrace & PT_PTRACED) { | ||
205 | pt_error_return(regs, EPERM); | ||
206 | goto out; | ||
207 | } | ||
208 | ret = security_ptrace(current->parent, current); | ||
209 | if (ret) { | ||
210 | pt_error_return(regs, -ret); | ||
211 | goto out; | ||
212 | } | ||
213 | |||
214 | /* set the ptrace bit in the process flags. */ | ||
215 | current->ptrace |= PT_PTRACED; | ||
216 | pt_succ_return(regs, 0); | 202 | pt_succ_return(regs, 0); |
217 | goto out; | 203 | goto out; |
218 | } | 204 | } |
219 | #ifndef ALLOW_INIT_TRACING | ||
220 | if (pid == 1) { | ||
221 | /* Can't dork with init. */ | ||
222 | pt_error_return(regs, EPERM); | ||
223 | goto out; | ||
224 | } | ||
225 | #endif | ||
226 | read_lock(&tasklist_lock); | ||
227 | child = find_task_by_pid(pid); | ||
228 | if (child) | ||
229 | get_task_struct(child); | ||
230 | read_unlock(&tasklist_lock); | ||
231 | 205 | ||
232 | if (!child) { | 206 | child = ptrace_get_task_struct(pid); |
233 | pt_error_return(regs, ESRCH); | 207 | if (IS_ERR(child)) { |
208 | ret = PTR_ERR(child); | ||
209 | pt_error_return(regs, -ret); | ||
234 | goto out; | 210 | goto out; |
235 | } | 211 | } |
236 | 212 | ||
diff --git a/arch/um/Kconfig b/arch/um/Kconfig index 1eb21de9d1b5..b4ff2e576021 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig | |||
@@ -22,10 +22,6 @@ config SBUS | |||
22 | config PCI | 22 | config PCI |
23 | bool | 23 | bool |
24 | 24 | ||
25 | config UID16 | ||
26 | bool | ||
27 | default y | ||
28 | |||
29 | config GENERIC_CALIBRATE_DELAY | 25 | config GENERIC_CALIBRATE_DELAY |
30 | bool | 26 | bool |
31 | default y | 27 | default y |
@@ -83,7 +79,7 @@ config KERNEL_HALF_GIGS | |||
83 | of physical memory. | 79 | of physical memory. |
84 | 80 | ||
85 | config MODE_SKAS | 81 | config MODE_SKAS |
86 | bool "Separate Kernel Address Space support" | 82 | bool "Separate Kernel Address Space support" if MODE_TT |
87 | default y | 83 | default y |
88 | help | 84 | help |
89 | This option controls whether skas (separate kernel address space) | 85 | This option controls whether skas (separate kernel address space) |
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 73f9652b2ee9..3a93c6f772fa 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c | |||
@@ -117,6 +117,7 @@ static int ubd_open(struct inode * inode, struct file * filp); | |||
117 | static int ubd_release(struct inode * inode, struct file * file); | 117 | static int ubd_release(struct inode * inode, struct file * file); |
118 | static int ubd_ioctl(struct inode * inode, struct file * file, | 118 | static int ubd_ioctl(struct inode * inode, struct file * file, |
119 | unsigned int cmd, unsigned long arg); | 119 | unsigned int cmd, unsigned long arg); |
120 | static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo); | ||
120 | 121 | ||
121 | #define MAX_DEV (8) | 122 | #define MAX_DEV (8) |
122 | 123 | ||
@@ -125,6 +126,7 @@ static struct block_device_operations ubd_blops = { | |||
125 | .open = ubd_open, | 126 | .open = ubd_open, |
126 | .release = ubd_release, | 127 | .release = ubd_release, |
127 | .ioctl = ubd_ioctl, | 128 | .ioctl = ubd_ioctl, |
129 | .getgeo = ubd_getgeo, | ||
128 | }; | 130 | }; |
129 | 131 | ||
130 | /* Protected by the queue_lock */ | 132 | /* Protected by the queue_lock */ |
@@ -1058,6 +1060,16 @@ static void do_ubd_request(request_queue_t *q) | |||
1058 | } | 1060 | } |
1059 | } | 1061 | } |
1060 | 1062 | ||
1063 | static int ubd_getgeo(struct block_device *bdev, struct hd_geometry *geo) | ||
1064 | { | ||
1065 | struct ubd *dev = bdev->bd_disk->private_data; | ||
1066 | |||
1067 | geo->heads = 128; | ||
1068 | geo->sectors = 32; | ||
1069 | geo->cylinders = dev->size / (128 * 32 * 512); | ||
1070 | return 0; | ||
1071 | } | ||
1072 | |||
1061 | static int ubd_ioctl(struct inode * inode, struct file * file, | 1073 | static int ubd_ioctl(struct inode * inode, struct file * file, |
1062 | unsigned int cmd, unsigned long arg) | 1074 | unsigned int cmd, unsigned long arg) |
1063 | { | 1075 | { |
@@ -1070,16 +1082,7 @@ static int ubd_ioctl(struct inode * inode, struct file * file, | |||
1070 | }; | 1082 | }; |
1071 | 1083 | ||
1072 | switch (cmd) { | 1084 | switch (cmd) { |
1073 | struct hd_geometry g; | ||
1074 | struct cdrom_volctrl volume; | 1085 | struct cdrom_volctrl volume; |
1075 | case HDIO_GETGEO: | ||
1076 | if(!loc) return(-EINVAL); | ||
1077 | g.heads = 128; | ||
1078 | g.sectors = 32; | ||
1079 | g.cylinders = dev->size / (128 * 32 * 512); | ||
1080 | g.start = get_start_sect(inode->i_bdev); | ||
1081 | return(copy_to_user(loc, &g, sizeof(g)) ? -EFAULT : 0); | ||
1082 | |||
1083 | case HDIO_GET_IDENTITY: | 1086 | case HDIO_GET_IDENTITY: |
1084 | ubd_id.cyls = dev->size / (128 * 32 * 512); | 1087 | ubd_id.cyls = dev->size / (128 * 32 * 512); |
1085 | if(copy_to_user((char __user *) arg, (char *) &ubd_id, | 1088 | if(copy_to_user((char __user *) arg, (char *) &ubd_id, |
diff --git a/arch/um/include/kern_util.h b/arch/um/include/kern_util.h index e5fec5570199..8f4e46d677ab 100644 --- a/arch/um/include/kern_util.h +++ b/arch/um/include/kern_util.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
@@ -10,6 +10,19 @@ | |||
10 | #include "sysdep/ptrace.h" | 10 | #include "sysdep/ptrace.h" |
11 | #include "sysdep/faultinfo.h" | 11 | #include "sysdep/faultinfo.h" |
12 | 12 | ||
13 | typedef void (*kern_hndl)(int, union uml_pt_regs *); | ||
14 | |||
15 | struct kern_handlers { | ||
16 | kern_hndl relay_signal; | ||
17 | kern_hndl winch; | ||
18 | kern_hndl bus_handler; | ||
19 | kern_hndl page_fault; | ||
20 | kern_hndl sigio_handler; | ||
21 | kern_hndl timer_handler; | ||
22 | }; | ||
23 | |||
24 | extern struct kern_handlers handlinfo_kern; | ||
25 | |||
13 | extern int ncpus; | 26 | extern int ncpus; |
14 | extern char *linux_prog; | 27 | extern char *linux_prog; |
15 | extern char *gdb_init; | 28 | extern char *gdb_init; |
@@ -51,8 +64,6 @@ extern void timer_handler(int sig, union uml_pt_regs *regs); | |||
51 | extern int set_signals(int enable); | 64 | extern int set_signals(int enable); |
52 | extern void force_sigbus(void); | 65 | extern void force_sigbus(void); |
53 | extern int pid_to_processor_id(int pid); | 66 | extern int pid_to_processor_id(int pid); |
54 | extern void block_signals(void); | ||
55 | extern void unblock_signals(void); | ||
56 | extern void deliver_signals(void *t); | 67 | extern void deliver_signals(void *t); |
57 | extern int next_syscall_index(int max); | 68 | extern int next_syscall_index(int max); |
58 | extern int next_trap_index(int max); | 69 | extern int next_trap_index(int max); |
@@ -111,6 +122,8 @@ extern void arch_switch(void); | |||
111 | extern void free_irq(unsigned int, void *); | 122 | extern void free_irq(unsigned int, void *); |
112 | extern int um_in_interrupt(void); | 123 | extern int um_in_interrupt(void); |
113 | extern int cpu(void); | 124 | extern int cpu(void); |
125 | extern void segv_handler(int sig, union uml_pt_regs *regs); | ||
126 | extern void sigio_handler(int sig, union uml_pt_regs *regs); | ||
114 | 127 | ||
115 | #endif | 128 | #endif |
116 | 129 | ||
diff --git a/arch/um/include/os.h b/arch/um/include/os.h index c279ee6d89e4..dd72d66cf0ed 100644 --- a/arch/um/include/os.h +++ b/arch/um/include/os.h | |||
@@ -9,6 +9,8 @@ | |||
9 | #include "uml-config.h" | 9 | #include "uml-config.h" |
10 | #include "asm/types.h" | 10 | #include "asm/types.h" |
11 | #include "../os/include/file.h" | 11 | #include "../os/include/file.h" |
12 | #include "sysdep/ptrace.h" | ||
13 | #include "kern_util.h" | ||
12 | 14 | ||
13 | #define OS_TYPE_FILE 1 | 15 | #define OS_TYPE_FILE 1 |
14 | #define OS_TYPE_DIR 2 | 16 | #define OS_TYPE_DIR 2 |
@@ -219,4 +221,18 @@ extern int umid_file_name(char *name, char *buf, int len); | |||
219 | extern int set_umid(char *name); | 221 | extern int set_umid(char *name); |
220 | extern char *get_umid(void); | 222 | extern char *get_umid(void); |
221 | 223 | ||
224 | /* signal.c */ | ||
225 | extern void set_sigstack(void *sig_stack, int size); | ||
226 | extern void remove_sigstack(void); | ||
227 | extern void set_handler(int sig, void (*handler)(int), int flags, ...); | ||
228 | extern int change_sig(int signal, int on); | ||
229 | extern void block_signals(void); | ||
230 | extern void unblock_signals(void); | ||
231 | extern int get_signals(void); | ||
232 | extern int set_signals(int enable); | ||
233 | |||
234 | /* trap.c */ | ||
235 | extern void os_fill_handlinfo(struct kern_handlers h); | ||
236 | extern void do_longjmp(void *p, int val); | ||
237 | |||
222 | #endif | 238 | #endif |
diff --git a/arch/um/include/signal_user.h b/arch/um/include/signal_user.h deleted file mode 100644 index b075e543d864..000000000000 --- a/arch/um/include/signal_user.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #ifndef __SIGNAL_USER_H__ | ||
7 | #define __SIGNAL_USER_H__ | ||
8 | |||
9 | extern int signal_stack_size; | ||
10 | |||
11 | extern int change_sig(int signal, int on); | ||
12 | extern void set_sigstack(void *stack, int size); | ||
13 | extern void set_handler(int sig, void (*handler)(int), int flags, ...); | ||
14 | extern int set_signals(int enable); | ||
15 | extern int get_signals(void); | ||
16 | |||
17 | #endif | ||
18 | |||
19 | /* | ||
20 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
21 | * Emacs will notice this stuff at the end of the file and automatically | ||
22 | * adjust the settings for this buffer only. This must remain at the end | ||
23 | * of the file. | ||
24 | * --------------------------------------------------------------------------- | ||
25 | * Local variables: | ||
26 | * c-file-style: "linux" | ||
27 | * End: | ||
28 | */ | ||
diff --git a/arch/um/include/user_util.h b/arch/um/include/user_util.h index b9984003e603..c1dbd77b073f 100644 --- a/arch/um/include/user_util.h +++ b/arch/um/include/user_util.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
@@ -23,12 +23,7 @@ struct cpu_task { | |||
23 | 23 | ||
24 | extern struct cpu_task cpu_tasks[]; | 24 | extern struct cpu_task cpu_tasks[]; |
25 | 25 | ||
26 | struct signal_info { | 26 | extern void (*sig_info[])(int, union uml_pt_regs *); |
27 | void (*handler)(int, union uml_pt_regs *); | ||
28 | int is_irq; | ||
29 | }; | ||
30 | |||
31 | extern struct signal_info sig_info[]; | ||
32 | 27 | ||
33 | extern unsigned long low_physmem; | 28 | extern unsigned long low_physmem; |
34 | extern unsigned long high_physmem; | 29 | extern unsigned long high_physmem; |
@@ -64,7 +59,6 @@ extern void setup_machinename(char *machine_out); | |||
64 | extern void setup_hostinfo(void); | 59 | extern void setup_hostinfo(void); |
65 | extern void do_exec(int old_pid, int new_pid); | 60 | extern void do_exec(int old_pid, int new_pid); |
66 | extern void tracer_panic(char *msg, ...); | 61 | extern void tracer_panic(char *msg, ...); |
67 | extern void do_longjmp(void *p, int val); | ||
68 | extern int detach(int pid, int sig); | 62 | extern int detach(int pid, int sig); |
69 | extern int attach(int pid); | 63 | extern int attach(int pid); |
70 | extern void kill_child_dead(int pid); | 64 | extern void kill_child_dead(int pid); |
diff --git a/arch/um/kernel/Makefile b/arch/um/kernel/Makefile index 6f7700593a6f..193cc2b7448d 100644 --- a/arch/um/kernel/Makefile +++ b/arch/um/kernel/Makefile | |||
@@ -9,8 +9,8 @@ clean-files := | |||
9 | obj-y = config.o exec_kern.o exitcode.o \ | 9 | obj-y = config.o exec_kern.o exitcode.o \ |
10 | init_task.o irq.o irq_user.o ksyms.o mem.o physmem.o \ | 10 | init_task.o irq.o irq_user.o ksyms.o mem.o physmem.o \ |
11 | process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \ | 11 | process_kern.o ptrace.o reboot.o resource.o sigio_user.o sigio_kern.o \ |
12 | signal_kern.o signal_user.o smp.o syscall_kern.o sysrq.o time.o \ | 12 | signal_kern.o smp.o syscall_kern.o sysrq.o time.o \ |
13 | time_kern.o tlb.o trap_kern.o trap_user.o uaccess.o um_arch.o umid.o \ | 13 | time_kern.o tlb.o trap_kern.o uaccess.o um_arch.o umid.o \ |
14 | user_util.o | 14 | user_util.o |
15 | 15 | ||
16 | obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o | 16 | obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o |
diff --git a/arch/um/kernel/irq_user.c b/arch/um/kernel/irq_user.c index 50a2aa35cda9..0e32f5f4a887 100644 --- a/arch/um/kernel/irq_user.c +++ b/arch/um/kernel/irq_user.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include "kern_util.h" | 15 | #include "kern_util.h" |
16 | #include "user.h" | 16 | #include "user.h" |
17 | #include "process.h" | 17 | #include "process.h" |
18 | #include "signal_user.h" | ||
19 | #include "sigio.h" | 18 | #include "sigio.h" |
20 | #include "irq_user.h" | 19 | #include "irq_user.h" |
21 | #include "os.h" | 20 | #include "os.h" |
diff --git a/arch/um/kernel/process_kern.c b/arch/um/kernel/process_kern.c index 651abf255bc5..d2d3f256778c 100644 --- a/arch/um/kernel/process_kern.c +++ b/arch/um/kernel/process_kern.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include "kern_util.h" | 36 | #include "kern_util.h" |
37 | #include "kern.h" | 37 | #include "kern.h" |
38 | #include "signal_kern.h" | 38 | #include "signal_kern.h" |
39 | #include "signal_user.h" | ||
40 | #include "init.h" | 39 | #include "init.h" |
41 | #include "irq_user.h" | 40 | #include "irq_user.h" |
42 | #include "mem_user.h" | 41 | #include "mem_user.h" |
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c index a637e885c583..6f1a3a288117 100644 --- a/arch/um/kernel/reboot.c +++ b/arch/um/kernel/reboot.c | |||
@@ -12,6 +12,8 @@ | |||
12 | #include "mode.h" | 12 | #include "mode.h" |
13 | #include "choose-mode.h" | 13 | #include "choose-mode.h" |
14 | 14 | ||
15 | void (*pm_power_off)(void); | ||
16 | |||
15 | #ifdef CONFIG_SMP | 17 | #ifdef CONFIG_SMP |
16 | static void kill_idlers(int me) | 18 | static void kill_idlers(int me) |
17 | { | 19 | { |
diff --git a/arch/um/kernel/signal_kern.c b/arch/um/kernel/signal_kern.c index 03618bd13d55..7b0e0e81c161 100644 --- a/arch/um/kernel/signal_kern.c +++ b/arch/um/kernel/signal_kern.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include "asm/ucontext.h" | 22 | #include "asm/ucontext.h" |
23 | #include "kern_util.h" | 23 | #include "kern_util.h" |
24 | #include "signal_kern.h" | 24 | #include "signal_kern.h" |
25 | #include "signal_user.h" | ||
26 | #include "kern.h" | 25 | #include "kern.h" |
27 | #include "frame_kern.h" | 26 | #include "frame_kern.h" |
28 | #include "sigcontext.h" | 27 | #include "sigcontext.h" |
diff --git a/arch/um/kernel/signal_user.c b/arch/um/kernel/signal_user.c deleted file mode 100644 index 62f457835fb1..000000000000 --- a/arch/um/kernel/signal_user.c +++ /dev/null | |||
@@ -1,157 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #include <stdio.h> | ||
7 | #include <unistd.h> | ||
8 | #include <stdlib.h> | ||
9 | #include <signal.h> | ||
10 | #include <errno.h> | ||
11 | #include <stdarg.h> | ||
12 | #include <string.h> | ||
13 | #include <sys/mman.h> | ||
14 | #include "user_util.h" | ||
15 | #include "kern_util.h" | ||
16 | #include "user.h" | ||
17 | #include "signal_user.h" | ||
18 | #include "signal_kern.h" | ||
19 | #include "sysdep/sigcontext.h" | ||
20 | #include "sigcontext.h" | ||
21 | |||
22 | void set_sigstack(void *sig_stack, int size) | ||
23 | { | ||
24 | stack_t stack = ((stack_t) { .ss_flags = 0, | ||
25 | .ss_sp = (__ptr_t) sig_stack, | ||
26 | .ss_size = size - sizeof(void *) }); | ||
27 | |||
28 | if(sigaltstack(&stack, NULL) != 0) | ||
29 | panic("enabling signal stack failed, errno = %d\n", errno); | ||
30 | } | ||
31 | |||
32 | void set_handler(int sig, void (*handler)(int), int flags, ...) | ||
33 | { | ||
34 | struct sigaction action; | ||
35 | va_list ap; | ||
36 | int mask; | ||
37 | |||
38 | va_start(ap, flags); | ||
39 | action.sa_handler = handler; | ||
40 | sigemptyset(&action.sa_mask); | ||
41 | while((mask = va_arg(ap, int)) != -1){ | ||
42 | sigaddset(&action.sa_mask, mask); | ||
43 | } | ||
44 | va_end(ap); | ||
45 | action.sa_flags = flags; | ||
46 | action.sa_restorer = NULL; | ||
47 | if(sigaction(sig, &action, NULL) < 0) | ||
48 | panic("sigaction failed"); | ||
49 | } | ||
50 | |||
51 | int change_sig(int signal, int on) | ||
52 | { | ||
53 | sigset_t sigset, old; | ||
54 | |||
55 | sigemptyset(&sigset); | ||
56 | sigaddset(&sigset, signal); | ||
57 | sigprocmask(on ? SIG_UNBLOCK : SIG_BLOCK, &sigset, &old); | ||
58 | return(!sigismember(&old, signal)); | ||
59 | } | ||
60 | |||
61 | /* Both here and in set/get_signal we don't touch SIGPROF, because we must not | ||
62 | * disable profiling; it's safe because the profiling code does not interact | ||
63 | * with the kernel code at all.*/ | ||
64 | |||
65 | static void change_signals(int type) | ||
66 | { | ||
67 | sigset_t mask; | ||
68 | |||
69 | sigemptyset(&mask); | ||
70 | sigaddset(&mask, SIGVTALRM); | ||
71 | sigaddset(&mask, SIGALRM); | ||
72 | sigaddset(&mask, SIGIO); | ||
73 | if(sigprocmask(type, &mask, NULL) < 0) | ||
74 | panic("Failed to change signal mask - errno = %d", errno); | ||
75 | } | ||
76 | |||
77 | void block_signals(void) | ||
78 | { | ||
79 | change_signals(SIG_BLOCK); | ||
80 | } | ||
81 | |||
82 | void unblock_signals(void) | ||
83 | { | ||
84 | change_signals(SIG_UNBLOCK); | ||
85 | } | ||
86 | |||
87 | /* These are the asynchronous signals. SIGVTALRM and SIGARLM are handled | ||
88 | * together under SIGVTALRM_BIT. SIGPROF is excluded because we want to | ||
89 | * be able to profile all of UML, not just the non-critical sections. If | ||
90 | * profiling is not thread-safe, then that is not my problem. We can disable | ||
91 | * profiling when SMP is enabled in that case. | ||
92 | */ | ||
93 | #define SIGIO_BIT 0 | ||
94 | #define SIGVTALRM_BIT 1 | ||
95 | |||
96 | static int enable_mask(sigset_t *mask) | ||
97 | { | ||
98 | int sigs; | ||
99 | |||
100 | sigs = sigismember(mask, SIGIO) ? 0 : 1 << SIGIO_BIT; | ||
101 | sigs |= sigismember(mask, SIGVTALRM) ? 0 : 1 << SIGVTALRM_BIT; | ||
102 | sigs |= sigismember(mask, SIGALRM) ? 0 : 1 << SIGVTALRM_BIT; | ||
103 | return(sigs); | ||
104 | } | ||
105 | |||
106 | int get_signals(void) | ||
107 | { | ||
108 | sigset_t mask; | ||
109 | |||
110 | if(sigprocmask(SIG_SETMASK, NULL, &mask) < 0) | ||
111 | panic("Failed to get signal mask"); | ||
112 | return(enable_mask(&mask)); | ||
113 | } | ||
114 | |||
115 | int set_signals(int enable) | ||
116 | { | ||
117 | sigset_t mask; | ||
118 | int ret; | ||
119 | |||
120 | sigemptyset(&mask); | ||
121 | if(enable & (1 << SIGIO_BIT)) | ||
122 | sigaddset(&mask, SIGIO); | ||
123 | if(enable & (1 << SIGVTALRM_BIT)){ | ||
124 | sigaddset(&mask, SIGVTALRM); | ||
125 | sigaddset(&mask, SIGALRM); | ||
126 | } | ||
127 | |||
128 | /* This is safe - sigprocmask is guaranteed to copy locally the | ||
129 | * value of new_set, do his work and then, at the end, write to | ||
130 | * old_set. | ||
131 | */ | ||
132 | if(sigprocmask(SIG_UNBLOCK, &mask, &mask) < 0) | ||
133 | panic("Failed to enable signals"); | ||
134 | ret = enable_mask(&mask); | ||
135 | sigemptyset(&mask); | ||
136 | if((enable & (1 << SIGIO_BIT)) == 0) | ||
137 | sigaddset(&mask, SIGIO); | ||
138 | if((enable & (1 << SIGVTALRM_BIT)) == 0){ | ||
139 | sigaddset(&mask, SIGVTALRM); | ||
140 | sigaddset(&mask, SIGALRM); | ||
141 | } | ||
142 | if(sigprocmask(SIG_BLOCK, &mask, NULL) < 0) | ||
143 | panic("Failed to block signals"); | ||
144 | |||
145 | return(ret); | ||
146 | } | ||
147 | |||
148 | /* | ||
149 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
150 | * Emacs will notice this stuff at the end of the file and automatically | ||
151 | * adjust the settings for this buffer only. This must remain at the end | ||
152 | * of the file. | ||
153 | * --------------------------------------------------------------------------- | ||
154 | * Local variables: | ||
155 | * c-file-style: "linux" | ||
156 | * End: | ||
157 | */ | ||
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile index 8de471b59c1c..7a9fc16d71d4 100644 --- a/arch/um/kernel/skas/Makefile +++ b/arch/um/kernel/skas/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | # | 4 | # |
5 | 5 | ||
6 | obj-y := clone.o exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \ | 6 | obj-y := clone.o exec_kern.o mem.o mem_user.o mmu.o process.o process_kern.o \ |
7 | syscall.o tlb.o trap_user.o uaccess.o | 7 | syscall.o tlb.o uaccess.o |
8 | 8 | ||
9 | USER_OBJS := process.o clone.o | 9 | USER_OBJS := process.o clone.o |
10 | 10 | ||
diff --git a/arch/um/kernel/skas/include/skas.h b/arch/um/kernel/skas/include/skas.h index daa2f85b684c..01d489de3986 100644 --- a/arch/um/kernel/skas/include/skas.h +++ b/arch/um/kernel/skas/include/skas.h | |||
@@ -22,7 +22,6 @@ extern int start_idle_thread(void *stack, void *switch_buf_ptr, | |||
22 | extern int user_thread(unsigned long stack, int flags); | 22 | extern int user_thread(unsigned long stack, int flags); |
23 | extern void userspace(union uml_pt_regs *regs); | 23 | extern void userspace(union uml_pt_regs *regs); |
24 | extern void new_thread_proc(void *stack, void (*handler)(int sig)); | 24 | extern void new_thread_proc(void *stack, void (*handler)(int sig)); |
25 | extern void remove_sigstack(void); | ||
26 | extern void new_thread_handler(int sig); | 25 | extern void new_thread_handler(int sig); |
27 | extern void handle_syscall(union uml_pt_regs *regs); | 26 | extern void handle_syscall(union uml_pt_regs *regs); |
28 | extern int map(struct mm_id * mm_idp, unsigned long virt, | 27 | extern int map(struct mm_id * mm_idp, unsigned long virt, |
diff --git a/arch/um/kernel/skas/process.c b/arch/um/kernel/skas/process.c index 599d679bd4fc..9264d4021dfe 100644 --- a/arch/um/kernel/skas/process.c +++ b/arch/um/kernel/skas/process.c | |||
@@ -31,7 +31,6 @@ | |||
31 | #include "proc_mm.h" | 31 | #include "proc_mm.h" |
32 | #include "skas_ptrace.h" | 32 | #include "skas_ptrace.h" |
33 | #include "chan_user.h" | 33 | #include "chan_user.h" |
34 | #include "signal_user.h" | ||
35 | #include "registers.h" | 34 | #include "registers.h" |
36 | #include "mem.h" | 35 | #include "mem.h" |
37 | #include "uml-config.h" | 36 | #include "uml-config.h" |
@@ -514,16 +513,6 @@ int start_idle_thread(void *stack, void *switch_buf_ptr, void **fork_buf_ptr) | |||
514 | siglongjmp(**switch_buf, 1); | 513 | siglongjmp(**switch_buf, 1); |
515 | } | 514 | } |
516 | 515 | ||
517 | void remove_sigstack(void) | ||
518 | { | ||
519 | stack_t stack = ((stack_t) { .ss_flags = SS_DISABLE, | ||
520 | .ss_sp = NULL, | ||
521 | .ss_size = 0 }); | ||
522 | |||
523 | if(sigaltstack(&stack, NULL) != 0) | ||
524 | panic("disabling signal stack failed, errno = %d\n", errno); | ||
525 | } | ||
526 | |||
527 | void initial_thread_cb_skas(void (*proc)(void *), void *arg) | 516 | void initial_thread_cb_skas(void (*proc)(void *), void *arg) |
528 | { | 517 | { |
529 | sigjmp_buf here; | 518 | sigjmp_buf here; |
diff --git a/arch/um/kernel/skas/process_kern.c b/arch/um/kernel/skas/process_kern.c index 9c990253966c..09790ccb161c 100644 --- a/arch/um/kernel/skas/process_kern.c +++ b/arch/um/kernel/skas/process_kern.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include "asm/atomic.h" | 14 | #include "asm/atomic.h" |
15 | #include "kern_util.h" | 15 | #include "kern_util.h" |
16 | #include "time_user.h" | 16 | #include "time_user.h" |
17 | #include "signal_user.h" | ||
18 | #include "skas.h" | 17 | #include "skas.h" |
19 | #include "os.h" | 18 | #include "os.h" |
20 | #include "user_util.h" | 19 | #include "user_util.h" |
diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c index c40b611e3d93..11f518a7e156 100644 --- a/arch/um/kernel/time.c +++ b/arch/um/kernel/time.c | |||
@@ -14,9 +14,9 @@ | |||
14 | #include "kern_util.h" | 14 | #include "kern_util.h" |
15 | #include "user.h" | 15 | #include "user.h" |
16 | #include "process.h" | 16 | #include "process.h" |
17 | #include "signal_user.h" | ||
18 | #include "time_user.h" | 17 | #include "time_user.h" |
19 | #include "kern_constants.h" | 18 | #include "kern_constants.h" |
19 | #include "os.h" | ||
20 | 20 | ||
21 | /* XXX This really needs to be declared and initialized in a kernel file since | 21 | /* XXX This really needs to be declared and initialized in a kernel file since |
22 | * it's in <linux/time.h> | 22 | * it's in <linux/time.h> |
diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c index 0d4c10a73607..d56046c2aba2 100644 --- a/arch/um/kernel/trap_kern.c +++ b/arch/um/kernel/trap_kern.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000, 2001 Jeff Dike (jdike@karaya.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
@@ -26,9 +26,13 @@ | |||
26 | #include "mconsole_kern.h" | 26 | #include "mconsole_kern.h" |
27 | #include "mem.h" | 27 | #include "mem.h" |
28 | #include "mem_kern.h" | 28 | #include "mem_kern.h" |
29 | #include "sysdep/sigcontext.h" | ||
30 | #include "sysdep/ptrace.h" | ||
31 | #include "os.h" | ||
29 | #ifdef CONFIG_MODE_SKAS | 32 | #ifdef CONFIG_MODE_SKAS |
30 | #include "skas.h" | 33 | #include "skas.h" |
31 | #endif | 34 | #endif |
35 | #include "os.h" | ||
32 | 36 | ||
33 | /* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */ | 37 | /* Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by segv(). */ |
34 | int handle_page_fault(unsigned long address, unsigned long ip, | 38 | int handle_page_fault(unsigned long address, unsigned long ip, |
@@ -125,6 +129,25 @@ out_of_memory: | |||
125 | goto out; | 129 | goto out; |
126 | } | 130 | } |
127 | 131 | ||
132 | void segv_handler(int sig, union uml_pt_regs *regs) | ||
133 | { | ||
134 | struct faultinfo * fi = UPT_FAULTINFO(regs); | ||
135 | |||
136 | if(UPT_IS_USER(regs) && !SEGV_IS_FIXABLE(fi)){ | ||
137 | bad_segv(*fi, UPT_IP(regs)); | ||
138 | return; | ||
139 | } | ||
140 | segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs); | ||
141 | } | ||
142 | |||
143 | struct kern_handlers handlinfo_kern = { | ||
144 | .relay_signal = relay_signal, | ||
145 | .winch = winch, | ||
146 | .bus_handler = relay_signal, | ||
147 | .page_fault = segv_handler, | ||
148 | .sigio_handler = sigio_handler, | ||
149 | .timer_handler = timer_handler | ||
150 | }; | ||
128 | /* | 151 | /* |
129 | * We give a *copy* of the faultinfo in the regs to segv. | 152 | * We give a *copy* of the faultinfo in the regs to segv. |
130 | * This must be done, since nesting SEGVs could overwrite | 153 | * This must be done, since nesting SEGVs could overwrite |
diff --git a/arch/um/kernel/trap_user.c b/arch/um/kernel/trap_user.c deleted file mode 100644 index e9ccd6b8d3c7..000000000000 --- a/arch/um/kernel/trap_user.c +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #include <stdlib.h> | ||
7 | #include <errno.h> | ||
8 | #include <setjmp.h> | ||
9 | #include <signal.h> | ||
10 | #include <sys/time.h> | ||
11 | #include <sys/wait.h> | ||
12 | #include <asm/page.h> | ||
13 | #include <asm/unistd.h> | ||
14 | #include <asm/ptrace.h> | ||
15 | #include "init.h" | ||
16 | #include "sysdep/ptrace.h" | ||
17 | #include "sigcontext.h" | ||
18 | #include "sysdep/sigcontext.h" | ||
19 | #include "irq_user.h" | ||
20 | #include "signal_user.h" | ||
21 | #include "time_user.h" | ||
22 | #include "task.h" | ||
23 | #include "mode.h" | ||
24 | #include "choose-mode.h" | ||
25 | #include "kern_util.h" | ||
26 | #include "user_util.h" | ||
27 | #include "os.h" | ||
28 | |||
29 | void kill_child_dead(int pid) | ||
30 | { | ||
31 | kill(pid, SIGKILL); | ||
32 | kill(pid, SIGCONT); | ||
33 | do { | ||
34 | int n; | ||
35 | CATCH_EINTR(n = waitpid(pid, NULL, 0)); | ||
36 | if (n > 0) | ||
37 | kill(pid, SIGCONT); | ||
38 | else | ||
39 | break; | ||
40 | } while(1); | ||
41 | } | ||
42 | |||
43 | void segv_handler(int sig, union uml_pt_regs *regs) | ||
44 | { | ||
45 | struct faultinfo * fi = UPT_FAULTINFO(regs); | ||
46 | |||
47 | if(UPT_IS_USER(regs) && !SEGV_IS_FIXABLE(fi)){ | ||
48 | bad_segv(*fi, UPT_IP(regs)); | ||
49 | return; | ||
50 | } | ||
51 | segv(*fi, UPT_IP(regs), UPT_IS_USER(regs), regs); | ||
52 | } | ||
53 | |||
54 | void usr2_handler(int sig, union uml_pt_regs *regs) | ||
55 | { | ||
56 | CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0); | ||
57 | } | ||
58 | |||
59 | struct signal_info sig_info[] = { | ||
60 | [ SIGTRAP ] { .handler = relay_signal, | ||
61 | .is_irq = 0 }, | ||
62 | [ SIGFPE ] { .handler = relay_signal, | ||
63 | .is_irq = 0 }, | ||
64 | [ SIGILL ] { .handler = relay_signal, | ||
65 | .is_irq = 0 }, | ||
66 | [ SIGWINCH ] { .handler = winch, | ||
67 | .is_irq = 1 }, | ||
68 | [ SIGBUS ] { .handler = bus_handler, | ||
69 | .is_irq = 0 }, | ||
70 | [ SIGSEGV] { .handler = segv_handler, | ||
71 | .is_irq = 0 }, | ||
72 | [ SIGIO ] { .handler = sigio_handler, | ||
73 | .is_irq = 1 }, | ||
74 | [ SIGVTALRM ] { .handler = timer_handler, | ||
75 | .is_irq = 1 }, | ||
76 | [ SIGALRM ] { .handler = timer_handler, | ||
77 | .is_irq = 1 }, | ||
78 | [ SIGUSR2 ] { .handler = usr2_handler, | ||
79 | .is_irq = 0 }, | ||
80 | }; | ||
81 | |||
82 | void do_longjmp(void *b, int val) | ||
83 | { | ||
84 | sigjmp_buf *buf = b; | ||
85 | |||
86 | siglongjmp(*buf, val); | ||
87 | } | ||
88 | |||
89 | /* | ||
90 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
91 | * Emacs will notice this stuff at the end of the file and automatically | ||
92 | * adjust the settings for this buffer only. This must remain at the end | ||
93 | * of the file. | ||
94 | * --------------------------------------------------------------------------- | ||
95 | * Local variables: | ||
96 | * c-file-style: "linux" | ||
97 | * End: | ||
98 | */ | ||
diff --git a/arch/um/kernel/tt/exec_kern.c b/arch/um/kernel/tt/exec_kern.c index 065b504a653b..136e54c47d37 100644 --- a/arch/um/kernel/tt/exec_kern.c +++ b/arch/um/kernel/tt/exec_kern.c | |||
@@ -14,7 +14,6 @@ | |||
14 | #include "kern_util.h" | 14 | #include "kern_util.h" |
15 | #include "irq_user.h" | 15 | #include "irq_user.h" |
16 | #include "time_user.h" | 16 | #include "time_user.h" |
17 | #include "signal_user.h" | ||
18 | #include "mem_user.h" | 17 | #include "mem_user.h" |
19 | #include "os.h" | 18 | #include "os.h" |
20 | #include "tlb.h" | 19 | #include "tlb.h" |
diff --git a/arch/um/kernel/tt/process_kern.c b/arch/um/kernel/tt/process_kern.c index cfaa373a6e77..14d4622a5fb8 100644 --- a/arch/um/kernel/tt/process_kern.c +++ b/arch/um/kernel/tt/process_kern.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include "asm/ptrace.h" | 13 | #include "asm/ptrace.h" |
14 | #include "asm/tlbflush.h" | 14 | #include "asm/tlbflush.h" |
15 | #include "irq_user.h" | 15 | #include "irq_user.h" |
16 | #include "signal_user.h" | ||
17 | #include "kern_util.h" | 16 | #include "kern_util.h" |
18 | #include "user_util.h" | 17 | #include "user_util.h" |
19 | #include "os.h" | 18 | #include "os.h" |
diff --git a/arch/um/kernel/tt/tracer.c b/arch/um/kernel/tt/tracer.c index d11e7399d7a1..71daae24e48a 100644 --- a/arch/um/kernel/tt/tracer.c +++ b/arch/um/kernel/tt/tracer.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include "sigcontext.h" | 19 | #include "sigcontext.h" |
20 | #include "sysdep/sigcontext.h" | 20 | #include "sysdep/sigcontext.h" |
21 | #include "os.h" | 21 | #include "os.h" |
22 | #include "signal_user.h" | ||
23 | #include "user_util.h" | 22 | #include "user_util.h" |
24 | #include "mem_user.h" | 23 | #include "mem_user.h" |
25 | #include "process.h" | 24 | #include "process.h" |
diff --git a/arch/um/kernel/tt/trap_user.c b/arch/um/kernel/tt/trap_user.c index fc108615beaf..a414c529fbcd 100644 --- a/arch/um/kernel/tt/trap_user.c +++ b/arch/um/kernel/tt/trap_user.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
@@ -8,18 +8,18 @@ | |||
8 | #include <signal.h> | 8 | #include <signal.h> |
9 | #include "sysdep/ptrace.h" | 9 | #include "sysdep/ptrace.h" |
10 | #include "sysdep/sigcontext.h" | 10 | #include "sysdep/sigcontext.h" |
11 | #include "signal_user.h" | ||
12 | #include "user_util.h" | 11 | #include "user_util.h" |
13 | #include "kern_util.h" | 12 | #include "kern_util.h" |
14 | #include "task.h" | 13 | #include "task.h" |
15 | #include "tt.h" | 14 | #include "tt.h" |
15 | #include "os.h" | ||
16 | 16 | ||
17 | void sig_handler_common_tt(int sig, void *sc_ptr) | 17 | void sig_handler_common_tt(int sig, void *sc_ptr) |
18 | { | 18 | { |
19 | struct sigcontext *sc = sc_ptr; | 19 | struct sigcontext *sc = sc_ptr; |
20 | struct tt_regs save_regs, *r; | 20 | struct tt_regs save_regs, *r; |
21 | struct signal_info *info; | ||
22 | int save_errno = errno, is_user; | 21 | int save_errno = errno, is_user; |
22 | void (*handler)(int, union uml_pt_regs *); | ||
23 | 23 | ||
24 | /* This is done because to allow SIGSEGV to be delivered inside a SEGV | 24 | /* This is done because to allow SIGSEGV to be delivered inside a SEGV |
25 | * handler. This can happen in copy_user, and if SEGV is disabled, | 25 | * handler. This can happen in copy_user, and if SEGV is disabled, |
@@ -40,10 +40,14 @@ void sig_handler_common_tt(int sig, void *sc_ptr) | |||
40 | if(sig != SIGUSR2) | 40 | if(sig != SIGUSR2) |
41 | r->syscall = -1; | 41 | r->syscall = -1; |
42 | 42 | ||
43 | info = &sig_info[sig]; | 43 | handler = sig_info[sig]; |
44 | if(!info->is_irq) unblock_signals(); | 44 | |
45 | /* unblock SIGALRM, SIGVTALRM, SIGIO if sig isn't IRQ signal */ | ||
46 | if (sig != SIGIO && sig != SIGWINCH && | ||
47 | sig != SIGVTALRM && sig != SIGALRM) | ||
48 | unblock_signals(); | ||
45 | 49 | ||
46 | (*info->handler)(sig, (union uml_pt_regs *) r); | 50 | handler(sig, (union uml_pt_regs *) r); |
47 | 51 | ||
48 | if(is_user){ | 52 | if(is_user){ |
49 | interrupt_end(); | 53 | interrupt_end(); |
diff --git a/arch/um/kernel/um_arch.c b/arch/um/kernel/um_arch.c index 26626b2b9172..73747ac19774 100644 --- a/arch/um/kernel/um_arch.c +++ b/arch/um/kernel/um_arch.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000, 2002 Jeff Dike (jdike@karaya.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
@@ -363,6 +363,11 @@ int linux_main(int argc, char **argv) | |||
363 | uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, | 363 | uml_start = CHOOSE_MODE_PROC(set_task_sizes_tt, set_task_sizes_skas, 0, |
364 | &host_task_size, &task_size); | 364 | &host_task_size, &task_size); |
365 | 365 | ||
366 | /* | ||
367 | * Setting up handlers to 'sig_info' struct | ||
368 | */ | ||
369 | os_fill_handlinfo(handlinfo_kern); | ||
370 | |||
366 | brk_start = (unsigned long) sbrk(0); | 371 | brk_start = (unsigned long) sbrk(0); |
367 | CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start); | 372 | CHOOSE_MODE_PROC(before_mem_tt, before_mem_skas, brk_start); |
368 | /* Increase physical memory size for exec-shield users | 373 | /* Increase physical memory size for exec-shield users |
diff --git a/arch/um/os-Linux/Makefile b/arch/um/os-Linux/Makefile index 11e30b13e318..40c7d6b1df68 100644 --- a/arch/um/os-Linux/Makefile +++ b/arch/um/os-Linux/Makefile | |||
@@ -4,11 +4,13 @@ | |||
4 | # | 4 | # |
5 | 5 | ||
6 | obj-y = aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \ | 6 | obj-y = aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \ |
7 | start_up.o time.o tt.o tty.o uaccess.o umid.o user_syms.o drivers/ \ | 7 | start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o user_syms.o \ |
8 | sys-$(SUBARCH)/ | 8 | drivers/ sys-$(SUBARCH)/ |
9 | |||
10 | obj-$(CONFIG_MODE_SKAS) += skas/ | ||
9 | 11 | ||
10 | USER_OBJS := aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \ | 12 | USER_OBJS := aio.o elf_aux.o file.o helper.o main.o mem.o process.o signal.o \ |
11 | start_up.o time.o tt.o tty.o uaccess.o umid.o | 13 | start_up.o time.o trap.o tt.o tty.o uaccess.o umid.o |
12 | 14 | ||
13 | elf_aux.o: $(ARCH_DIR)/kernel-offsets.h | 15 | elf_aux.o: $(ARCH_DIR)/kernel-offsets.h |
14 | CFLAGS_elf_aux.o += -I$(objtree)/arch/um | 16 | CFLAGS_elf_aux.o += -I$(objtree)/arch/um |
diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c index 23da27d22569..172c8474453c 100644 --- a/arch/um/os-Linux/main.c +++ b/arch/um/os-Linux/main.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include "user_util.h" | 16 | #include "user_util.h" |
17 | #include "kern_util.h" | 17 | #include "kern_util.h" |
18 | #include "mem_user.h" | 18 | #include "mem_user.h" |
19 | #include "signal_user.h" | ||
20 | #include "time_user.h" | 19 | #include "time_user.h" |
21 | #include "irq_user.h" | 20 | #include "irq_user.h" |
22 | #include "user.h" | 21 | #include "user.h" |
diff --git a/arch/um/os-Linux/process.c b/arch/um/os-Linux/process.c index d9c52387c4a1..39815c6b5e45 100644 --- a/arch/um/os-Linux/process.c +++ b/arch/um/os-Linux/process.c | |||
@@ -15,7 +15,6 @@ | |||
15 | #include "os.h" | 15 | #include "os.h" |
16 | #include "user.h" | 16 | #include "user.h" |
17 | #include "user_util.h" | 17 | #include "user_util.h" |
18 | #include "signal_user.h" | ||
19 | #include "process.h" | 18 | #include "process.h" |
20 | #include "irq_user.h" | 19 | #include "irq_user.h" |
21 | #include "kern_util.h" | 20 | #include "kern_util.h" |
diff --git a/arch/um/os-Linux/signal.c b/arch/um/os-Linux/signal.c index c7bfd5ee3925..c1f46a0fef13 100644 --- a/arch/um/os-Linux/signal.c +++ b/arch/um/os-Linux/signal.c | |||
@@ -4,9 +4,22 @@ | |||
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <signal.h> | 6 | #include <signal.h> |
7 | #include <stdio.h> | ||
8 | #include <unistd.h> | ||
9 | #include <stdlib.h> | ||
10 | #include <errno.h> | ||
11 | #include <stdarg.h> | ||
12 | #include <string.h> | ||
13 | #include <sys/mman.h> | ||
14 | #include "user_util.h" | ||
15 | #include "kern_util.h" | ||
16 | #include "user.h" | ||
17 | #include "signal_kern.h" | ||
18 | #include "sysdep/sigcontext.h" | ||
19 | #include "sysdep/signal.h" | ||
20 | #include "sigcontext.h" | ||
7 | #include "time_user.h" | 21 | #include "time_user.h" |
8 | #include "mode.h" | 22 | #include "mode.h" |
9 | #include "sysdep/signal.h" | ||
10 | 23 | ||
11 | void sig_handler(ARCH_SIGHDLR_PARAM) | 24 | void sig_handler(ARCH_SIGHDLR_PARAM) |
12 | { | 25 | { |
@@ -36,13 +49,138 @@ void alarm_handler(ARCH_SIGHDLR_PARAM) | |||
36 | switch_timers(1); | 49 | switch_timers(1); |
37 | } | 50 | } |
38 | 51 | ||
39 | /* | 52 | void set_sigstack(void *sig_stack, int size) |
40 | * Overrides for Emacs so that we follow Linus's tabbing style. | 53 | { |
41 | * Emacs will notice this stuff at the end of the file and automatically | 54 | stack_t stack = ((stack_t) { .ss_flags = 0, |
42 | * adjust the settings for this buffer only. This must remain at the end | 55 | .ss_sp = (__ptr_t) sig_stack, |
43 | * of the file. | 56 | .ss_size = size - sizeof(void *) }); |
44 | * --------------------------------------------------------------------------- | 57 | |
45 | * Local variables: | 58 | if(sigaltstack(&stack, NULL) != 0) |
46 | * c-file-style: "linux" | 59 | panic("enabling signal stack failed, errno = %d\n", errno); |
47 | * End: | 60 | } |
61 | |||
62 | void remove_sigstack(void) | ||
63 | { | ||
64 | stack_t stack = ((stack_t) { .ss_flags = SS_DISABLE, | ||
65 | .ss_sp = NULL, | ||
66 | .ss_size = 0 }); | ||
67 | |||
68 | if(sigaltstack(&stack, NULL) != 0) | ||
69 | panic("disabling signal stack failed, errno = %d\n", errno); | ||
70 | } | ||
71 | |||
72 | void set_handler(int sig, void (*handler)(int), int flags, ...) | ||
73 | { | ||
74 | struct sigaction action; | ||
75 | va_list ap; | ||
76 | int mask; | ||
77 | |||
78 | va_start(ap, flags); | ||
79 | action.sa_handler = handler; | ||
80 | sigemptyset(&action.sa_mask); | ||
81 | while((mask = va_arg(ap, int)) != -1){ | ||
82 | sigaddset(&action.sa_mask, mask); | ||
83 | } | ||
84 | va_end(ap); | ||
85 | action.sa_flags = flags; | ||
86 | action.sa_restorer = NULL; | ||
87 | if(sigaction(sig, &action, NULL) < 0) | ||
88 | panic("sigaction failed"); | ||
89 | } | ||
90 | |||
91 | int change_sig(int signal, int on) | ||
92 | { | ||
93 | sigset_t sigset, old; | ||
94 | |||
95 | sigemptyset(&sigset); | ||
96 | sigaddset(&sigset, signal); | ||
97 | sigprocmask(on ? SIG_UNBLOCK : SIG_BLOCK, &sigset, &old); | ||
98 | return(!sigismember(&old, signal)); | ||
99 | } | ||
100 | |||
101 | /* Both here and in set/get_signal we don't touch SIGPROF, because we must not | ||
102 | * disable profiling; it's safe because the profiling code does not interact | ||
103 | * with the kernel code at all.*/ | ||
104 | |||
105 | static void change_signals(int type) | ||
106 | { | ||
107 | sigset_t mask; | ||
108 | |||
109 | sigemptyset(&mask); | ||
110 | sigaddset(&mask, SIGVTALRM); | ||
111 | sigaddset(&mask, SIGALRM); | ||
112 | sigaddset(&mask, SIGIO); | ||
113 | if(sigprocmask(type, &mask, NULL) < 0) | ||
114 | panic("Failed to change signal mask - errno = %d", errno); | ||
115 | } | ||
116 | |||
117 | void block_signals(void) | ||
118 | { | ||
119 | change_signals(SIG_BLOCK); | ||
120 | } | ||
121 | |||
122 | void unblock_signals(void) | ||
123 | { | ||
124 | change_signals(SIG_UNBLOCK); | ||
125 | } | ||
126 | |||
127 | /* These are the asynchronous signals. SIGVTALRM and SIGARLM are handled | ||
128 | * together under SIGVTALRM_BIT. SIGPROF is excluded because we want to | ||
129 | * be able to profile all of UML, not just the non-critical sections. If | ||
130 | * profiling is not thread-safe, then that is not my problem. We can disable | ||
131 | * profiling when SMP is enabled in that case. | ||
48 | */ | 132 | */ |
133 | #define SIGIO_BIT 0 | ||
134 | #define SIGVTALRM_BIT 1 | ||
135 | |||
136 | static int enable_mask(sigset_t *mask) | ||
137 | { | ||
138 | int sigs; | ||
139 | |||
140 | sigs = sigismember(mask, SIGIO) ? 0 : 1 << SIGIO_BIT; | ||
141 | sigs |= sigismember(mask, SIGVTALRM) ? 0 : 1 << SIGVTALRM_BIT; | ||
142 | sigs |= sigismember(mask, SIGALRM) ? 0 : 1 << SIGVTALRM_BIT; | ||
143 | return(sigs); | ||
144 | } | ||
145 | |||
146 | int get_signals(void) | ||
147 | { | ||
148 | sigset_t mask; | ||
149 | |||
150 | if(sigprocmask(SIG_SETMASK, NULL, &mask) < 0) | ||
151 | panic("Failed to get signal mask"); | ||
152 | return(enable_mask(&mask)); | ||
153 | } | ||
154 | |||
155 | int set_signals(int enable) | ||
156 | { | ||
157 | sigset_t mask; | ||
158 | int ret; | ||
159 | |||
160 | sigemptyset(&mask); | ||
161 | if(enable & (1 << SIGIO_BIT)) | ||
162 | sigaddset(&mask, SIGIO); | ||
163 | if(enable & (1 << SIGVTALRM_BIT)){ | ||
164 | sigaddset(&mask, SIGVTALRM); | ||
165 | sigaddset(&mask, SIGALRM); | ||
166 | } | ||
167 | |||
168 | /* This is safe - sigprocmask is guaranteed to copy locally the | ||
169 | * value of new_set, do his work and then, at the end, write to | ||
170 | * old_set. | ||
171 | */ | ||
172 | if(sigprocmask(SIG_UNBLOCK, &mask, &mask) < 0) | ||
173 | panic("Failed to enable signals"); | ||
174 | ret = enable_mask(&mask); | ||
175 | sigemptyset(&mask); | ||
176 | if((enable & (1 << SIGIO_BIT)) == 0) | ||
177 | sigaddset(&mask, SIGIO); | ||
178 | if((enable & (1 << SIGVTALRM_BIT)) == 0){ | ||
179 | sigaddset(&mask, SIGVTALRM); | ||
180 | sigaddset(&mask, SIGALRM); | ||
181 | } | ||
182 | if(sigprocmask(SIG_BLOCK, &mask, NULL) < 0) | ||
183 | panic("Failed to block signals"); | ||
184 | |||
185 | return(ret); | ||
186 | } | ||
diff --git a/arch/um/os-Linux/skas/Makefile b/arch/um/os-Linux/skas/Makefile new file mode 100644 index 000000000000..eab5386d60a7 --- /dev/null +++ b/arch/um/os-Linux/skas/Makefile | |||
@@ -0,0 +1,10 @@ | |||
1 | # | ||
2 | # Copyright (C) 2002 - 2004 Jeff Dike (jdike@addtoit.com) | ||
3 | # Licensed under the GPL | ||
4 | # | ||
5 | |||
6 | obj-y := trap.o | ||
7 | |||
8 | USER_OBJS := trap.o | ||
9 | |||
10 | include arch/um/scripts/Makefile.rules | ||
diff --git a/arch/um/kernel/skas/trap_user.c b/arch/um/os-Linux/skas/trap.c index 9950a6716fe5..9ad5fbec4593 100644 --- a/arch/um/kernel/skas/trap_user.c +++ b/arch/um/os-Linux/skas/trap.c | |||
@@ -1,11 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com) | 2 | * Copyright (C) 2002 - 2003 Jeff Dike (jdike@addtoit.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <signal.h> | 6 | #include <signal.h> |
7 | #include <errno.h> | 7 | #include <errno.h> |
8 | #include "signal_user.h" | ||
9 | #include "user_util.h" | 8 | #include "user_util.h" |
10 | #include "kern_util.h" | 9 | #include "kern_util.h" |
11 | #include "task.h" | 10 | #include "task.h" |
@@ -14,12 +13,13 @@ | |||
14 | #include "ptrace_user.h" | 13 | #include "ptrace_user.h" |
15 | #include "sysdep/ptrace.h" | 14 | #include "sysdep/ptrace.h" |
16 | #include "sysdep/ptrace_user.h" | 15 | #include "sysdep/ptrace_user.h" |
16 | #include "os.h" | ||
17 | 17 | ||
18 | void sig_handler_common_skas(int sig, void *sc_ptr) | 18 | void sig_handler_common_skas(int sig, void *sc_ptr) |
19 | { | 19 | { |
20 | struct sigcontext *sc = sc_ptr; | 20 | struct sigcontext *sc = sc_ptr; |
21 | struct skas_regs *r; | 21 | struct skas_regs *r; |
22 | struct signal_info *info; | 22 | void (*handler)(int, union uml_pt_regs *); |
23 | int save_errno = errno; | 23 | int save_errno = errno; |
24 | int save_user; | 24 | int save_user; |
25 | 25 | ||
@@ -34,17 +34,22 @@ void sig_handler_common_skas(int sig, void *sc_ptr) | |||
34 | r = &TASK_REGS(get_current())->skas; | 34 | r = &TASK_REGS(get_current())->skas; |
35 | save_user = r->is_user; | 35 | save_user = r->is_user; |
36 | r->is_user = 0; | 36 | r->is_user = 0; |
37 | if ( sig == SIGFPE || sig == SIGSEGV || | 37 | if ( sig == SIGFPE || sig == SIGSEGV || |
38 | sig == SIGBUS || sig == SIGILL || | 38 | sig == SIGBUS || sig == SIGILL || |
39 | sig == SIGTRAP ) { | 39 | sig == SIGTRAP ) { |
40 | GET_FAULTINFO_FROM_SC(r->faultinfo, sc); | 40 | GET_FAULTINFO_FROM_SC(r->faultinfo, sc); |
41 | } | 41 | } |
42 | 42 | ||
43 | change_sig(SIGUSR1, 1); | 43 | change_sig(SIGUSR1, 1); |
44 | info = &sig_info[sig]; | ||
45 | if(!info->is_irq) unblock_signals(); | ||
46 | 44 | ||
47 | (*info->handler)(sig, (union uml_pt_regs *) r); | 45 | handler = sig_info[sig]; |
46 | |||
47 | /* unblock SIGALRM, SIGVTALRM, SIGIO if sig isn't IRQ signal */ | ||
48 | if (sig != SIGIO && sig != SIGWINCH && | ||
49 | sig != SIGVTALRM && sig != SIGALRM) | ||
50 | unblock_signals(); | ||
51 | |||
52 | handler(sig, (union uml_pt_regs *) r); | ||
48 | 53 | ||
49 | errno = save_errno; | 54 | errno = save_errno; |
50 | r->is_user = save_user; | 55 | r->is_user = save_user; |
@@ -54,25 +59,15 @@ extern int ptrace_faultinfo; | |||
54 | 59 | ||
55 | void user_signal(int sig, union uml_pt_regs *regs, int pid) | 60 | void user_signal(int sig, union uml_pt_regs *regs, int pid) |
56 | { | 61 | { |
57 | struct signal_info *info; | 62 | void (*handler)(int, union uml_pt_regs *); |
58 | int segv = ((sig == SIGFPE) || (sig == SIGSEGV) || (sig == SIGBUS) || | 63 | int segv = ((sig == SIGFPE) || (sig == SIGSEGV) || (sig == SIGBUS) || |
59 | (sig == SIGILL) || (sig == SIGTRAP)); | 64 | (sig == SIGILL) || (sig == SIGTRAP)); |
60 | 65 | ||
61 | if (segv) | 66 | if (segv) |
62 | get_skas_faultinfo(pid, ®s->skas.faultinfo); | 67 | get_skas_faultinfo(pid, ®s->skas.faultinfo); |
63 | info = &sig_info[sig]; | 68 | |
64 | (*info->handler)(sig, regs); | 69 | handler = sig_info[sig]; |
70 | handler(sig, (union uml_pt_regs *) regs); | ||
65 | 71 | ||
66 | unblock_signals(); | 72 | unblock_signals(); |
67 | } | 73 | } |
68 | |||
69 | /* | ||
70 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
71 | * Emacs will notice this stuff at the end of the file and automatically | ||
72 | * adjust the settings for this buffer only. This must remain at the end | ||
73 | * of the file. | ||
74 | * --------------------------------------------------------------------------- | ||
75 | * Local variables: | ||
76 | * c-file-style: "linux" | ||
77 | * End: | ||
78 | */ | ||
diff --git a/arch/um/os-Linux/start_up.c b/arch/um/os-Linux/start_up.c index 29a9e3f43763..b47e5e71d1a5 100644 --- a/arch/um/os-Linux/start_up.c +++ b/arch/um/os-Linux/start_up.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include "kern_util.h" | 24 | #include "kern_util.h" |
25 | #include "user.h" | 25 | #include "user.h" |
26 | #include "signal_kern.h" | 26 | #include "signal_kern.h" |
27 | #include "signal_user.h" | ||
28 | #include "sysdep/ptrace.h" | 27 | #include "sysdep/ptrace.h" |
29 | #include "sysdep/sigcontext.h" | 28 | #include "sysdep/sigcontext.h" |
30 | #include "irq_user.h" | 29 | #include "irq_user.h" |
diff --git a/arch/um/os-Linux/trap.c b/arch/um/os-Linux/trap.c new file mode 100644 index 000000000000..321e1c8e227d --- /dev/null +++ b/arch/um/os-Linux/trap.c | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | ||
3 | * Licensed under the GPL | ||
4 | */ | ||
5 | |||
6 | #include <stdlib.h> | ||
7 | #include <signal.h> | ||
8 | #include <setjmp.h> | ||
9 | #include "kern_util.h" | ||
10 | #include "user_util.h" | ||
11 | #include "os.h" | ||
12 | #include "mode.h" | ||
13 | |||
14 | void usr2_handler(int sig, union uml_pt_regs *regs) | ||
15 | { | ||
16 | CHOOSE_MODE(syscall_handler_tt(sig, regs), (void) 0); | ||
17 | } | ||
18 | |||
19 | void (*sig_info[NSIG])(int, union uml_pt_regs *); | ||
20 | |||
21 | void os_fill_handlinfo(struct kern_handlers h) | ||
22 | { | ||
23 | sig_info[SIGTRAP] = h.relay_signal; | ||
24 | sig_info[SIGFPE] = h.relay_signal; | ||
25 | sig_info[SIGILL] = h.relay_signal; | ||
26 | sig_info[SIGWINCH] = h.winch; | ||
27 | sig_info[SIGBUS] = h.bus_handler; | ||
28 | sig_info[SIGSEGV] = h.page_fault; | ||
29 | sig_info[SIGIO] = h.sigio_handler; | ||
30 | sig_info[SIGVTALRM] = h.timer_handler; | ||
31 | sig_info[SIGALRM] = h.timer_handler; | ||
32 | sig_info[SIGUSR2] = usr2_handler; | ||
33 | } | ||
34 | |||
35 | void do_longjmp(void *b, int val) | ||
36 | { | ||
37 | sigjmp_buf *buf = b; | ||
38 | |||
39 | siglongjmp(*buf, val); | ||
40 | } | ||
diff --git a/arch/um/os-Linux/tt.c b/arch/um/os-Linux/tt.c index a6db8877931a..cb2648b79d0f 100644 --- a/arch/um/os-Linux/tt.c +++ b/arch/um/os-Linux/tt.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include "kern_util.h" | 23 | #include "kern_util.h" |
24 | #include "user.h" | 24 | #include "user.h" |
25 | #include "signal_kern.h" | 25 | #include "signal_kern.h" |
26 | #include "signal_user.h" | ||
27 | #include "sysdep/ptrace.h" | 26 | #include "sysdep/ptrace.h" |
28 | #include "sysdep/sigcontext.h" | 27 | #include "sysdep/sigcontext.h" |
29 | #include "irq_user.h" | 28 | #include "irq_user.h" |
@@ -50,6 +49,20 @@ int protect_memory(unsigned long addr, unsigned long len, int r, int w, int x, | |||
50 | return(0); | 49 | return(0); |
51 | } | 50 | } |
52 | 51 | ||
52 | void kill_child_dead(int pid) | ||
53 | { | ||
54 | kill(pid, SIGKILL); | ||
55 | kill(pid, SIGCONT); | ||
56 | do { | ||
57 | int n; | ||
58 | CATCH_EINTR(n = waitpid(pid, NULL, 0)); | ||
59 | if (n > 0) | ||
60 | kill(pid, SIGCONT); | ||
61 | else | ||
62 | break; | ||
63 | } while(1); | ||
64 | } | ||
65 | |||
53 | /* | 66 | /* |
54 | *------------------------- | 67 | *------------------------- |
55 | * only for tt mode (will be deleted in future...) | 68 | * only for tt mode (will be deleted in future...) |
diff --git a/arch/um/sys-i386/signal.c b/arch/um/sys-i386/signal.c index 16bc19928b3c..7cd1a82dc8c2 100644 --- a/arch/um/sys-i386/signal.c +++ b/arch/um/sys-i386/signal.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include "asm/uaccess.h" | 10 | #include "asm/uaccess.h" |
11 | #include "asm/unistd.h" | 11 | #include "asm/unistd.h" |
12 | #include "frame_kern.h" | 12 | #include "frame_kern.h" |
13 | #include "signal_user.h" | ||
14 | #include "sigcontext.h" | 13 | #include "sigcontext.h" |
15 | #include "registers.h" | 14 | #include "registers.h" |
16 | #include "mode.h" | 15 | #include "mode.h" |
diff --git a/arch/v850/Kconfig b/arch/v850/Kconfig index 310865903234..04494638b963 100644 --- a/arch/v850/Kconfig +++ b/arch/v850/Kconfig | |||
@@ -10,9 +10,6 @@ mainmenu "uClinux/v850 (w/o MMU) Kernel Configuration" | |||
10 | config MMU | 10 | config MMU |
11 | bool | 11 | bool |
12 | default n | 12 | default n |
13 | config UID16 | ||
14 | bool | ||
15 | default n | ||
16 | config RWSEM_GENERIC_SPINLOCK | 13 | config RWSEM_GENERIC_SPINLOCK |
17 | bool | 14 | bool |
18 | default y | 15 | default y |
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index 6ece645e4dbe..4f3e925962c3 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig | |||
@@ -542,11 +542,6 @@ config SYSVIPC_COMPAT | |||
542 | depends on COMPAT && SYSVIPC | 542 | depends on COMPAT && SYSVIPC |
543 | default y | 543 | default y |
544 | 544 | ||
545 | config UID16 | ||
546 | bool | ||
547 | depends on IA32_EMULATION | ||
548 | default y | ||
549 | |||
550 | endmenu | 545 | endmenu |
551 | 546 | ||
552 | source "net/Kconfig" | 547 | source "net/Kconfig" |
diff --git a/arch/x86_64/boot/compressed/misc.c b/arch/x86_64/boot/compressed/misc.c index 0e10fd84c7cc..cf4b88c416dc 100644 --- a/arch/x86_64/boot/compressed/misc.c +++ b/arch/x86_64/boot/compressed/misc.c | |||
@@ -9,7 +9,7 @@ | |||
9 | * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996 | 9 | * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996 |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include "miscsetup.h" | 12 | #include <linux/screen_info.h> |
13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | #include <asm/page.h> | 14 | #include <asm/page.h> |
15 | 15 | ||
diff --git a/arch/x86_64/boot/compressed/miscsetup.h b/arch/x86_64/boot/compressed/miscsetup.h deleted file mode 100644 index bb1620531703..000000000000 --- a/arch/x86_64/boot/compressed/miscsetup.h +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | #define NULL 0 | ||
2 | //typedef unsigned int size_t; | ||
3 | |||
4 | |||
5 | struct screen_info { | ||
6 | unsigned char orig_x; /* 0x00 */ | ||
7 | unsigned char orig_y; /* 0x01 */ | ||
8 | unsigned short dontuse1; /* 0x02 -- EXT_MEM_K sits here */ | ||
9 | unsigned short orig_video_page; /* 0x04 */ | ||
10 | unsigned char orig_video_mode; /* 0x06 */ | ||
11 | unsigned char orig_video_cols; /* 0x07 */ | ||
12 | unsigned short unused2; /* 0x08 */ | ||
13 | unsigned short orig_video_ega_bx; /* 0x0a */ | ||
14 | unsigned short unused3; /* 0x0c */ | ||
15 | unsigned char orig_video_lines; /* 0x0e */ | ||
16 | unsigned char orig_video_isVGA; /* 0x0f */ | ||
17 | unsigned short orig_video_points; /* 0x10 */ | ||
18 | |||
19 | /* VESA graphic mode -- linear frame buffer */ | ||
20 | unsigned short lfb_width; /* 0x12 */ | ||
21 | unsigned short lfb_height; /* 0x14 */ | ||
22 | unsigned short lfb_depth; /* 0x16 */ | ||
23 | unsigned long lfb_base; /* 0x18 */ | ||
24 | unsigned long lfb_size; /* 0x1c */ | ||
25 | unsigned short dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */ | ||
26 | unsigned short lfb_linelength; /* 0x24 */ | ||
27 | unsigned char red_size; /* 0x26 */ | ||
28 | unsigned char red_pos; /* 0x27 */ | ||
29 | unsigned char green_size; /* 0x28 */ | ||
30 | unsigned char green_pos; /* 0x29 */ | ||
31 | unsigned char blue_size; /* 0x2a */ | ||
32 | unsigned char blue_pos; /* 0x2b */ | ||
33 | unsigned char rsvd_size; /* 0x2c */ | ||
34 | unsigned char rsvd_pos; /* 0x2d */ | ||
35 | unsigned short vesapm_seg; /* 0x2e */ | ||
36 | unsigned short vesapm_off; /* 0x30 */ | ||
37 | unsigned short pages; /* 0x32 */ | ||
38 | /* 0x34 -- 0x3f reserved for future expansion */ | ||
39 | }; | ||
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S index df0773c9bdbe..1f0ff5adc80e 100644 --- a/arch/x86_64/ia32/ia32entry.S +++ b/arch/x86_64/ia32/ia32entry.S | |||
@@ -643,6 +643,7 @@ ia32_sys_call_table: | |||
643 | .quad sys_inotify_init | 643 | .quad sys_inotify_init |
644 | .quad sys_inotify_add_watch | 644 | .quad sys_inotify_add_watch |
645 | .quad sys_inotify_rm_watch | 645 | .quad sys_inotify_rm_watch |
646 | .quad sys_migrate_pages | ||
646 | ia32_syscall_end: | 647 | ia32_syscall_end: |
647 | .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 | 648 | .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8 |
648 | .quad ni_syscall | 649 | .quad ni_syscall |
diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86_64/ia32/ptrace32.c index 2a925e2af390..5f4cdfa56901 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86_64/ia32/ptrace32.c | |||
@@ -196,36 +196,6 @@ static int getreg32(struct task_struct *child, unsigned regno, u32 *val) | |||
196 | 196 | ||
197 | #undef R32 | 197 | #undef R32 |
198 | 198 | ||
199 | static struct task_struct *find_target(int request, int pid, int *err) | ||
200 | { | ||
201 | struct task_struct *child; | ||
202 | |||
203 | *err = -EPERM; | ||
204 | if (pid == 1) | ||
205 | return NULL; | ||
206 | |||
207 | *err = -ESRCH; | ||
208 | read_lock(&tasklist_lock); | ||
209 | child = find_task_by_pid(pid); | ||
210 | if (child) | ||
211 | get_task_struct(child); | ||
212 | read_unlock(&tasklist_lock); | ||
213 | if (child) { | ||
214 | *err = -EPERM; | ||
215 | if (child->pid == 1) | ||
216 | goto out; | ||
217 | *err = ptrace_check_attach(child, request == PTRACE_KILL); | ||
218 | if (*err < 0) | ||
219 | goto out; | ||
220 | return child; | ||
221 | } | ||
222 | out: | ||
223 | if (child) | ||
224 | put_task_struct(child); | ||
225 | return NULL; | ||
226 | |||
227 | } | ||
228 | |||
229 | asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) | 199 | asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) |
230 | { | 200 | { |
231 | struct task_struct *child; | 201 | struct task_struct *child; |
@@ -254,9 +224,16 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) | |||
254 | break; | 224 | break; |
255 | } | 225 | } |
256 | 226 | ||
257 | child = find_target(request, pid, &ret); | 227 | if (request == PTRACE_TRACEME) |
258 | if (!child) | 228 | return ptrace_traceme(); |
259 | return ret; | 229 | |
230 | child = ptrace_get_task_struct(pid); | ||
231 | if (IS_ERR(child)) | ||
232 | return PTR_ERR(child); | ||
233 | |||
234 | ret = ptrace_check_attach(child, request == PTRACE_KILL); | ||
235 | if (ret < 0) | ||
236 | goto out; | ||
260 | 237 | ||
261 | childregs = (struct pt_regs *)(child->thread.rsp0 - sizeof(struct pt_regs)); | 238 | childregs = (struct pt_regs *)(child->thread.rsp0 - sizeof(struct pt_regs)); |
262 | 239 | ||
@@ -373,6 +350,7 @@ asmlinkage long sys32_ptrace(long request, u32 pid, u32 addr, u32 data) | |||
373 | break; | 350 | break; |
374 | } | 351 | } |
375 | 352 | ||
353 | out: | ||
376 | put_task_struct(child); | 354 | put_task_struct(child); |
377 | return ret; | 355 | return ret; |
378 | } | 356 | } |
diff --git a/arch/x86_64/kernel/init_task.c b/arch/x86_64/kernel/init_task.c index e0ba5c1043fd..ce31d904d601 100644 --- a/arch/x86_64/kernel/init_task.c +++ b/arch/x86_64/kernel/init_task.c | |||
@@ -44,6 +44,6 @@ EXPORT_SYMBOL(init_task); | |||
44 | * section. Since TSS's are completely CPU-local, we want them | 44 | * section. Since TSS's are completely CPU-local, we want them |
45 | * on exact cacheline boundaries, to eliminate cacheline ping-pong. | 45 | * on exact cacheline boundaries, to eliminate cacheline ping-pong. |
46 | */ | 46 | */ |
47 | DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_maxaligned_in_smp = INIT_TSS; | 47 | DEFINE_PER_CPU(struct tss_struct, init_tss) ____cacheline_internodealigned_in_smp = INIT_TSS; |
48 | 48 | ||
49 | #define ALIGN_TO_4K __attribute__((section(".data.init_task"))) | 49 | #define ALIGN_TO_4K __attribute__((section(".data.init_task"))) |
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index 74102796e5c0..43c9fa0f8d5f 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c | |||
@@ -1075,8 +1075,6 @@ device_initcall(time_init_device); | |||
1075 | */ | 1075 | */ |
1076 | #include <linux/rtc.h> | 1076 | #include <linux/rtc.h> |
1077 | 1077 | ||
1078 | extern irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs); | ||
1079 | |||
1080 | #define DEFAULT_RTC_INT_FREQ 64 | 1078 | #define DEFAULT_RTC_INT_FREQ 64 |
1081 | #define RTC_NUM_INTS 1 | 1079 | #define RTC_NUM_INTS 1 |
1082 | 1080 | ||