diff options
Diffstat (limited to 'arch')
45 files changed, 319 insertions, 622 deletions
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index 39b06ed80646..0a41080d2266 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c | |||
@@ -123,7 +123,7 @@ static void __init ixdp425_init(void) | |||
123 | platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); | 123 | platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); |
124 | } | 124 | } |
125 | 125 | ||
126 | #ifdef CONFIG_ARCH_IXDP465 | 126 | #ifdef CONFIG_ARCH_IXDP425 |
127 | MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") | 127 | MACHINE_START(IXDP425, "Intel IXDP425 Development Platform") |
128 | /* Maintainer: MontaVista Software, Inc. */ | 128 | /* Maintainer: MontaVista Software, Inc. */ |
129 | .phys_ram = PHYS_OFFSET, | 129 | .phys_ram = PHYS_OFFSET, |
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c index 6a291e6fdabd..a30e0451df72 100644 --- a/arch/arm/mach-versatile/core.c +++ b/arch/arm/mach-versatile/core.c | |||
@@ -51,8 +51,9 @@ | |||
51 | * | 51 | * |
52 | * Setup a VA for the Versatile Vectored Interrupt Controller. | 52 | * Setup a VA for the Versatile Vectored Interrupt Controller. |
53 | */ | 53 | */ |
54 | #define VA_VIC_BASE IO_ADDRESS(VERSATILE_VIC_BASE) | 54 | #define __io_address(n) __io(IO_ADDRESS(n)) |
55 | #define VA_SIC_BASE IO_ADDRESS(VERSATILE_SIC_BASE) | 55 | #define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE) |
56 | #define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE) | ||
56 | 57 | ||
57 | static void vic_mask_irq(unsigned int irq) | 58 | static void vic_mask_irq(unsigned int irq) |
58 | { | 59 | { |
@@ -213,7 +214,7 @@ void __init versatile_map_io(void) | |||
213 | iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); | 214 | iotable_init(versatile_io_desc, ARRAY_SIZE(versatile_io_desc)); |
214 | } | 215 | } |
215 | 216 | ||
216 | #define VERSATILE_REFCOUNTER (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET) | 217 | #define VERSATILE_REFCOUNTER (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_24MHz_OFFSET) |
217 | 218 | ||
218 | /* | 219 | /* |
219 | * This is the Versatile sched_clock implementation. This has | 220 | * This is the Versatile sched_clock implementation. This has |
@@ -230,7 +231,7 @@ unsigned long long sched_clock(void) | |||
230 | } | 231 | } |
231 | 232 | ||
232 | 233 | ||
233 | #define VERSATILE_FLASHCTRL (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) | 234 | #define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) |
234 | 235 | ||
235 | static int versatile_flash_init(void) | 236 | static int versatile_flash_init(void) |
236 | { | 237 | { |
@@ -308,7 +309,7 @@ static struct platform_device smc91x_device = { | |||
308 | .resource = smc91x_resources, | 309 | .resource = smc91x_resources, |
309 | }; | 310 | }; |
310 | 311 | ||
311 | #define VERSATILE_SYSMCI (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET) | 312 | #define VERSATILE_SYSMCI (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_MCI_OFFSET) |
312 | 313 | ||
313 | unsigned int mmc_status(struct device *dev) | 314 | unsigned int mmc_status(struct device *dev) |
314 | { | 315 | { |
@@ -342,11 +343,11 @@ static const struct icst307_params versatile_oscvco_params = { | |||
342 | 343 | ||
343 | static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) | 344 | static void versatile_oscvco_set(struct clk *clk, struct icst307_vco vco) |
344 | { | 345 | { |
345 | unsigned long sys_lock = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; | 346 | void __iomem *sys_lock = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LOCK_OFFSET; |
346 | #if defined(CONFIG_ARCH_VERSATILE_PB) | 347 | #if defined(CONFIG_ARCH_VERSATILE_PB) |
347 | unsigned long sys_osc = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC4_OFFSET; | 348 | void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC4_OFFSET; |
348 | #elif defined(CONFIG_MACH_VERSATILE_AB) | 349 | #elif defined(CONFIG_MACH_VERSATILE_AB) |
349 | unsigned long sys_osc = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC1_OFFSET; | 350 | void __iomem *sys_osc = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_OSC1_OFFSET; |
350 | #endif | 351 | #endif |
351 | u32 val; | 352 | u32 val; |
352 | 353 | ||
@@ -482,7 +483,7 @@ static struct clcd_panel epson_2_2_in = { | |||
482 | */ | 483 | */ |
483 | static struct clcd_panel *versatile_clcd_panel(void) | 484 | static struct clcd_panel *versatile_clcd_panel(void) |
484 | { | 485 | { |
485 | unsigned long sys_clcd = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; | 486 | void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; |
486 | struct clcd_panel *panel = &vga; | 487 | struct clcd_panel *panel = &vga; |
487 | u32 val; | 488 | u32 val; |
488 | 489 | ||
@@ -509,7 +510,7 @@ static struct clcd_panel *versatile_clcd_panel(void) | |||
509 | */ | 510 | */ |
510 | static void versatile_clcd_disable(struct clcd_fb *fb) | 511 | static void versatile_clcd_disable(struct clcd_fb *fb) |
511 | { | 512 | { |
512 | unsigned long sys_clcd = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; | 513 | void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; |
513 | u32 val; | 514 | u32 val; |
514 | 515 | ||
515 | val = readl(sys_clcd); | 516 | val = readl(sys_clcd); |
@@ -521,7 +522,7 @@ static void versatile_clcd_disable(struct clcd_fb *fb) | |||
521 | * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off | 522 | * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light off |
522 | */ | 523 | */ |
523 | if (fb->panel == &sanyo_2_5_in) { | 524 | if (fb->panel == &sanyo_2_5_in) { |
524 | unsigned long versatile_ib2_ctrl = IO_ADDRESS(VERSATILE_IB2_CTRL); | 525 | void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); |
525 | unsigned long ctrl; | 526 | unsigned long ctrl; |
526 | 527 | ||
527 | ctrl = readl(versatile_ib2_ctrl); | 528 | ctrl = readl(versatile_ib2_ctrl); |
@@ -536,7 +537,7 @@ static void versatile_clcd_disable(struct clcd_fb *fb) | |||
536 | */ | 537 | */ |
537 | static void versatile_clcd_enable(struct clcd_fb *fb) | 538 | static void versatile_clcd_enable(struct clcd_fb *fb) |
538 | { | 539 | { |
539 | unsigned long sys_clcd = IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; | 540 | void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET; |
540 | u32 val; | 541 | u32 val; |
541 | 542 | ||
542 | val = readl(sys_clcd); | 543 | val = readl(sys_clcd); |
@@ -570,7 +571,7 @@ static void versatile_clcd_enable(struct clcd_fb *fb) | |||
570 | * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on | 571 | * If the LCD is Sanyo 2x5 in on the IB2 board, turn the back-light on |
571 | */ | 572 | */ |
572 | if (fb->panel == &sanyo_2_5_in) { | 573 | if (fb->panel == &sanyo_2_5_in) { |
573 | unsigned long versatile_ib2_ctrl = IO_ADDRESS(VERSATILE_IB2_CTRL); | 574 | void __iomem *versatile_ib2_ctrl = __io_address(VERSATILE_IB2_CTRL); |
574 | unsigned long ctrl; | 575 | unsigned long ctrl; |
575 | 576 | ||
576 | ctrl = readl(versatile_ib2_ctrl); | 577 | ctrl = readl(versatile_ib2_ctrl); |
@@ -719,7 +720,7 @@ static struct amba_device *amba_devs[] __initdata = { | |||
719 | }; | 720 | }; |
720 | 721 | ||
721 | #ifdef CONFIG_LEDS | 722 | #ifdef CONFIG_LEDS |
722 | #define VA_LEDS_BASE (IO_ADDRESS(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET) | 723 | #define VA_LEDS_BASE (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_LED_OFFSET) |
723 | 724 | ||
724 | static void versatile_leds_event(led_event_t ledevt) | 725 | static void versatile_leds_event(led_event_t ledevt) |
725 | { | 726 | { |
@@ -777,11 +778,11 @@ void __init versatile_init(void) | |||
777 | /* | 778 | /* |
778 | * Where is the timer (VA)? | 779 | * Where is the timer (VA)? |
779 | */ | 780 | */ |
780 | #define TIMER0_VA_BASE IO_ADDRESS(VERSATILE_TIMER0_1_BASE) | 781 | #define TIMER0_VA_BASE __io_address(VERSATILE_TIMER0_1_BASE) |
781 | #define TIMER1_VA_BASE (IO_ADDRESS(VERSATILE_TIMER0_1_BASE) + 0x20) | 782 | #define TIMER1_VA_BASE (__io_address(VERSATILE_TIMER0_1_BASE) + 0x20) |
782 | #define TIMER2_VA_BASE IO_ADDRESS(VERSATILE_TIMER2_3_BASE) | 783 | #define TIMER2_VA_BASE __io_address(VERSATILE_TIMER2_3_BASE) |
783 | #define TIMER3_VA_BASE (IO_ADDRESS(VERSATILE_TIMER2_3_BASE) + 0x20) | 784 | #define TIMER3_VA_BASE (__io_address(VERSATILE_TIMER2_3_BASE) + 0x20) |
784 | #define VA_IC_BASE IO_ADDRESS(VERSATILE_VIC_BASE) | 785 | #define VA_IC_BASE __io_address(VERSATILE_VIC_BASE) |
785 | 786 | ||
786 | /* | 787 | /* |
787 | * How long is the timer interval? | 788 | * How long is the timer interval? |
@@ -876,12 +877,12 @@ static void __init versatile_timer_init(void) | |||
876 | * VERSATILE_REFCLK is 32KHz | 877 | * VERSATILE_REFCLK is 32KHz |
877 | * VERSATILE_TIMCLK is 1MHz | 878 | * VERSATILE_TIMCLK is 1MHz |
878 | */ | 879 | */ |
879 | val = readl(IO_ADDRESS(VERSATILE_SCTL_BASE)); | 880 | val = readl(__io_address(VERSATILE_SCTL_BASE)); |
880 | writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) | | 881 | writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) | |
881 | (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) | | 882 | (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) | |
882 | (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) | | 883 | (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) | |
883 | (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val, | 884 | (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val, |
884 | IO_ADDRESS(VERSATILE_SCTL_BASE)); | 885 | __io_address(VERSATILE_SCTL_BASE)); |
885 | 886 | ||
886 | /* | 887 | /* |
887 | * Initialise to a known state (all timers off) | 888 | * Initialise to a known state (all timers off) |
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c index 73aeaf5a9d4e..4c1ddf2b57cc 100644 --- a/arch/i386/kernel/cpu/amd.c +++ b/arch/i386/kernel/cpu/amd.c | |||
@@ -28,6 +28,22 @@ static void __init init_amd(struct cpuinfo_x86 *c) | |||
28 | int mbytes = num_physpages >> (20-PAGE_SHIFT); | 28 | int mbytes = num_physpages >> (20-PAGE_SHIFT); |
29 | int r; | 29 | int r; |
30 | 30 | ||
31 | #ifdef CONFIG_SMP | ||
32 | unsigned long value; | ||
33 | |||
34 | /* Disable TLB flush filter by setting HWCR.FFDIS on K8 | ||
35 | * bit 6 of msr C001_0015 | ||
36 | * | ||
37 | * Errata 63 for SH-B3 steppings | ||
38 | * Errata 122 for all steppings (F+ have it disabled by default) | ||
39 | */ | ||
40 | if (c->x86 == 15) { | ||
41 | rdmsrl(MSR_K7_HWCR, value); | ||
42 | value |= 1 << 6; | ||
43 | wrmsrl(MSR_K7_HWCR, value); | ||
44 | } | ||
45 | #endif | ||
46 | |||
31 | /* | 47 | /* |
32 | * FIXME: We should handle the K5 here. Set up the write | 48 | * FIXME: We should handle the K5 here. Set up the write |
33 | * range and also turn on MSR 83 bits 4 and 31 (write alloc, | 49 | * range and also turn on MSR 83 bits 4 and 31 (write alloc, |
diff --git a/arch/ppc/boot/ld.script b/arch/ppc/boot/ld.script index 9362193742ac..d4dd8f15395e 100644 --- a/arch/ppc/boot/ld.script +++ b/arch/ppc/boot/ld.script | |||
@@ -1,4 +1,4 @@ | |||
1 | OUTPUT_ARCH(powerpc) | 1 | OUTPUT_ARCH(powerpc:common) |
2 | SECTIONS | 2 | SECTIONS |
3 | { | 3 | { |
4 | /* Read-only sections, merged into text segment: */ | 4 | /* Read-only sections, merged into text segment: */ |
diff --git a/arch/ppc/syslib/mv64x60.c b/arch/ppc/syslib/mv64x60.c index 839f8872826f..4849850a59ed 100644 --- a/arch/ppc/syslib/mv64x60.c +++ b/arch/ppc/syslib/mv64x60.c | |||
@@ -34,7 +34,7 @@ u8 mv64x60_pci_exclude_bridge = 1; | |||
34 | DEFINE_SPINLOCK(mv64x60_lock); | 34 | DEFINE_SPINLOCK(mv64x60_lock); |
35 | 35 | ||
36 | static phys_addr_t mv64x60_bridge_pbase; | 36 | static phys_addr_t mv64x60_bridge_pbase; |
37 | static void *mv64x60_bridge_vbase; | 37 | static void __iomem *mv64x60_bridge_vbase; |
38 | static u32 mv64x60_bridge_type = MV64x60_TYPE_INVALID; | 38 | static u32 mv64x60_bridge_type = MV64x60_TYPE_INVALID; |
39 | static u32 mv64x60_bridge_rev; | 39 | static u32 mv64x60_bridge_rev; |
40 | #if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260) | 40 | #if defined(CONFIG_SYSFS) && !defined(CONFIG_GT64260) |
@@ -938,7 +938,7 @@ mv64x60_setup_for_chip(struct mv64x60_handle *bh) | |||
938 | * | 938 | * |
939 | * Return the virtual address of the bridge's registers. | 939 | * Return the virtual address of the bridge's registers. |
940 | */ | 940 | */ |
941 | void * | 941 | void __iomem * |
942 | mv64x60_get_bridge_vbase(void) | 942 | mv64x60_get_bridge_vbase(void) |
943 | { | 943 | { |
944 | return mv64x60_bridge_vbase; | 944 | return mv64x60_bridge_vbase; |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index 7358cdb8441f..4ff6808456ea 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -143,7 +143,7 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) | |||
143 | break; | 143 | break; |
144 | case __SI_FAULT >> 16: | 144 | case __SI_FAULT >> 16: |
145 | err |= __get_user(tmp, &from->si_addr); | 145 | err |= __get_user(tmp, &from->si_addr); |
146 | to->si_addr = (void *)(u64) (tmp & PSW32_ADDR_INSN); | 146 | to->si_addr = (void __user *)(u64) (tmp & PSW32_ADDR_INSN); |
147 | break; | 147 | break; |
148 | case __SI_POLL >> 16: | 148 | case __SI_POLL >> 16: |
149 | err |= __get_user(to->si_band, &from->si_band); | 149 | err |= __get_user(to->si_band, &from->si_band); |
@@ -338,7 +338,7 @@ sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss, | |||
338 | err |= __get_user(kss.ss_flags, &uss->ss_flags); | 338 | err |= __get_user(kss.ss_flags, &uss->ss_flags); |
339 | if (err) | 339 | if (err) |
340 | return -EFAULT; | 340 | return -EFAULT; |
341 | kss.ss_sp = (void *) ss_sp; | 341 | kss.ss_sp = (void __user *) ss_sp; |
342 | } | 342 | } |
343 | 343 | ||
344 | set_fs (KERNEL_DS); | 344 | set_fs (KERNEL_DS); |
@@ -461,7 +461,7 @@ asmlinkage long sys32_rt_sigreturn(struct pt_regs *regs) | |||
461 | goto badframe; | 461 | goto badframe; |
462 | 462 | ||
463 | err = __get_user(ss_sp, &frame->uc.uc_stack.ss_sp); | 463 | err = __get_user(ss_sp, &frame->uc.uc_stack.ss_sp); |
464 | st.ss_sp = (void *) A((unsigned long)ss_sp); | 464 | st.ss_sp = compat_ptr(ss_sp); |
465 | err |= __get_user(st.ss_size, &frame->uc.uc_stack.ss_size); | 465 | err |= __get_user(st.ss_size, &frame->uc.uc_stack.ss_size); |
466 | err |= __get_user(st.ss_flags, &frame->uc.uc_stack.ss_flags); | 466 | err |= __get_user(st.ss_flags, &frame->uc.uc_stack.ss_flags); |
467 | if (err) | 467 | if (err) |
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c index 6a3f5b7473a9..6e0110d71191 100644 --- a/arch/s390/kernel/signal.c +++ b/arch/s390/kernel/signal.c | |||
@@ -376,8 +376,8 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
376 | 376 | ||
377 | /* Create the ucontext. */ | 377 | /* Create the ucontext. */ |
378 | err |= __put_user(0, &frame->uc.uc_flags); | 378 | err |= __put_user(0, &frame->uc.uc_flags); |
379 | err |= __put_user(0, &frame->uc.uc_link); | 379 | err |= __put_user(NULL, &frame->uc.uc_link); |
380 | err |= __put_user((void *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); | 380 | err |= __put_user((void __user *)current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); |
381 | err |= __put_user(sas_ss_flags(regs->gprs[15]), | 381 | err |= __put_user(sas_ss_flags(regs->gprs[15]), |
382 | &frame->uc.uc_stack.ss_flags); | 382 | &frame->uc.uc_stack.ss_flags); |
383 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); | 383 | err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); |
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c index 48756958116b..77ef5df4e5a7 100644 --- a/arch/sparc64/kernel/cpu.c +++ b/arch/sparc64/kernel/cpu.c | |||
@@ -39,6 +39,8 @@ struct cpu_fp_info linux_sparc_fpu[] = { | |||
39 | { 0x3e, 0x15, 0, "UltraSparc III+ integrated FPU"}, | 39 | { 0x3e, 0x15, 0, "UltraSparc III+ integrated FPU"}, |
40 | { 0x3e, 0x16, 0, "UltraSparc IIIi integrated FPU"}, | 40 | { 0x3e, 0x16, 0, "UltraSparc IIIi integrated FPU"}, |
41 | { 0x3e, 0x18, 0, "UltraSparc IV integrated FPU"}, | 41 | { 0x3e, 0x18, 0, "UltraSparc IV integrated FPU"}, |
42 | { 0x3e, 0x19, 0, "UltraSparc IV+ integrated FPU"}, | ||
43 | { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"}, | ||
42 | }; | 44 | }; |
43 | 45 | ||
44 | #define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) | 46 | #define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info)) |
@@ -53,6 +55,8 @@ struct cpu_iu_info linux_sparc_chips[] = { | |||
53 | { 0x3e, 0x15, "TI UltraSparc III+ (Cheetah+)"}, | 55 | { 0x3e, 0x15, "TI UltraSparc III+ (Cheetah+)"}, |
54 | { 0x3e, 0x16, "TI UltraSparc IIIi (Jalapeno)"}, | 56 | { 0x3e, 0x16, "TI UltraSparc IIIi (Jalapeno)"}, |
55 | { 0x3e, 0x18, "TI UltraSparc IV (Jaguar)"}, | 57 | { 0x3e, 0x18, "TI UltraSparc IV (Jaguar)"}, |
58 | { 0x3e, 0x19, "TI UltraSparc IV+ (Panther)"}, | ||
59 | { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"}, | ||
56 | }; | 60 | }; |
57 | 61 | ||
58 | #define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) | 62 | #define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info)) |
diff --git a/arch/sparc64/kernel/unaligned.c b/arch/sparc64/kernel/unaligned.c index 42718f6a7d36..02af08ffec8f 100644 --- a/arch/sparc64/kernel/unaligned.c +++ b/arch/sparc64/kernel/unaligned.c | |||
@@ -294,7 +294,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u | |||
294 | 294 | ||
295 | kernel_mna_trap_fault(); | 295 | kernel_mna_trap_fault(); |
296 | } else { | 296 | } else { |
297 | unsigned long addr; | 297 | unsigned long addr, *reg_addr; |
298 | int orig_asi, asi; | 298 | int orig_asi, asi; |
299 | 299 | ||
300 | addr = compute_effective_address(regs, insn, | 300 | addr = compute_effective_address(regs, insn, |
@@ -319,11 +319,11 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u | |||
319 | }; | 319 | }; |
320 | switch (dir) { | 320 | switch (dir) { |
321 | case load: | 321 | case load: |
322 | do_int_load(fetch_reg_addr(((insn>>25)&0x1f), regs), | 322 | reg_addr = fetch_reg_addr(((insn>>25)&0x1f), regs); |
323 | size, (unsigned long *) addr, | 323 | do_int_load(reg_addr, size, (unsigned long *) addr, |
324 | decode_signedness(insn), asi); | 324 | decode_signedness(insn), asi); |
325 | if (unlikely(asi != orig_asi)) { | 325 | if (unlikely(asi != orig_asi)) { |
326 | unsigned long val_in = *(unsigned long *) addr; | 326 | unsigned long val_in = *reg_addr; |
327 | switch (size) { | 327 | switch (size) { |
328 | case 2: | 328 | case 2: |
329 | val_in = swab16(val_in); | 329 | val_in = swab16(val_in); |
@@ -339,7 +339,7 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn, u | |||
339 | BUG(); | 339 | BUG(); |
340 | break; | 340 | break; |
341 | }; | 341 | }; |
342 | *(unsigned long *) addr = val_in; | 342 | *reg_addr = val_in; |
343 | } | 343 | } |
344 | break; | 344 | break; |
345 | 345 | ||
diff --git a/arch/sparc64/kernel/us3_cpufreq.c b/arch/sparc64/kernel/us3_cpufreq.c index 9080e7cd4bb0..0340041f6143 100644 --- a/arch/sparc64/kernel/us3_cpufreq.c +++ b/arch/sparc64/kernel/us3_cpufreq.c | |||
@@ -208,7 +208,10 @@ static int __init us3_freq_init(void) | |||
208 | impl = ((ver >> 32) & 0xffff); | 208 | impl = ((ver >> 32) & 0xffff); |
209 | 209 | ||
210 | if (manuf == CHEETAH_MANUF && | 210 | if (manuf == CHEETAH_MANUF && |
211 | (impl == CHEETAH_IMPL || impl == CHEETAH_PLUS_IMPL)) { | 211 | (impl == CHEETAH_IMPL || |
212 | impl == CHEETAH_PLUS_IMPL || | ||
213 | impl == JAGUAR_IMPL || | ||
214 | impl == PANTHER_IMPL)) { | ||
212 | struct cpufreq_driver *driver; | 215 | struct cpufreq_driver *driver; |
213 | 216 | ||
214 | ret = -ENOMEM; | 217 | ret = -ENOMEM; |
diff --git a/arch/um/Makefile b/arch/um/Makefile index 5b5af95721ab..7af37e342e33 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -28,8 +28,6 @@ SYMLINK_HEADERS := $(foreach header,$(SYMLINK_HEADERS),include/asm-um/$(header)) | |||
28 | ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ | 28 | ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ |
29 | $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h | 29 | $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h |
30 | 30 | ||
31 | GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h | ||
32 | |||
33 | um-modes-$(CONFIG_MODE_TT) += tt | 31 | um-modes-$(CONFIG_MODE_TT) += tt |
34 | um-modes-$(CONFIG_MODE_SKAS) += skas | 32 | um-modes-$(CONFIG_MODE_SKAS) += skas |
35 | 33 | ||
@@ -45,9 +43,7 @@ endif | |||
45 | 43 | ||
46 | ARCH_INCLUDE := -I$(ARCH_DIR)/include | 44 | ARCH_INCLUDE := -I$(ARCH_DIR)/include |
47 | ifneq ($(KBUILD_SRC),) | 45 | ifneq ($(KBUILD_SRC),) |
48 | ARCH_INCLUDE += -I$(ARCH_DIR)/include2 | ||
49 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include | 46 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include |
50 | MRPROPER_DIRS += $(ARCH_DIR)/include2 | ||
51 | endif | 47 | endif |
52 | SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) | 48 | SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) |
53 | 49 | ||
@@ -87,10 +83,6 @@ CONFIG_KERNEL_HALF_GIGS ?= 0 | |||
87 | 83 | ||
88 | SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) | 84 | SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) |
89 | 85 | ||
90 | ifeq ($(CONFIG_MODE_SKAS), y) | ||
91 | $(SYS_HEADERS) : $(ARCH_DIR)/include/skas_ptregs.h | ||
92 | endif | ||
93 | |||
94 | .PHONY: linux | 86 | .PHONY: linux |
95 | 87 | ||
96 | all: linux | 88 | all: linux |
@@ -111,7 +103,8 @@ else | |||
111 | $(shell cd $(ARCH_DIR) && ln -sf Kconfig.$(SUBARCH) Kconfig.arch) | 103 | $(shell cd $(ARCH_DIR) && ln -sf Kconfig.$(SUBARCH) Kconfig.arch) |
112 | endif | 104 | endif |
113 | 105 | ||
114 | archprepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) | 106 | archprepare: $(ARCH_SYMLINKS) $(ARCH_DIR)/include/user_constants.h |
107 | prepare: $(ARCH_DIR)/include/kern_constants.h | ||
115 | 108 | ||
116 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static | 109 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static |
117 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib | 110 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib |
@@ -146,15 +139,13 @@ endef | |||
146 | #When cleaning we don't include .config, so we don't include | 139 | #When cleaning we don't include .config, so we don't include |
147 | #TT or skas makefiles and don't clean skas_ptregs.h. | 140 | #TT or skas makefiles and don't clean skas_ptregs.h. |
148 | CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ | 141 | CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ |
149 | $(GEN_HEADERS) $(ARCH_DIR)/include/skas_ptregs.h \ | 142 | $(ARCH_DIR)/include/user_constants.h \ |
150 | $(ARCH_DIR)/include/user_constants.h $(ARCH_DIR)/Kconfig.arch | 143 | $(ARCH_DIR)/include/kern_constants.h $(ARCH_DIR)/Kconfig.arch |
151 | 144 | ||
152 | MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ | 145 | MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ |
153 | $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os | 146 | $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os |
154 | 147 | ||
155 | archclean: | 148 | archclean: |
156 | $(Q)$(MAKE) $(clean)=$(ARCH_DIR)/util | ||
157 | $(Q)$(MAKE) $(clean)=$(ARCH_DIR)/os-$(OS)/util | ||
158 | @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ | 149 | @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ |
159 | -o -name '*.gcov' \) -type f -print | xargs rm -f | 150 | -o -name '*.gcov' \) -type f -print | xargs rm -f |
160 | 151 | ||
@@ -180,9 +171,7 @@ $(ARCH_DIR)/include/sysdep: | |||
180 | @echo ' SYMLINK $@' | 171 | @echo ' SYMLINK $@' |
181 | ifneq ($(KBUILD_SRC),) | 172 | ifneq ($(KBUILD_SRC),) |
182 | $(Q)mkdir -p $(ARCH_DIR)/include | 173 | $(Q)mkdir -p $(ARCH_DIR)/include |
183 | $(Q)mkdir -p $(ARCH_DIR)/include2 | 174 | $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) $(ARCH_DIR)/include/sysdep |
184 | $(Q)ln -fsn sysdep-$(SUBARCH) $(ARCH_DIR)/include/sysdep | ||
185 | $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) $(ARCH_DIR)/include2/sysdep | ||
186 | else | 175 | else |
187 | $(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep | 176 | $(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep |
188 | endif | 177 | endif |
@@ -202,8 +191,6 @@ endef | |||
202 | 191 | ||
203 | define filechk_gen-asm-offsets | 192 | define filechk_gen-asm-offsets |
204 | (set -e; \ | 193 | (set -e; \ |
205 | echo "#ifndef __ASM_OFFSETS_H__"; \ | ||
206 | echo "#define __ASM_OFFSETS_H__"; \ | ||
207 | echo "/*"; \ | 194 | echo "/*"; \ |
208 | echo " * DO NOT MODIFY."; \ | 195 | echo " * DO NOT MODIFY."; \ |
209 | echo " *"; \ | 196 | echo " *"; \ |
@@ -212,8 +199,7 @@ define filechk_gen-asm-offsets | |||
212 | echo " */"; \ | 199 | echo " */"; \ |
213 | echo ""; \ | 200 | echo ""; \ |
214 | sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ | 201 | sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ |
215 | echo ""; \ | 202 | echo ""; ) |
216 | echo "#endif" ) | ||
217 | endef | 203 | endef |
218 | 204 | ||
219 | $(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h | 205 | $(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h |
@@ -222,50 +208,18 @@ $(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h | |||
222 | $(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c | 208 | $(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c |
223 | $(CC) $(USER_CFLAGS) -S -o $@ $< | 209 | $(CC) $(USER_CFLAGS) -S -o $@ $< |
224 | 210 | ||
225 | $(ARCH_DIR)/user-offsets.h: $(ARCH_DIR)/user-offsets.s | 211 | $(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/user-offsets.s |
226 | $(call filechk,gen-asm-offsets) | 212 | $(call filechk,gen-asm-offsets) |
227 | 213 | ||
228 | CLEAN_FILES += $(ARCH_DIR)/user-offsets.s $(ARCH_DIR)/user-offsets.h | 214 | CLEAN_FILES += $(ARCH_DIR)/user-offsets.s |
229 | 215 | ||
230 | $(ARCH_DIR)/kernel-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/kernel-offsets.c \ | 216 | $(ARCH_DIR)/kernel-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/kernel-offsets.c \ |
231 | $(ARCH_SYMLINKS) \ | 217 | archprepare |
232 | $(SYS_DIR)/sc.h \ | ||
233 | include/asm include/linux/version.h \ | ||
234 | include/config/MARKER \ | ||
235 | $(ARCH_DIR)/include/user_constants.h | ||
236 | $(CC) $(CFLAGS) $(NOSTDINC_FLAGS) $(CPPFLAGS) -S -o $@ $< | 218 | $(CC) $(CFLAGS) $(NOSTDINC_FLAGS) $(CPPFLAGS) -S -o $@ $< |
237 | 219 | ||
238 | $(ARCH_DIR)/kernel-offsets.h: $(ARCH_DIR)/kernel-offsets.s | 220 | $(ARCH_DIR)/include/kern_constants.h: $(ARCH_DIR)/kernel-offsets.s |
239 | $(call filechk,gen-asm-offsets) | 221 | $(call filechk,gen-asm-offsets) |
240 | 222 | ||
241 | CLEAN_FILES += $(ARCH_DIR)/kernel-offsets.s $(ARCH_DIR)/kernel-offsets.h | 223 | CLEAN_FILES += $(ARCH_DIR)/kernel-offsets.s |
242 | |||
243 | $(ARCH_DIR)/include/task.h: $(ARCH_DIR)/util/mk_task | ||
244 | $(call filechk,gen_header) | ||
245 | |||
246 | $(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/os-$(OS)/util/mk_user_constants | ||
247 | $(call filechk,gen_header) | ||
248 | |||
249 | $(ARCH_DIR)/include/kern_constants.h: $(ARCH_DIR)/util/mk_constants | ||
250 | $(call filechk,gen_header) | ||
251 | |||
252 | $(ARCH_DIR)/include/skas_ptregs.h: $(ARCH_DIR)/kernel/skas/util/mk_ptregs | ||
253 | $(call filechk,gen_header) | ||
254 | |||
255 | $(ARCH_DIR)/os-$(OS)/util/mk_user_constants: $(ARCH_DIR)/os-$(OS)/util FORCE ; | ||
256 | |||
257 | $(ARCH_DIR)/util/mk_task $(ARCH_DIR)/util/mk_constants: $(ARCH_DIR)/include/user_constants.h $(ARCH_DIR)/util \ | ||
258 | FORCE ; | ||
259 | |||
260 | $(ARCH_DIR)/kernel/skas/util/mk_ptregs: $(ARCH_DIR)/kernel/skas/util FORCE ; | ||
261 | |||
262 | $(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h $(ARCH_DIR)/kernel-offsets.h FORCE | ||
263 | $(Q)$(MAKE) $(build)=$@ | ||
264 | |||
265 | $(ARCH_DIR)/kernel/skas/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE | ||
266 | $(Q)$(MAKE) $(build)=$@ | ||
267 | |||
268 | $(ARCH_DIR)/os-$(OS)/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE | ||
269 | $(Q)$(MAKE) $(build)=$@ | ||
270 | 224 | ||
271 | export SUBARCH USER_CFLAGS OS | 225 | export SUBARCH USER_CFLAGS OS |
diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 1ab431a53ac3..2ee8a2858117 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 | |||
@@ -32,25 +32,3 @@ CFLAGS += -U__$(SUBARCH)__ -U$(SUBARCH) | |||
32 | ifneq ($(CONFIG_GPROF),y) | 32 | ifneq ($(CONFIG_GPROF),y) |
33 | ARCH_CFLAGS += -DUM_FASTCALL | 33 | ARCH_CFLAGS += -DUM_FASTCALL |
34 | endif | 34 | endif |
35 | |||
36 | SYS_UTIL_DIR := $(ARCH_DIR)/sys-i386/util | ||
37 | SYS_HEADERS := $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h | ||
38 | |||
39 | prepare: $(SYS_HEADERS) | ||
40 | |||
41 | $(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc | ||
42 | $(call filechk,gen_header) | ||
43 | |||
44 | $(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread | ||
45 | $(call filechk,gen_header) | ||
46 | |||
47 | $(SYS_UTIL_DIR)/mk_sc: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE | ||
48 | $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ | ||
49 | |||
50 | $(SYS_UTIL_DIR)/mk_thread: scripts_basic $(ARCH_DIR)/kernel-offsets.h FORCE | ||
51 | $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ | ||
52 | |||
53 | $(SYS_UTIL_DIR): scripts_basic include/asm FORCE | ||
54 | $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) | ||
55 | |||
56 | CLEAN_FILES += $(SYS_HEADERS) | ||
diff --git a/arch/um/Makefile-skas b/arch/um/Makefile-skas index fd18ec572271..ac35de5316a6 100644 --- a/arch/um/Makefile-skas +++ b/arch/um/Makefile-skas | |||
@@ -10,5 +10,3 @@ CFLAGS-$(CONFIG_GCOV) += $(GCOV_OPT) | |||
10 | CFLAGS-$(CONFIG_GPROF) += $(GPROF_OPT) | 10 | CFLAGS-$(CONFIG_GPROF) += $(GPROF_OPT) |
11 | LINK-$(CONFIG_GCOV) += $(GCOV_OPT) | 11 | LINK-$(CONFIG_GCOV) += $(GCOV_OPT) |
12 | LINK-$(CONFIG_GPROF) += $(GPROF_OPT) | 12 | LINK-$(CONFIG_GPROF) += $(GPROF_OPT) |
13 | |||
14 | GEN_HEADERS += $(ARCH_DIR)/include/skas_ptregs.h | ||
diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index 436abbba409b..4f118d5cc2ee 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 | |||
@@ -12,24 +12,3 @@ CHECKFLAGS += -m64 | |||
12 | 12 | ||
13 | ELF_ARCH := i386:x86-64 | 13 | ELF_ARCH := i386:x86-64 |
14 | ELF_FORMAT := elf64-x86-64 | 14 | ELF_FORMAT := elf64-x86-64 |
15 | |||
16 | SYS_UTIL_DIR := $(ARCH_DIR)/sys-x86_64/util | ||
17 | SYS_DIR := $(ARCH_DIR)/include/sysdep-x86_64 | ||
18 | |||
19 | SYS_HEADERS = $(SYS_DIR)/sc.h $(SYS_DIR)/thread.h | ||
20 | |||
21 | prepare: $(SYS_HEADERS) | ||
22 | |||
23 | $(SYS_DIR)/sc.h: $(SYS_UTIL_DIR)/mk_sc | ||
24 | $(call filechk,gen_header) | ||
25 | |||
26 | $(SYS_DIR)/thread.h: $(SYS_UTIL_DIR)/mk_thread | ||
27 | $(call filechk,gen_header) | ||
28 | |||
29 | $(SYS_UTIL_DIR)/mk_sc: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE | ||
30 | $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ | ||
31 | |||
32 | $(SYS_UTIL_DIR)/mk_thread: scripts_basic $(GEN_HEADERS) $(ARCH_DIR)/kernel-offsets.h FORCE | ||
33 | $(Q)$(MAKE) $(build)=$(SYS_UTIL_DIR) $@ | ||
34 | |||
35 | CLEAN_FILES += $(SYS_HEADERS) | ||
diff --git a/arch/um/include/common-offsets.h b/arch/um/include/common-offsets.h index 782ac3a3baf9..356390d1f8b9 100644 --- a/arch/um/include/common-offsets.h +++ b/arch/um/include/common-offsets.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* for use by sys-$SUBARCH/kernel-offsets.c */ | 1 | /* for use by sys-$SUBARCH/kernel-offsets.c */ |
2 | 2 | ||
3 | OFFSET(TASK_REGS, task_struct, thread.regs); | 3 | OFFSET(HOST_TASK_REGS, task_struct, thread.regs); |
4 | OFFSET(TASK_PID, task_struct, pid); | 4 | OFFSET(HOST_TASK_PID, task_struct, pid); |
5 | DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE); | 5 | DEFINE(UM_KERN_PAGE_SIZE, PAGE_SIZE); |
6 | DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC); | 6 | DEFINE(UM_NSEC_PER_SEC, NSEC_PER_SEC); |
7 | DEFINE_STR(UM_KERN_EMERG, KERN_EMERG); | 7 | DEFINE_STR(UM_KERN_EMERG, KERN_EMERG); |
diff --git a/arch/um/include/skas_ptregs.h b/arch/um/include/skas_ptregs.h new file mode 100644 index 000000000000..73db19e9c077 --- /dev/null +++ b/arch/um/include/skas_ptregs.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __SKAS_PT_REGS_ | ||
2 | #define __SKAS_PT_REGS_ | ||
3 | |||
4 | #include <user_constants.h> | ||
5 | |||
6 | #endif | ||
diff --git a/arch/um/include/sysdep-i386/sc.h b/arch/um/include/sysdep-i386/sc.h new file mode 100644 index 000000000000..c57d1780ad37 --- /dev/null +++ b/arch/um/include/sysdep-i386/sc.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef __SYSDEP_I386_SC_H | ||
2 | #define __SYSDEP_I386_SC_H | ||
3 | |||
4 | #include <user_constants.h> | ||
5 | |||
6 | #define SC_OFFSET(sc, field) \ | ||
7 | *((unsigned long *) &(((char *) (sc))[HOST_##field])) | ||
8 | #define SC_FP_OFFSET(sc, field) \ | ||
9 | *((unsigned long *) &(((char *) (SC_FPSTATE(sc)))[HOST_##field])) | ||
10 | #define SC_FP_OFFSET_PTR(sc, field, type) \ | ||
11 | ((type *) &(((char *) (SC_FPSTATE(sc)))[HOST_##field])) | ||
12 | |||
13 | #define SC_IP(sc) SC_OFFSET(sc, SC_IP) | ||
14 | #define SC_SP(sc) SC_OFFSET(sc, SC_SP) | ||
15 | #define SC_FS(sc) SC_OFFSET(sc, SC_FS) | ||
16 | #define SC_GS(sc) SC_OFFSET(sc, SC_GS) | ||
17 | #define SC_DS(sc) SC_OFFSET(sc, SC_DS) | ||
18 | #define SC_ES(sc) SC_OFFSET(sc, SC_ES) | ||
19 | #define SC_SS(sc) SC_OFFSET(sc, SC_SS) | ||
20 | #define SC_CS(sc) SC_OFFSET(sc, SC_CS) | ||
21 | #define SC_EFLAGS(sc) SC_OFFSET(sc, SC_EFLAGS) | ||
22 | #define SC_EAX(sc) SC_OFFSET(sc, SC_EAX) | ||
23 | #define SC_EBX(sc) SC_OFFSET(sc, SC_EBX) | ||
24 | #define SC_ECX(sc) SC_OFFSET(sc, SC_ECX) | ||
25 | #define SC_EDX(sc) SC_OFFSET(sc, SC_EDX) | ||
26 | #define SC_EDI(sc) SC_OFFSET(sc, SC_EDI) | ||
27 | #define SC_ESI(sc) SC_OFFSET(sc, SC_ESI) | ||
28 | #define SC_EBP(sc) SC_OFFSET(sc, SC_EBP) | ||
29 | #define SC_TRAPNO(sc) SC_OFFSET(sc, SC_TRAPNO) | ||
30 | #define SC_ERR(sc) SC_OFFSET(sc, SC_ERR) | ||
31 | #define SC_CR2(sc) SC_OFFSET(sc, SC_CR2) | ||
32 | #define SC_FPSTATE(sc) SC_OFFSET(sc, SC_FPSTATE) | ||
33 | #define SC_SIGMASK(sc) SC_OFFSET(sc, SC_SIGMASK) | ||
34 | #define SC_FP_CW(sc) SC_FP_OFFSET(sc, SC_FP_CW) | ||
35 | #define SC_FP_SW(sc) SC_FP_OFFSET(sc, SC_FP_SW) | ||
36 | #define SC_FP_TAG(sc) SC_FP_OFFSET(sc, SC_FP_TAG) | ||
37 | #define SC_FP_IPOFF(sc) SC_FP_OFFSET(sc, SC_FP_IPOFF) | ||
38 | #define SC_FP_CSSEL(sc) SC_FP_OFFSET(sc, SC_FP_CSSEL) | ||
39 | #define SC_FP_DATAOFF(sc) SC_FP_OFFSET(sc, SC_FP_DATAOFF) | ||
40 | #define SC_FP_DATASEL(sc) SC_FP_OFFSET(sc, SC_FP_DATASEL) | ||
41 | #define SC_FP_ST(sc) SC_FP_OFFSET_PTR(sc, SC_FP_ST, struct _fpstate) | ||
42 | #define SC_FXSR_ENV(sc) SC_FP_OFFSET_PTR(sc, SC_FXSR_ENV, void) | ||
43 | |||
44 | #endif | ||
diff --git a/arch/um/include/sysdep-i386/thread.h b/arch/um/include/sysdep-i386/thread.h new file mode 100644 index 000000000000..e2bd6bae8b8a --- /dev/null +++ b/arch/um/include/sysdep-i386/thread.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef __UM_THREAD_H | ||
2 | #define __UM_THREAD_H | ||
3 | |||
4 | #include <kern_constants.h> | ||
5 | |||
6 | #define TASK_DEBUGREGS(task) ((unsigned long *) &(((char *) (task))[HOST_TASK_DEBUGREGS])) | ||
7 | #ifdef CONFIG_MODE_TT | ||
8 | #define TASK_EXTERN_PID(task) *((int *) &(((char *) (task))[HOST_TASK_EXTERN_PID])) | ||
9 | #endif | ||
10 | |||
11 | #endif | ||
diff --git a/arch/um/include/sysdep-x86_64/sc.h b/arch/um/include/sysdep-x86_64/sc.h new file mode 100644 index 000000000000..a160d9fcc596 --- /dev/null +++ b/arch/um/include/sysdep-x86_64/sc.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef __SYSDEP_X86_64_SC_H | ||
2 | #define __SYSDEP_X86_64_SC_H | ||
3 | |||
4 | /* Copyright (C) 2003 - 2004 PathScale, Inc | ||
5 | * Released under the GPL | ||
6 | */ | ||
7 | |||
8 | #include <user_constants.h> | ||
9 | |||
10 | #define SC_OFFSET(sc, field) \ | ||
11 | *((unsigned long *) &(((char *) (sc))[HOST_##field])) | ||
12 | |||
13 | #define SC_RBX(sc) SC_OFFSET(sc, SC_RBX) | ||
14 | #define SC_RCX(sc) SC_OFFSET(sc, SC_RCX) | ||
15 | #define SC_RDX(sc) SC_OFFSET(sc, SC_RDX) | ||
16 | #define SC_RSI(sc) SC_OFFSET(sc, SC_RSI) | ||
17 | #define SC_RDI(sc) SC_OFFSET(sc, SC_RDI) | ||
18 | #define SC_RBP(sc) SC_OFFSET(sc, SC_RBP) | ||
19 | #define SC_RAX(sc) SC_OFFSET(sc, SC_RAX) | ||
20 | #define SC_R8(sc) SC_OFFSET(sc, SC_R8) | ||
21 | #define SC_R9(sc) SC_OFFSET(sc, SC_R9) | ||
22 | #define SC_R10(sc) SC_OFFSET(sc, SC_R10) | ||
23 | #define SC_R11(sc) SC_OFFSET(sc, SC_R11) | ||
24 | #define SC_R12(sc) SC_OFFSET(sc, SC_R12) | ||
25 | #define SC_R13(sc) SC_OFFSET(sc, SC_R13) | ||
26 | #define SC_R14(sc) SC_OFFSET(sc, SC_R14) | ||
27 | #define SC_R15(sc) SC_OFFSET(sc, SC_R15) | ||
28 | #define SC_IP(sc) SC_OFFSET(sc, SC_IP) | ||
29 | #define SC_SP(sc) SC_OFFSET(sc, SC_SP) | ||
30 | #define SC_CR2(sc) SC_OFFSET(sc, SC_CR2) | ||
31 | #define SC_ERR(sc) SC_OFFSET(sc, SC_ERR) | ||
32 | #define SC_TRAPNO(sc) SC_OFFSET(sc, SC_TRAPNO) | ||
33 | #define SC_CS(sc) SC_OFFSET(sc, SC_CS) | ||
34 | #define SC_FS(sc) SC_OFFSET(sc, SC_FS) | ||
35 | #define SC_GS(sc) SC_OFFSET(sc, SC_GS) | ||
36 | #define SC_EFLAGS(sc) SC_OFFSET(sc, SC_EFLAGS) | ||
37 | #define SC_SIGMASK(sc) SC_OFFSET(sc, SC_SIGMASK) | ||
38 | #if 0 | ||
39 | #define SC_ORIG_RAX(sc) SC_OFFSET(sc, SC_ORIG_RAX) | ||
40 | #define SC_DS(sc) SC_OFFSET(sc, SC_DS) | ||
41 | #define SC_ES(sc) SC_OFFSET(sc, SC_ES) | ||
42 | #define SC_SS(sc) SC_OFFSET(sc, SC_SS) | ||
43 | #endif | ||
44 | |||
45 | #endif | ||
diff --git a/arch/um/include/sysdep-x86_64/thread.h b/arch/um/include/sysdep-x86_64/thread.h new file mode 100644 index 000000000000..6a76a7f3683f --- /dev/null +++ b/arch/um/include/sysdep-x86_64/thread.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __UM_THREAD_H | ||
2 | #define __UM_THREAD_H | ||
3 | |||
4 | #include <kern_constants.h> | ||
5 | |||
6 | #ifdef CONFIG_MODE_TT | ||
7 | #define TASK_EXTERN_PID(task) *((int *) &(((char *) (task))[HOST_TASK_EXTERN_PID])) | ||
8 | #endif | ||
9 | |||
10 | #endif | ||
diff --git a/arch/um/include/task.h b/arch/um/include/task.h new file mode 100644 index 000000000000..6375ba7203c9 --- /dev/null +++ b/arch/um/include/task.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef __TASK_H | ||
2 | #define __TASK_H | ||
3 | |||
4 | #include <kern_constants.h> | ||
5 | |||
6 | #define TASK_REGS(task) ((union uml_pt_regs *) &(((char *) (task))[HOST_TASK_REGS])) | ||
7 | #define TASK_PID(task) *((int *) &(((char *) (task))[HOST_TASK_PID])) | ||
8 | |||
9 | #endif | ||
diff --git a/arch/um/kernel/skas/Makefile b/arch/um/kernel/skas/Makefile index db36c7c95940..8de471b59c1c 100644 --- a/arch/um/kernel/skas/Makefile +++ b/arch/um/kernel/skas/Makefile | |||
@@ -6,8 +6,6 @@ | |||
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 trap_user.o uaccess.o |
8 | 8 | ||
9 | subdir- := util | ||
10 | |||
11 | USER_OBJS := process.o clone.o | 9 | USER_OBJS := process.o clone.o |
12 | 10 | ||
13 | include arch/um/scripts/Makefile.rules | 11 | include arch/um/scripts/Makefile.rules |
diff --git a/arch/um/kernel/skas/util/Makefile b/arch/um/kernel/skas/util/Makefile deleted file mode 100644 index f7b7eba83340..000000000000 --- a/arch/um/kernel/skas/util/Makefile +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | hostprogs-y := mk_ptregs | ||
2 | always := $(hostprogs-y) | ||
3 | |||
4 | mk_ptregs-objs := mk_ptregs-$(SUBARCH).o | ||
5 | HOSTCFLAGS_mk_ptregs-$(SUBARCH).o := -I$(objtree)/arch/um | ||
diff --git a/arch/um/kernel/skas/util/mk_ptregs-i386.c b/arch/um/kernel/skas/util/mk_ptregs-i386.c deleted file mode 100644 index 1f96e1eeb8a7..000000000000 --- a/arch/um/kernel/skas/util/mk_ptregs-i386.c +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <user-offsets.h> | ||
3 | |||
4 | #define SHOW(name) printf("#define %s %d\n", #name, name) | ||
5 | |||
6 | int main(int argc, char **argv) | ||
7 | { | ||
8 | printf("/* Automatically generated by " | ||
9 | "arch/um/kernel/skas/util/mk_ptregs */\n"); | ||
10 | printf("\n"); | ||
11 | printf("#ifndef __SKAS_PT_REGS_\n"); | ||
12 | printf("#define __SKAS_PT_REGS_\n"); | ||
13 | printf("\n"); | ||
14 | SHOW(HOST_FRAME_SIZE); | ||
15 | SHOW(HOST_FP_SIZE); | ||
16 | SHOW(HOST_XFP_SIZE); | ||
17 | |||
18 | SHOW(HOST_IP); | ||
19 | SHOW(HOST_SP); | ||
20 | SHOW(HOST_EFLAGS); | ||
21 | SHOW(HOST_EAX); | ||
22 | SHOW(HOST_EBX); | ||
23 | SHOW(HOST_ECX); | ||
24 | SHOW(HOST_EDX); | ||
25 | SHOW(HOST_ESI); | ||
26 | SHOW(HOST_EDI); | ||
27 | SHOW(HOST_EBP); | ||
28 | SHOW(HOST_CS); | ||
29 | SHOW(HOST_SS); | ||
30 | SHOW(HOST_DS); | ||
31 | SHOW(HOST_FS); | ||
32 | SHOW(HOST_ES); | ||
33 | SHOW(HOST_GS); | ||
34 | |||
35 | printf("\n"); | ||
36 | printf("#endif\n"); | ||
37 | return(0); | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
42 | * Emacs will notice this stuff at the end of the file and automatically | ||
43 | * adjust the settings for this buffer only. This must remain at the end | ||
44 | * of the file. | ||
45 | * --------------------------------------------------------------------------- | ||
46 | * Local variables: | ||
47 | * c-file-style: "linux" | ||
48 | * End: | ||
49 | */ | ||
diff --git a/arch/um/kernel/skas/util/mk_ptregs-x86_64.c b/arch/um/kernel/skas/util/mk_ptregs-x86_64.c deleted file mode 100644 index 5fccbfe35f78..000000000000 --- a/arch/um/kernel/skas/util/mk_ptregs-x86_64.c +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2003 PathScale, Inc. | ||
3 | * | ||
4 | * Licensed under the GPL | ||
5 | */ | ||
6 | |||
7 | #include <stdio.h> | ||
8 | #include <user-offsets.h> | ||
9 | |||
10 | #define SHOW(name) \ | ||
11 | printf("#define %s (%d / sizeof(unsigned long))\n", #name, name) | ||
12 | |||
13 | int main(int argc, char **argv) | ||
14 | { | ||
15 | printf("/* Automatically generated by " | ||
16 | "arch/um/kernel/skas/util/mk_ptregs */\n"); | ||
17 | printf("\n"); | ||
18 | printf("#ifndef __SKAS_PT_REGS_\n"); | ||
19 | printf("#define __SKAS_PT_REGS_\n"); | ||
20 | SHOW(HOST_FRAME_SIZE); | ||
21 | SHOW(HOST_RBX); | ||
22 | SHOW(HOST_RCX); | ||
23 | SHOW(HOST_RDI); | ||
24 | SHOW(HOST_RSI); | ||
25 | SHOW(HOST_RDX); | ||
26 | SHOW(HOST_RBP); | ||
27 | SHOW(HOST_RAX); | ||
28 | SHOW(HOST_R8); | ||
29 | SHOW(HOST_R9); | ||
30 | SHOW(HOST_R10); | ||
31 | SHOW(HOST_R11); | ||
32 | SHOW(HOST_R12); | ||
33 | SHOW(HOST_R13); | ||
34 | SHOW(HOST_R14); | ||
35 | SHOW(HOST_R15); | ||
36 | SHOW(HOST_ORIG_RAX); | ||
37 | SHOW(HOST_CS); | ||
38 | SHOW(HOST_SS); | ||
39 | SHOW(HOST_EFLAGS); | ||
40 | #if 0 | ||
41 | SHOW(HOST_FS); | ||
42 | SHOW(HOST_GS); | ||
43 | SHOW(HOST_DS); | ||
44 | SHOW(HOST_ES); | ||
45 | #endif | ||
46 | |||
47 | SHOW(HOST_IP); | ||
48 | SHOW(HOST_SP); | ||
49 | printf("#define HOST_FP_SIZE 0\n"); | ||
50 | printf("#define HOST_XFP_SIZE 0\n"); | ||
51 | printf("\n"); | ||
52 | printf("\n"); | ||
53 | printf("#endif\n"); | ||
54 | return(0); | ||
55 | } | ||
56 | |||
57 | /* | ||
58 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
59 | * Emacs will notice this stuff at the end of the file and automatically | ||
60 | * adjust the settings for this buffer only. This must remain at the end | ||
61 | * of the file. | ||
62 | * --------------------------------------------------------------------------- | ||
63 | * Local variables: | ||
64 | * c-file-style: "linux" | ||
65 | * End: | ||
66 | */ | ||
diff --git a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c index ab33cb3c74ec..5a99dd3fbed0 100644 --- a/arch/um/os-Linux/elf_aux.c +++ b/arch/um/os-Linux/elf_aux.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include "init.h" | 12 | #include "init.h" |
13 | #include "elf_user.h" | 13 | #include "elf_user.h" |
14 | #include "mem_user.h" | 14 | #include "mem_user.h" |
15 | #include <kernel-offsets.h> | 15 | #include <kern_constants.h> |
16 | 16 | ||
17 | /* Use the one from the kernel - the host may miss it, if having old headers. */ | 17 | /* Use the one from the kernel - the host may miss it, if having old headers. */ |
18 | #if UM_ELF_CLASS == UM_ELFCLASS32 | 18 | #if UM_ELF_CLASS == UM_ELFCLASS32 |
diff --git a/arch/um/os-Linux/util/Makefile b/arch/um/os-Linux/util/Makefile deleted file mode 100644 index 9778aed0c314..000000000000 --- a/arch/um/os-Linux/util/Makefile +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | hostprogs-y := mk_user_constants | ||
2 | always := $(hostprogs-y) | ||
3 | |||
4 | HOSTCFLAGS_mk_user_constants.o := -I$(objtree)/arch/um | ||
diff --git a/arch/um/os-Linux/util/mk_user_constants.c b/arch/um/os-Linux/util/mk_user_constants.c deleted file mode 100644 index 4838f30eecf0..000000000000 --- a/arch/um/os-Linux/util/mk_user_constants.c +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <user-offsets.h> | ||
3 | |||
4 | int main(int argc, char **argv) | ||
5 | { | ||
6 | printf("/*\n"); | ||
7 | printf(" * Generated by mk_user_constants\n"); | ||
8 | printf(" */\n"); | ||
9 | printf("\n"); | ||
10 | printf("#ifndef __UM_USER_CONSTANTS_H\n"); | ||
11 | printf("#define __UM_USER_CONSTANTS_H\n"); | ||
12 | printf("\n"); | ||
13 | /* I'd like to use FRAME_SIZE from ptrace.h here, but that's wrong on | ||
14 | * x86_64 (216 vs 168 bytes). user_regs_struct is the correct size on | ||
15 | * both x86_64 and i386. | ||
16 | */ | ||
17 | printf("#define UM_FRAME_SIZE %d\n", __UM_FRAME_SIZE); | ||
18 | |||
19 | printf("\n"); | ||
20 | printf("#endif\n"); | ||
21 | |||
22 | return(0); | ||
23 | } | ||
diff --git a/arch/um/sys-i386/Makefile b/arch/um/sys-i386/Makefile index 4ca2a229da49..6dfeb70f6957 100644 --- a/arch/um/sys-i386/Makefile +++ b/arch/um/sys-i386/Makefile | |||
@@ -18,6 +18,4 @@ module.c-dir = kernel | |||
18 | 18 | ||
19 | $(obj)/stub_segv.o : _c_flags = $(call unprofile,$(CFLAGS)) | 19 | $(obj)/stub_segv.o : _c_flags = $(call unprofile,$(CFLAGS)) |
20 | 20 | ||
21 | subdir- := util | ||
22 | |||
23 | include arch/um/scripts/Makefile.unmap | 21 | include arch/um/scripts/Makefile.unmap |
diff --git a/arch/um/sys-i386/kernel-offsets.c b/arch/um/sys-i386/kernel-offsets.c index a1070af2bcd8..35db85057506 100644 --- a/arch/um/sys-i386/kernel-offsets.c +++ b/arch/um/sys-i386/kernel-offsets.c | |||
@@ -18,9 +18,9 @@ | |||
18 | 18 | ||
19 | void foo(void) | 19 | void foo(void) |
20 | { | 20 | { |
21 | OFFSET(TASK_DEBUGREGS, task_struct, thread.arch.debugregs); | 21 | OFFSET(HOST_TASK_DEBUGREGS, task_struct, thread.arch.debugregs); |
22 | #ifdef CONFIG_MODE_TT | 22 | #ifdef CONFIG_MODE_TT |
23 | OFFSET(TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); | 23 | OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); |
24 | #endif | 24 | #endif |
25 | #include <common-offsets.h> | 25 | #include <common-offsets.h> |
26 | } | 26 | } |
diff --git a/arch/um/sys-i386/user-offsets.c b/arch/um/sys-i386/user-offsets.c index 3ceaabceb3d7..677fc26a9bbe 100644 --- a/arch/um/sys-i386/user-offsets.c +++ b/arch/um/sys-i386/user-offsets.c | |||
@@ -7,47 +7,48 @@ | |||
7 | #define DEFINE(sym, val) \ | 7 | #define DEFINE(sym, val) \ |
8 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | 8 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
9 | 9 | ||
10 | #define DEFINE_LONGS(sym, val) \ | ||
11 | asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long))) | ||
12 | |||
10 | #define OFFSET(sym, str, mem) \ | 13 | #define OFFSET(sym, str, mem) \ |
11 | DEFINE(sym, offsetof(struct str, mem)); | 14 | DEFINE(sym, offsetof(struct str, mem)); |
12 | 15 | ||
13 | void foo(void) | 16 | void foo(void) |
14 | { | 17 | { |
15 | OFFSET(SC_IP, sigcontext, eip); | 18 | OFFSET(HOST_SC_IP, sigcontext, eip); |
16 | OFFSET(SC_SP, sigcontext, esp); | 19 | OFFSET(HOST_SC_SP, sigcontext, esp); |
17 | OFFSET(SC_FS, sigcontext, fs); | 20 | OFFSET(HOST_SC_FS, sigcontext, fs); |
18 | OFFSET(SC_GS, sigcontext, gs); | 21 | OFFSET(HOST_SC_GS, sigcontext, gs); |
19 | OFFSET(SC_DS, sigcontext, ds); | 22 | OFFSET(HOST_SC_DS, sigcontext, ds); |
20 | OFFSET(SC_ES, sigcontext, es); | 23 | OFFSET(HOST_SC_ES, sigcontext, es); |
21 | OFFSET(SC_SS, sigcontext, ss); | 24 | OFFSET(HOST_SC_SS, sigcontext, ss); |
22 | OFFSET(SC_CS, sigcontext, cs); | 25 | OFFSET(HOST_SC_CS, sigcontext, cs); |
23 | OFFSET(SC_EFLAGS, sigcontext, eflags); | 26 | OFFSET(HOST_SC_EFLAGS, sigcontext, eflags); |
24 | OFFSET(SC_EAX, sigcontext, eax); | 27 | OFFSET(HOST_SC_EAX, sigcontext, eax); |
25 | OFFSET(SC_EBX, sigcontext, ebx); | 28 | OFFSET(HOST_SC_EBX, sigcontext, ebx); |
26 | OFFSET(SC_ECX, sigcontext, ecx); | 29 | OFFSET(HOST_SC_ECX, sigcontext, ecx); |
27 | OFFSET(SC_EDX, sigcontext, edx); | 30 | OFFSET(HOST_SC_EDX, sigcontext, edx); |
28 | OFFSET(SC_EDI, sigcontext, edi); | 31 | OFFSET(HOST_SC_EDI, sigcontext, edi); |
29 | OFFSET(SC_ESI, sigcontext, esi); | 32 | OFFSET(HOST_SC_ESI, sigcontext, esi); |
30 | OFFSET(SC_EBP, sigcontext, ebp); | 33 | OFFSET(HOST_SC_EBP, sigcontext, ebp); |
31 | OFFSET(SC_TRAPNO, sigcontext, trapno); | 34 | OFFSET(HOST_SC_TRAPNO, sigcontext, trapno); |
32 | OFFSET(SC_ERR, sigcontext, err); | 35 | OFFSET(HOST_SC_ERR, sigcontext, err); |
33 | OFFSET(SC_CR2, sigcontext, cr2); | 36 | OFFSET(HOST_SC_CR2, sigcontext, cr2); |
34 | OFFSET(SC_FPSTATE, sigcontext, fpstate); | 37 | OFFSET(HOST_SC_FPSTATE, sigcontext, fpstate); |
35 | OFFSET(SC_SIGMASK, sigcontext, oldmask); | 38 | OFFSET(HOST_SC_SIGMASK, sigcontext, oldmask); |
36 | OFFSET(SC_FP_CW, _fpstate, cw); | 39 | OFFSET(HOST_SC_FP_CW, _fpstate, cw); |
37 | OFFSET(SC_FP_SW, _fpstate, sw); | 40 | OFFSET(HOST_SC_FP_SW, _fpstate, sw); |
38 | OFFSET(SC_FP_TAG, _fpstate, tag); | 41 | OFFSET(HOST_SC_FP_TAG, _fpstate, tag); |
39 | OFFSET(SC_FP_IPOFF, _fpstate, ipoff); | 42 | OFFSET(HOST_SC_FP_IPOFF, _fpstate, ipoff); |
40 | OFFSET(SC_FP_CSSEL, _fpstate, cssel); | 43 | OFFSET(HOST_SC_FP_CSSEL, _fpstate, cssel); |
41 | OFFSET(SC_FP_DATAOFF, _fpstate, dataoff); | 44 | OFFSET(HOST_SC_FP_DATAOFF, _fpstate, dataoff); |
42 | OFFSET(SC_FP_DATASEL, _fpstate, datasel); | 45 | OFFSET(HOST_SC_FP_DATASEL, _fpstate, datasel); |
43 | OFFSET(SC_FP_ST, _fpstate, _st); | 46 | OFFSET(HOST_SC_FP_ST, _fpstate, _st); |
44 | OFFSET(SC_FXSR_ENV, _fpstate, _fxsr_env); | 47 | OFFSET(HOST_SC_FXSR_ENV, _fpstate, _fxsr_env); |
45 | 48 | ||
46 | DEFINE(HOST_FRAME_SIZE, FRAME_SIZE); | 49 | DEFINE_LONGS(HOST_FRAME_SIZE, FRAME_SIZE); |
47 | DEFINE(HOST_FP_SIZE, | 50 | DEFINE_LONGS(HOST_FP_SIZE, sizeof(struct user_i387_struct)); |
48 | sizeof(struct user_i387_struct) / sizeof(unsigned long)); | 51 | DEFINE_LONGS(HOST_XFP_SIZE, sizeof(struct user_fxsr_struct)); |
49 | DEFINE(HOST_XFP_SIZE, | ||
50 | sizeof(struct user_fxsr_struct) / sizeof(unsigned long)); | ||
51 | 52 | ||
52 | DEFINE(HOST_IP, EIP); | 53 | DEFINE(HOST_IP, EIP); |
53 | DEFINE(HOST_SP, UESP); | 54 | DEFINE(HOST_SP, UESP); |
@@ -65,5 +66,5 @@ void foo(void) | |||
65 | DEFINE(HOST_FS, FS); | 66 | DEFINE(HOST_FS, FS); |
66 | DEFINE(HOST_ES, ES); | 67 | DEFINE(HOST_ES, ES); |
67 | DEFINE(HOST_GS, GS); | 68 | DEFINE(HOST_GS, GS); |
68 | DEFINE(__UM_FRAME_SIZE, sizeof(struct user_regs_struct)); | 69 | DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct)); |
69 | } | 70 | } |
diff --git a/arch/um/sys-i386/util/Makefile b/arch/um/sys-i386/util/Makefile deleted file mode 100644 index bf61afd0b045..000000000000 --- a/arch/um/sys-i386/util/Makefile +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | hostprogs-y := mk_sc mk_thread | ||
2 | always := $(hostprogs-y) | ||
3 | |||
4 | HOSTCFLAGS_mk_sc.o := -I$(objtree)/arch/um | ||
5 | HOSTCFLAGS_mk_thread.o := -I$(objtree)/arch/um | ||
diff --git a/arch/um/sys-i386/util/mk_sc.c b/arch/um/sys-i386/util/mk_sc.c deleted file mode 100644 index 04c0d73433aa..000000000000 --- a/arch/um/sys-i386/util/mk_sc.c +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <user-offsets.h> | ||
3 | |||
4 | #define SC_OFFSET(name, field) \ | ||
5 | printf("#define " #name "(sc) *((unsigned long *) &(((char *) (sc))[%d]))\n",\ | ||
6 | name) | ||
7 | |||
8 | #define SC_FP_OFFSET(name, field) \ | ||
9 | printf("#define " #name \ | ||
10 | "(sc) *((unsigned long *) &(((char *) (SC_FPSTATE(sc)))[%d]))\n",\ | ||
11 | name) | ||
12 | |||
13 | #define SC_FP_OFFSET_PTR(name, field, type) \ | ||
14 | printf("#define " #name \ | ||
15 | "(sc) ((" type " *) &(((char *) (SC_FPSTATE(sc)))[%d]))\n",\ | ||
16 | name) | ||
17 | |||
18 | int main(int argc, char **argv) | ||
19 | { | ||
20 | SC_OFFSET(SC_IP, eip); | ||
21 | SC_OFFSET(SC_SP, esp); | ||
22 | SC_OFFSET(SC_FS, fs); | ||
23 | SC_OFFSET(SC_GS, gs); | ||
24 | SC_OFFSET(SC_DS, ds); | ||
25 | SC_OFFSET(SC_ES, es); | ||
26 | SC_OFFSET(SC_SS, ss); | ||
27 | SC_OFFSET(SC_CS, cs); | ||
28 | SC_OFFSET(SC_EFLAGS, eflags); | ||
29 | SC_OFFSET(SC_EAX, eax); | ||
30 | SC_OFFSET(SC_EBX, ebx); | ||
31 | SC_OFFSET(SC_ECX, ecx); | ||
32 | SC_OFFSET(SC_EDX, edx); | ||
33 | SC_OFFSET(SC_EDI, edi); | ||
34 | SC_OFFSET(SC_ESI, esi); | ||
35 | SC_OFFSET(SC_EBP, ebp); | ||
36 | SC_OFFSET(SC_TRAPNO, trapno); | ||
37 | SC_OFFSET(SC_ERR, err); | ||
38 | SC_OFFSET(SC_CR2, cr2); | ||
39 | SC_OFFSET(SC_FPSTATE, fpstate); | ||
40 | SC_OFFSET(SC_SIGMASK, oldmask); | ||
41 | SC_FP_OFFSET(SC_FP_CW, cw); | ||
42 | SC_FP_OFFSET(SC_FP_SW, sw); | ||
43 | SC_FP_OFFSET(SC_FP_TAG, tag); | ||
44 | SC_FP_OFFSET(SC_FP_IPOFF, ipoff); | ||
45 | SC_FP_OFFSET(SC_FP_CSSEL, cssel); | ||
46 | SC_FP_OFFSET(SC_FP_DATAOFF, dataoff); | ||
47 | SC_FP_OFFSET(SC_FP_DATASEL, datasel); | ||
48 | SC_FP_OFFSET_PTR(SC_FP_ST, _st, "struct _fpstate"); | ||
49 | SC_FP_OFFSET_PTR(SC_FXSR_ENV, _fxsr_env, "void"); | ||
50 | return(0); | ||
51 | } | ||
diff --git a/arch/um/sys-i386/util/mk_thread.c b/arch/um/sys-i386/util/mk_thread.c deleted file mode 100644 index 7470d0dda67e..000000000000 --- a/arch/um/sys-i386/util/mk_thread.c +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <kernel-offsets.h> | ||
3 | |||
4 | int main(int argc, char **argv) | ||
5 | { | ||
6 | printf("/*\n"); | ||
7 | printf(" * Generated by mk_thread\n"); | ||
8 | printf(" */\n"); | ||
9 | printf("\n"); | ||
10 | printf("#ifndef __UM_THREAD_H\n"); | ||
11 | printf("#define __UM_THREAD_H\n"); | ||
12 | printf("\n"); | ||
13 | printf("#define TASK_DEBUGREGS(task) ((unsigned long *) " | ||
14 | "&(((char *) (task))[%d]))\n", TASK_DEBUGREGS); | ||
15 | #ifdef TASK_EXTERN_PID | ||
16 | printf("#define TASK_EXTERN_PID(task) *((int *) &(((char *) (task))[%d]))\n", | ||
17 | TASK_EXTERN_PID); | ||
18 | #endif | ||
19 | printf("\n"); | ||
20 | printf("#endif\n"); | ||
21 | return(0); | ||
22 | } | ||
diff --git a/arch/um/sys-x86_64/Makefile b/arch/um/sys-x86_64/Makefile index f0ab574d1e95..06c3633457a2 100644 --- a/arch/um/sys-x86_64/Makefile +++ b/arch/um/sys-x86_64/Makefile | |||
@@ -29,6 +29,4 @@ module.c-dir = kernel | |||
29 | 29 | ||
30 | $(obj)/stub_segv.o: _c_flags = $(call unprofile,$(CFLAGS)) | 30 | $(obj)/stub_segv.o: _c_flags = $(call unprofile,$(CFLAGS)) |
31 | 31 | ||
32 | subdir- := util | ||
33 | |||
34 | include arch/um/scripts/Makefile.unmap | 32 | include arch/um/scripts/Makefile.unmap |
diff --git a/arch/um/sys-x86_64/kernel-offsets.c b/arch/um/sys-x86_64/kernel-offsets.c index 998541eade41..bfcb104b846e 100644 --- a/arch/um/sys-x86_64/kernel-offsets.c +++ b/arch/um/sys-x86_64/kernel-offsets.c | |||
@@ -19,7 +19,7 @@ | |||
19 | void foo(void) | 19 | void foo(void) |
20 | { | 20 | { |
21 | #ifdef CONFIG_MODE_TT | 21 | #ifdef CONFIG_MODE_TT |
22 | OFFSET(TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); | 22 | OFFSET(HOST_TASK_EXTERN_PID, task_struct, thread.mode.tt.extern_pid); |
23 | #endif | 23 | #endif |
24 | #include <common-offsets.h> | 24 | #include <common-offsets.h> |
25 | } | 25 | } |
diff --git a/arch/um/sys-x86_64/user-offsets.c b/arch/um/sys-x86_64/user-offsets.c index 513d17ceafd4..5a585bfbb8c2 100644 --- a/arch/um/sys-x86_64/user-offsets.c +++ b/arch/um/sys-x86_64/user-offsets.c | |||
@@ -16,71 +16,76 @@ typedef __u32 u32; | |||
16 | #define DEFINE(sym, val) \ | 16 | #define DEFINE(sym, val) \ |
17 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) | 17 | asm volatile("\n->" #sym " %0 " #val : : "i" (val)) |
18 | 18 | ||
19 | #define DEFINE_LONGS(sym, val) \ | ||
20 | asm volatile("\n->" #sym " %0 " #val : : "i" (val/sizeof(unsigned long))) | ||
21 | |||
19 | #define OFFSET(sym, str, mem) \ | 22 | #define OFFSET(sym, str, mem) \ |
20 | DEFINE(sym, offsetof(struct str, mem)); | 23 | DEFINE(sym, offsetof(struct str, mem)); |
21 | 24 | ||
22 | void foo(void) | 25 | void foo(void) |
23 | { | 26 | { |
24 | OFFSET(SC_RBX, sigcontext, rbx); | 27 | OFFSET(HOST_SC_RBX, sigcontext, rbx); |
25 | OFFSET(SC_RCX, sigcontext, rcx); | 28 | OFFSET(HOST_SC_RCX, sigcontext, rcx); |
26 | OFFSET(SC_RDX, sigcontext, rdx); | 29 | OFFSET(HOST_SC_RDX, sigcontext, rdx); |
27 | OFFSET(SC_RSI, sigcontext, rsi); | 30 | OFFSET(HOST_SC_RSI, sigcontext, rsi); |
28 | OFFSET(SC_RDI, sigcontext, rdi); | 31 | OFFSET(HOST_SC_RDI, sigcontext, rdi); |
29 | OFFSET(SC_RBP, sigcontext, rbp); | 32 | OFFSET(HOST_SC_RBP, sigcontext, rbp); |
30 | OFFSET(SC_RAX, sigcontext, rax); | 33 | OFFSET(HOST_SC_RAX, sigcontext, rax); |
31 | OFFSET(SC_R8, sigcontext, r8); | 34 | OFFSET(HOST_SC_R8, sigcontext, r8); |
32 | OFFSET(SC_R9, sigcontext, r9); | 35 | OFFSET(HOST_SC_R9, sigcontext, r9); |
33 | OFFSET(SC_R10, sigcontext, r10); | 36 | OFFSET(HOST_SC_R10, sigcontext, r10); |
34 | OFFSET(SC_R11, sigcontext, r11); | 37 | OFFSET(HOST_SC_R11, sigcontext, r11); |
35 | OFFSET(SC_R12, sigcontext, r12); | 38 | OFFSET(HOST_SC_R12, sigcontext, r12); |
36 | OFFSET(SC_R13, sigcontext, r13); | 39 | OFFSET(HOST_SC_R13, sigcontext, r13); |
37 | OFFSET(SC_R14, sigcontext, r14); | 40 | OFFSET(HOST_SC_R14, sigcontext, r14); |
38 | OFFSET(SC_R15, sigcontext, r15); | 41 | OFFSET(HOST_SC_R15, sigcontext, r15); |
39 | OFFSET(SC_IP, sigcontext, rip); | 42 | OFFSET(HOST_SC_IP, sigcontext, rip); |
40 | OFFSET(SC_SP, sigcontext, rsp); | 43 | OFFSET(HOST_SC_SP, sigcontext, rsp); |
41 | OFFSET(SC_CR2, sigcontext, cr2); | 44 | OFFSET(HOST_SC_CR2, sigcontext, cr2); |
42 | OFFSET(SC_ERR, sigcontext, err); | 45 | OFFSET(HOST_SC_ERR, sigcontext, err); |
43 | OFFSET(SC_TRAPNO, sigcontext, trapno); | 46 | OFFSET(HOST_SC_TRAPNO, sigcontext, trapno); |
44 | OFFSET(SC_CS, sigcontext, cs); | 47 | OFFSET(HOST_SC_CS, sigcontext, cs); |
45 | OFFSET(SC_FS, sigcontext, fs); | 48 | OFFSET(HOST_SC_FS, sigcontext, fs); |
46 | OFFSET(SC_GS, sigcontext, gs); | 49 | OFFSET(HOST_SC_GS, sigcontext, gs); |
47 | OFFSET(SC_EFLAGS, sigcontext, eflags); | 50 | OFFSET(HOST_SC_EFLAGS, sigcontext, eflags); |
48 | OFFSET(SC_SIGMASK, sigcontext, oldmask); | 51 | OFFSET(HOST_SC_SIGMASK, sigcontext, oldmask); |
49 | #if 0 | 52 | #if 0 |
50 | OFFSET(SC_ORIG_RAX, sigcontext, orig_rax); | 53 | OFFSET(HOST_SC_ORIG_RAX, sigcontext, orig_rax); |
51 | OFFSET(SC_DS, sigcontext, ds); | 54 | OFFSET(HOST_SC_DS, sigcontext, ds); |
52 | OFFSET(SC_ES, sigcontext, es); | 55 | OFFSET(HOST_SC_ES, sigcontext, es); |
53 | OFFSET(SC_SS, sigcontext, ss); | 56 | OFFSET(HOST_SC_SS, sigcontext, ss); |
54 | #endif | 57 | #endif |
55 | 58 | ||
56 | DEFINE(HOST_FRAME_SIZE, FRAME_SIZE); | 59 | DEFINE_LONGS(HOST_FRAME_SIZE, FRAME_SIZE); |
57 | DEFINE(HOST_RBX, RBX); | 60 | DEFINE(HOST_FP_SIZE, 0); |
58 | DEFINE(HOST_RCX, RCX); | 61 | DEFINE(HOST_XFP_SIZE, 0); |
59 | DEFINE(HOST_RDI, RDI); | 62 | DEFINE_LONGS(HOST_RBX, RBX); |
60 | DEFINE(HOST_RSI, RSI); | 63 | DEFINE_LONGS(HOST_RCX, RCX); |
61 | DEFINE(HOST_RDX, RDX); | 64 | DEFINE_LONGS(HOST_RDI, RDI); |
62 | DEFINE(HOST_RBP, RBP); | 65 | DEFINE_LONGS(HOST_RSI, RSI); |
63 | DEFINE(HOST_RAX, RAX); | 66 | DEFINE_LONGS(HOST_RDX, RDX); |
64 | DEFINE(HOST_R8, R8); | 67 | DEFINE_LONGS(HOST_RBP, RBP); |
65 | DEFINE(HOST_R9, R9); | 68 | DEFINE_LONGS(HOST_RAX, RAX); |
66 | DEFINE(HOST_R10, R10); | 69 | DEFINE_LONGS(HOST_R8, R8); |
67 | DEFINE(HOST_R11, R11); | 70 | DEFINE_LONGS(HOST_R9, R9); |
68 | DEFINE(HOST_R12, R12); | 71 | DEFINE_LONGS(HOST_R10, R10); |
69 | DEFINE(HOST_R13, R13); | 72 | DEFINE_LONGS(HOST_R11, R11); |
70 | DEFINE(HOST_R14, R14); | 73 | DEFINE_LONGS(HOST_R12, R12); |
71 | DEFINE(HOST_R15, R15); | 74 | DEFINE_LONGS(HOST_R13, R13); |
72 | DEFINE(HOST_ORIG_RAX, ORIG_RAX); | 75 | DEFINE_LONGS(HOST_R14, R14); |
73 | DEFINE(HOST_CS, CS); | 76 | DEFINE_LONGS(HOST_R15, R15); |
74 | DEFINE(HOST_SS, SS); | 77 | DEFINE_LONGS(HOST_ORIG_RAX, ORIG_RAX); |
75 | DEFINE(HOST_EFLAGS, EFLAGS); | 78 | DEFINE_LONGS(HOST_CS, CS); |
79 | DEFINE_LONGS(HOST_SS, SS); | ||
80 | DEFINE_LONGS(HOST_EFLAGS, EFLAGS); | ||
76 | #if 0 | 81 | #if 0 |
77 | DEFINE(HOST_FS, FS); | 82 | DEFINE_LONGS(HOST_FS, FS); |
78 | DEFINE(HOST_GS, GS); | 83 | DEFINE_LONGS(HOST_GS, GS); |
79 | DEFINE(HOST_DS, DS); | 84 | DEFINE_LONGS(HOST_DS, DS); |
80 | DEFINE(HOST_ES, ES); | 85 | DEFINE_LONGS(HOST_ES, ES); |
81 | #endif | 86 | #endif |
82 | 87 | ||
83 | DEFINE(HOST_IP, RIP); | 88 | DEFINE_LONGS(HOST_IP, RIP); |
84 | DEFINE(HOST_SP, RSP); | 89 | DEFINE_LONGS(HOST_SP, RSP); |
85 | DEFINE(__UM_FRAME_SIZE, sizeof(struct user_regs_struct)); | 90 | DEFINE(UM_FRAME_SIZE, sizeof(struct user_regs_struct)); |
86 | } | 91 | } |
diff --git a/arch/um/sys-x86_64/util/Makefile b/arch/um/sys-x86_64/util/Makefile deleted file mode 100644 index 75b052cfc206..000000000000 --- a/arch/um/sys-x86_64/util/Makefile +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | # Copyright 2003 - 2004 Pathscale, Inc | ||
2 | # Released under the GPL | ||
3 | |||
4 | hostprogs-y := mk_sc mk_thread | ||
5 | always := $(hostprogs-y) | ||
6 | |||
7 | HOSTCFLAGS_mk_sc.o := -I$(objtree)/arch/um | ||
8 | HOSTCFLAGS_mk_thread.o := -I$(objtree)/arch/um | ||
diff --git a/arch/um/sys-x86_64/util/mk_sc.c b/arch/um/sys-x86_64/util/mk_sc.c deleted file mode 100644 index 7619bc377c1f..000000000000 --- a/arch/um/sys-x86_64/util/mk_sc.c +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* Copyright (C) 2003 - 2004 PathScale, Inc | ||
2 | * Released under the GPL | ||
3 | */ | ||
4 | |||
5 | #include <stdio.h> | ||
6 | #include <user-offsets.h> | ||
7 | |||
8 | #define SC_OFFSET(name) \ | ||
9 | printf("#define " #name \ | ||
10 | "(sc) *((unsigned long *) &(((char *) (sc))[%d]))\n",\ | ||
11 | name) | ||
12 | |||
13 | int main(int argc, char **argv) | ||
14 | { | ||
15 | SC_OFFSET(SC_RBX); | ||
16 | SC_OFFSET(SC_RCX); | ||
17 | SC_OFFSET(SC_RDX); | ||
18 | SC_OFFSET(SC_RSI); | ||
19 | SC_OFFSET(SC_RDI); | ||
20 | SC_OFFSET(SC_RBP); | ||
21 | SC_OFFSET(SC_RAX); | ||
22 | SC_OFFSET(SC_R8); | ||
23 | SC_OFFSET(SC_R9); | ||
24 | SC_OFFSET(SC_R10); | ||
25 | SC_OFFSET(SC_R11); | ||
26 | SC_OFFSET(SC_R12); | ||
27 | SC_OFFSET(SC_R13); | ||
28 | SC_OFFSET(SC_R14); | ||
29 | SC_OFFSET(SC_R15); | ||
30 | SC_OFFSET(SC_IP); | ||
31 | SC_OFFSET(SC_SP); | ||
32 | SC_OFFSET(SC_CR2); | ||
33 | SC_OFFSET(SC_ERR); | ||
34 | SC_OFFSET(SC_TRAPNO); | ||
35 | SC_OFFSET(SC_CS); | ||
36 | SC_OFFSET(SC_FS); | ||
37 | SC_OFFSET(SC_GS); | ||
38 | SC_OFFSET(SC_EFLAGS); | ||
39 | SC_OFFSET(SC_SIGMASK); | ||
40 | #if 0 | ||
41 | SC_OFFSET(SC_ORIG_RAX); | ||
42 | SC_OFFSET(SC_DS); | ||
43 | SC_OFFSET(SC_ES); | ||
44 | SC_OFFSET(SC_SS); | ||
45 | #endif | ||
46 | return(0); | ||
47 | } | ||
diff --git a/arch/um/sys-x86_64/util/mk_thread.c b/arch/um/sys-x86_64/util/mk_thread.c deleted file mode 100644 index 15517396e9cf..000000000000 --- a/arch/um/sys-x86_64/util/mk_thread.c +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <kernel-offsets.h> | ||
3 | |||
4 | int main(int argc, char **argv) | ||
5 | { | ||
6 | printf("/*\n"); | ||
7 | printf(" * Generated by mk_thread\n"); | ||
8 | printf(" */\n"); | ||
9 | printf("\n"); | ||
10 | printf("#ifndef __UM_THREAD_H\n"); | ||
11 | printf("#define __UM_THREAD_H\n"); | ||
12 | printf("\n"); | ||
13 | #ifdef TASK_EXTERN_PID | ||
14 | printf("#define TASK_EXTERN_PID(task) *((int *) &(((char *) (task))[%d]))\n", | ||
15 | TASK_EXTERN_PID); | ||
16 | #endif | ||
17 | printf("\n"); | ||
18 | printf("#endif\n"); | ||
19 | return(0); | ||
20 | } | ||
diff --git a/arch/um/util/Makefile b/arch/um/util/Makefile deleted file mode 100644 index 4c7551c28033..000000000000 --- a/arch/um/util/Makefile +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | hostprogs-y := mk_task mk_constants | ||
2 | always := $(hostprogs-y) | ||
3 | |||
4 | HOSTCFLAGS_mk_task.o := -I$(objtree)/arch/um | ||
5 | HOSTCFLAGS_mk_constants.o := -I$(objtree)/arch/um | ||
diff --git a/arch/um/util/mk_constants.c b/arch/um/util/mk_constants.c deleted file mode 100644 index ab217becc36a..000000000000 --- a/arch/um/util/mk_constants.c +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <kernel-offsets.h> | ||
3 | |||
4 | #define SHOW_INT(sym) printf("#define %s %d\n", #sym, sym) | ||
5 | #define SHOW_STR(sym) printf("#define %s %s\n", #sym, sym) | ||
6 | |||
7 | int main(int argc, char **argv) | ||
8 | { | ||
9 | printf("/*\n"); | ||
10 | printf(" * Generated by mk_constants\n"); | ||
11 | printf(" */\n"); | ||
12 | printf("\n"); | ||
13 | printf("#ifndef __UM_CONSTANTS_H\n"); | ||
14 | printf("#define __UM_CONSTANTS_H\n"); | ||
15 | printf("\n"); | ||
16 | |||
17 | SHOW_INT(UM_KERN_PAGE_SIZE); | ||
18 | |||
19 | SHOW_STR(UM_KERN_EMERG); | ||
20 | SHOW_STR(UM_KERN_ALERT); | ||
21 | SHOW_STR(UM_KERN_CRIT); | ||
22 | SHOW_STR(UM_KERN_ERR); | ||
23 | SHOW_STR(UM_KERN_WARNING); | ||
24 | SHOW_STR(UM_KERN_NOTICE); | ||
25 | SHOW_STR(UM_KERN_INFO); | ||
26 | SHOW_STR(UM_KERN_DEBUG); | ||
27 | |||
28 | SHOW_INT(UM_NSEC_PER_SEC); | ||
29 | printf("\n"); | ||
30 | printf("#endif\n"); | ||
31 | return(0); | ||
32 | } | ||
diff --git a/arch/um/util/mk_task.c b/arch/um/util/mk_task.c deleted file mode 100644 index 36c9606505e2..000000000000 --- a/arch/um/util/mk_task.c +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <kernel-offsets.h> | ||
3 | |||
4 | void print_ptr(char *name, char *type, int offset) | ||
5 | { | ||
6 | printf("#define %s(task) ((%s *) &(((char *) (task))[%d]))\n", name, type, | ||
7 | offset); | ||
8 | } | ||
9 | |||
10 | void print(char *name, char *type, int offset) | ||
11 | { | ||
12 | printf("#define %s(task) *((%s *) &(((char *) (task))[%d]))\n", name, type, | ||
13 | offset); | ||
14 | } | ||
15 | |||
16 | int main(int argc, char **argv) | ||
17 | { | ||
18 | printf("/*\n"); | ||
19 | printf(" * Generated by mk_task\n"); | ||
20 | printf(" */\n"); | ||
21 | printf("\n"); | ||
22 | printf("#ifndef __TASK_H\n"); | ||
23 | printf("#define __TASK_H\n"); | ||
24 | printf("\n"); | ||
25 | print_ptr("TASK_REGS", "union uml_pt_regs", TASK_REGS); | ||
26 | print("TASK_PID", "int", TASK_PID); | ||
27 | printf("\n"); | ||
28 | printf("#endif\n"); | ||
29 | return(0); | ||
30 | } | ||
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index 08203b07f4bd..69541db5ff2c 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c | |||
@@ -54,9 +54,12 @@ void mce_log(struct mce *mce) | |||
54 | { | 54 | { |
55 | unsigned next, entry; | 55 | unsigned next, entry; |
56 | mce->finished = 0; | 56 | mce->finished = 0; |
57 | smp_wmb(); | 57 | wmb(); |
58 | for (;;) { | 58 | for (;;) { |
59 | entry = rcu_dereference(mcelog.next); | 59 | entry = rcu_dereference(mcelog.next); |
60 | /* The rmb forces the compiler to reload next in each | ||
61 | iteration */ | ||
62 | rmb(); | ||
60 | for (;;) { | 63 | for (;;) { |
61 | /* When the buffer fills up discard new entries. Assume | 64 | /* When the buffer fills up discard new entries. Assume |
62 | that the earlier errors are the more interesting. */ | 65 | that the earlier errors are the more interesting. */ |
@@ -69,6 +72,7 @@ void mce_log(struct mce *mce) | |||
69 | entry++; | 72 | entry++; |
70 | continue; | 73 | continue; |
71 | } | 74 | } |
75 | break; | ||
72 | } | 76 | } |
73 | smp_rmb(); | 77 | smp_rmb(); |
74 | next = entry + 1; | 78 | next = entry + 1; |
@@ -76,9 +80,9 @@ void mce_log(struct mce *mce) | |||
76 | break; | 80 | break; |
77 | } | 81 | } |
78 | memcpy(mcelog.entry + entry, mce, sizeof(struct mce)); | 82 | memcpy(mcelog.entry + entry, mce, sizeof(struct mce)); |
79 | smp_wmb(); | 83 | wmb(); |
80 | mcelog.entry[entry].finished = 1; | 84 | mcelog.entry[entry].finished = 1; |
81 | smp_wmb(); | 85 | wmb(); |
82 | 86 | ||
83 | if (!test_and_set_bit(0, &console_logged)) | 87 | if (!test_and_set_bit(0, &console_logged)) |
84 | notify_user = 1; | 88 | notify_user = 1; |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index 238f73e1a834..257f5ba17902 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -831,8 +831,6 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c) | |||
831 | #endif | 831 | #endif |
832 | } | 832 | } |
833 | 833 | ||
834 | #define HWCR 0xc0010015 | ||
835 | |||
836 | static int __init init_amd(struct cpuinfo_x86 *c) | 834 | static int __init init_amd(struct cpuinfo_x86 *c) |
837 | { | 835 | { |
838 | int r; | 836 | int r; |
@@ -841,14 +839,18 @@ static int __init init_amd(struct cpuinfo_x86 *c) | |||
841 | #ifdef CONFIG_SMP | 839 | #ifdef CONFIG_SMP |
842 | unsigned long value; | 840 | unsigned long value; |
843 | 841 | ||
844 | // Disable TLB flush filter by setting HWCR.FFDIS: | 842 | /* |
845 | // bit 6 of msr C001_0015 | 843 | * Disable TLB flush filter by setting HWCR.FFDIS on K8 |
846 | // | 844 | * bit 6 of msr C001_0015 |
847 | // Errata 63 for SH-B3 steppings | 845 | * |
848 | // Errata 122 for all(?) steppings | 846 | * Errata 63 for SH-B3 steppings |
849 | rdmsrl(HWCR, value); | 847 | * Errata 122 for all steppings (F+ have it disabled by default) |
850 | value |= 1 << 6; | 848 | */ |
851 | wrmsrl(HWCR, value); | 849 | if (c->x86 == 15) { |
850 | rdmsrl(MSR_K8_HWCR, value); | ||
851 | value |= 1 << 6; | ||
852 | wrmsrl(MSR_K8_HWCR, value); | ||
853 | } | ||
852 | #endif | 854 | #endif |
853 | 855 | ||
854 | /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; | 856 | /* Bit 31 in normal CPUID used for nonstandard 3DNow ID; |