aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/configs/omap_ldp_defconfig24
-rw-r--r--arch/arm/configs/pcm037_defconfig23
-rw-r--r--arch/arm/configs/realview-smp_defconfig24
-rw-r--r--arch/arm/configs/realview_defconfig24
-rw-r--r--arch/arm/mach-at91/pm.c8
-rw-r--r--arch/arm/mach-gemini/include/mach/system.h2
-rw-r--r--arch/arm/mach-mmp/include/mach/system.h2
-rw-r--r--arch/arm/mach-mx3/pcm037.c23
-rw-r--r--arch/arm/mach-omap2/Makefile2
-rw-r--r--arch/arm/mach-omap2/board-ldp.c47
-rw-r--r--arch/arm/mach-omap2/board-overo.c65
-rw-r--r--arch/arm/mach-realview/core.c17
-rw-r--r--arch/arm/mach-realview/localtimer.c1
-rw-r--r--arch/arm/mm/abort-ev6.S4
-rw-r--r--arch/arm/mm/cache-feroceon-l2.c9
-rw-r--r--arch/arm/vfp/entry.S23
-rw-r--r--arch/arm/vfp/vfphw.S12
-rw-r--r--arch/arm/vfp/vfpmodule.c6
-rw-r--r--arch/m68k/include/asm/bootinfo.h381
-rw-r--r--arch/m68k/include/asm/bootinfo_mm.h378
-rw-r--r--arch/m68k/include/asm/bootinfo_no.h2
-rw-r--r--arch/m68k/include/asm/bug.h31
-rw-r--r--arch/m68k/include/asm/bug_mm.h29
-rw-r--r--arch/m68k/include/asm/bug_no.h4
-rw-r--r--arch/m68k/include/asm/bugs.h21
-rw-r--r--arch/m68k/include/asm/bugs_mm.h14
-rw-r--r--arch/m68k/include/asm/bugs_no.h16
-rw-r--r--arch/m68k/include/asm/cache.h14
-rw-r--r--arch/m68k/include/asm/cache_mm.h11
-rw-r--r--arch/m68k/include/asm/cache_no.h12
-rw-r--r--arch/m68k/include/asm/current.h31
-rw-r--r--arch/m68k/include/asm/current_mm.h6
-rw-r--r--arch/m68k/include/asm/current_no.h24
-rw-r--r--arch/m68k/include/asm/div64.h37
-rw-r--r--arch/m68k/include/asm/div64_mm.h28
-rw-r--r--arch/m68k/include/asm/div64_no.h1
-rw-r--r--arch/m68k/include/asm/dma-mapping.h113
-rw-r--r--arch/m68k/include/asm/dma-mapping_mm.h112
-rw-r--r--arch/m68k/include/asm/dma-mapping_no.h6
-rw-r--r--arch/m68k/include/asm/elf.h120
-rw-r--r--arch/m68k/include/asm/elf_mm.h119
-rw-r--r--arch/m68k/include/asm/elf_no.h110
-rw-r--r--arch/m68k/include/asm/fb.h41
-rw-r--r--arch/m68k/include/asm/fb_mm.h34
-rw-r--r--arch/m68k/include/asm/fb_no.h12
-rw-r--r--arch/m68k/include/asm/fpu.h22
-rw-r--r--arch/m68k/include/asm/fpu_mm.h21
-rw-r--r--arch/m68k/include/asm/fpu_no.h21
-rw-r--r--arch/m68k/include/asm/hw_irq.h9
-rw-r--r--arch/m68k/include/asm/hw_irq_mm.h6
-rw-r--r--arch/m68k/include/asm/hw_irq_no.h4
-rw-r--r--arch/m68k/include/asm/kmap_types.h26
-rw-r--r--arch/m68k/include/asm/kmap_types_mm.h21
-rw-r--r--arch/m68k/include/asm/kmap_types_no.h21
-rw-r--r--arch/m68k/include/asm/m532xsim.h1
-rw-r--r--arch/m68k/include/asm/mc146818rtc.h31
-rw-r--r--arch/m68k/include/asm/mc146818rtc_mm.h26
-rw-r--r--arch/m68k/include/asm/mc146818rtc_no.h9
-rw-r--r--arch/m68k/include/asm/mcfpci.h119
-rw-r--r--arch/m68k/include/asm/mmu.h14
-rw-r--r--arch/m68k/include/asm/mmu_context.h176
-rw-r--r--arch/m68k/include/asm/mmu_context_mm.h154
-rw-r--r--arch/m68k/include/asm/mmu_context_no.h33
-rw-r--r--arch/m68k/include/asm/mmu_mm.h7
-rw-r--r--arch/m68k/include/asm/mmu_no.h10
-rw-r--r--arch/m68k/include/asm/module.h51
-rw-r--r--arch/m68k/include/asm/module_mm.h39
-rw-r--r--arch/m68k/include/asm/module_no.h11
-rw-r--r--arch/m68k/include/asm/page_offset.h12
-rw-r--r--arch/m68k/include/asm/page_offset_mm.h8
-rw-r--r--arch/m68k/include/asm/page_offset_no.h5
-rw-r--r--arch/m68k/include/asm/pci.h17
-rw-r--r--arch/m68k/include/asm/pci_mm.h12
-rw-r--r--arch/m68k/include/asm/pci_no.h29
-rw-r--r--arch/m68k/include/asm/pgalloc.h20
-rw-r--r--arch/m68k/include/asm/pgalloc_mm.h19
-rw-r--r--arch/m68k/include/asm/pgalloc_no.h8
-rw-r--r--arch/m68k/include/asm/pgtable_no.h2
-rw-r--r--arch/m68k/include/asm/rtc.h7
-rw-r--r--arch/m68k/include/asm/scatterlist.h26
-rw-r--r--arch/m68k/include/asm/scatterlist_mm.h23
-rw-r--r--arch/m68k/include/asm/scatterlist_no.h22
-rw-r--r--arch/m68k/include/asm/segment.h64
-rw-r--r--arch/m68k/include/asm/segment_mm.h57
-rw-r--r--arch/m68k/include/asm/segment_no.h51
-rw-r--r--arch/m68k/include/asm/timex.h21
-rw-r--r--arch/m68k/include/asm/timex_mm.h18
-rw-r--r--arch/m68k/include/asm/timex_no.h23
-rw-r--r--arch/m68k/include/asm/tlbflush.h268
-rw-r--r--arch/m68k/include/asm/tlbflush_mm.h219
-rw-r--r--arch/m68k/include/asm/tlbflush_no.h55
-rw-r--r--arch/m68k/include/asm/ucontext.h33
-rw-r--r--arch/m68k/include/asm/ucontext_mm.h30
-rw-r--r--arch/m68k/include/asm/ucontext_no.h32
-rw-r--r--arch/m68k/include/asm/unaligned.h26
-rw-r--r--arch/m68k/include/asm/unaligned_mm.h13
-rw-r--r--arch/m68k/include/asm/unaligned_no.h25
-rw-r--r--arch/m68k/kernel/time.c18
-rw-r--r--arch/m68knommu/Makefile14
-rw-r--r--arch/m68knommu/kernel/dma.c8
-rw-r--r--arch/m68knommu/kernel/irq.c2
-rw-r--r--arch/m68knommu/mm/init.c6
-rw-r--r--arch/m68knommu/platform/5249/config.c11
-rw-r--r--arch/m68knommu/platform/5307/config.c8
-rw-r--r--arch/m68knommu/platform/5407/config.c8
-rw-r--r--arch/m68knommu/platform/coldfire/Makefile2
-rw-r--r--arch/m68knommu/platform/coldfire/clk.c40
-rw-r--r--arch/parisc/Kconfig12
-rw-r--r--arch/parisc/Makefile4
-rw-r--r--arch/parisc/include/asm/atomic.h18
-rw-r--r--arch/parisc/include/asm/cacheflush.h3
-rw-r--r--arch/parisc/include/asm/elf.h10
-rw-r--r--arch/parisc/include/asm/ftrace.h25
-rw-r--r--arch/parisc/include/asm/page.h13
-rw-r--r--arch/parisc/include/asm/pdc.h4
-rw-r--r--arch/parisc/include/asm/pgtable.h15
-rw-r--r--arch/parisc/include/asm/smp.h3
-rw-r--r--arch/parisc/kernel/Makefile15
-rw-r--r--arch/parisc/kernel/entry.S60
-rw-r--r--arch/parisc/kernel/firmware.c6
-rw-r--r--arch/parisc/kernel/ftrace.c185
-rw-r--r--arch/parisc/kernel/irq.c4
-rw-r--r--arch/parisc/kernel/module.c18
-rw-r--r--arch/parisc/kernel/parisc_ksyms.c5
-rw-r--r--arch/parisc/kernel/process.c29
-rw-r--r--arch/parisc/kernel/processor.c13
-rw-r--r--arch/parisc/kernel/smp.c21
-rw-r--r--arch/parisc/kernel/stacktrace.c63
-rw-r--r--arch/parisc/kernel/syscall.S58
-rw-r--r--arch/parisc/kernel/time.c9
-rw-r--r--arch/parisc/kernel/traps.c5
-rw-r--r--arch/parisc/kernel/vmlinux.lds.S2
-rw-r--r--arch/parisc/mm/init.c7
-rw-r--r--arch/powerpc/include/asm/ps3.h3
-rw-r--r--arch/powerpc/kernel/time.c16
-rw-r--r--arch/powerpc/platforms/ps3/os-area.c2
-rw-r--r--arch/powerpc/platforms/ps3/platform.h2
-rw-r--r--arch/powerpc/platforms/ps3/setup.c2
-rw-r--r--arch/powerpc/platforms/ps3/time.c26
-rw-r--r--arch/um/drivers/ubd_kern.c12
-rw-r--r--arch/x86/Kconfig4
-rw-r--r--arch/x86/kernel/amd_iommu.c7
-rw-r--r--arch/x86/mm/highmem_32.c1
-rw-r--r--arch/x86/mm/iomap_32.c2
-rw-r--r--arch/x86/pci/i386.c46
145 files changed, 2421 insertions, 2426 deletions
diff --git a/arch/arm/configs/omap_ldp_defconfig b/arch/arm/configs/omap_ldp_defconfig
index aa9d34feddc6..679a4a3e265e 100644
--- a/arch/arm/configs/omap_ldp_defconfig
+++ b/arch/arm/configs/omap_ldp_defconfig
@@ -474,14 +474,34 @@ CONFIG_NETDEVICES=y
474# CONFIG_EQUALIZER is not set 474# CONFIG_EQUALIZER is not set
475# CONFIG_TUN is not set 475# CONFIG_TUN is not set
476# CONFIG_VETH is not set 476# CONFIG_VETH is not set
477# CONFIG_PHYLIB is not set 477CONFIG_PHYLIB=y
478
479#
480# MII PHY device drivers
481#
482# CONFIG_MARVELL_PHY is not set
483# CONFIG_DAVICOM_PHY is not set
484# CONFIG_QSEMI_PHY is not set
485# CONFIG_LXT_PHY is not set
486# CONFIG_CICADA_PHY is not set
487# CONFIG_VITESSE_PHY is not set
488CONFIG_SMSC_PHY=y
489# CONFIG_BROADCOM_PHY is not set
490# CONFIG_ICPLUS_PHY is not set
491# CONFIG_REALTEK_PHY is not set
492# CONFIG_NATIONAL_PHY is not set
493# CONFIG_STE10XP is not set
494# CONFIG_LSI_ET1011C_PHY is not set
495# CONFIG_FIXED_PHY is not set
496# CONFIG_MDIO_BITBANG is not set
478CONFIG_NET_ETHERNET=y 497CONFIG_NET_ETHERNET=y
479CONFIG_MII=y 498CONFIG_MII=y
480# CONFIG_AX88796 is not set 499# CONFIG_AX88796 is not set
481# CONFIG_SMC91X is not set 500# CONFIG_SMC91X is not set
482# CONFIG_DM9000 is not set 501# CONFIG_DM9000 is not set
483# CONFIG_ENC28J60 is not set 502# CONFIG_ENC28J60 is not set
484CONFIG_SMC911X=y 503# CONFIG_SMC911X is not set
504CONFIG_SMSC911X=y
485# CONFIG_IBM_NEW_EMAC_ZMII is not set 505# CONFIG_IBM_NEW_EMAC_ZMII is not set
486# CONFIG_IBM_NEW_EMAC_RGMII is not set 506# CONFIG_IBM_NEW_EMAC_RGMII is not set
487# CONFIG_IBM_NEW_EMAC_TAH is not set 507# CONFIG_IBM_NEW_EMAC_TAH is not set
diff --git a/arch/arm/configs/pcm037_defconfig b/arch/arm/configs/pcm037_defconfig
index 627474586470..6e37c77c4760 100644
--- a/arch/arm/configs/pcm037_defconfig
+++ b/arch/arm/configs/pcm037_defconfig
@@ -465,12 +465,33 @@ CONFIG_NETDEVICES=y
465# CONFIG_EQUALIZER is not set 465# CONFIG_EQUALIZER is not set
466# CONFIG_TUN is not set 466# CONFIG_TUN is not set
467# CONFIG_VETH is not set 467# CONFIG_VETH is not set
468# CONFIG_PHYLIB is not set 468CONFIG_PHYLIB=y
469
470#
471# MII PHY device drivers
472#
473# CONFIG_MARVELL_PHY is not set
474# CONFIG_DAVICOM_PHY is not set
475# CONFIG_QSEMI_PHY is not set
476# CONFIG_LXT_PHY is not set
477# CONFIG_CICADA_PHY is not set
478# CONFIG_VITESSE_PHY is not set
479CONFIG_SMSC_PHY=y
480# CONFIG_BROADCOM_PHY is not set
481# CONFIG_ICPLUS_PHY is not set
482# CONFIG_REALTEK_PHY is not set
483# CONFIG_NATIONAL_PHY is not set
484# CONFIG_STE10XP is not set
485# CONFIG_LSI_ET1011C_PHY is not set
486# CONFIG_FIXED_PHY is not set
487# CONFIG_MDIO_BITBANG is not set
469CONFIG_NET_ETHERNET=y 488CONFIG_NET_ETHERNET=y
470CONFIG_MII=y 489CONFIG_MII=y
471# CONFIG_AX88796 is not set 490# CONFIG_AX88796 is not set
472CONFIG_SMC91X=y 491CONFIG_SMC91X=y
473# CONFIG_DM9000 is not set 492# CONFIG_DM9000 is not set
493# CONFIG_SMC911X is not set
494CONFIG_SMSC911X=y
474# CONFIG_IBM_NEW_EMAC_ZMII is not set 495# CONFIG_IBM_NEW_EMAC_ZMII is not set
475# CONFIG_IBM_NEW_EMAC_RGMII is not set 496# CONFIG_IBM_NEW_EMAC_RGMII is not set
476# CONFIG_IBM_NEW_EMAC_TAH is not set 497# CONFIG_IBM_NEW_EMAC_TAH is not set
diff --git a/arch/arm/configs/realview-smp_defconfig b/arch/arm/configs/realview-smp_defconfig
index cd29824d791c..21db4b3ec8ff 100644
--- a/arch/arm/configs/realview-smp_defconfig
+++ b/arch/arm/configs/realview-smp_defconfig
@@ -496,13 +496,33 @@ CONFIG_NETDEVICES=y
496# CONFIG_EQUALIZER is not set 496# CONFIG_EQUALIZER is not set
497# CONFIG_TUN is not set 497# CONFIG_TUN is not set
498# CONFIG_VETH is not set 498# CONFIG_VETH is not set
499# CONFIG_PHYLIB is not set 499CONFIG_PHYLIB=y
500
501#
502# MII PHY device drivers
503#
504# CONFIG_MARVELL_PHY is not set
505# CONFIG_DAVICOM_PHY is not set
506# CONFIG_QSEMI_PHY is not set
507# CONFIG_LXT_PHY is not set
508# CONFIG_CICADA_PHY is not set
509# CONFIG_VITESSE_PHY is not set
510CONFIG_SMSC_PHY=y
511# CONFIG_BROADCOM_PHY is not set
512# CONFIG_ICPLUS_PHY is not set
513# CONFIG_REALTEK_PHY is not set
514# CONFIG_NATIONAL_PHY is not set
515# CONFIG_STE10XP is not set
516# CONFIG_LSI_ET1011C_PHY is not set
517# CONFIG_FIXED_PHY is not set
518# CONFIG_MDIO_BITBANG is not set
500CONFIG_NET_ETHERNET=y 519CONFIG_NET_ETHERNET=y
501CONFIG_MII=y 520CONFIG_MII=y
502# CONFIG_AX88796 is not set 521# CONFIG_AX88796 is not set
503CONFIG_SMC91X=y 522CONFIG_SMC91X=y
504# CONFIG_DM9000 is not set 523# CONFIG_DM9000 is not set
505CONFIG_SMC911X=y 524# CONFIG_SMC911X is not set
525CONFIG_SMSC911X=y
506# CONFIG_IBM_NEW_EMAC_ZMII is not set 526# CONFIG_IBM_NEW_EMAC_ZMII is not set
507# CONFIG_IBM_NEW_EMAC_RGMII is not set 527# CONFIG_IBM_NEW_EMAC_RGMII is not set
508# CONFIG_IBM_NEW_EMAC_TAH is not set 528# CONFIG_IBM_NEW_EMAC_TAH is not set
diff --git a/arch/arm/configs/realview_defconfig b/arch/arm/configs/realview_defconfig
index 7e253f58ed18..9a75c30b910d 100644
--- a/arch/arm/configs/realview_defconfig
+++ b/arch/arm/configs/realview_defconfig
@@ -490,13 +490,33 @@ CONFIG_NETDEVICES=y
490# CONFIG_EQUALIZER is not set 490# CONFIG_EQUALIZER is not set
491# CONFIG_TUN is not set 491# CONFIG_TUN is not set
492# CONFIG_VETH is not set 492# CONFIG_VETH is not set
493# CONFIG_PHYLIB is not set 493CONFIG_PHYLIB=y
494
495#
496# MII PHY device drivers
497#
498# CONFIG_MARVELL_PHY is not set
499# CONFIG_DAVICOM_PHY is not set
500# CONFIG_QSEMI_PHY is not set
501# CONFIG_LXT_PHY is not set
502# CONFIG_CICADA_PHY is not set
503# CONFIG_VITESSE_PHY is not set
504CONFIG_SMSC_PHY=y
505# CONFIG_BROADCOM_PHY is not set
506# CONFIG_ICPLUS_PHY is not set
507# CONFIG_REALTEK_PHY is not set
508# CONFIG_NATIONAL_PHY is not set
509# CONFIG_STE10XP is not set
510# CONFIG_LSI_ET1011C_PHY is not set
511# CONFIG_FIXED_PHY is not set
512# CONFIG_MDIO_BITBANG is not set
494CONFIG_NET_ETHERNET=y 513CONFIG_NET_ETHERNET=y
495CONFIG_MII=y 514CONFIG_MII=y
496# CONFIG_AX88796 is not set 515# CONFIG_AX88796 is not set
497CONFIG_SMC91X=y 516CONFIG_SMC91X=y
498# CONFIG_DM9000 is not set 517# CONFIG_DM9000 is not set
499CONFIG_SMC911X=y 518# CONFIG_SMC911X is not set
519CONFIG_SMSC911X=y
500# CONFIG_IBM_NEW_EMAC_ZMII is not set 520# CONFIG_IBM_NEW_EMAC_ZMII is not set
501# CONFIG_IBM_NEW_EMAC_RGMII is not set 521# CONFIG_IBM_NEW_EMAC_RGMII is not set
502# CONFIG_IBM_NEW_EMAC_TAH is not set 522# CONFIG_IBM_NEW_EMAC_TAH is not set
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 7ac812dc055a..e26c4fe61fae 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -198,17 +198,17 @@ static int at91_pm_verify_clocks(void)
198 /* USB must not be using PLLB */ 198 /* USB must not be using PLLB */
199 if (cpu_is_at91rm9200()) { 199 if (cpu_is_at91rm9200()) {
200 if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) { 200 if ((scsr & (AT91RM9200_PMC_UHP | AT91RM9200_PMC_UDP)) != 0) {
201 pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); 201 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
202 return 0; 202 return 0;
203 } 203 }
204 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) { 204 } else if (cpu_is_at91sam9260() || cpu_is_at91sam9261() || cpu_is_at91sam9263() || cpu_is_at91sam9g20()) {
205 if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) { 205 if ((scsr & (AT91SAM926x_PMC_UHP | AT91SAM926x_PMC_UDP)) != 0) {
206 pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); 206 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
207 return 0; 207 return 0;
208 } 208 }
209 } else if (cpu_is_at91cap9()) { 209 } else if (cpu_is_at91cap9()) {
210 if ((scsr & AT91CAP9_PMC_UHP) != 0) { 210 if ((scsr & AT91CAP9_PMC_UHP) != 0) {
211 pr_debug("AT91: PM - Suspend-to-RAM with USB still active\n"); 211 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
212 return 0; 212 return 0;
213 } 213 }
214 } 214 }
@@ -223,7 +223,7 @@ static int at91_pm_verify_clocks(void)
223 223
224 css = at91_sys_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS; 224 css = at91_sys_read(AT91_PMC_PCKR(i)) & AT91_PMC_CSS;
225 if (css != AT91_PMC_CSS_SLOW) { 225 if (css != AT91_PMC_CSS_SLOW) {
226 pr_debug("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css); 226 pr_err("AT91: PM - Suspend-to-RAM with PCK%d src %d\n", i, css);
227 return 0; 227 return 0;
228 } 228 }
229 } 229 }
diff --git a/arch/arm/mach-gemini/include/mach/system.h b/arch/arm/mach-gemini/include/mach/system.h
index bbbd72767a02..4d9c1f872472 100644
--- a/arch/arm/mach-gemini/include/mach/system.h
+++ b/arch/arm/mach-gemini/include/mach/system.h
@@ -28,7 +28,7 @@ static inline void arch_idle(void)
28 cpu_do_idle(); 28 cpu_do_idle();
29} 29}
30 30
31static inline void arch_reset(char mode) 31static inline void arch_reset(char mode, const char *cmd)
32{ 32{
33 __raw_writel(RESET_GLOBAL | RESET_CPU1, 33 __raw_writel(RESET_GLOBAL | RESET_CPU1,
34 IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET); 34 IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET);
diff --git a/arch/arm/mach-mmp/include/mach/system.h b/arch/arm/mach-mmp/include/mach/system.h
index 001edfefec19..4f5b0e0ce6cf 100644
--- a/arch/arm/mach-mmp/include/mach/system.h
+++ b/arch/arm/mach-mmp/include/mach/system.h
@@ -14,7 +14,7 @@ static inline void arch_idle(void)
14 cpu_do_idle(); 14 cpu_do_idle();
15} 15}
16 16
17static inline void arch_reset(char mode) 17static inline void arch_reset(char mode, const char *cmd)
18{ 18{
19 cpu_reset(0); 19 cpu_reset(0);
20} 20}
diff --git a/arch/arm/mach-mx3/pcm037.c b/arch/arm/mach-mx3/pcm037.c
index 5fce022114de..c3648eff5137 100644
--- a/arch/arm/mach-mx3/pcm037.c
+++ b/arch/arm/mach-mx3/pcm037.c
@@ -24,7 +24,7 @@
24#include <linux/mtd/plat-ram.h> 24#include <linux/mtd/plat-ram.h>
25#include <linux/memory.h> 25#include <linux/memory.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/smc911x.h> 27#include <linux/smsc911x.h>
28#include <linux/interrupt.h> 28#include <linux/interrupt.h>
29#include <linux/i2c.h> 29#include <linux/i2c.h>
30#include <linux/i2c/at24.h> 30#include <linux/i2c/at24.h>
@@ -70,7 +70,7 @@ static struct imxuart_platform_data uart_pdata = {
70 .flags = IMXUART_HAVE_RTSCTS, 70 .flags = IMXUART_HAVE_RTSCTS,
71}; 71};
72 72
73static struct resource smc911x_resources[] = { 73static struct resource smsc911x_resources[] = {
74 [0] = { 74 [0] = {
75 .start = CS1_BASE_ADDR + 0x300, 75 .start = CS1_BASE_ADDR + 0x300,
76 .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1, 76 .end = CS1_BASE_ADDR + 0x300 + SZ_64K - 1,
@@ -79,22 +79,25 @@ static struct resource smc911x_resources[] = {
79 [1] = { 79 [1] = {
80 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), 80 .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
81 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), 81 .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1),
82 .flags = IORESOURCE_IRQ, 82 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
83 }, 83 },
84}; 84};
85 85
86static struct smc911x_platdata smc911x_info = { 86static struct smsc911x_platform_config smsc911x_info = {
87 .flags = SMC911X_USE_32BIT, 87 .flags = SMSC911X_USE_32BIT | SMSC911X_FORCE_INTERNAL_PHY |
88 .irq_flags = IRQF_SHARED | IRQF_TRIGGER_LOW, 88 SMSC911X_SAVE_MAC_ADDRESS,
89 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
90 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
91 .phy_interface = PHY_INTERFACE_MODE_MII,
89}; 92};
90 93
91static struct platform_device pcm037_eth = { 94static struct platform_device pcm037_eth = {
92 .name = "smc911x", 95 .name = "smsc911x",
93 .id = -1, 96 .id = -1,
94 .num_resources = ARRAY_SIZE(smc911x_resources), 97 .num_resources = ARRAY_SIZE(smsc911x_resources),
95 .resource = smc911x_resources, 98 .resource = smsc911x_resources,
96 .dev = { 99 .dev = {
97 .platform_data = &smc911x_info, 100 .platform_data = &smsc911x_info,
98 }, 101 },
99}; 102};
100 103
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index a2c3fcc27a22..c49d9bfa3abd 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -47,6 +47,8 @@ obj-$(CONFIG_MACH_OMAP_3430SDP) += board-3430sdp.o \
47 47
48obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \ 48obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
49 board-rx51-peripherals.o \ 49 board-rx51-peripherals.o \
50 mmc-twl4030.o
51
50# Platform specific device init code 52# Platform specific device init code
51ifeq ($(CONFIG_USB_MUSB_SOC),y) 53ifeq ($(CONFIG_USB_MUSB_SOC),y)
52obj-y += usb-musb.o 54obj-y += usb-musb.o
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index e096f776f996..da57b0fcda14 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -23,6 +23,7 @@
23#include <linux/spi/ads7846.h> 23#include <linux/spi/ads7846.h>
24#include <linux/i2c/twl4030.h> 24#include <linux/i2c/twl4030.h>
25#include <linux/io.h> 25#include <linux/io.h>
26#include <linux/smsc911x.h>
26 27
27#include <mach/hardware.h> 28#include <mach/hardware.h>
28#include <asm/mach-types.h> 29#include <asm/mach-types.h>
@@ -41,12 +42,12 @@
41 42
42#include "mmc-twl4030.h" 43#include "mmc-twl4030.h"
43 44
44#define LDP_SMC911X_CS 1 45#define LDP_SMSC911X_CS 1
45#define LDP_SMC911X_GPIO 152 46#define LDP_SMSC911X_GPIO 152
46#define DEBUG_BASE 0x08000000 47#define DEBUG_BASE 0x08000000
47#define LDP_ETHR_START DEBUG_BASE 48#define LDP_ETHR_START DEBUG_BASE
48 49
49static struct resource ldp_smc911x_resources[] = { 50static struct resource ldp_smsc911x_resources[] = {
50 [0] = { 51 [0] = {
51 .start = LDP_ETHR_START, 52 .start = LDP_ETHR_START,
52 .end = LDP_ETHR_START + SZ_4K, 53 .end = LDP_ETHR_START + SZ_4K,
@@ -59,40 +60,50 @@ static struct resource ldp_smc911x_resources[] = {
59 }, 60 },
60}; 61};
61 62
62static struct platform_device ldp_smc911x_device = { 63static struct smsc911x_platform_config ldp_smsc911x_config = {
63 .name = "smc911x", 64 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
65 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
66 .flags = SMSC911X_USE_32BIT,
67 .phy_interface = PHY_INTERFACE_MODE_MII,
68};
69
70static struct platform_device ldp_smsc911x_device = {
71 .name = "smsc911x",
64 .id = -1, 72 .id = -1,
65 .num_resources = ARRAY_SIZE(ldp_smc911x_resources), 73 .num_resources = ARRAY_SIZE(ldp_smsc911x_resources),
66 .resource = ldp_smc911x_resources, 74 .resource = ldp_smsc911x_resources,
75 .dev = {
76 .platform_data = &ldp_smsc911x_config,
77 },
67}; 78};
68 79
69static struct platform_device *ldp_devices[] __initdata = { 80static struct platform_device *ldp_devices[] __initdata = {
70 &ldp_smc911x_device, 81 &ldp_smsc911x_device,
71}; 82};
72 83
73static inline void __init ldp_init_smc911x(void) 84static inline void __init ldp_init_smsc911x(void)
74{ 85{
75 int eth_cs; 86 int eth_cs;
76 unsigned long cs_mem_base; 87 unsigned long cs_mem_base;
77 int eth_gpio = 0; 88 int eth_gpio = 0;
78 89
79 eth_cs = LDP_SMC911X_CS; 90 eth_cs = LDP_SMSC911X_CS;
80 91
81 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) { 92 if (gpmc_cs_request(eth_cs, SZ_16M, &cs_mem_base) < 0) {
82 printk(KERN_ERR "Failed to request GPMC mem for smc911x\n"); 93 printk(KERN_ERR "Failed to request GPMC mem for smsc911x\n");
83 return; 94 return;
84 } 95 }
85 96
86 ldp_smc911x_resources[0].start = cs_mem_base + 0x0; 97 ldp_smsc911x_resources[0].start = cs_mem_base + 0x0;
87 ldp_smc911x_resources[0].end = cs_mem_base + 0xff; 98 ldp_smsc911x_resources[0].end = cs_mem_base + 0xff;
88 udelay(100); 99 udelay(100);
89 100
90 eth_gpio = LDP_SMC911X_GPIO; 101 eth_gpio = LDP_SMSC911X_GPIO;
91 102
92 ldp_smc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio); 103 ldp_smsc911x_resources[1].start = OMAP_GPIO_IRQ(eth_gpio);
93 104
94 if (gpio_request(eth_gpio, "smc911x irq") < 0) { 105 if (gpio_request(eth_gpio, "smsc911x irq") < 0) {
95 printk(KERN_ERR "Failed to request GPIO%d for smc911x IRQ\n", 106 printk(KERN_ERR "Failed to request GPIO%d for smsc911x IRQ\n",
96 eth_gpio); 107 eth_gpio);
97 return; 108 return;
98 } 109 }
@@ -104,7 +115,7 @@ static void __init omap_ldp_init_irq(void)
104 omap2_init_common_hw(NULL); 115 omap2_init_common_hw(NULL);
105 omap_init_irq(); 116 omap_init_irq();
106 omap_gpio_init(); 117 omap_gpio_init();
107 ldp_init_smc911x(); 118 ldp_init_smsc911x();
108} 119}
109 120
110static struct omap_uart_config ldp_uart_config __initdata = { 121static struct omap_uart_config ldp_uart_config __initdata = {
diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c
index b3f6e9d81807..b1f23bea863f 100644
--- a/arch/arm/mach-omap2/board-overo.c
+++ b/arch/arm/mach-omap2/board-overo.c
@@ -57,6 +57,9 @@
57#define GPMC_CS0_BASE 0x60 57#define GPMC_CS0_BASE 0x60
58#define GPMC_CS_SIZE 0x30 58#define GPMC_CS_SIZE 0x30
59 59
60#define OVERO_SMSC911X_CS 5
61#define OVERO_SMSC911X_GPIO 176
62
60#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \ 63#if defined(CONFIG_TOUCHSCREEN_ADS7846) || \
61 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) 64 defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
62 65
@@ -116,6 +119,67 @@ static void __init overo_ads7846_init(void)
116static inline void __init overo_ads7846_init(void) { return; } 119static inline void __init overo_ads7846_init(void) { return; }
117#endif 120#endif
118 121
122#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
123
124#include <linux/smsc911x.h>
125
126static struct resource overo_smsc911x_resources[] = {
127 {
128 .name = "smsc911x-memory",
129 .flags = IORESOURCE_MEM,
130 },
131 {
132 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL,
133 },
134};
135
136static struct smsc911x_platform_config overo_smsc911x_config = {
137 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
138 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
139 .flags = SMSC911X_USE_32BIT ,
140 .phy_interface = PHY_INTERFACE_MODE_MII,
141};
142
143static struct platform_device overo_smsc911x_device = {
144 .name = "smsc911x",
145 .id = -1,
146 .num_resources = ARRAY_SIZE(overo_smsc911x_resources),
147 .resource = &overo_smsc911x_resources,
148 .dev = {
149 .platform_data = &overo_smsc911x_config,
150 },
151};
152
153static inline void __init overo_init_smsc911x(void)
154{
155 unsigned long cs_mem_base;
156
157 if (gpmc_cs_request(OVERO_SMSC911X_CS, SZ_16M, &cs_mem_base) < 0) {
158 printk(KERN_ERR "Failed request for GPMC mem for smsc911x\n");
159 return;
160 }
161
162 overo_smsc911x_resources[0].start = cs_mem_base + 0x0;
163 overo_smsc911x_resources[0].end = cs_mem_base + 0xff;
164
165 if ((gpio_request(OVERO_SMSC911X_GPIO, "SMSC911X IRQ") == 0) &&
166 (gpio_direction_input(OVERO_SMSC911X_GPIO) == 0)) {
167 gpio_export(OVERO_SMSC911X_GPIO, 0);
168 } else {
169 printk(KERN_ERR "could not obtain gpio for SMSC911X IRQ\n");
170 return;
171 }
172
173 overo_smsc911x_resources[1].start = OMAP_GPIO_IRQ(OVERO_SMSC911X_GPIO);
174 overo_smsc911x_resources[1].end = 0;
175
176 platform_device_register(&overo_smsc911x_device);
177}
178
179#else
180static inline void __init overo_init_smsc911x(void) { return; }
181#endif
182
119static struct mtd_partition overo_nand_partitions[] = { 183static struct mtd_partition overo_nand_partitions[] = {
120 { 184 {
121 .name = "xloader", 185 .name = "xloader",
@@ -290,6 +354,7 @@ static void __init overo_init(void)
290 overo_flash_init(); 354 overo_flash_init();
291 usb_musb_init(); 355 usb_musb_init();
292 overo_ads7846_init(); 356 overo_ads7846_init();
357 overo_init_smsc911x();
293 358
294 if ((gpio_request(OVERO_GPIO_W2W_NRESET, 359 if ((gpio_request(OVERO_GPIO_W2W_NRESET,
295 "OVERO_GPIO_W2W_NRESET") == 0) && 360 "OVERO_GPIO_W2W_NRESET") == 0) &&
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index d6766685cfc7..9ab947c14f26 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -28,7 +28,7 @@
28#include <linux/clocksource.h> 28#include <linux/clocksource.h>
29#include <linux/clockchips.h> 29#include <linux/clockchips.h>
30#include <linux/io.h> 30#include <linux/io.h>
31#include <linux/smc911x.h> 31#include <linux/smsc911x.h>
32#include <linux/ata_platform.h> 32#include <linux/ata_platform.h>
33 33
34#include <asm/clkdev.h> 34#include <asm/clkdev.h>
@@ -128,14 +128,15 @@ int realview_flash_register(struct resource *res, u32 num)
128 return platform_device_register(&realview_flash_device); 128 return platform_device_register(&realview_flash_device);
129} 129}
130 130
131static struct smc911x_platdata realview_smc911x_platdata = { 131static struct smsc911x_platform_config smsc911x_config = {
132 .flags = SMC911X_USE_32BIT, 132 .flags = SMSC911X_USE_32BIT,
133 .irq_flags = IRQF_SHARED, 133 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_HIGH,
134 .irq_polarity = 1, 134 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
135 .phy_interface = PHY_INTERFACE_MODE_MII,
135}; 136};
136 137
137static struct platform_device realview_eth_device = { 138static struct platform_device realview_eth_device = {
138 .name = "smc911x", 139 .name = "smsc911x",
139 .id = 0, 140 .id = 0,
140 .num_resources = 2, 141 .num_resources = 2,
141}; 142};
@@ -145,8 +146,8 @@ int realview_eth_register(const char *name, struct resource *res)
145 if (name) 146 if (name)
146 realview_eth_device.name = name; 147 realview_eth_device.name = name;
147 realview_eth_device.resource = res; 148 realview_eth_device.resource = res;
148 if (strcmp(realview_eth_device.name, "smc911x") == 0) 149 if (strcmp(realview_eth_device.name, "smsc911x") == 0)
149 realview_eth_device.dev.platform_data = &realview_smc911x_platdata; 150 realview_eth_device.dev.platform_data = &smsc911x_config;
150 151
151 return platform_device_register(&realview_eth_device); 152 return platform_device_register(&realview_eth_device);
152} 153}
diff --git a/arch/arm/mach-realview/localtimer.c b/arch/arm/mach-realview/localtimer.c
index 67d6d9cc68b2..d0d39adf6407 100644
--- a/arch/arm/mach-realview/localtimer.c
+++ b/arch/arm/mach-realview/localtimer.c
@@ -191,6 +191,7 @@ void __cpuinit local_timer_setup(void)
191 clk->name = "dummy_timer"; 191 clk->name = "dummy_timer";
192 clk->features = CLOCK_EVT_FEAT_DUMMY; 192 clk->features = CLOCK_EVT_FEAT_DUMMY;
193 clk->rating = 200; 193 clk->rating = 200;
194 clk->mult = 1;
194 clk->set_mode = dummy_timer_set_mode; 195 clk->set_mode = dummy_timer_set_mode;
195 clk->broadcast = smp_timer_broadcast; 196 clk->broadcast = smp_timer_broadcast;
196 clk->cpumask = cpumask_of(cpu); 197 clk->cpumask = cpumask_of(cpu);
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S
index 94077fbd96b7..6f7e70907e44 100644
--- a/arch/arm/mm/abort-ev6.S
+++ b/arch/arm/mm/abort-ev6.S
@@ -29,10 +29,10 @@ ENTRY(v6_early_abort)
29 mrc p15, 0, r1, c5, c0, 0 @ get FSR 29 mrc p15, 0, r1, c5, c0, 0 @ get FSR
30 mrc p15, 0, r0, c6, c0, 0 @ get FAR 30 mrc p15, 0, r0, c6, c0, 0 @ get FAR
31/* 31/*
32 * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR. 32 * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR (erratum 326103).
33 * The test below covers all the write situations, including Java bytecodes 33 * The test below covers all the write situations, including Java bytecodes
34 */ 34 */
35 bic r1, r1, #1 << 11 | 1 << 10 @ clear bits 11 and 10 of FSR 35 bic r1, r1, #1 << 11 @ clear bit 11 of FSR
36 tst r3, #PSR_J_BIT @ Java? 36 tst r3, #PSR_J_BIT @ Java?
37 movne pc, lr 37 movne pc, lr
38 do_thumb_abort 38 do_thumb_abort
diff --git a/arch/arm/mm/cache-feroceon-l2.c b/arch/arm/mm/cache-feroceon-l2.c
index d6dd83826f8a..6e77c042d8e9 100644
--- a/arch/arm/mm/cache-feroceon-l2.c
+++ b/arch/arm/mm/cache-feroceon-l2.c
@@ -115,6 +115,10 @@ static inline void l2_inv_pa_range(unsigned long start, unsigned long end)
115 raw_local_irq_restore(flags); 115 raw_local_irq_restore(flags);
116} 116}
117 117
118static inline void l2_inv_all(void)
119{
120 __asm__("mcr p15, 1, %0, c15, c11, 0" : : "r" (0));
121}
118 122
119/* 123/*
120 * Linux primitives. 124 * Linux primitives.
@@ -254,9 +258,7 @@ static void __init enable_dcache(void)
254 258
255static void __init __invalidate_icache(void) 259static void __init __invalidate_icache(void)
256{ 260{
257 int dummy; 261 __asm__("mcr p15, 0, %0, c7, c5, 0" : : "r" (0));
258
259 __asm__ __volatile__("mcr p15, 0, %0, c7, c5, 0" : "=r" (dummy));
260} 262}
261 263
262static int __init invalidate_and_disable_icache(void) 264static int __init invalidate_and_disable_icache(void)
@@ -321,6 +323,7 @@ static void __init enable_l2(void)
321 323
322 d = flush_and_disable_dcache(); 324 d = flush_and_disable_dcache();
323 i = invalidate_and_disable_icache(); 325 i = invalidate_and_disable_icache();
326 l2_inv_all();
324 write_extra_features(u | 0x00400000); 327 write_extra_features(u | 0x00400000);
325 if (i) 328 if (i)
326 enable_icache(); 329 enable_icache();
diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
index ba592a9e6fb3..a2bed62aec21 100644
--- a/arch/arm/vfp/entry.S
+++ b/arch/arm/vfp/entry.S
@@ -15,13 +15,16 @@
15 * r10 = thread_info structure 15 * r10 = thread_info structure
16 * lr = failure return 16 * lr = failure return
17 */ 17 */
18#include <linux/linkage.h> 18#include <asm/thread_info.h>
19#include <linux/init.h>
20#include <asm/asm-offsets.h>
21#include <asm/assembler.h>
22#include <asm/vfpmacros.h> 19#include <asm/vfpmacros.h>
20#include "../kernel/entry-header.S"
23 21
24ENTRY(do_vfp) 22ENTRY(do_vfp)
23#ifdef CONFIG_PREEMPT
24 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
25 add r11, r4, #1 @ increment it
26 str r11, [r10, #TI_PREEMPT]
27#endif
25 enable_irq 28 enable_irq
26 ldr r4, .LCvfp 29 ldr r4, .LCvfp
27 ldr r11, [r10, #TI_CPU] @ CPU number 30 ldr r11, [r10, #TI_CPU] @ CPU number
@@ -30,6 +33,12 @@ ENTRY(do_vfp)
30ENDPROC(do_vfp) 33ENDPROC(do_vfp)
31 34
32ENTRY(vfp_null_entry) 35ENTRY(vfp_null_entry)
36#ifdef CONFIG_PREEMPT
37 get_thread_info r10
38 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
39 sub r11, r4, #1 @ decrement it
40 str r11, [r10, #TI_PREEMPT]
41#endif
33 mov pc, lr 42 mov pc, lr
34ENDPROC(vfp_null_entry) 43ENDPROC(vfp_null_entry)
35 44
@@ -41,6 +50,12 @@ ENDPROC(vfp_null_entry)
41 50
42 __INIT 51 __INIT
43ENTRY(vfp_testing_entry) 52ENTRY(vfp_testing_entry)
53#ifdef CONFIG_PREEMPT
54 get_thread_info r10
55 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
56 sub r11, r4, #1 @ decrement it
57 str r11, [r10, #TI_PREEMPT]
58#endif
44 ldr r0, VFP_arch_address 59 ldr r0, VFP_arch_address
45 str r5, [r0] @ known non-zero value 60 str r5, [r0] @ known non-zero value
46 mov pc, r9 @ we have handled the fault 61 mov pc, r9 @ we have handled the fault
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
index a5a4e57763c3..83c4e384b16d 100644
--- a/arch/arm/vfp/vfphw.S
+++ b/arch/arm/vfp/vfphw.S
@@ -137,6 +137,12 @@ check_for_exception:
137 VFPFMXR FPEXC, r1 @ restore FPEXC last 137 VFPFMXR FPEXC, r1 @ restore FPEXC last
138 sub r2, r2, #4 138 sub r2, r2, #4
139 str r2, [sp, #S_PC] @ retry the instruction 139 str r2, [sp, #S_PC] @ retry the instruction
140#ifdef CONFIG_PREEMPT
141 get_thread_info r10
142 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
143 sub r11, r4, #1 @ decrement it
144 str r11, [r10, #TI_PREEMPT]
145#endif
140 mov pc, r9 @ we think we have handled things 146 mov pc, r9 @ we think we have handled things
141 147
142 148
@@ -155,6 +161,12 @@ look_for_VFP_exceptions:
155 @ not recognised by VFP 161 @ not recognised by VFP
156 162
157 DBGSTR "not VFP" 163 DBGSTR "not VFP"
164#ifdef CONFIG_PREEMPT
165 get_thread_info r10
166 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
167 sub r11, r4, #1 @ decrement it
168 str r11, [r10, #TI_PREEMPT]
169#endif
158 mov pc, lr 170 mov pc, lr
159 171
160process_exception: 172process_exception:
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 75457b30d813..01599c4ef726 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -266,7 +266,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
266 * on VFP subarch 1. 266 * on VFP subarch 1.
267 */ 267 */
268 vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr, regs); 268 vfp_raise_exceptions(VFP_EXCEPTION_ERROR, trigger, fpscr, regs);
269 return; 269 goto exit;
270 } 270 }
271 271
272 /* 272 /*
@@ -297,7 +297,7 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
297 * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1. 297 * the FPEXC.FP2V bit is valid only if FPEXC.EX is 1.
298 */ 298 */
299 if (fpexc ^ (FPEXC_EX | FPEXC_FP2V)) 299 if (fpexc ^ (FPEXC_EX | FPEXC_FP2V))
300 return; 300 goto exit;
301 301
302 /* 302 /*
303 * The barrier() here prevents fpinst2 being read 303 * The barrier() here prevents fpinst2 being read
@@ -310,6 +310,8 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs)
310 exceptions = vfp_emulate_instruction(trigger, orig_fpscr, regs); 310 exceptions = vfp_emulate_instruction(trigger, orig_fpscr, regs);
311 if (exceptions) 311 if (exceptions)
312 vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs); 312 vfp_raise_exceptions(exceptions, trigger, orig_fpscr, regs);
313 exit:
314 preempt_enable();
313} 315}
314 316
315static void vfp_enable(void *unused) 317static void vfp_enable(void *unused)
diff --git a/arch/m68k/include/asm/bootinfo.h b/arch/m68k/include/asm/bootinfo.h
index fedf3e326121..fb8a06b9ab6a 100644
--- a/arch/m68k/include/asm/bootinfo.h
+++ b/arch/m68k/include/asm/bootinfo.h
@@ -1,5 +1,378 @@
1#ifdef __uClinux__ 1/*
2#include "bootinfo_no.h" 2** asm/bootinfo.h -- Definition of the Linux/m68k boot information structure
3#else 3**
4#include "bootinfo_mm.h" 4** Copyright 1992 by Greg Harp
5**
6** This file is subject to the terms and conditions of the GNU General Public
7** License. See the file COPYING in the main directory of this archive
8** for more details.
9**
10** Created 09/29/92 by Greg Harp
11**
12** 5/2/94 Roman Hodek:
13** Added bi_atari part of the machine dependent union bi_un; for now it
14** contains just a model field to distinguish between TT and Falcon.
15** 26/7/96 Roman Zippel:
16** Renamed to setup.h; added some useful macros to allow gcc some
17** optimizations if possible.
18** 5/10/96 Geert Uytterhoeven:
19** Redesign of the boot information structure; renamed to bootinfo.h again
20** 27/11/96 Geert Uytterhoeven:
21** Backwards compatibility with bootinfo interface version 1.0
22*/
23
24#ifndef _M68K_BOOTINFO_H
25#define _M68K_BOOTINFO_H
26
27
28 /*
29 * Bootinfo definitions
30 *
31 * This is an easily parsable and extendable structure containing all
32 * information to be passed from the bootstrap to the kernel.
33 *
34 * This way I hope to keep all future changes back/forewards compatible.
35 * Thus, keep your fingers crossed...
36 *
37 * This structure is copied right after the kernel bss by the bootstrap
38 * routine.
39 */
40
41#ifndef __ASSEMBLY__
42
43struct bi_record {
44 unsigned short tag; /* tag ID */
45 unsigned short size; /* size of record (in bytes) */
46 unsigned long data[0]; /* data */
47};
48
49#endif /* __ASSEMBLY__ */
50
51
52 /*
53 * Tag Definitions
54 *
55 * Machine independent tags start counting from 0x0000
56 * Machine dependent tags start counting from 0x8000
57 */
58
59#define BI_LAST 0x0000 /* last record (sentinel) */
60#define BI_MACHTYPE 0x0001 /* machine type (u_long) */
61#define BI_CPUTYPE 0x0002 /* cpu type (u_long) */
62#define BI_FPUTYPE 0x0003 /* fpu type (u_long) */
63#define BI_MMUTYPE 0x0004 /* mmu type (u_long) */
64#define BI_MEMCHUNK 0x0005 /* memory chunk address and size */
65 /* (struct mem_info) */
66#define BI_RAMDISK 0x0006 /* ramdisk address and size */
67 /* (struct mem_info) */
68#define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
69 /* (string) */
70
71 /*
72 * Amiga-specific tags
73 */
74
75#define BI_AMIGA_MODEL 0x8000 /* model (u_long) */
76#define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */
77 /* (struct ConfigDev) */
78#define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */
79#define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */
80#define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */
81#define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */
82#define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */
83#define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */
84
85 /*
86 * Atari-specific tags
87 */
88
89#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */
90#define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */
91 /* (values are ATARI_MACH_* defines */
92
93/* mch_cookie values (upper word) */
94#define ATARI_MCH_ST 0
95#define ATARI_MCH_STE 1
96#define ATARI_MCH_TT 2
97#define ATARI_MCH_FALCON 3
98
99/* mch_type values */
100#define ATARI_MACH_NORMAL 0 /* no special machine type */
101#define ATARI_MACH_MEDUSA 1 /* Medusa 040 */
102#define ATARI_MACH_HADES 2 /* Hades 040 or 060 */
103#define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */
104
105 /*
106 * VME-specific tags
107 */
108
109#define BI_VME_TYPE 0x8000 /* VME sub-architecture (u_long) */
110#define BI_VME_BRDINFO 0x8001 /* VME board information (struct) */
111
112/* BI_VME_TYPE codes */
113#define VME_TYPE_TP34V 0x0034 /* Tadpole TP34V */
114#define VME_TYPE_MVME147 0x0147 /* Motorola MVME147 */
115#define VME_TYPE_MVME162 0x0162 /* Motorola MVME162 */
116#define VME_TYPE_MVME166 0x0166 /* Motorola MVME166 */
117#define VME_TYPE_MVME167 0x0167 /* Motorola MVME167 */
118#define VME_TYPE_MVME172 0x0172 /* Motorola MVME172 */
119#define VME_TYPE_MVME177 0x0177 /* Motorola MVME177 */
120#define VME_TYPE_BVME4000 0x4000 /* BVM Ltd. BVME4000 */
121#define VME_TYPE_BVME6000 0x6000 /* BVM Ltd. BVME6000 */
122
123/* BI_VME_BRDINFO is a 32 byte struct as returned by the Bug code on
124 * Motorola VME boards. Contains board number, Bug version, board
125 * configuration options, etc. See include/asm/mvme16xhw.h for details.
126 */
127
128
129 /*
130 * Macintosh-specific tags (all u_long)
131 */
132
133#define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */
134#define BI_MAC_VADDR 0x8001 /* Mac video base address */
135#define BI_MAC_VDEPTH 0x8002 /* Mac video depth */
136#define BI_MAC_VROW 0x8003 /* Mac video rowbytes */
137#define BI_MAC_VDIM 0x8004 /* Mac video dimensions */
138#define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */
139#define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */
140#define BI_MAC_BTIME 0x8007 /* Mac boot time */
141#define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */
142#define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */
143#define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */
144#define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */
145
146 /*
147 * Macintosh hardware profile data - unused, see macintosh.h for
148 * resonable type values
149 */
150
151#define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */
152#define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */
153#define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */
154#define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */
155#define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */
156#define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */
157#define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */
158#define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */
159#define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */
160#define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */
161#define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */
162#define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */
163#define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */
164#define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */
165#define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */
166#define BI_MAC_PMU 0x801f /* Mac power management / poweroff hardware */
167#define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */
168#define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */
169
170 /*
171 * Mac: compatibility with old booter data format (temporarily)
172 * Fields unused with the new bootinfo can be deleted now; instead of
173 * adding new fields the struct might be splitted into a hardware address
174 * part and a hardware type part
175 */
176
177#ifndef __ASSEMBLY__
178
179struct mac_booter_data
180{
181 unsigned long videoaddr;
182 unsigned long videorow;
183 unsigned long videodepth;
184 unsigned long dimensions;
185 unsigned long args;
186 unsigned long boottime;
187 unsigned long gmtbias;
188 unsigned long bootver;
189 unsigned long videological;
190 unsigned long sccbase;
191 unsigned long id;
192 unsigned long memsize;
193 unsigned long serialmf;
194 unsigned long serialhsk;
195 unsigned long serialgpi;
196 unsigned long printmf;
197 unsigned long printhsk;
198 unsigned long printgpi;
199 unsigned long cpuid;
200 unsigned long rombase;
201 unsigned long adbdelay;
202 unsigned long timedbra;
203};
204
205extern struct mac_booter_data
206 mac_bi_data;
207
5#endif 208#endif
209
210 /*
211 * Apollo-specific tags
212 */
213
214#define BI_APOLLO_MODEL 0x8000 /* model (u_long) */
215
216 /*
217 * HP300-specific tags
218 */
219
220#define BI_HP300_MODEL 0x8000 /* model (u_long) */
221#define BI_HP300_UART_SCODE 0x8001 /* UART select code (u_long) */
222#define BI_HP300_UART_ADDR 0x8002 /* phys. addr of UART (u_long) */
223
224 /*
225 * Stuff for bootinfo interface versioning
226 *
227 * At the start of kernel code, a 'struct bootversion' is located.
228 * bootstrap checks for a matching version of the interface before booting
229 * a kernel, to avoid user confusion if kernel and bootstrap don't work
230 * together :-)
231 *
232 * If incompatible changes are made to the bootinfo interface, the major
233 * number below should be stepped (and the minor reset to 0) for the
234 * appropriate machine. If a change is backward-compatible, the minor
235 * should be stepped. "Backwards-compatible" means that booting will work,
236 * but certain features may not.
237 */
238
239#define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */
240#define MK_BI_VERSION(major,minor) (((major)<<16)+(minor))
241#define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff)
242#define BI_VERSION_MINOR(v) ((v) & 0xffff)
243
244#ifndef __ASSEMBLY__
245
246struct bootversion {
247 unsigned short branch;
248 unsigned long magic;
249 struct {
250 unsigned long machtype;
251 unsigned long version;
252 } machversions[0];
253};
254
255#endif /* __ASSEMBLY__ */
256
257#define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
258#define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 )
259#define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
260#define MVME147_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
261#define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
262#define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
263#define Q40_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
264#define HP300_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
265
266#ifdef BOOTINFO_COMPAT_1_0
267
268 /*
269 * Backwards compatibility with bootinfo interface version 1.0
270 */
271
272#define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
273#define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
274#define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
275
276#include <linux/zorro.h>
277
278#define COMPAT_NUM_AUTO 16
279
280struct compat_bi_Amiga {
281 int model;
282 int num_autocon;
283 struct ConfigDev autocon[COMPAT_NUM_AUTO];
284 unsigned long chip_size;
285 unsigned char vblank;
286 unsigned char psfreq;
287 unsigned long eclock;
288 unsigned long chipset;
289 unsigned long hw_present;
290};
291
292struct compat_bi_Atari {
293 unsigned long hw_present;
294 unsigned long mch_cookie;
295};
296
297#ifndef __ASSEMBLY__
298
299struct compat_bi_Macintosh
300{
301 unsigned long videoaddr;
302 unsigned long videorow;
303 unsigned long videodepth;
304 unsigned long dimensions;
305 unsigned long args;
306 unsigned long boottime;
307 unsigned long gmtbias;
308 unsigned long bootver;
309 unsigned long videological;
310 unsigned long sccbase;
311 unsigned long id;
312 unsigned long memsize;
313 unsigned long serialmf;
314 unsigned long serialhsk;
315 unsigned long serialgpi;
316 unsigned long printmf;
317 unsigned long printhsk;
318 unsigned long printgpi;
319 unsigned long cpuid;
320 unsigned long rombase;
321 unsigned long adbdelay;
322 unsigned long timedbra;
323};
324
325#endif
326
327struct compat_mem_info {
328 unsigned long addr;
329 unsigned long size;
330};
331
332#define COMPAT_NUM_MEMINFO 4
333
334#define COMPAT_CPUB_68020 0
335#define COMPAT_CPUB_68030 1
336#define COMPAT_CPUB_68040 2
337#define COMPAT_CPUB_68060 3
338#define COMPAT_FPUB_68881 5
339#define COMPAT_FPUB_68882 6
340#define COMPAT_FPUB_68040 7
341#define COMPAT_FPUB_68060 8
342
343#define COMPAT_CPU_68020 (1<<COMPAT_CPUB_68020)
344#define COMPAT_CPU_68030 (1<<COMPAT_CPUB_68030)
345#define COMPAT_CPU_68040 (1<<COMPAT_CPUB_68040)
346#define COMPAT_CPU_68060 (1<<COMPAT_CPUB_68060)
347#define COMPAT_CPU_MASK (31)
348#define COMPAT_FPU_68881 (1<<COMPAT_FPUB_68881)
349#define COMPAT_FPU_68882 (1<<COMPAT_FPUB_68882)
350#define COMPAT_FPU_68040 (1<<COMPAT_FPUB_68040)
351#define COMPAT_FPU_68060 (1<<COMPAT_FPUB_68060)
352#define COMPAT_FPU_MASK (0xfe0)
353
354#define COMPAT_CL_SIZE (256)
355
356struct compat_bootinfo {
357 unsigned long machtype;
358 unsigned long cputype;
359 struct compat_mem_info memory[COMPAT_NUM_MEMINFO];
360 int num_memory;
361 unsigned long ramdisk_size;
362 unsigned long ramdisk_addr;
363 char command_line[COMPAT_CL_SIZE];
364 union {
365 struct compat_bi_Amiga bi_ami;
366 struct compat_bi_Atari bi_ata;
367 struct compat_bi_Macintosh bi_mac;
368 } bi_un;
369};
370
371#define bi_amiga bi_un.bi_ami
372#define bi_atari bi_un.bi_ata
373#define bi_mac bi_un.bi_mac
374
375#endif /* BOOTINFO_COMPAT_1_0 */
376
377
378#endif /* _M68K_BOOTINFO_H */
diff --git a/arch/m68k/include/asm/bootinfo_mm.h b/arch/m68k/include/asm/bootinfo_mm.h
deleted file mode 100644
index fb8a06b9ab6a..000000000000
--- a/arch/m68k/include/asm/bootinfo_mm.h
+++ /dev/null
@@ -1,378 +0,0 @@
1/*
2** asm/bootinfo.h -- Definition of the Linux/m68k boot information structure
3**
4** Copyright 1992 by Greg Harp
5**
6** This file is subject to the terms and conditions of the GNU General Public
7** License. See the file COPYING in the main directory of this archive
8** for more details.
9**
10** Created 09/29/92 by Greg Harp
11**
12** 5/2/94 Roman Hodek:
13** Added bi_atari part of the machine dependent union bi_un; for now it
14** contains just a model field to distinguish between TT and Falcon.
15** 26/7/96 Roman Zippel:
16** Renamed to setup.h; added some useful macros to allow gcc some
17** optimizations if possible.
18** 5/10/96 Geert Uytterhoeven:
19** Redesign of the boot information structure; renamed to bootinfo.h again
20** 27/11/96 Geert Uytterhoeven:
21** Backwards compatibility with bootinfo interface version 1.0
22*/
23
24#ifndef _M68K_BOOTINFO_H
25#define _M68K_BOOTINFO_H
26
27
28 /*
29 * Bootinfo definitions
30 *
31 * This is an easily parsable and extendable structure containing all
32 * information to be passed from the bootstrap to the kernel.
33 *
34 * This way I hope to keep all future changes back/forewards compatible.
35 * Thus, keep your fingers crossed...
36 *
37 * This structure is copied right after the kernel bss by the bootstrap
38 * routine.
39 */
40
41#ifndef __ASSEMBLY__
42
43struct bi_record {
44 unsigned short tag; /* tag ID */
45 unsigned short size; /* size of record (in bytes) */
46 unsigned long data[0]; /* data */
47};
48
49#endif /* __ASSEMBLY__ */
50
51
52 /*
53 * Tag Definitions
54 *
55 * Machine independent tags start counting from 0x0000
56 * Machine dependent tags start counting from 0x8000
57 */
58
59#define BI_LAST 0x0000 /* last record (sentinel) */
60#define BI_MACHTYPE 0x0001 /* machine type (u_long) */
61#define BI_CPUTYPE 0x0002 /* cpu type (u_long) */
62#define BI_FPUTYPE 0x0003 /* fpu type (u_long) */
63#define BI_MMUTYPE 0x0004 /* mmu type (u_long) */
64#define BI_MEMCHUNK 0x0005 /* memory chunk address and size */
65 /* (struct mem_info) */
66#define BI_RAMDISK 0x0006 /* ramdisk address and size */
67 /* (struct mem_info) */
68#define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
69 /* (string) */
70
71 /*
72 * Amiga-specific tags
73 */
74
75#define BI_AMIGA_MODEL 0x8000 /* model (u_long) */
76#define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */
77 /* (struct ConfigDev) */
78#define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */
79#define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */
80#define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */
81#define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */
82#define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */
83#define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */
84
85 /*
86 * Atari-specific tags
87 */
88
89#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */
90#define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */
91 /* (values are ATARI_MACH_* defines */
92
93/* mch_cookie values (upper word) */
94#define ATARI_MCH_ST 0
95#define ATARI_MCH_STE 1
96#define ATARI_MCH_TT 2
97#define ATARI_MCH_FALCON 3
98
99/* mch_type values */
100#define ATARI_MACH_NORMAL 0 /* no special machine type */
101#define ATARI_MACH_MEDUSA 1 /* Medusa 040 */
102#define ATARI_MACH_HADES 2 /* Hades 040 or 060 */
103#define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */
104
105 /*
106 * VME-specific tags
107 */
108
109#define BI_VME_TYPE 0x8000 /* VME sub-architecture (u_long) */
110#define BI_VME_BRDINFO 0x8001 /* VME board information (struct) */
111
112/* BI_VME_TYPE codes */
113#define VME_TYPE_TP34V 0x0034 /* Tadpole TP34V */
114#define VME_TYPE_MVME147 0x0147 /* Motorola MVME147 */
115#define VME_TYPE_MVME162 0x0162 /* Motorola MVME162 */
116#define VME_TYPE_MVME166 0x0166 /* Motorola MVME166 */
117#define VME_TYPE_MVME167 0x0167 /* Motorola MVME167 */
118#define VME_TYPE_MVME172 0x0172 /* Motorola MVME172 */
119#define VME_TYPE_MVME177 0x0177 /* Motorola MVME177 */
120#define VME_TYPE_BVME4000 0x4000 /* BVM Ltd. BVME4000 */
121#define VME_TYPE_BVME6000 0x6000 /* BVM Ltd. BVME6000 */
122
123/* BI_VME_BRDINFO is a 32 byte struct as returned by the Bug code on
124 * Motorola VME boards. Contains board number, Bug version, board
125 * configuration options, etc. See include/asm/mvme16xhw.h for details.
126 */
127
128
129 /*
130 * Macintosh-specific tags (all u_long)
131 */
132
133#define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */
134#define BI_MAC_VADDR 0x8001 /* Mac video base address */
135#define BI_MAC_VDEPTH 0x8002 /* Mac video depth */
136#define BI_MAC_VROW 0x8003 /* Mac video rowbytes */
137#define BI_MAC_VDIM 0x8004 /* Mac video dimensions */
138#define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */
139#define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */
140#define BI_MAC_BTIME 0x8007 /* Mac boot time */
141#define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */
142#define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */
143#define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */
144#define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */
145
146 /*
147 * Macintosh hardware profile data - unused, see macintosh.h for
148 * resonable type values
149 */
150
151#define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */
152#define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */
153#define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */
154#define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */
155#define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */
156#define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */
157#define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */
158#define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */
159#define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */
160#define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */
161#define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */
162#define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */
163#define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */
164#define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */
165#define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */
166#define BI_MAC_PMU 0x801f /* Mac power management / poweroff hardware */
167#define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */
168#define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */
169
170 /*
171 * Mac: compatibility with old booter data format (temporarily)
172 * Fields unused with the new bootinfo can be deleted now; instead of
173 * adding new fields the struct might be splitted into a hardware address
174 * part and a hardware type part
175 */
176
177#ifndef __ASSEMBLY__
178
179struct mac_booter_data
180{
181 unsigned long videoaddr;
182 unsigned long videorow;
183 unsigned long videodepth;
184 unsigned long dimensions;
185 unsigned long args;
186 unsigned long boottime;
187 unsigned long gmtbias;
188 unsigned long bootver;
189 unsigned long videological;
190 unsigned long sccbase;
191 unsigned long id;
192 unsigned long memsize;
193 unsigned long serialmf;
194 unsigned long serialhsk;
195 unsigned long serialgpi;
196 unsigned long printmf;
197 unsigned long printhsk;
198 unsigned long printgpi;
199 unsigned long cpuid;
200 unsigned long rombase;
201 unsigned long adbdelay;
202 unsigned long timedbra;
203};
204
205extern struct mac_booter_data
206 mac_bi_data;
207
208#endif
209
210 /*
211 * Apollo-specific tags
212 */
213
214#define BI_APOLLO_MODEL 0x8000 /* model (u_long) */
215
216 /*
217 * HP300-specific tags
218 */
219
220#define BI_HP300_MODEL 0x8000 /* model (u_long) */
221#define BI_HP300_UART_SCODE 0x8001 /* UART select code (u_long) */
222#define BI_HP300_UART_ADDR 0x8002 /* phys. addr of UART (u_long) */
223
224 /*
225 * Stuff for bootinfo interface versioning
226 *
227 * At the start of kernel code, a 'struct bootversion' is located.
228 * bootstrap checks for a matching version of the interface before booting
229 * a kernel, to avoid user confusion if kernel and bootstrap don't work
230 * together :-)
231 *
232 * If incompatible changes are made to the bootinfo interface, the major
233 * number below should be stepped (and the minor reset to 0) for the
234 * appropriate machine. If a change is backward-compatible, the minor
235 * should be stepped. "Backwards-compatible" means that booting will work,
236 * but certain features may not.
237 */
238
239#define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */
240#define MK_BI_VERSION(major,minor) (((major)<<16)+(minor))
241#define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff)
242#define BI_VERSION_MINOR(v) ((v) & 0xffff)
243
244#ifndef __ASSEMBLY__
245
246struct bootversion {
247 unsigned short branch;
248 unsigned long magic;
249 struct {
250 unsigned long machtype;
251 unsigned long version;
252 } machversions[0];
253};
254
255#endif /* __ASSEMBLY__ */
256
257#define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
258#define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 )
259#define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
260#define MVME147_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
261#define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
262#define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
263#define Q40_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
264#define HP300_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
265
266#ifdef BOOTINFO_COMPAT_1_0
267
268 /*
269 * Backwards compatibility with bootinfo interface version 1.0
270 */
271
272#define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
273#define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
274#define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
275
276#include <linux/zorro.h>
277
278#define COMPAT_NUM_AUTO 16
279
280struct compat_bi_Amiga {
281 int model;
282 int num_autocon;
283 struct ConfigDev autocon[COMPAT_NUM_AUTO];
284 unsigned long chip_size;
285 unsigned char vblank;
286 unsigned char psfreq;
287 unsigned long eclock;
288 unsigned long chipset;
289 unsigned long hw_present;
290};
291
292struct compat_bi_Atari {
293 unsigned long hw_present;
294 unsigned long mch_cookie;
295};
296
297#ifndef __ASSEMBLY__
298
299struct compat_bi_Macintosh
300{
301 unsigned long videoaddr;
302 unsigned long videorow;
303 unsigned long videodepth;
304 unsigned long dimensions;
305 unsigned long args;
306 unsigned long boottime;
307 unsigned long gmtbias;
308 unsigned long bootver;
309 unsigned long videological;
310 unsigned long sccbase;
311 unsigned long id;
312 unsigned long memsize;
313 unsigned long serialmf;
314 unsigned long serialhsk;
315 unsigned long serialgpi;
316 unsigned long printmf;
317 unsigned long printhsk;
318 unsigned long printgpi;
319 unsigned long cpuid;
320 unsigned long rombase;
321 unsigned long adbdelay;
322 unsigned long timedbra;
323};
324
325#endif
326
327struct compat_mem_info {
328 unsigned long addr;
329 unsigned long size;
330};
331
332#define COMPAT_NUM_MEMINFO 4
333
334#define COMPAT_CPUB_68020 0
335#define COMPAT_CPUB_68030 1
336#define COMPAT_CPUB_68040 2
337#define COMPAT_CPUB_68060 3
338#define COMPAT_FPUB_68881 5
339#define COMPAT_FPUB_68882 6
340#define COMPAT_FPUB_68040 7
341#define COMPAT_FPUB_68060 8
342
343#define COMPAT_CPU_68020 (1<<COMPAT_CPUB_68020)
344#define COMPAT_CPU_68030 (1<<COMPAT_CPUB_68030)
345#define COMPAT_CPU_68040 (1<<COMPAT_CPUB_68040)
346#define COMPAT_CPU_68060 (1<<COMPAT_CPUB_68060)
347#define COMPAT_CPU_MASK (31)
348#define COMPAT_FPU_68881 (1<<COMPAT_FPUB_68881)
349#define COMPAT_FPU_68882 (1<<COMPAT_FPUB_68882)
350#define COMPAT_FPU_68040 (1<<COMPAT_FPUB_68040)
351#define COMPAT_FPU_68060 (1<<COMPAT_FPUB_68060)
352#define COMPAT_FPU_MASK (0xfe0)
353
354#define COMPAT_CL_SIZE (256)
355
356struct compat_bootinfo {
357 unsigned long machtype;
358 unsigned long cputype;
359 struct compat_mem_info memory[COMPAT_NUM_MEMINFO];
360 int num_memory;
361 unsigned long ramdisk_size;
362 unsigned long ramdisk_addr;
363 char command_line[COMPAT_CL_SIZE];
364 union {
365 struct compat_bi_Amiga bi_ami;
366 struct compat_bi_Atari bi_ata;
367 struct compat_bi_Macintosh bi_mac;
368 } bi_un;
369};
370
371#define bi_amiga bi_un.bi_ami
372#define bi_atari bi_un.bi_ata
373#define bi_mac bi_un.bi_mac
374
375#endif /* BOOTINFO_COMPAT_1_0 */
376
377
378#endif /* _M68K_BOOTINFO_H */
diff --git a/arch/m68k/include/asm/bootinfo_no.h b/arch/m68k/include/asm/bootinfo_no.h
deleted file mode 100644
index c12e526f5189..000000000000
--- a/arch/m68k/include/asm/bootinfo_no.h
+++ /dev/null
@@ -1,2 +0,0 @@
1
2/* Nothing for m68knommu */
diff --git a/arch/m68k/include/asm/bug.h b/arch/m68k/include/asm/bug.h
index 997e0944ebc1..ef9a2e47352f 100644
--- a/arch/m68k/include/asm/bug.h
+++ b/arch/m68k/include/asm/bug.h
@@ -1,5 +1,30 @@
1#ifdef __uClinux__ 1#ifndef _M68K_BUG_H
2#include "bug_no.h" 2#define _M68K_BUG_H
3
4#ifdef CONFIG_MMU
5#ifdef CONFIG_BUG
6#ifdef CONFIG_DEBUG_BUGVERBOSE
7#ifndef CONFIG_SUN3
8#define BUG() do { \
9 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
10 __builtin_trap(); \
11} while (0)
3#else 12#else
4#include "bug_mm.h" 13#define BUG() do { \
14 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
15 panic("BUG!"); \
16} while (0)
17#endif
18#else
19#define BUG() do { \
20 __builtin_trap(); \
21} while (0)
22#endif
23
24#define HAVE_ARCH_BUG
25#endif
26#endif /* CONFIG_MMU */
27
28#include <asm-generic/bug.h>
29
5#endif 30#endif
diff --git a/arch/m68k/include/asm/bug_mm.h b/arch/m68k/include/asm/bug_mm.h
deleted file mode 100644
index e5b528deb8a8..000000000000
--- a/arch/m68k/include/asm/bug_mm.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifndef _M68K_BUG_H
2#define _M68K_BUG_H
3
4
5#ifdef CONFIG_BUG
6#ifdef CONFIG_DEBUG_BUGVERBOSE
7#ifndef CONFIG_SUN3
8#define BUG() do { \
9 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
10 __builtin_trap(); \
11} while (0)
12#else
13#define BUG() do { \
14 printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \
15 panic("BUG!"); \
16} while (0)
17#endif
18#else
19#define BUG() do { \
20 __builtin_trap(); \
21} while (0)
22#endif
23
24#define HAVE_ARCH_BUG
25#endif
26
27#include <asm-generic/bug.h>
28
29#endif
diff --git a/arch/m68k/include/asm/bug_no.h b/arch/m68k/include/asm/bug_no.h
deleted file mode 100644
index 70e7dc0af21a..000000000000
--- a/arch/m68k/include/asm/bug_no.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef _M68KNOMMU_BUG_H
2#define _M68KNOMMU_BUG_H
3#include <asm-generic/bug.h>
4#endif
diff --git a/arch/m68k/include/asm/bugs.h b/arch/m68k/include/asm/bugs.h
index 01f047d784ec..d06207b9ba5a 100644
--- a/arch/m68k/include/asm/bugs.h
+++ b/arch/m68k/include/asm/bugs.h
@@ -1,5 +1,20 @@
1#ifdef __uClinux__ 1/*
2#include "bugs_no.h" 2 * include/asm-m68k/bugs.h
3 *
4 * Copyright (C) 1994 Linus Torvalds
5 */
6
7/*
8 * This is included by init/main.c to check for architecture-dependent bugs.
9 *
10 * Needs:
11 * void check_bugs(void);
12 */
13
14#ifdef CONFIG_MMU
15extern void check_bugs(void); /* in arch/m68k/kernel/setup.c */
3#else 16#else
4#include "bugs_mm.h" 17static void check_bugs(void)
18{
19}
5#endif 20#endif
diff --git a/arch/m68k/include/asm/bugs_mm.h b/arch/m68k/include/asm/bugs_mm.h
deleted file mode 100644
index d01935592410..000000000000
--- a/arch/m68k/include/asm/bugs_mm.h
+++ /dev/null
@@ -1,14 +0,0 @@
1/*
2 * include/asm-m68k/bugs.h
3 *
4 * Copyright (C) 1994 Linus Torvalds
5 */
6
7/*
8 * This is included by init/main.c to check for architecture-dependent bugs.
9 *
10 * Needs:
11 * void check_bugs(void);
12 */
13
14extern void check_bugs(void); /* in arch/m68k/kernel/setup.c */
diff --git a/arch/m68k/include/asm/bugs_no.h b/arch/m68k/include/asm/bugs_no.h
deleted file mode 100644
index 5f382dac3a60..000000000000
--- a/arch/m68k/include/asm/bugs_no.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * include/asm-m68k/bugs.h
3 *
4 * Copyright (C) 1994 Linus Torvalds
5 */
6
7/*
8 * This is included by init/main.c to check for architecture-dependent bugs.
9 *
10 * Needs:
11 * void check_bugs(void);
12 */
13
14static void check_bugs(void)
15{
16}
diff --git a/arch/m68k/include/asm/cache.h b/arch/m68k/include/asm/cache.h
index 599c29bc8f40..fed3fd30de7e 100644
--- a/arch/m68k/include/asm/cache.h
+++ b/arch/m68k/include/asm/cache.h
@@ -1,5 +1,11 @@
1#ifdef __uClinux__ 1/*
2#include "cache_no.h" 2 * include/asm-m68k/cache.h
3#else 3 */
4#include "cache_mm.h" 4#ifndef __ARCH_M68K_CACHE_H
5#define __ARCH_M68K_CACHE_H
6
7/* bytes per L1 cache line */
8#define L1_CACHE_SHIFT 4
9#define L1_CACHE_BYTES (1<< L1_CACHE_SHIFT)
10
5#endif 11#endif
diff --git a/arch/m68k/include/asm/cache_mm.h b/arch/m68k/include/asm/cache_mm.h
deleted file mode 100644
index fed3fd30de7e..000000000000
--- a/arch/m68k/include/asm/cache_mm.h
+++ /dev/null
@@ -1,11 +0,0 @@
1/*
2 * include/asm-m68k/cache.h
3 */
4#ifndef __ARCH_M68K_CACHE_H
5#define __ARCH_M68K_CACHE_H
6
7/* bytes per L1 cache line */
8#define L1_CACHE_SHIFT 4
9#define L1_CACHE_BYTES (1<< L1_CACHE_SHIFT)
10
11#endif
diff --git a/arch/m68k/include/asm/cache_no.h b/arch/m68k/include/asm/cache_no.h
deleted file mode 100644
index 24e9eace5f8c..000000000000
--- a/arch/m68k/include/asm/cache_no.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef __ARCH_M68KNOMMU_CACHE_H
2#define __ARCH_M68KNOMMU_CACHE_H
3
4/* bytes per L1 cache line */
5#define L1_CACHE_BYTES 16 /* this need to be at least 1 */
6
7/* m68k-elf-gcc 2.95.2 doesn't like these */
8
9#define __cacheline_aligned
10#define ____cacheline_aligned
11
12#endif
diff --git a/arch/m68k/include/asm/current.h b/arch/m68k/include/asm/current.h
index 51b056dfaedd..91fcc5358cfe 100644
--- a/arch/m68k/include/asm/current.h
+++ b/arch/m68k/include/asm/current.h
@@ -1,5 +1,28 @@
1#ifdef __uClinux__ 1#ifndef _M68K_CURRENT_H
2#include "current_no.h" 2#define _M68K_CURRENT_H
3
4#ifdef CONFIG_MMU
5
6register struct task_struct *current __asm__("%a2");
7
3#else 8#else
4#include "current_mm.h" 9
5#endif 10/*
11 * Rather than dedicate a register (as the m68k source does), we
12 * just keep a global, we should probably just change it all to be
13 * current and lose _current_task.
14 */
15#include <linux/thread_info.h>
16
17struct task_struct;
18
19static inline struct task_struct *get_current(void)
20{
21 return(current_thread_info()->task);
22}
23
24#define current get_current()
25
26#endif /* CONFNIG_MMU */
27
28#endif /* !(_M68K_CURRENT_H) */
diff --git a/arch/m68k/include/asm/current_mm.h b/arch/m68k/include/asm/current_mm.h
deleted file mode 100644
index 8de8f8ceda61..000000000000
--- a/arch/m68k/include/asm/current_mm.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _M68K_CURRENT_H
2#define _M68K_CURRENT_H
3
4register struct task_struct *current __asm__("%a2");
5
6#endif /* !(_M68K_CURRENT_H) */
diff --git a/arch/m68k/include/asm/current_no.h b/arch/m68k/include/asm/current_no.h
deleted file mode 100644
index 53ee0f9f7cef..000000000000
--- a/arch/m68k/include/asm/current_no.h
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef _M68KNOMMU_CURRENT_H
2#define _M68KNOMMU_CURRENT_H
3/*
4 * current.h
5 * (C) Copyright 2000, Lineo, David McCullough <davidm@uclinux.org>
6 * (C) Copyright 2002, Greg Ungerer (gerg@snapgear.com)
7 *
8 * rather than dedicate a register (as the m68k source does), we
9 * just keep a global, we should probably just change it all to be
10 * current and lose _current_task.
11 */
12
13#include <linux/thread_info.h>
14
15struct task_struct;
16
17static inline struct task_struct *get_current(void)
18{
19 return(current_thread_info()->task);
20}
21
22#define current get_current()
23
24#endif /* _M68KNOMMU_CURRENT_H */
diff --git a/arch/m68k/include/asm/div64.h b/arch/m68k/include/asm/div64.h
index d211d9f54276..edb66148a71d 100644
--- a/arch/m68k/include/asm/div64.h
+++ b/arch/m68k/include/asm/div64.h
@@ -1,5 +1,34 @@
1#ifdef __uClinux__ 1#ifndef _M68K_DIV64_H
2#include "div64_no.h" 2#define _M68K_DIV64_H
3
4#ifdef CONFIG_MMU
5
6#include <linux/types.h>
7
8/* n = n / base; return rem; */
9
10#define do_div(n, base) ({ \
11 union { \
12 unsigned long n32[2]; \
13 unsigned long long n64; \
14 } __n; \
15 unsigned long __rem, __upper; \
16 \
17 __n.n64 = (n); \
18 if ((__upper = __n.n32[0])) { \
19 asm ("divul.l %2,%1:%0" \
20 : "=d" (__n.n32[0]), "=d" (__upper) \
21 : "d" (base), "0" (__n.n32[0])); \
22 } \
23 asm ("divu.l %2,%1:%0" \
24 : "=d" (__n.n32[1]), "=d" (__rem) \
25 : "d" (base), "1" (__upper), "0" (__n.n32[1])); \
26 (n) = __n.n64; \
27 __rem; \
28})
29
3#else 30#else
4#include "div64_mm.h" 31#include <asm-generic/div64.h>
5#endif 32#endif /* CONFIG_MMU */
33
34#endif /* _M68K_DIV64_H */
diff --git a/arch/m68k/include/asm/div64_mm.h b/arch/m68k/include/asm/div64_mm.h
deleted file mode 100644
index 8243c931b5c0..000000000000
--- a/arch/m68k/include/asm/div64_mm.h
+++ /dev/null
@@ -1,28 +0,0 @@
1#ifndef _M68K_DIV64_H
2#define _M68K_DIV64_H
3
4#include <linux/types.h>
5
6/* n = n / base; return rem; */
7
8#define do_div(n, base) ({ \
9 union { \
10 unsigned long n32[2]; \
11 unsigned long long n64; \
12 } __n; \
13 unsigned long __rem, __upper; \
14 \
15 __n.n64 = (n); \
16 if ((__upper = __n.n32[0])) { \
17 asm ("divul.l %2,%1:%0" \
18 : "=d" (__n.n32[0]), "=d" (__upper) \
19 : "d" (base), "0" (__n.n32[0])); \
20 } \
21 asm ("divu.l %2,%1:%0" \
22 : "=d" (__n.n32[1]), "=d" (__rem) \
23 : "d" (base), "1" (__upper), "0" (__n.n32[1])); \
24 (n) = __n.n64; \
25 __rem; \
26})
27
28#endif /* _M68K_DIV64_H */
diff --git a/arch/m68k/include/asm/div64_no.h b/arch/m68k/include/asm/div64_no.h
deleted file mode 100644
index 6cd978cefb28..000000000000
--- a/arch/m68k/include/asm/div64_no.h
+++ /dev/null
@@ -1 +0,0 @@
1#include <asm-generic/div64.h>
diff --git a/arch/m68k/include/asm/dma-mapping.h b/arch/m68k/include/asm/dma-mapping.h
index f4a4c7638f89..26f505488c11 100644
--- a/arch/m68k/include/asm/dma-mapping.h
+++ b/arch/m68k/include/asm/dma-mapping.h
@@ -1,5 +1,112 @@
1#ifdef __uClinux__ 1#ifndef _M68K_DMA_MAPPING_H
2#include "dma-mapping_no.h" 2#define _M68K_DMA_MAPPING_H
3
4#include <asm/cache.h>
5
6struct scatterlist;
7
8#ifndef CONFIG_MMU_SUN3
9static inline int dma_supported(struct device *dev, u64 mask)
10{
11 return 1;
12}
13
14static inline int dma_set_mask(struct device *dev, u64 mask)
15{
16 return 0;
17}
18
19static inline int dma_get_cache_alignment(void)
20{
21 return 1 << L1_CACHE_SHIFT;
22}
23
24static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
25{
26 return 0;
27}
28
29extern void *dma_alloc_coherent(struct device *, size_t,
30 dma_addr_t *, gfp_t);
31extern void dma_free_coherent(struct device *, size_t,
32 void *, dma_addr_t);
33
34static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
35 dma_addr_t *handle, gfp_t flag)
36{
37 return dma_alloc_coherent(dev, size, handle, flag);
38}
39static inline void dma_free_noncoherent(struct device *dev, size_t size,
40 void *addr, dma_addr_t handle)
41{
42 dma_free_coherent(dev, size, addr, handle);
43}
44static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
45 enum dma_data_direction dir)
46{
47 /* we use coherent allocation, so not much to do here. */
48}
49
50extern dma_addr_t dma_map_single(struct device *, void *, size_t,
51 enum dma_data_direction);
52static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
53 size_t size, enum dma_data_direction dir)
54{
55}
56
57extern dma_addr_t dma_map_page(struct device *, struct page *,
58 unsigned long, size_t size,
59 enum dma_data_direction);
60static inline void dma_unmap_page(struct device *dev, dma_addr_t address,
61 size_t size, enum dma_data_direction dir)
62{
63}
64
65extern int dma_map_sg(struct device *, struct scatterlist *, int,
66 enum dma_data_direction);
67static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
68 int nhwentries, enum dma_data_direction dir)
69{
70}
71
72extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t,
73 enum dma_data_direction);
74extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
75 enum dma_data_direction);
76
77static inline void dma_sync_single_range_for_device(struct device *dev,
78 dma_addr_t dma_handle, unsigned long offset, size_t size,
79 enum dma_data_direction direction)
80{
81 /* just sync everything for now */
82 dma_sync_single_for_device(dev, dma_handle, offset + size, direction);
83}
84
85static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
86 size_t size, enum dma_data_direction dir)
87{
88}
89
90static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
91 int nents, enum dma_data_direction dir)
92{
93}
94
95static inline void dma_sync_single_range_for_cpu(struct device *dev,
96 dma_addr_t dma_handle, unsigned long offset, size_t size,
97 enum dma_data_direction direction)
98{
99 /* just sync everything for now */
100 dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction);
101}
102
103static inline int dma_mapping_error(struct device *dev, dma_addr_t handle)
104{
105 return 0;
106}
107
3#else 108#else
4#include "dma-mapping_mm.h" 109#include <asm-generic/dma-mapping-broken.h>
5#endif 110#endif
111
112#endif /* _M68K_DMA_MAPPING_H */
diff --git a/arch/m68k/include/asm/dma-mapping_mm.h b/arch/m68k/include/asm/dma-mapping_mm.h
deleted file mode 100644
index 26f505488c11..000000000000
--- a/arch/m68k/include/asm/dma-mapping_mm.h
+++ /dev/null
@@ -1,112 +0,0 @@
1#ifndef _M68K_DMA_MAPPING_H
2#define _M68K_DMA_MAPPING_H
3
4#include <asm/cache.h>
5
6struct scatterlist;
7
8#ifndef CONFIG_MMU_SUN3
9static inline int dma_supported(struct device *dev, u64 mask)
10{
11 return 1;
12}
13
14static inline int dma_set_mask(struct device *dev, u64 mask)
15{
16 return 0;
17}
18
19static inline int dma_get_cache_alignment(void)
20{
21 return 1 << L1_CACHE_SHIFT;
22}
23
24static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
25{
26 return 0;
27}
28
29extern void *dma_alloc_coherent(struct device *, size_t,
30 dma_addr_t *, gfp_t);
31extern void dma_free_coherent(struct device *, size_t,
32 void *, dma_addr_t);
33
34static inline void *dma_alloc_noncoherent(struct device *dev, size_t size,
35 dma_addr_t *handle, gfp_t flag)
36{
37 return dma_alloc_coherent(dev, size, handle, flag);
38}
39static inline void dma_free_noncoherent(struct device *dev, size_t size,
40 void *addr, dma_addr_t handle)
41{
42 dma_free_coherent(dev, size, addr, handle);
43}
44static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
45 enum dma_data_direction dir)
46{
47 /* we use coherent allocation, so not much to do here. */
48}
49
50extern dma_addr_t dma_map_single(struct device *, void *, size_t,
51 enum dma_data_direction);
52static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
53 size_t size, enum dma_data_direction dir)
54{
55}
56
57extern dma_addr_t dma_map_page(struct device *, struct page *,
58 unsigned long, size_t size,
59 enum dma_data_direction);
60static inline void dma_unmap_page(struct device *dev, dma_addr_t address,
61 size_t size, enum dma_data_direction dir)
62{
63}
64
65extern int dma_map_sg(struct device *, struct scatterlist *, int,
66 enum dma_data_direction);
67static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
68 int nhwentries, enum dma_data_direction dir)
69{
70}
71
72extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t,
73 enum dma_data_direction);
74extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
75 enum dma_data_direction);
76
77static inline void dma_sync_single_range_for_device(struct device *dev,
78 dma_addr_t dma_handle, unsigned long offset, size_t size,
79 enum dma_data_direction direction)
80{
81 /* just sync everything for now */
82 dma_sync_single_for_device(dev, dma_handle, offset + size, direction);
83}
84
85static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
86 size_t size, enum dma_data_direction dir)
87{
88}
89
90static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
91 int nents, enum dma_data_direction dir)
92{
93}
94
95static inline void dma_sync_single_range_for_cpu(struct device *dev,
96 dma_addr_t dma_handle, unsigned long offset, size_t size,
97 enum dma_data_direction direction)
98{
99 /* just sync everything for now */
100 dma_sync_single_for_cpu(dev, dma_handle, offset + size, direction);
101}
102
103static inline int dma_mapping_error(struct device *dev, dma_addr_t handle)
104{
105 return 0;
106}
107
108#else
109#include <asm-generic/dma-mapping-broken.h>
110#endif
111
112#endif /* _M68K_DMA_MAPPING_H */
diff --git a/arch/m68k/include/asm/dma-mapping_no.h b/arch/m68k/include/asm/dma-mapping_no.h
deleted file mode 100644
index 1748f2bca940..000000000000
--- a/arch/m68k/include/asm/dma-mapping_no.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef _M68KNOMMU_DMA_MAPPING_H
2#define _M68KNOMMU_DMA_MAPPING_H
3
4#include <asm-generic/dma-mapping-broken.h>
5
6#endif /* _M68KNOMMU_DMA_MAPPING_H */
diff --git a/arch/m68k/include/asm/elf.h b/arch/m68k/include/asm/elf.h
index 04ce488bc63f..0b0f49eb876b 100644
--- a/arch/m68k/include/asm/elf.h
+++ b/arch/m68k/include/asm/elf.h
@@ -1,5 +1,119 @@
1#ifdef __uClinux__ 1#ifndef __ASMm68k_ELF_H
2#include "elf_no.h" 2#define __ASMm68k_ELF_H
3
4/*
5 * ELF register definitions..
6 */
7
8#include <asm/ptrace.h>
9#include <asm/user.h>
10
11/*
12 * 68k ELF relocation types
13 */
14#define R_68K_NONE 0
15#define R_68K_32 1
16#define R_68K_16 2
17#define R_68K_8 3
18#define R_68K_PC32 4
19#define R_68K_PC16 5
20#define R_68K_PC8 6
21#define R_68K_GOT32 7
22#define R_68K_GOT16 8
23#define R_68K_GOT8 9
24#define R_68K_GOT32O 10
25#define R_68K_GOT16O 11
26#define R_68K_GOT8O 12
27#define R_68K_PLT32 13
28#define R_68K_PLT16 14
29#define R_68K_PLT8 15
30#define R_68K_PLT32O 16
31#define R_68K_PLT16O 17
32#define R_68K_PLT8O 18
33#define R_68K_COPY 19
34#define R_68K_GLOB_DAT 20
35#define R_68K_JMP_SLOT 21
36#define R_68K_RELATIVE 22
37
38typedef unsigned long elf_greg_t;
39
40#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
41typedef elf_greg_t elf_gregset_t[ELF_NGREG];
42
43typedef struct user_m68kfp_struct elf_fpregset_t;
44
45/*
46 * This is used to ensure we don't load something for the wrong architecture.
47 */
48#define elf_check_arch(x) ((x)->e_machine == EM_68K)
49
50/*
51 * These are used to set parameters in the core dumps.
52 */
53#define ELF_CLASS ELFCLASS32
54#define ELF_DATA ELFDATA2MSB
55#define ELF_ARCH EM_68K
56
57/* For SVR4/m68k the function pointer to be registered with `atexit' is
58 passed in %a1. Although my copy of the ABI has no such statement, it
59 is actually used on ASV. */
60#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0
61
62#define USE_ELF_CORE_DUMP
63#ifndef CONFIG_SUN3
64#define ELF_EXEC_PAGESIZE 4096
3#else 65#else
4#include "elf_mm.h" 66#define ELF_EXEC_PAGESIZE 8192
67#endif
68
69/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
70 use of this is to invoke "./ld.so someprog" to test out a new version of
71 the loader. We need to make sure that it is out of the way of the program
72 that it will "exec", and that there is sufficient room for the brk. */
73
74#ifndef CONFIG_SUN3
75#define ELF_ET_DYN_BASE 0xD0000000UL
76#else
77#define ELF_ET_DYN_BASE 0x0D800000UL
78#endif
79
80#define ELF_CORE_COPY_REGS(pr_reg, regs) \
81 /* Bleech. */ \
82 pr_reg[0] = regs->d1; \
83 pr_reg[1] = regs->d2; \
84 pr_reg[2] = regs->d3; \
85 pr_reg[3] = regs->d4; \
86 pr_reg[4] = regs->d5; \
87 pr_reg[7] = regs->a0; \
88 pr_reg[8] = regs->a1; \
89 pr_reg[9] = regs->a2; \
90 pr_reg[14] = regs->d0; \
91 pr_reg[15] = rdusp(); \
92 pr_reg[16] = regs->orig_d0; \
93 pr_reg[17] = regs->sr; \
94 pr_reg[18] = regs->pc; \
95 pr_reg[19] = (regs->format << 12) | regs->vector; \
96 { \
97 struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \
98 pr_reg[5] = sw->d6; \
99 pr_reg[6] = sw->d7; \
100 pr_reg[10] = sw->a3; \
101 pr_reg[11] = sw->a4; \
102 pr_reg[12] = sw->a5; \
103 pr_reg[13] = sw->a6; \
104 }
105
106/* This yields a mask that user programs can use to figure out what
107 instruction set this cpu supports. */
108
109#define ELF_HWCAP (0)
110
111/* This yields a string that ld.so will use to load implementation
112 specific libraries for optimization. This is more specific in
113 intent than poking at uname or /proc/cpuinfo. */
114
115#define ELF_PLATFORM (NULL)
116
117#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
118
5#endif 119#endif
diff --git a/arch/m68k/include/asm/elf_mm.h b/arch/m68k/include/asm/elf_mm.h
deleted file mode 100644
index 0b0f49eb876b..000000000000
--- a/arch/m68k/include/asm/elf_mm.h
+++ /dev/null
@@ -1,119 +0,0 @@
1#ifndef __ASMm68k_ELF_H
2#define __ASMm68k_ELF_H
3
4/*
5 * ELF register definitions..
6 */
7
8#include <asm/ptrace.h>
9#include <asm/user.h>
10
11/*
12 * 68k ELF relocation types
13 */
14#define R_68K_NONE 0
15#define R_68K_32 1
16#define R_68K_16 2
17#define R_68K_8 3
18#define R_68K_PC32 4
19#define R_68K_PC16 5
20#define R_68K_PC8 6
21#define R_68K_GOT32 7
22#define R_68K_GOT16 8
23#define R_68K_GOT8 9
24#define R_68K_GOT32O 10
25#define R_68K_GOT16O 11
26#define R_68K_GOT8O 12
27#define R_68K_PLT32 13
28#define R_68K_PLT16 14
29#define R_68K_PLT8 15
30#define R_68K_PLT32O 16
31#define R_68K_PLT16O 17
32#define R_68K_PLT8O 18
33#define R_68K_COPY 19
34#define R_68K_GLOB_DAT 20
35#define R_68K_JMP_SLOT 21
36#define R_68K_RELATIVE 22
37
38typedef unsigned long elf_greg_t;
39
40#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
41typedef elf_greg_t elf_gregset_t[ELF_NGREG];
42
43typedef struct user_m68kfp_struct elf_fpregset_t;
44
45/*
46 * This is used to ensure we don't load something for the wrong architecture.
47 */
48#define elf_check_arch(x) ((x)->e_machine == EM_68K)
49
50/*
51 * These are used to set parameters in the core dumps.
52 */
53#define ELF_CLASS ELFCLASS32
54#define ELF_DATA ELFDATA2MSB
55#define ELF_ARCH EM_68K
56
57/* For SVR4/m68k the function pointer to be registered with `atexit' is
58 passed in %a1. Although my copy of the ABI has no such statement, it
59 is actually used on ASV. */
60#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0
61
62#define USE_ELF_CORE_DUMP
63#ifndef CONFIG_SUN3
64#define ELF_EXEC_PAGESIZE 4096
65#else
66#define ELF_EXEC_PAGESIZE 8192
67#endif
68
69/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
70 use of this is to invoke "./ld.so someprog" to test out a new version of
71 the loader. We need to make sure that it is out of the way of the program
72 that it will "exec", and that there is sufficient room for the brk. */
73
74#ifndef CONFIG_SUN3
75#define ELF_ET_DYN_BASE 0xD0000000UL
76#else
77#define ELF_ET_DYN_BASE 0x0D800000UL
78#endif
79
80#define ELF_CORE_COPY_REGS(pr_reg, regs) \
81 /* Bleech. */ \
82 pr_reg[0] = regs->d1; \
83 pr_reg[1] = regs->d2; \
84 pr_reg[2] = regs->d3; \
85 pr_reg[3] = regs->d4; \
86 pr_reg[4] = regs->d5; \
87 pr_reg[7] = regs->a0; \
88 pr_reg[8] = regs->a1; \
89 pr_reg[9] = regs->a2; \
90 pr_reg[14] = regs->d0; \
91 pr_reg[15] = rdusp(); \
92 pr_reg[16] = regs->orig_d0; \
93 pr_reg[17] = regs->sr; \
94 pr_reg[18] = regs->pc; \
95 pr_reg[19] = (regs->format << 12) | regs->vector; \
96 { \
97 struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \
98 pr_reg[5] = sw->d6; \
99 pr_reg[6] = sw->d7; \
100 pr_reg[10] = sw->a3; \
101 pr_reg[11] = sw->a4; \
102 pr_reg[12] = sw->a5; \
103 pr_reg[13] = sw->a6; \
104 }
105
106/* This yields a mask that user programs can use to figure out what
107 instruction set this cpu supports. */
108
109#define ELF_HWCAP (0)
110
111/* This yields a string that ld.so will use to load implementation
112 specific libraries for optimization. This is more specific in
113 intent than poking at uname or /proc/cpuinfo. */
114
115#define ELF_PLATFORM (NULL)
116
117#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
118
119#endif
diff --git a/arch/m68k/include/asm/elf_no.h b/arch/m68k/include/asm/elf_no.h
deleted file mode 100644
index b8046837f384..000000000000
--- a/arch/m68k/include/asm/elf_no.h
+++ /dev/null
@@ -1,110 +0,0 @@
1#ifndef __ASMm68k_ELF_H
2#define __ASMm68k_ELF_H
3
4/*
5 * ELF register definitions..
6 */
7
8#include <asm/ptrace.h>
9#include <asm/user.h>
10
11/*
12 * 68k ELF relocation types
13 */
14#define R_68K_NONE 0
15#define R_68K_32 1
16#define R_68K_16 2
17#define R_68K_8 3
18#define R_68K_PC32 4
19#define R_68K_PC16 5
20#define R_68K_PC8 6
21#define R_68K_GOT32 7
22#define R_68K_GOT16 8
23#define R_68K_GOT8 9
24#define R_68K_GOT32O 10
25#define R_68K_GOT16O 11
26#define R_68K_GOT8O 12
27#define R_68K_PLT32 13
28#define R_68K_PLT16 14
29#define R_68K_PLT8 15
30#define R_68K_PLT32O 16
31#define R_68K_PLT16O 17
32#define R_68K_PLT8O 18
33#define R_68K_COPY 19
34#define R_68K_GLOB_DAT 20
35#define R_68K_JMP_SLOT 21
36#define R_68K_RELATIVE 22
37
38typedef unsigned long elf_greg_t;
39
40#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
41typedef elf_greg_t elf_gregset_t[ELF_NGREG];
42
43typedef struct user_m68kfp_struct elf_fpregset_t;
44
45/*
46 * This is used to ensure we don't load something for the wrong architecture.
47 */
48#define elf_check_arch(x) ((x)->e_machine == EM_68K)
49
50/*
51 * These are used to set parameters in the core dumps.
52 */
53#define ELF_CLASS ELFCLASS32
54#define ELF_DATA ELFDATA2MSB
55#define ELF_ARCH EM_68K
56
57/* For SVR4/m68k the function pointer to be registered with `atexit' is
58 passed in %a1. Although my copy of the ABI has no such statement, it
59 is actually used on ASV. */
60#define ELF_PLAT_INIT(_r, load_addr) _r->a1 = 0
61
62#define USE_ELF_CORE_DUMP
63#define ELF_EXEC_PAGESIZE 4096
64
65/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
66 use of this is to invoke "./ld.so someprog" to test out a new version of
67 the loader. We need to make sure that it is out of the way of the program
68 that it will "exec", and that there is sufficient room for the brk. */
69
70#define ELF_ET_DYN_BASE 0xD0000000UL
71
72#define ELF_CORE_COPY_REGS(pr_reg, regs) \
73 /* Bleech. */ \
74 pr_reg[0] = regs->d1; \
75 pr_reg[1] = regs->d2; \
76 pr_reg[2] = regs->d3; \
77 pr_reg[3] = regs->d4; \
78 pr_reg[4] = regs->d5; \
79 pr_reg[7] = regs->a0; \
80 pr_reg[8] = regs->a1; \
81 pr_reg[14] = regs->d0; \
82 pr_reg[15] = rdusp(); \
83 pr_reg[16] = 0 /* regs->orig_d0 */; \
84 pr_reg[17] = regs->sr; \
85 pr_reg[18] = regs->pc; \
86 /* pr_reg[19] = (regs->format << 12) | regs->vector; */ \
87 { \
88 struct switch_stack *sw = ((struct switch_stack *)regs) - 1; \
89 pr_reg[5] = sw->d6; \
90 pr_reg[6] = sw->d7; \
91 pr_reg[10] = sw->a3; \
92 pr_reg[11] = sw->a4; \
93 pr_reg[12] = sw->a5; \
94 pr_reg[13] = sw->a6; \
95 }
96
97/* This yields a mask that user programs can use to figure out what
98 instruction set this cpu supports. */
99
100#define ELF_HWCAP (0)
101
102/* This yields a string that ld.so will use to load implementation
103 specific libraries for optimization. This is more specific in
104 intent than poking at uname or /proc/cpuinfo. */
105
106#define ELF_PLATFORM (NULL)
107
108#define SET_PERSONALITY(ex) set_personality(PER_LINUX)
109
110#endif
diff --git a/arch/m68k/include/asm/fb.h b/arch/m68k/include/asm/fb.h
index 97bcaefd2064..be4e4c6797e8 100644
--- a/arch/m68k/include/asm/fb.h
+++ b/arch/m68k/include/asm/fb.h
@@ -1,5 +1,38 @@
1#ifdef __uClinux__ 1#ifndef _ASM_FB_H_
2#include "fb_no.h" 2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7#include <asm/setup.h>
8
9#ifdef CONFIG_MMU
10#ifdef CONFIG_SUN3
11static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
12 unsigned long off)
13{
14 pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE;
15}
3#else 16#else
4#include "fb_mm.h" 17static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
5#endif 18 unsigned long off)
19{
20 if (CPU_IS_020_OR_030)
21 pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030;
22 if (CPU_IS_040_OR_060) {
23 pgprot_val(vma->vm_page_prot) &= _CACHEMASK040;
24 /* Use no-cache mode, serialized */
25 pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S;
26 }
27}
28#endif /* CONFIG_SUN3 */
29#else
30#define fb_pgprotect(...) do {} while (0)
31#endif /* CONFIG_MMU */
32
33static inline int fb_is_primary_device(struct fb_info *info)
34{
35 return 0;
36}
37
38#endif /* _ASM_FB_H_ */
diff --git a/arch/m68k/include/asm/fb_mm.h b/arch/m68k/include/asm/fb_mm.h
deleted file mode 100644
index 380b97ae8157..000000000000
--- a/arch/m68k/include/asm/fb_mm.h
+++ /dev/null
@@ -1,34 +0,0 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3
4#include <linux/fb.h>
5#include <linux/fs.h>
6#include <asm/page.h>
7#include <asm/setup.h>
8
9#ifdef CONFIG_SUN3
10static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
11 unsigned long off)
12{
13 pgprot_val(vma->vm_page_prot) |= SUN3_PAGE_NOCACHE;
14}
15#else
16static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma,
17 unsigned long off)
18{
19 if (CPU_IS_020_OR_030)
20 pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE030;
21 if (CPU_IS_040_OR_060) {
22 pgprot_val(vma->vm_page_prot) &= _CACHEMASK040;
23 /* Use no-cache mode, serialized */
24 pgprot_val(vma->vm_page_prot) |= _PAGE_NOCACHE_S;
25 }
26}
27#endif /* CONFIG_SUN3 */
28
29static inline int fb_is_primary_device(struct fb_info *info)
30{
31 return 0;
32}
33
34#endif /* _ASM_FB_H_ */
diff --git a/arch/m68k/include/asm/fb_no.h b/arch/m68k/include/asm/fb_no.h
deleted file mode 100644
index c7df38030992..000000000000
--- a/arch/m68k/include/asm/fb_no.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_FB_H_
2#define _ASM_FB_H_
3#include <linux/fb.h>
4
5#define fb_pgprotect(...) do {} while (0)
6
7static inline int fb_is_primary_device(struct fb_info *info)
8{
9 return 0;
10}
11
12#endif /* _ASM_FB_H_ */
diff --git a/arch/m68k/include/asm/fpu.h b/arch/m68k/include/asm/fpu.h
index e19bc5ed9c37..ffb6b8cfc6d5 100644
--- a/arch/m68k/include/asm/fpu.h
+++ b/arch/m68k/include/asm/fpu.h
@@ -1,5 +1,21 @@
1#ifdef __uClinux__ 1#ifndef __M68K_FPU_H
2#include "fpu_no.h" 2#define __M68K_FPU_H
3
4
5/*
6 * MAX floating point unit state size (FSAVE/FRESTORE)
7 */
8
9#if defined(CONFIG_M68020) || defined(CONFIG_M68030)
10#define FPSTATESIZE (216)
11#elif defined(CONFIG_M68040)
12#define FPSTATESIZE (96)
13#elif defined(CONFIG_M68KFPU_EMU)
14#define FPSTATESIZE (28)
15#elif defined(CONFIG_M68060)
16#define FPSTATESIZE (12)
3#else 17#else
4#include "fpu_mm.h" 18#define FPSTATESIZE (0)
5#endif 19#endif
20
21#endif /* __M68K_FPU_H */
diff --git a/arch/m68k/include/asm/fpu_mm.h b/arch/m68k/include/asm/fpu_mm.h
deleted file mode 100644
index ffb6b8cfc6d5..000000000000
--- a/arch/m68k/include/asm/fpu_mm.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __M68K_FPU_H
2#define __M68K_FPU_H
3
4
5/*
6 * MAX floating point unit state size (FSAVE/FRESTORE)
7 */
8
9#if defined(CONFIG_M68020) || defined(CONFIG_M68030)
10#define FPSTATESIZE (216)
11#elif defined(CONFIG_M68040)
12#define FPSTATESIZE (96)
13#elif defined(CONFIG_M68KFPU_EMU)
14#define FPSTATESIZE (28)
15#elif defined(CONFIG_M68060)
16#define FPSTATESIZE (12)
17#else
18#define FPSTATESIZE (0)
19#endif
20
21#endif /* __M68K_FPU_H */
diff --git a/arch/m68k/include/asm/fpu_no.h b/arch/m68k/include/asm/fpu_no.h
deleted file mode 100644
index b16b2e4fca2a..000000000000
--- a/arch/m68k/include/asm/fpu_no.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __M68KNOMMU_FPU_H
2#define __M68KNOMMU_FPU_H
3
4
5/*
6 * MAX floating point unit state size (FSAVE/FRESTORE)
7 */
8#if defined(CONFIG_M68020) || defined(CONFIG_M68030)
9#define FPSTATESIZE (216/sizeof(unsigned char))
10#elif defined(CONFIG_M68040)
11#define FPSTATESIZE (96/sizeof(unsigned char))
12#elif defined(CONFIG_M68KFPU_EMU)
13#define FPSTATESIZE (28/sizeof(unsigned char))
14#elif defined(CONFIG_M68060)
15#define FPSTATESIZE (12/sizeof(unsigned char))
16#else
17/* Assume no FP unit present then... */
18#define FPSTATESIZE (2) /* dummy size */
19#endif
20
21#endif /* __M68K_FPU_H */
diff --git a/arch/m68k/include/asm/hw_irq.h b/arch/m68k/include/asm/hw_irq.h
index e19526015890..eacef0951fbf 100644
--- a/arch/m68k/include/asm/hw_irq.h
+++ b/arch/m68k/include/asm/hw_irq.h
@@ -1,5 +1,6 @@
1#ifdef __uClinux__ 1#ifndef __ASM_M68K_HW_IRQ_H
2#include "hw_irq_no.h" 2#define __ASM_M68K_HW_IRQ_H
3#else 3
4#include "hw_irq_mm.h" 4/* Dummy include. */
5
5#endif 6#endif
diff --git a/arch/m68k/include/asm/hw_irq_mm.h b/arch/m68k/include/asm/hw_irq_mm.h
deleted file mode 100644
index eacef0951fbf..000000000000
--- a/arch/m68k/include/asm/hw_irq_mm.h
+++ /dev/null
@@ -1,6 +0,0 @@
1#ifndef __ASM_M68K_HW_IRQ_H
2#define __ASM_M68K_HW_IRQ_H
3
4/* Dummy include. */
5
6#endif
diff --git a/arch/m68k/include/asm/hw_irq_no.h b/arch/m68k/include/asm/hw_irq_no.h
deleted file mode 100644
index f3ec9e5ae049..000000000000
--- a/arch/m68k/include/asm/hw_irq_no.h
+++ /dev/null
@@ -1,4 +0,0 @@
1#ifndef __M68KNOMMU_HW_IRQ_H__
2#define __M68KNOMMU_HW_IRQ_H__
3
4#endif /* __M68KNOMMU_HW_IRQ_H__ */
diff --git a/arch/m68k/include/asm/kmap_types.h b/arch/m68k/include/asm/kmap_types.h
index 045d9fd122a2..c843c63d3801 100644
--- a/arch/m68k/include/asm/kmap_types.h
+++ b/arch/m68k/include/asm/kmap_types.h
@@ -1,5 +1,21 @@
1#ifdef __uClinux__ 1#ifndef __ASM_M68K_KMAP_TYPES_H
2#include "kmap_types_no.h" 2#define __ASM_M68K_KMAP_TYPES_H
3#else 3
4#include "kmap_types_mm.h" 4enum km_type {
5#endif 5 KM_BOUNCE_READ,
6 KM_SKB_SUNRPC_DATA,
7 KM_SKB_DATA_SOFTIRQ,
8 KM_USER0,
9 KM_USER1,
10 KM_BIO_SRC_IRQ,
11 KM_BIO_DST_IRQ,
12 KM_PTE0,
13 KM_PTE1,
14 KM_IRQ0,
15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
18 KM_TYPE_NR
19};
20
21#endif /* __ASM_M68K_KMAP_TYPES_H */
diff --git a/arch/m68k/include/asm/kmap_types_mm.h b/arch/m68k/include/asm/kmap_types_mm.h
deleted file mode 100644
index c843c63d3801..000000000000
--- a/arch/m68k/include/asm/kmap_types_mm.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __ASM_M68K_KMAP_TYPES_H
2#define __ASM_M68K_KMAP_TYPES_H
3
4enum km_type {
5 KM_BOUNCE_READ,
6 KM_SKB_SUNRPC_DATA,
7 KM_SKB_DATA_SOFTIRQ,
8 KM_USER0,
9 KM_USER1,
10 KM_BIO_SRC_IRQ,
11 KM_BIO_DST_IRQ,
12 KM_PTE0,
13 KM_PTE1,
14 KM_IRQ0,
15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
18 KM_TYPE_NR
19};
20
21#endif /* __ASM_M68K_KMAP_TYPES_H */
diff --git a/arch/m68k/include/asm/kmap_types_no.h b/arch/m68k/include/asm/kmap_types_no.h
deleted file mode 100644
index bfb6707575d1..000000000000
--- a/arch/m68k/include/asm/kmap_types_no.h
+++ /dev/null
@@ -1,21 +0,0 @@
1#ifndef __ASM_M68K_KMAP_TYPES_H
2#define __ASM_M68K_KMAP_TYPES_H
3
4enum km_type {
5 KM_BOUNCE_READ,
6 KM_SKB_SUNRPC_DATA,
7 KM_SKB_DATA_SOFTIRQ,
8 KM_USER0,
9 KM_USER1,
10 KM_BIO_SRC_IRQ,
11 KM_BIO_DST_IRQ,
12 KM_PTE0,
13 KM_PTE1,
14 KM_IRQ0,
15 KM_IRQ1,
16 KM_SOFTIRQ0,
17 KM_SOFTIRQ1,
18 KM_TYPE_NR
19};
20
21#endif
diff --git a/arch/m68k/include/asm/m532xsim.h b/arch/m68k/include/asm/m532xsim.h
index 1835fd20a82c..ce603451b55e 100644
--- a/arch/m68k/include/asm/m532xsim.h
+++ b/arch/m68k/include/asm/m532xsim.h
@@ -16,6 +16,7 @@
16#define MCFINT_VECBASE 64 16#define MCFINT_VECBASE 64
17#define MCFINT_UART0 26 /* Interrupt number for UART0 */ 17#define MCFINT_UART0 26 /* Interrupt number for UART0 */
18#define MCFINT_UART1 27 /* Interrupt number for UART1 */ 18#define MCFINT_UART1 27 /* Interrupt number for UART1 */
19#define MCFINT_UART2 28 /* Interrupt number for UART2 */
19 20
20#define MCF_WTM_WCR MCF_REG16(0xFC098000) 21#define MCF_WTM_WCR MCF_REG16(0xFC098000)
21 22
diff --git a/arch/m68k/include/asm/mc146818rtc.h b/arch/m68k/include/asm/mc146818rtc.h
index fb90dcf78426..9f70a01f73dc 100644
--- a/arch/m68k/include/asm/mc146818rtc.h
+++ b/arch/m68k/include/asm/mc146818rtc.h
@@ -1,5 +1,26 @@
1#ifdef __uClinux__ 1/*
2#include "mc146818rtc_no.h" 2 * Machine dependent access functions for RTC registers.
3#else 3 */
4#include "mc146818rtc_mm.h" 4#ifndef _ASM_MC146818RTC_H
5#endif 5#define _ASM_MC146818RTC_H
6
7
8#ifdef CONFIG_ATARI
9/* RTC in Atari machines */
10
11#include <asm/atarihw.h>
12
13#define RTC_PORT(x) (TT_RTC_BAS + 2*(x))
14#define RTC_ALWAYS_BCD 0
15
16#define CMOS_READ(addr) ({ \
17atari_outb_p((addr),RTC_PORT(0)); \
18atari_inb_p(RTC_PORT(1)); \
19})
20#define CMOS_WRITE(val, addr) ({ \
21atari_outb_p((addr),RTC_PORT(0)); \
22atari_outb_p((val),RTC_PORT(1)); \
23})
24#endif /* CONFIG_ATARI */
25
26#endif /* _ASM_MC146818RTC_H */
diff --git a/arch/m68k/include/asm/mc146818rtc_mm.h b/arch/m68k/include/asm/mc146818rtc_mm.h
deleted file mode 100644
index 9f70a01f73dc..000000000000
--- a/arch/m68k/include/asm/mc146818rtc_mm.h
+++ /dev/null
@@ -1,26 +0,0 @@
1/*
2 * Machine dependent access functions for RTC registers.
3 */
4#ifndef _ASM_MC146818RTC_H
5#define _ASM_MC146818RTC_H
6
7
8#ifdef CONFIG_ATARI
9/* RTC in Atari machines */
10
11#include <asm/atarihw.h>
12
13#define RTC_PORT(x) (TT_RTC_BAS + 2*(x))
14#define RTC_ALWAYS_BCD 0
15
16#define CMOS_READ(addr) ({ \
17atari_outb_p((addr),RTC_PORT(0)); \
18atari_inb_p(RTC_PORT(1)); \
19})
20#define CMOS_WRITE(val, addr) ({ \
21atari_outb_p((addr),RTC_PORT(0)); \
22atari_outb_p((val),RTC_PORT(1)); \
23})
24#endif /* CONFIG_ATARI */
25
26#endif /* _ASM_MC146818RTC_H */
diff --git a/arch/m68k/include/asm/mc146818rtc_no.h b/arch/m68k/include/asm/mc146818rtc_no.h
deleted file mode 100644
index 907a0481a140..000000000000
--- a/arch/m68k/include/asm/mc146818rtc_no.h
+++ /dev/null
@@ -1,9 +0,0 @@
1/*
2 * Machine dependent access functions for RTC registers.
3 */
4#ifndef _M68KNOMMU_MC146818RTC_H
5#define _M68KNOMMU_MC146818RTC_H
6
7/* empty include file to satisfy the include in genrtc.c/ide-geometry.c */
8
9#endif /* _M68KNOMMU_MC146818RTC_H */
diff --git a/arch/m68k/include/asm/mcfpci.h b/arch/m68k/include/asm/mcfpci.h
deleted file mode 100644
index f1507dd06ec6..000000000000
--- a/arch/m68k/include/asm/mcfpci.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/****************************************************************************/
2
3/*
4 * mcfpci.h -- PCI bridge on ColdFire eval boards.
5 *
6 * (C) Copyright 2000, Greg Ungerer (gerg@snapgear.com)
7 * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
8 */
9
10/****************************************************************************/
11#ifndef mcfpci_h
12#define mcfpci_h
13/****************************************************************************/
14
15
16#ifdef CONFIG_PCI
17
18/*
19 * Address regions in the PCI address space are not mapped into the
20 * normal memory space of the ColdFire. They must be accessed via
21 * handler routines. This is easy for I/O space (inb/outb/etc) but
22 * needs some code changes to support ordinary memory. Interrupts
23 * also need to be vectored through the PCI handler first, then it
24 * will call the actual driver sub-handlers.
25 */
26
27/*
28 * Un-define all the standard I/O access routines.
29 */
30#undef inb
31#undef inw
32#undef inl
33#undef inb_p
34#undef inw_p
35#undef insb
36#undef insw
37#undef insl
38#undef outb
39#undef outw
40#undef outl
41#undef outb_p
42#undef outw_p
43#undef outsb
44#undef outsw
45#undef outsl
46
47#undef request_irq
48#undef free_irq
49
50#undef bus_to_virt
51#undef virt_to_bus
52
53
54/*
55 * Re-direct all I/O memory accesses functions to PCI specific ones.
56 */
57#define inb pci_inb
58#define inw pci_inw
59#define inl pci_inl
60#define inb_p pci_inb
61#define inw_p pci_inw
62#define insb pci_insb
63#define insw pci_insw
64#define insl pci_insl
65
66#define outb pci_outb
67#define outw pci_outw
68#define outl pci_outl
69#define outb_p pci_outb
70#define outw_p pci_outw
71#define outsb pci_outsb
72#define outsw pci_outsw
73#define outsl pci_outsl
74
75#define request_irq pci_request_irq
76#define free_irq pci_free_irq
77
78#define virt_to_bus pci_virt_to_bus
79#define bus_to_virt pci_bus_to_virt
80
81#define CONFIG_COMEMPCI 1
82
83
84/*
85 * Prototypes of the real PCI functions (defined in bios32.c).
86 */
87unsigned char pci_inb(unsigned int addr);
88unsigned short pci_inw(unsigned int addr);
89unsigned int pci_inl(unsigned int addr);
90void pci_insb(void *addr, void *buf, int len);
91void pci_insw(void *addr, void *buf, int len);
92void pci_insl(void *addr, void *buf, int len);
93
94void pci_outb(unsigned char val, unsigned int addr);
95void pci_outw(unsigned short val, unsigned int addr);
96void pci_outl(unsigned int val, unsigned int addr);
97void pci_outsb(void *addr, void *buf, int len);
98void pci_outsw(void *addr, void *buf, int len);
99void pci_outsl(void *addr, void *buf, int len);
100
101int pci_request_irq(unsigned int irq,
102 void (*handler)(int, void *, struct pt_regs *),
103 unsigned long flags,
104 const char *device,
105 void *dev_id);
106void pci_free_irq(unsigned int irq, void *dev_id);
107
108void *pci_bmalloc(int size);
109void pci_bmfree(void *bmp, int len);
110void pci_copytoshmem(unsigned long bmp, void *src, int size);
111void pci_copyfromshmem(void *dst, unsigned long bmp, int size);
112unsigned long pci_virt_to_bus(volatile void *address);
113void *pci_bus_to_virt(unsigned long address);
114void pci_bmcpyto(void *dst, void *src, int len);
115void pci_bmcpyfrom(void *dst, void *src, int len);
116
117#endif /* CONFIG_PCI */
118/****************************************************************************/
119#endif /* mcfpci_h */
diff --git a/arch/m68k/include/asm/mmu.h b/arch/m68k/include/asm/mmu.h
index a81d3946675f..8a11a63ee15a 100644
--- a/arch/m68k/include/asm/mmu.h
+++ b/arch/m68k/include/asm/mmu.h
@@ -1,5 +1,13 @@
1#ifdef __uClinux__ 1#ifndef __MMU_H
2#include "mmu_no.h" 2#define __MMU_H
3
4#ifdef CONFIG_MMU
5/* Default "unsigned long" context */
6typedef unsigned long mm_context_t;
3#else 7#else
4#include "mmu_mm.h" 8typedef struct {
9 unsigned long end_brk;
10} mm_context_t;
11#endif
12
5#endif 13#endif
diff --git a/arch/m68k/include/asm/mmu_context.h b/arch/m68k/include/asm/mmu_context.h
index b440928fc6c7..7d4341e55a99 100644
--- a/arch/m68k/include/asm/mmu_context.h
+++ b/arch/m68k/include/asm/mmu_context.h
@@ -1,5 +1,175 @@
1#ifdef __uClinux__ 1#ifndef __M68K_MMU_CONTEXT_H
2#include "mmu_context_no.h" 2#define __M68K_MMU_CONTEXT_H
3
4#include <asm-generic/mm_hooks.h>
5
6static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
7{
8}
9
10#ifdef CONFIG_MMU
11#ifndef CONFIG_SUN3
12
13#include <asm/setup.h>
14#include <asm/page.h>
15#include <asm/pgalloc.h>
16
17static inline int init_new_context(struct task_struct *tsk,
18 struct mm_struct *mm)
19{
20 mm->context = virt_to_phys(mm->pgd);
21 return 0;
22}
23
24#define destroy_context(mm) do { } while(0)
25
26static inline void switch_mm_0230(struct mm_struct *mm)
27{
28 unsigned long crp[2] = {
29 0x80000000 | _PAGE_TABLE, mm->context
30 };
31 unsigned long tmp;
32
33 asm volatile (".chip 68030");
34
35 /* flush MC68030/MC68020 caches (they are virtually addressed) */
36 asm volatile (
37 "movec %%cacr,%0;"
38 "orw %1,%0; "
39 "movec %0,%%cacr"
40 : "=d" (tmp) : "di" (FLUSH_I_AND_D));
41
42 /* Switch the root pointer. For a 030-only kernel,
43 * avoid flushing the whole ATC, we only need to
44 * flush the user entries. The 68851 does this by
45 * itself. Avoid a runtime check here.
46 */
47 asm volatile (
48#ifdef CPU_M68030_ONLY
49 "pmovefd %0,%%crp; "
50 "pflush #0,#4"
3#else 51#else
4#include "mmu_context_mm.h" 52 "pmove %0,%%crp"
5#endif 53#endif
54 : : "m" (crp[0]));
55
56 asm volatile (".chip 68k");
57}
58
59static inline void switch_mm_0460(struct mm_struct *mm)
60{
61 asm volatile (".chip 68040");
62
63 /* flush address translation cache (user entries) */
64 asm volatile ("pflushan");
65
66 /* switch the root pointer */
67 asm volatile ("movec %0,%%urp" : : "r" (mm->context));
68
69 if (CPU_IS_060) {
70 unsigned long tmp;
71
72 /* clear user entries in the branch cache */
73 asm volatile (
74 "movec %%cacr,%0; "
75 "orl %1,%0; "
76 "movec %0,%%cacr"
77 : "=d" (tmp): "di" (0x00200000));
78 }
79
80 asm volatile (".chip 68k");
81}
82
83static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
84{
85 if (prev != next) {
86 if (CPU_IS_020_OR_030)
87 switch_mm_0230(next);
88 else
89 switch_mm_0460(next);
90 }
91}
92
93#define deactivate_mm(tsk,mm) do { } while (0)
94
95static inline void activate_mm(struct mm_struct *prev_mm,
96 struct mm_struct *next_mm)
97{
98 next_mm->context = virt_to_phys(next_mm->pgd);
99
100 if (CPU_IS_020_OR_030)
101 switch_mm_0230(next_mm);
102 else
103 switch_mm_0460(next_mm);
104}
105
106#else /* CONFIG_SUN3 */
107#include <asm/sun3mmu.h>
108#include <linux/sched.h>
109
110extern unsigned long get_free_context(struct mm_struct *mm);
111extern void clear_context(unsigned long context);
112
113/* set the context for a new task to unmapped */
114static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
115{
116 mm->context = SUN3_INVALID_CONTEXT;
117 return 0;
118}
119
120/* find the context given to this process, and if it hasn't already
121 got one, go get one for it. */
122static inline void get_mmu_context(struct mm_struct *mm)
123{
124 if(mm->context == SUN3_INVALID_CONTEXT)
125 mm->context = get_free_context(mm);
126}
127
128/* flush context if allocated... */
129static inline void destroy_context(struct mm_struct *mm)
130{
131 if(mm->context != SUN3_INVALID_CONTEXT)
132 clear_context(mm->context);
133}
134
135static inline void activate_context(struct mm_struct *mm)
136{
137 get_mmu_context(mm);
138 sun3_put_context(mm->context);
139}
140
141static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
142{
143 activate_context(tsk->mm);
144}
145
146#define deactivate_mm(tsk,mm) do { } while (0)
147
148static inline void activate_mm(struct mm_struct *prev_mm,
149 struct mm_struct *next_mm)
150{
151 activate_context(next_mm);
152}
153
154#endif
155#else /* !CONFIG_MMU */
156
157static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
158{
159 return 0;
160}
161
162
163static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
164{
165}
166
167#define destroy_context(mm) do { } while (0)
168#define deactivate_mm(tsk,mm) do { } while (0)
169
170static inline void activate_mm(struct mm_struct *prev_mm, struct mm_struct *next_mm)
171{
172}
173
174#endif /* CONFIG_MMU */
175#endif /* __M68K_MMU_CONTEXT_H */
diff --git a/arch/m68k/include/asm/mmu_context_mm.h b/arch/m68k/include/asm/mmu_context_mm.h
deleted file mode 100644
index 894dacbcee14..000000000000
--- a/arch/m68k/include/asm/mmu_context_mm.h
+++ /dev/null
@@ -1,154 +0,0 @@
1#ifndef __M68K_MMU_CONTEXT_H
2#define __M68K_MMU_CONTEXT_H
3
4#include <asm-generic/mm_hooks.h>
5
6static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
7{
8}
9
10#ifndef CONFIG_SUN3
11
12#include <asm/setup.h>
13#include <asm/page.h>
14#include <asm/pgalloc.h>
15
16static inline int init_new_context(struct task_struct *tsk,
17 struct mm_struct *mm)
18{
19 mm->context = virt_to_phys(mm->pgd);
20 return 0;
21}
22
23#define destroy_context(mm) do { } while(0)
24
25static inline void switch_mm_0230(struct mm_struct *mm)
26{
27 unsigned long crp[2] = {
28 0x80000000 | _PAGE_TABLE, mm->context
29 };
30 unsigned long tmp;
31
32 asm volatile (".chip 68030");
33
34 /* flush MC68030/MC68020 caches (they are virtually addressed) */
35 asm volatile (
36 "movec %%cacr,%0;"
37 "orw %1,%0; "
38 "movec %0,%%cacr"
39 : "=d" (tmp) : "di" (FLUSH_I_AND_D));
40
41 /* Switch the root pointer. For a 030-only kernel,
42 * avoid flushing the whole ATC, we only need to
43 * flush the user entries. The 68851 does this by
44 * itself. Avoid a runtime check here.
45 */
46 asm volatile (
47#ifdef CPU_M68030_ONLY
48 "pmovefd %0,%%crp; "
49 "pflush #0,#4"
50#else
51 "pmove %0,%%crp"
52#endif
53 : : "m" (crp[0]));
54
55 asm volatile (".chip 68k");
56}
57
58static inline void switch_mm_0460(struct mm_struct *mm)
59{
60 asm volatile (".chip 68040");
61
62 /* flush address translation cache (user entries) */
63 asm volatile ("pflushan");
64
65 /* switch the root pointer */
66 asm volatile ("movec %0,%%urp" : : "r" (mm->context));
67
68 if (CPU_IS_060) {
69 unsigned long tmp;
70
71 /* clear user entries in the branch cache */
72 asm volatile (
73 "movec %%cacr,%0; "
74 "orl %1,%0; "
75 "movec %0,%%cacr"
76 : "=d" (tmp): "di" (0x00200000));
77 }
78
79 asm volatile (".chip 68k");
80}
81
82static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
83{
84 if (prev != next) {
85 if (CPU_IS_020_OR_030)
86 switch_mm_0230(next);
87 else
88 switch_mm_0460(next);
89 }
90}
91
92#define deactivate_mm(tsk,mm) do { } while (0)
93
94static inline void activate_mm(struct mm_struct *prev_mm,
95 struct mm_struct *next_mm)
96{
97 next_mm->context = virt_to_phys(next_mm->pgd);
98
99 if (CPU_IS_020_OR_030)
100 switch_mm_0230(next_mm);
101 else
102 switch_mm_0460(next_mm);
103}
104
105#else /* CONFIG_SUN3 */
106#include <asm/sun3mmu.h>
107#include <linux/sched.h>
108
109extern unsigned long get_free_context(struct mm_struct *mm);
110extern void clear_context(unsigned long context);
111
112/* set the context for a new task to unmapped */
113static inline int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
114{
115 mm->context = SUN3_INVALID_CONTEXT;
116 return 0;
117}
118
119/* find the context given to this process, and if it hasn't already
120 got one, go get one for it. */
121static inline void get_mmu_context(struct mm_struct *mm)
122{
123 if(mm->context == SUN3_INVALID_CONTEXT)
124 mm->context = get_free_context(mm);
125}
126
127/* flush context if allocated... */
128static inline void destroy_context(struct mm_struct *mm)
129{
130 if(mm->context != SUN3_INVALID_CONTEXT)
131 clear_context(mm->context);
132}
133
134static inline void activate_context(struct mm_struct *mm)
135{
136 get_mmu_context(mm);
137 sun3_put_context(mm->context);
138}
139
140static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
141{
142 activate_context(tsk->mm);
143}
144
145#define deactivate_mm(tsk,mm) do { } while (0)
146
147static inline void activate_mm(struct mm_struct *prev_mm,
148 struct mm_struct *next_mm)
149{
150 activate_context(next_mm);
151}
152
153#endif
154#endif
diff --git a/arch/m68k/include/asm/mmu_context_no.h b/arch/m68k/include/asm/mmu_context_no.h
deleted file mode 100644
index 9ccee4278c97..000000000000
--- a/arch/m68k/include/asm/mmu_context_no.h
+++ /dev/null
@@ -1,33 +0,0 @@
1#ifndef __M68KNOMMU_MMU_CONTEXT_H
2#define __M68KNOMMU_MMU_CONTEXT_H
3
4#include <asm/setup.h>
5#include <asm/page.h>
6#include <asm/pgalloc.h>
7#include <asm-generic/mm_hooks.h>
8
9static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk)
10{
11}
12
13static inline int
14init_new_context(struct task_struct *tsk, struct mm_struct *mm)
15{
16 // mm->context = virt_to_phys(mm->pgd);
17 return(0);
18}
19
20#define destroy_context(mm) do { } while(0)
21
22static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, struct task_struct *tsk)
23{
24}
25
26#define deactivate_mm(tsk,mm) do { } while (0)
27
28static inline void activate_mm(struct mm_struct *prev_mm,
29 struct mm_struct *next_mm)
30{
31}
32
33#endif
diff --git a/arch/m68k/include/asm/mmu_mm.h b/arch/m68k/include/asm/mmu_mm.h
deleted file mode 100644
index ccd36d26615a..000000000000
--- a/arch/m68k/include/asm/mmu_mm.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef __MMU_H
2#define __MMU_H
3
4/* Default "unsigned long" context */
5typedef unsigned long mm_context_t;
6
7#endif
diff --git a/arch/m68k/include/asm/mmu_no.h b/arch/m68k/include/asm/mmu_no.h
deleted file mode 100644
index e2da1e6f09fe..000000000000
--- a/arch/m68k/include/asm/mmu_no.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef __M68KNOMMU_MMU_H
2#define __M68KNOMMU_MMU_H
3
4/* Copyright (C) 2002, David McCullough <davidm@snapgear.com> */
5
6typedef struct {
7 unsigned long end_brk;
8} mm_context_t;
9
10#endif /* __M68KNOMMU_MMU_H */
diff --git a/arch/m68k/include/asm/module.h b/arch/m68k/include/asm/module.h
index 79b59d137dd0..5f21e11071bd 100644
--- a/arch/m68k/include/asm/module.h
+++ b/arch/m68k/include/asm/module.h
@@ -1,5 +1,48 @@
1#ifdef __uClinux__ 1#ifndef _ASM_M68K_MODULE_H
2#include "module_no.h" 2#define _ASM_M68K_MODULE_H
3
4#ifdef CONFIG_MMU
5
6struct mod_arch_specific {
7 struct m68k_fixup_info *fixup_start, *fixup_end;
8};
9
10#define MODULE_ARCH_INIT { \
11 .fixup_start = __start_fixup, \
12 .fixup_end = __stop_fixup, \
13}
14
15
16enum m68k_fixup_type {
17 m68k_fixup_memoffset,
18 m68k_fixup_vnode_shift,
19};
20
21struct m68k_fixup_info {
22 enum m68k_fixup_type type;
23 void *addr;
24};
25
26#define m68k_fixup(type, addr) \
27 " .section \".m68k_fixup\",\"aw\"\n" \
28 " .long " #type "," #addr "\n" \
29 " .previous\n"
30
31extern struct m68k_fixup_info __start_fixup[], __stop_fixup[];
32
33struct module;
34extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
35 struct m68k_fixup_info *end);
36
3#else 37#else
4#include "module_mm.h" 38
5#endif 39struct mod_arch_specific {
40};
41
42#endif /* CONFIG_MMU */
43
44#define Elf_Shdr Elf32_Shdr
45#define Elf_Sym Elf32_Sym
46#define Elf_Ehdr Elf32_Ehdr
47
48#endif /* _ASM_M68K_MODULE_H */
diff --git a/arch/m68k/include/asm/module_mm.h b/arch/m68k/include/asm/module_mm.h
deleted file mode 100644
index 382d20a6fc18..000000000000
--- a/arch/m68k/include/asm/module_mm.h
+++ /dev/null
@@ -1,39 +0,0 @@
1#ifndef _ASM_M68K_MODULE_H
2#define _ASM_M68K_MODULE_H
3
4struct mod_arch_specific {
5 struct m68k_fixup_info *fixup_start, *fixup_end;
6};
7
8#define MODULE_ARCH_INIT { \
9 .fixup_start = __start_fixup, \
10 .fixup_end = __stop_fixup, \
11}
12
13#define Elf_Shdr Elf32_Shdr
14#define Elf_Sym Elf32_Sym
15#define Elf_Ehdr Elf32_Ehdr
16
17
18enum m68k_fixup_type {
19 m68k_fixup_memoffset,
20 m68k_fixup_vnode_shift,
21};
22
23struct m68k_fixup_info {
24 enum m68k_fixup_type type;
25 void *addr;
26};
27
28#define m68k_fixup(type, addr) \
29 " .section \".m68k_fixup\",\"aw\"\n" \
30 " .long " #type "," #addr "\n" \
31 " .previous\n"
32
33extern struct m68k_fixup_info __start_fixup[], __stop_fixup[];
34
35struct module;
36extern void module_fixup(struct module *mod, struct m68k_fixup_info *start,
37 struct m68k_fixup_info *end);
38
39#endif /* _ASM_M68K_MODULE_H */
diff --git a/arch/m68k/include/asm/module_no.h b/arch/m68k/include/asm/module_no.h
deleted file mode 100644
index 2e45ab50b232..000000000000
--- a/arch/m68k/include/asm/module_no.h
+++ /dev/null
@@ -1,11 +0,0 @@
1#ifndef ASM_M68KNOMMU_MODULE_H
2#define ASM_M68KNOMMU_MODULE_H
3
4struct mod_arch_specific {
5};
6
7#define Elf_Shdr Elf32_Shdr
8#define Elf_Sym Elf32_Sym
9#define Elf_Ehdr Elf32_Ehdr
10
11#endif /* ASM_M68KNOMMU_MODULE_H */
diff --git a/arch/m68k/include/asm/page_offset.h b/arch/m68k/include/asm/page_offset.h
index 66455c849fbb..1780152d81da 100644
--- a/arch/m68k/include/asm/page_offset.h
+++ b/arch/m68k/include/asm/page_offset.h
@@ -1,5 +1,11 @@
1#ifdef __uClinux__ 1/* This handles the memory map.. */
2#include "page_offset_no.h" 2
3#ifdef CONFIG_MMU
4#ifndef CONFIG_SUN3
5#define PAGE_OFFSET_RAW 0x00000000
3#else 6#else
4#include "page_offset_mm.h" 7#define PAGE_OFFSET_RAW 0x0E000000
8#endif
9#else
10#define PAGE_OFFSET_RAW CONFIG_RAMBASE
5#endif 11#endif
diff --git a/arch/m68k/include/asm/page_offset_mm.h b/arch/m68k/include/asm/page_offset_mm.h
deleted file mode 100644
index 1cbdb7f30ac2..000000000000
--- a/arch/m68k/include/asm/page_offset_mm.h
+++ /dev/null
@@ -1,8 +0,0 @@
1
2/* This handles the memory map.. */
3#ifndef CONFIG_SUN3
4#define PAGE_OFFSET_RAW 0x00000000
5#else
6#define PAGE_OFFSET_RAW 0x0E000000
7#endif
8
diff --git a/arch/m68k/include/asm/page_offset_no.h b/arch/m68k/include/asm/page_offset_no.h
deleted file mode 100644
index d4e73e0ba646..000000000000
--- a/arch/m68k/include/asm/page_offset_no.h
+++ /dev/null
@@ -1,5 +0,0 @@
1
2
3/* This handles the memory map.. */
4#define PAGE_OFFSET_RAW CONFIG_RAMBASE
5
diff --git a/arch/m68k/include/asm/pci.h b/arch/m68k/include/asm/pci.h
index dbea95373080..4ad0aea48ab4 100644
--- a/arch/m68k/include/asm/pci.h
+++ b/arch/m68k/include/asm/pci.h
@@ -1,5 +1,12 @@
1#ifdef __uClinux__ 1#ifndef _ASM_M68K_PCI_H
2#include "pci_no.h" 2#define _ASM_M68K_PCI_H
3#else 3
4#include "pci_mm.h" 4#include <asm-generic/pci-dma-compat.h>
5#endif 5
6/* The PCI address space does equal the physical memory
7 * address space. The networking and block device layers use
8 * this boolean for bounce buffer decisions.
9 */
10#define PCI_DMA_BUS_IS_PHYS (1)
11
12#endif /* _ASM_M68K_PCI_H */
diff --git a/arch/m68k/include/asm/pci_mm.h b/arch/m68k/include/asm/pci_mm.h
deleted file mode 100644
index 4ad0aea48ab4..000000000000
--- a/arch/m68k/include/asm/pci_mm.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef _ASM_M68K_PCI_H
2#define _ASM_M68K_PCI_H
3
4#include <asm-generic/pci-dma-compat.h>
5
6/* The PCI address space does equal the physical memory
7 * address space. The networking and block device layers use
8 * this boolean for bounce buffer decisions.
9 */
10#define PCI_DMA_BUS_IS_PHYS (1)
11
12#endif /* _ASM_M68K_PCI_H */
diff --git a/arch/m68k/include/asm/pci_no.h b/arch/m68k/include/asm/pci_no.h
deleted file mode 100644
index 9abbc03c73ee..000000000000
--- a/arch/m68k/include/asm/pci_no.h
+++ /dev/null
@@ -1,29 +0,0 @@
1#ifndef M68KNOMMU_PCI_H
2#define M68KNOMMU_PCI_H
3
4#include <asm/pci_mm.h>
5
6#ifdef CONFIG_COMEMPCI
7/*
8 * These are pretty much arbitary with the CoMEM implementation.
9 * We have the whole address space to ourselves.
10 */
11#define PCIBIOS_MIN_IO 0x100
12#define PCIBIOS_MIN_MEM 0x00010000
13
14#define pcibios_scan_all_fns(a, b) 0
15
16/*
17 * Return whether the given PCI device DMA address mask can
18 * be supported properly. For example, if your device can
19 * only drive the low 24-bits during PCI bus mastering, then
20 * you would pass 0x00ffffff as the mask to this function.
21 */
22static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
23{
24 return 1;
25}
26
27#endif /* CONFIG_COMEMPCI */
28
29#endif /* M68KNOMMU_PCI_H */
diff --git a/arch/m68k/include/asm/pgalloc.h b/arch/m68k/include/asm/pgalloc.h
index 059cb73e78fc..c294aad8a900 100644
--- a/arch/m68k/include/asm/pgalloc.h
+++ b/arch/m68k/include/asm/pgalloc.h
@@ -1,5 +1,19 @@
1#ifdef __uClinux__ 1#ifndef M68K_PGALLOC_H
2#include "pgalloc_no.h" 2#define M68K_PGALLOC_H
3
4#include <linux/mm.h>
5#include <linux/highmem.h>
6#include <asm/setup.h>
7
8#ifdef CONFIG_MMU
9#include <asm/virtconvert.h>
10#ifdef CONFIG_SUN3
11#include <asm/sun3_pgalloc.h>
3#else 12#else
4#include "pgalloc_mm.h" 13#include <asm/motorola_pgalloc.h>
5#endif 14#endif
15
16extern void m68k_setup_node(int node);
17#endif
18
19#endif /* M68K_PGALLOC_H */
diff --git a/arch/m68k/include/asm/pgalloc_mm.h b/arch/m68k/include/asm/pgalloc_mm.h
deleted file mode 100644
index 4cb1a57ab763..000000000000
--- a/arch/m68k/include/asm/pgalloc_mm.h
+++ /dev/null
@@ -1,19 +0,0 @@
1
2#ifndef M68K_PGALLOC_H
3#define M68K_PGALLOC_H
4
5#include <linux/mm.h>
6#include <linux/highmem.h>
7#include <asm/setup.h>
8#include <asm/virtconvert.h>
9
10
11#ifdef CONFIG_SUN3
12#include <asm/sun3_pgalloc.h>
13#else
14#include <asm/motorola_pgalloc.h>
15#endif
16
17extern void m68k_setup_node(int node);
18
19#endif /* M68K_PGALLOC_H */
diff --git a/arch/m68k/include/asm/pgalloc_no.h b/arch/m68k/include/asm/pgalloc_no.h
deleted file mode 100644
index d6352f671ec0..000000000000
--- a/arch/m68k/include/asm/pgalloc_no.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _M68KNOMMU_PGALLOC_H
2#define _M68KNOMMU_PGALLOC_H
3
4#include <asm/setup.h>
5
6#define check_pgt_cache() do { } while (0)
7
8#endif /* _M68KNOMMU_PGALLOC_H */
diff --git a/arch/m68k/include/asm/pgtable_no.h b/arch/m68k/include/asm/pgtable_no.h
index 46251016e821..bf86b29fe64a 100644
--- a/arch/m68k/include/asm/pgtable_no.h
+++ b/arch/m68k/include/asm/pgtable_no.h
@@ -67,4 +67,6 @@ extern unsigned int kobjsize(const void *objp);
67 67
68#include <asm-generic/pgtable.h> 68#include <asm-generic/pgtable.h>
69 69
70#define check_pgt_cache() do { } while (0)
71
70#endif /* _M68KNOMMU_PGTABLE_H */ 72#endif /* _M68KNOMMU_PGTABLE_H */
diff --git a/arch/m68k/include/asm/rtc.h b/arch/m68k/include/asm/rtc.h
index 5d3e03859844..a4d08ea122ee 100644
--- a/arch/m68k/include/asm/rtc.h
+++ b/arch/m68k/include/asm/rtc.h
@@ -36,13 +36,16 @@ static inline unsigned int get_rtc_time(struct rtc_time *time)
36 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated 36 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
37 * by the RTC when initially set to a non-zero value. 37 * by the RTC when initially set to a non-zero value.
38 */ 38 */
39 mach_hwclk(0, time); 39 if (mach_hwclk)
40 mach_hwclk(0, time);
40 return RTC_24H; 41 return RTC_24H;
41} 42}
42 43
43static inline int set_rtc_time(struct rtc_time *time) 44static inline int set_rtc_time(struct rtc_time *time)
44{ 45{
45 return mach_hwclk(1, time); 46 if (mach_hwclk)
47 return mach_hwclk(1, time);
48 return -EINVAL;
46} 49}
47 50
48static inline unsigned int get_rtc_ss(void) 51static inline unsigned int get_rtc_ss(void)
diff --git a/arch/m68k/include/asm/scatterlist.h b/arch/m68k/include/asm/scatterlist.h
index b7e528636252..e27ad902b1cf 100644
--- a/arch/m68k/include/asm/scatterlist.h
+++ b/arch/m68k/include/asm/scatterlist.h
@@ -1,5 +1,23 @@
1#ifdef __uClinux__ 1#ifndef _M68K_SCATTERLIST_H
2#include "scatterlist_no.h" 2#define _M68K_SCATTERLIST_H
3#else 3
4#include "scatterlist_mm.h" 4#include <linux/types.h>
5
6struct scatterlist {
7#ifdef CONFIG_DEBUG_SG
8 unsigned long sg_magic;
5#endif 9#endif
10 unsigned long page_link;
11 unsigned int offset;
12 unsigned int length;
13
14 dma_addr_t dma_address; /* A place to hang host-specific addresses at. */
15};
16
17/* This is bogus and should go away. */
18#define ISA_DMA_THRESHOLD (0x00ffffff)
19
20#define sg_dma_address(sg) ((sg)->dma_address)
21#define sg_dma_len(sg) ((sg)->length)
22
23#endif /* !(_M68K_SCATTERLIST_H) */
diff --git a/arch/m68k/include/asm/scatterlist_mm.h b/arch/m68k/include/asm/scatterlist_mm.h
deleted file mode 100644
index d3a7a0edfeca..000000000000
--- a/arch/m68k/include/asm/scatterlist_mm.h
+++ /dev/null
@@ -1,23 +0,0 @@
1#ifndef _M68K_SCATTERLIST_H
2#define _M68K_SCATTERLIST_H
3
4#include <linux/types.h>
5
6struct scatterlist {
7#ifdef CONFIG_DEBUG_SG
8 unsigned long sg_magic;
9#endif
10 unsigned long page_link;
11 unsigned int offset;
12 unsigned int length;
13
14 __u32 dma_address; /* A place to hang host-specific addresses at. */
15};
16
17/* This is bogus and should go away. */
18#define ISA_DMA_THRESHOLD (0x00ffffff)
19
20#define sg_dma_address(sg) ((sg)->dma_address)
21#define sg_dma_len(sg) ((sg)->length)
22
23#endif /* !(_M68K_SCATTERLIST_H) */
diff --git a/arch/m68k/include/asm/scatterlist_no.h b/arch/m68k/include/asm/scatterlist_no.h
deleted file mode 100644
index afc4788b0d2c..000000000000
--- a/arch/m68k/include/asm/scatterlist_no.h
+++ /dev/null
@@ -1,22 +0,0 @@
1#ifndef _M68KNOMMU_SCATTERLIST_H
2#define _M68KNOMMU_SCATTERLIST_H
3
4#include <linux/mm.h>
5#include <asm/types.h>
6
7struct scatterlist {
8#ifdef CONFIG_DEBUG_SG
9 unsigned long sg_magic;
10#endif
11 unsigned long page_link;
12 unsigned int offset;
13 dma_addr_t dma_address;
14 unsigned int length;
15};
16
17#define sg_dma_address(sg) ((sg)->dma_address)
18#define sg_dma_len(sg) ((sg)->length)
19
20#define ISA_DMA_THRESHOLD (0xffffffff)
21
22#endif /* !(_M68KNOMMU_SCATTERLIST_H) */
diff --git a/arch/m68k/include/asm/segment.h b/arch/m68k/include/asm/segment.h
index 82583bc004bd..ee959219fdfe 100644
--- a/arch/m68k/include/asm/segment.h
+++ b/arch/m68k/include/asm/segment.h
@@ -1,5 +1,63 @@
1#ifdef __uClinux__ 1#ifndef _M68K_SEGMENT_H
2#include "segment_no.h" 2#define _M68K_SEGMENT_H
3
4/* define constants */
5/* Address spaces (FC0-FC2) */
6#define USER_DATA (1)
7#ifndef __USER_DS
8#define __USER_DS (USER_DATA)
9#endif
10#define USER_PROGRAM (2)
11#define SUPER_DATA (5)
12#ifndef __KERNEL_DS
13#define __KERNEL_DS (SUPER_DATA)
14#endif
15#define SUPER_PROGRAM (6)
16#define CPU_SPACE (7)
17
18#ifndef __ASSEMBLY__
19
20typedef struct {
21 unsigned long seg;
22} mm_segment_t;
23
24#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
25#define USER_DS MAKE_MM_SEG(__USER_DS)
26#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
27
28/*
29 * Get/set the SFC/DFC registers for MOVES instructions
30 */
31
32static inline mm_segment_t get_fs(void)
33{
34#ifdef CONFIG_MMU
35 mm_segment_t _v;
36 __asm__ ("movec %/dfc,%0":"=r" (_v.seg):);
37
38 return _v;
3#else 39#else
4#include "segment_mm.h" 40 return USER_DS;
41#endif
42}
43
44static inline mm_segment_t get_ds(void)
45{
46 /* return the supervisor data space code */
47 return KERNEL_DS;
48}
49
50static inline void set_fs(mm_segment_t val)
51{
52#ifdef CONFIG_MMU
53 __asm__ __volatile__ ("movec %0,%/sfc\n\t"
54 "movec %0,%/dfc\n\t"
55 : /* no outputs */ : "r" (val.seg) : "memory");
5#endif 56#endif
57}
58
59#define segment_eq(a,b) ((a).seg == (b).seg)
60
61#endif /* __ASSEMBLY__ */
62
63#endif /* _M68K_SEGMENT_H */
diff --git a/arch/m68k/include/asm/segment_mm.h b/arch/m68k/include/asm/segment_mm.h
deleted file mode 100644
index 7b0b2d3127f9..000000000000
--- a/arch/m68k/include/asm/segment_mm.h
+++ /dev/null
@@ -1,57 +0,0 @@
1#ifndef _M68K_SEGMENT_H
2#define _M68K_SEGMENT_H
3
4/* define constants */
5/* Address spaces (FC0-FC2) */
6#define USER_DATA (1)
7#ifndef __USER_DS
8#define __USER_DS (USER_DATA)
9#endif
10#define USER_PROGRAM (2)
11#define SUPER_DATA (5)
12#ifndef __KERNEL_DS
13#define __KERNEL_DS (SUPER_DATA)
14#endif
15#define SUPER_PROGRAM (6)
16#define CPU_SPACE (7)
17
18#ifndef __ASSEMBLY__
19
20typedef struct {
21 unsigned long seg;
22} mm_segment_t;
23
24#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
25#define USER_DS MAKE_MM_SEG(__USER_DS)
26#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
27
28/*
29 * Get/set the SFC/DFC registers for MOVES instructions
30 */
31
32static inline mm_segment_t get_fs(void)
33{
34 mm_segment_t _v;
35 __asm__ ("movec %/dfc,%0":"=r" (_v.seg):);
36
37 return _v;
38}
39
40static inline mm_segment_t get_ds(void)
41{
42 /* return the supervisor data space code */
43 return KERNEL_DS;
44}
45
46static inline void set_fs(mm_segment_t val)
47{
48 __asm__ __volatile__ ("movec %0,%/sfc\n\t"
49 "movec %0,%/dfc\n\t"
50 : /* no outputs */ : "r" (val.seg) : "memory");
51}
52
53#define segment_eq(a,b) ((a).seg == (b).seg)
54
55#endif /* __ASSEMBLY__ */
56
57#endif /* _M68K_SEGMENT_H */
diff --git a/arch/m68k/include/asm/segment_no.h b/arch/m68k/include/asm/segment_no.h
deleted file mode 100644
index 42318ebec7ec..000000000000
--- a/arch/m68k/include/asm/segment_no.h
+++ /dev/null
@@ -1,51 +0,0 @@
1#ifndef _M68K_SEGMENT_H
2#define _M68K_SEGMENT_H
3
4/* define constants */
5/* Address spaces (FC0-FC2) */
6#define USER_DATA (1)
7#ifndef __USER_DS
8#define __USER_DS (USER_DATA)
9#endif
10#define USER_PROGRAM (2)
11#define SUPER_DATA (5)
12#ifndef __KERNEL_DS
13#define __KERNEL_DS (SUPER_DATA)
14#endif
15#define SUPER_PROGRAM (6)
16#define CPU_SPACE (7)
17
18#ifndef __ASSEMBLY__
19
20typedef struct {
21 unsigned long seg;
22} mm_segment_t;
23
24#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
25#define USER_DS MAKE_MM_SEG(__USER_DS)
26#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
27
28/*
29 * Get/set the SFC/DFC registers for MOVES instructions
30 */
31
32static inline mm_segment_t get_fs(void)
33{
34 return USER_DS;
35}
36
37static inline mm_segment_t get_ds(void)
38{
39 /* return the supervisor data space code */
40 return KERNEL_DS;
41}
42
43static inline void set_fs(mm_segment_t val)
44{
45}
46
47#define segment_eq(a,b) ((a).seg == (b).seg)
48
49#endif /* __ASSEMBLY__ */
50
51#endif /* _M68K_SEGMENT_H */
diff --git a/arch/m68k/include/asm/timex.h b/arch/m68k/include/asm/timex.h
index 719762980578..b87f2f278f67 100644
--- a/arch/m68k/include/asm/timex.h
+++ b/arch/m68k/include/asm/timex.h
@@ -1,5 +1,18 @@
1#ifdef __uClinux__ 1/*
2#include "timex_no.h" 2 * linux/include/asm-m68k/timex.h
3#else 3 *
4#include "timex_mm.h" 4 * m68k architecture timex specifications
5 */
6#ifndef _ASMm68k_TIMEX_H
7#define _ASMm68k_TIMEX_H
8
9#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
10
11typedef unsigned long cycles_t;
12
13static inline cycles_t get_cycles(void)
14{
15 return 0;
16}
17
5#endif 18#endif
diff --git a/arch/m68k/include/asm/timex_mm.h b/arch/m68k/include/asm/timex_mm.h
deleted file mode 100644
index b87f2f278f67..000000000000
--- a/arch/m68k/include/asm/timex_mm.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * linux/include/asm-m68k/timex.h
3 *
4 * m68k architecture timex specifications
5 */
6#ifndef _ASMm68k_TIMEX_H
7#define _ASMm68k_TIMEX_H
8
9#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
10
11typedef unsigned long cycles_t;
12
13static inline cycles_t get_cycles(void)
14{
15 return 0;
16}
17
18#endif
diff --git a/arch/m68k/include/asm/timex_no.h b/arch/m68k/include/asm/timex_no.h
deleted file mode 100644
index 109050f3fe91..000000000000
--- a/arch/m68k/include/asm/timex_no.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * linux/include/asm-m68knommu/timex.h
3 *
4 * m68knommu architecture timex specifications
5 */
6#ifndef _ASM_M68KNOMMU_TIMEX_H
7#define _ASM_M68KNOMMU_TIMEX_H
8
9#ifdef CONFIG_COLDFIRE
10#include <asm/coldfire.h>
11#define CLOCK_TICK_RATE MCF_CLK
12#else
13#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
14#endif
15
16typedef unsigned long cycles_t;
17
18static inline cycles_t get_cycles(void)
19{
20 return 0;
21}
22
23#endif
diff --git a/arch/m68k/include/asm/tlbflush.h b/arch/m68k/include/asm/tlbflush.h
index b6f93b30951e..a6b4ed4fc90f 100644
--- a/arch/m68k/include/asm/tlbflush.h
+++ b/arch/m68k/include/asm/tlbflush.h
@@ -1,5 +1,267 @@
1#ifdef __uClinux__ 1#ifndef _M68K_TLBFLUSH_H
2#include "tlbflush_no.h" 2#define _M68K_TLBFLUSH_H
3
4#ifdef CONFIG_MMU
5#ifndef CONFIG_SUN3
6
7#include <asm/current.h>
8
9static inline void flush_tlb_kernel_page(void *addr)
10{
11 if (CPU_IS_040_OR_060) {
12 mm_segment_t old_fs = get_fs();
13 set_fs(KERNEL_DS);
14 __asm__ __volatile__(".chip 68040\n\t"
15 "pflush (%0)\n\t"
16 ".chip 68k"
17 : : "a" (addr));
18 set_fs(old_fs);
19 } else if (CPU_IS_020_OR_030)
20 __asm__ __volatile__("pflush #4,#4,(%0)" : : "a" (addr));
21}
22
23/*
24 * flush all user-space atc entries.
25 */
26static inline void __flush_tlb(void)
27{
28 if (CPU_IS_040_OR_060)
29 __asm__ __volatile__(".chip 68040\n\t"
30 "pflushan\n\t"
31 ".chip 68k");
32 else if (CPU_IS_020_OR_030)
33 __asm__ __volatile__("pflush #0,#4");
34}
35
36static inline void __flush_tlb040_one(unsigned long addr)
37{
38 __asm__ __volatile__(".chip 68040\n\t"
39 "pflush (%0)\n\t"
40 ".chip 68k"
41 : : "a" (addr));
42}
43
44static inline void __flush_tlb_one(unsigned long addr)
45{
46 if (CPU_IS_040_OR_060)
47 __flush_tlb040_one(addr);
48 else if (CPU_IS_020_OR_030)
49 __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr));
50}
51
52#define flush_tlb() __flush_tlb()
53
54/*
55 * flush all atc entries (both kernel and user-space entries).
56 */
57static inline void flush_tlb_all(void)
58{
59 if (CPU_IS_040_OR_060)
60 __asm__ __volatile__(".chip 68040\n\t"
61 "pflusha\n\t"
62 ".chip 68k");
63 else if (CPU_IS_020_OR_030)
64 __asm__ __volatile__("pflusha");
65}
66
67static inline void flush_tlb_mm(struct mm_struct *mm)
68{
69 if (mm == current->active_mm)
70 __flush_tlb();
71}
72
73static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
74{
75 if (vma->vm_mm == current->active_mm) {
76 mm_segment_t old_fs = get_fs();
77 set_fs(USER_DS);
78 __flush_tlb_one(addr);
79 set_fs(old_fs);
80 }
81}
82
83static inline void flush_tlb_range(struct vm_area_struct *vma,
84 unsigned long start, unsigned long end)
85{
86 if (vma->vm_mm == current->active_mm)
87 __flush_tlb();
88}
89
90static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end)
91{
92 flush_tlb_all();
93}
94
3#else 95#else
4#include "tlbflush_mm.h" 96
97
98/* Reserved PMEGs. */
99extern char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
100extern unsigned long pmeg_vaddr[SUN3_PMEGS_NUM];
101extern unsigned char pmeg_alloc[SUN3_PMEGS_NUM];
102extern unsigned char pmeg_ctx[SUN3_PMEGS_NUM];
103
104/* Flush all userspace mappings one by one... (why no flush command,
105 sun?) */
106static inline void flush_tlb_all(void)
107{
108 unsigned long addr;
109 unsigned char ctx, oldctx;
110
111 oldctx = sun3_get_context();
112 for(addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) {
113 for(ctx = 0; ctx < 8; ctx++) {
114 sun3_put_context(ctx);
115 sun3_put_segmap(addr, SUN3_INVALID_PMEG);
116 }
117 }
118
119 sun3_put_context(oldctx);
120 /* erase all of the userspace pmeg maps, we've clobbered them
121 all anyway */
122 for(addr = 0; addr < SUN3_INVALID_PMEG; addr++) {
123 if(pmeg_alloc[addr] == 1) {
124 pmeg_alloc[addr] = 0;
125 pmeg_ctx[addr] = 0;
126 pmeg_vaddr[addr] = 0;
127 }
128 }
129
130}
131
132/* Clear user TLB entries within the context named in mm */
133static inline void flush_tlb_mm (struct mm_struct *mm)
134{
135 unsigned char oldctx;
136 unsigned char seg;
137 unsigned long i;
138
139 oldctx = sun3_get_context();
140 sun3_put_context(mm->context);
141
142 for(i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) {
143 seg = sun3_get_segmap(i);
144 if(seg == SUN3_INVALID_PMEG)
145 continue;
146
147 sun3_put_segmap(i, SUN3_INVALID_PMEG);
148 pmeg_alloc[seg] = 0;
149 pmeg_ctx[seg] = 0;
150 pmeg_vaddr[seg] = 0;
151 }
152
153 sun3_put_context(oldctx);
154
155}
156
157/* Flush a single TLB page. In this case, we're limited to flushing a
158 single PMEG */
159static inline void flush_tlb_page (struct vm_area_struct *vma,
160 unsigned long addr)
161{
162 unsigned char oldctx;
163 unsigned char i;
164
165 oldctx = sun3_get_context();
166 sun3_put_context(vma->vm_mm->context);
167 addr &= ~SUN3_PMEG_MASK;
168 if((i = sun3_get_segmap(addr)) != SUN3_INVALID_PMEG)
169 {
170 pmeg_alloc[i] = 0;
171 pmeg_ctx[i] = 0;
172 pmeg_vaddr[i] = 0;
173 sun3_put_segmap (addr, SUN3_INVALID_PMEG);
174 }
175 sun3_put_context(oldctx);
176
177}
178/* Flush a range of pages from TLB. */
179
180static inline void flush_tlb_range (struct vm_area_struct *vma,
181 unsigned long start, unsigned long end)
182{
183 struct mm_struct *mm = vma->vm_mm;
184 unsigned char seg, oldctx;
185
186 start &= ~SUN3_PMEG_MASK;
187
188 oldctx = sun3_get_context();
189 sun3_put_context(mm->context);
190
191 while(start < end)
192 {
193 if((seg = sun3_get_segmap(start)) == SUN3_INVALID_PMEG)
194 goto next;
195 if(pmeg_ctx[seg] == mm->context) {
196 pmeg_alloc[seg] = 0;
197 pmeg_ctx[seg] = 0;
198 pmeg_vaddr[seg] = 0;
199 }
200 sun3_put_segmap(start, SUN3_INVALID_PMEG);
201 next:
202 start += SUN3_PMEG_SIZE;
203 }
204}
205
206static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end)
207{
208 flush_tlb_all();
209}
210
211/* Flush kernel page from TLB. */
212static inline void flush_tlb_kernel_page (unsigned long addr)
213{
214 sun3_put_segmap (addr & ~(SUN3_PMEG_SIZE - 1), SUN3_INVALID_PMEG);
215}
216
5#endif 217#endif
218
219#else /* !CONFIG_MMU */
220
221/*
222 * flush all user-space atc entries.
223 */
224static inline void __flush_tlb(void)
225{
226 BUG();
227}
228
229static inline void __flush_tlb_one(unsigned long addr)
230{
231 BUG();
232}
233
234#define flush_tlb() __flush_tlb()
235
236/*
237 * flush all atc entries (both kernel and user-space entries).
238 */
239static inline void flush_tlb_all(void)
240{
241 BUG();
242}
243
244static inline void flush_tlb_mm(struct mm_struct *mm)
245{
246 BUG();
247}
248
249static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
250{
251 BUG();
252}
253
254static inline void flush_tlb_range(struct mm_struct *mm,
255 unsigned long start, unsigned long end)
256{
257 BUG();
258}
259
260static inline void flush_tlb_kernel_page(unsigned long addr)
261{
262 BUG();
263}
264
265#endif /* CONFIG_MMU */
266
267#endif /* _M68K_TLBFLUSH_H */
diff --git a/arch/m68k/include/asm/tlbflush_mm.h b/arch/m68k/include/asm/tlbflush_mm.h
deleted file mode 100644
index acb6bf21a321..000000000000
--- a/arch/m68k/include/asm/tlbflush_mm.h
+++ /dev/null
@@ -1,219 +0,0 @@
1#ifndef _M68K_TLBFLUSH_H
2#define _M68K_TLBFLUSH_H
3
4
5#ifndef CONFIG_SUN3
6
7#include <asm/current.h>
8
9static inline void flush_tlb_kernel_page(void *addr)
10{
11 if (CPU_IS_040_OR_060) {
12 mm_segment_t old_fs = get_fs();
13 set_fs(KERNEL_DS);
14 __asm__ __volatile__(".chip 68040\n\t"
15 "pflush (%0)\n\t"
16 ".chip 68k"
17 : : "a" (addr));
18 set_fs(old_fs);
19 } else if (CPU_IS_020_OR_030)
20 __asm__ __volatile__("pflush #4,#4,(%0)" : : "a" (addr));
21}
22
23/*
24 * flush all user-space atc entries.
25 */
26static inline void __flush_tlb(void)
27{
28 if (CPU_IS_040_OR_060)
29 __asm__ __volatile__(".chip 68040\n\t"
30 "pflushan\n\t"
31 ".chip 68k");
32 else if (CPU_IS_020_OR_030)
33 __asm__ __volatile__("pflush #0,#4");
34}
35
36static inline void __flush_tlb040_one(unsigned long addr)
37{
38 __asm__ __volatile__(".chip 68040\n\t"
39 "pflush (%0)\n\t"
40 ".chip 68k"
41 : : "a" (addr));
42}
43
44static inline void __flush_tlb_one(unsigned long addr)
45{
46 if (CPU_IS_040_OR_060)
47 __flush_tlb040_one(addr);
48 else if (CPU_IS_020_OR_030)
49 __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr));
50}
51
52#define flush_tlb() __flush_tlb()
53
54/*
55 * flush all atc entries (both kernel and user-space entries).
56 */
57static inline void flush_tlb_all(void)
58{
59 if (CPU_IS_040_OR_060)
60 __asm__ __volatile__(".chip 68040\n\t"
61 "pflusha\n\t"
62 ".chip 68k");
63 else if (CPU_IS_020_OR_030)
64 __asm__ __volatile__("pflusha");
65}
66
67static inline void flush_tlb_mm(struct mm_struct *mm)
68{
69 if (mm == current->active_mm)
70 __flush_tlb();
71}
72
73static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
74{
75 if (vma->vm_mm == current->active_mm) {
76 mm_segment_t old_fs = get_fs();
77 set_fs(USER_DS);
78 __flush_tlb_one(addr);
79 set_fs(old_fs);
80 }
81}
82
83static inline void flush_tlb_range(struct vm_area_struct *vma,
84 unsigned long start, unsigned long end)
85{
86 if (vma->vm_mm == current->active_mm)
87 __flush_tlb();
88}
89
90static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end)
91{
92 flush_tlb_all();
93}
94
95#else
96
97
98/* Reserved PMEGs. */
99extern char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
100extern unsigned long pmeg_vaddr[SUN3_PMEGS_NUM];
101extern unsigned char pmeg_alloc[SUN3_PMEGS_NUM];
102extern unsigned char pmeg_ctx[SUN3_PMEGS_NUM];
103
104/* Flush all userspace mappings one by one... (why no flush command,
105 sun?) */
106static inline void flush_tlb_all(void)
107{
108 unsigned long addr;
109 unsigned char ctx, oldctx;
110
111 oldctx = sun3_get_context();
112 for(addr = 0x00000000; addr < TASK_SIZE; addr += SUN3_PMEG_SIZE) {
113 for(ctx = 0; ctx < 8; ctx++) {
114 sun3_put_context(ctx);
115 sun3_put_segmap(addr, SUN3_INVALID_PMEG);
116 }
117 }
118
119 sun3_put_context(oldctx);
120 /* erase all of the userspace pmeg maps, we've clobbered them
121 all anyway */
122 for(addr = 0; addr < SUN3_INVALID_PMEG; addr++) {
123 if(pmeg_alloc[addr] == 1) {
124 pmeg_alloc[addr] = 0;
125 pmeg_ctx[addr] = 0;
126 pmeg_vaddr[addr] = 0;
127 }
128 }
129
130}
131
132/* Clear user TLB entries within the context named in mm */
133static inline void flush_tlb_mm (struct mm_struct *mm)
134{
135 unsigned char oldctx;
136 unsigned char seg;
137 unsigned long i;
138
139 oldctx = sun3_get_context();
140 sun3_put_context(mm->context);
141
142 for(i = 0; i < TASK_SIZE; i += SUN3_PMEG_SIZE) {
143 seg = sun3_get_segmap(i);
144 if(seg == SUN3_INVALID_PMEG)
145 continue;
146
147 sun3_put_segmap(i, SUN3_INVALID_PMEG);
148 pmeg_alloc[seg] = 0;
149 pmeg_ctx[seg] = 0;
150 pmeg_vaddr[seg] = 0;
151 }
152
153 sun3_put_context(oldctx);
154
155}
156
157/* Flush a single TLB page. In this case, we're limited to flushing a
158 single PMEG */
159static inline void flush_tlb_page (struct vm_area_struct *vma,
160 unsigned long addr)
161{
162 unsigned char oldctx;
163 unsigned char i;
164
165 oldctx = sun3_get_context();
166 sun3_put_context(vma->vm_mm->context);
167 addr &= ~SUN3_PMEG_MASK;
168 if((i = sun3_get_segmap(addr)) != SUN3_INVALID_PMEG)
169 {
170 pmeg_alloc[i] = 0;
171 pmeg_ctx[i] = 0;
172 pmeg_vaddr[i] = 0;
173 sun3_put_segmap (addr, SUN3_INVALID_PMEG);
174 }
175 sun3_put_context(oldctx);
176
177}
178/* Flush a range of pages from TLB. */
179
180static inline void flush_tlb_range (struct vm_area_struct *vma,
181 unsigned long start, unsigned long end)
182{
183 struct mm_struct *mm = vma->vm_mm;
184 unsigned char seg, oldctx;
185
186 start &= ~SUN3_PMEG_MASK;
187
188 oldctx = sun3_get_context();
189 sun3_put_context(mm->context);
190
191 while(start < end)
192 {
193 if((seg = sun3_get_segmap(start)) == SUN3_INVALID_PMEG)
194 goto next;
195 if(pmeg_ctx[seg] == mm->context) {
196 pmeg_alloc[seg] = 0;
197 pmeg_ctx[seg] = 0;
198 pmeg_vaddr[seg] = 0;
199 }
200 sun3_put_segmap(start, SUN3_INVALID_PMEG);
201 next:
202 start += SUN3_PMEG_SIZE;
203 }
204}
205
206static inline void flush_tlb_kernel_range(unsigned long start, unsigned long end)
207{
208 flush_tlb_all();
209}
210
211/* Flush kernel page from TLB. */
212static inline void flush_tlb_kernel_page (unsigned long addr)
213{
214 sun3_put_segmap (addr & ~(SUN3_PMEG_SIZE - 1), SUN3_INVALID_PMEG);
215}
216
217#endif
218
219#endif /* _M68K_TLBFLUSH_H */
diff --git a/arch/m68k/include/asm/tlbflush_no.h b/arch/m68k/include/asm/tlbflush_no.h
deleted file mode 100644
index a470cfb803eb..000000000000
--- a/arch/m68k/include/asm/tlbflush_no.h
+++ /dev/null
@@ -1,55 +0,0 @@
1#ifndef _M68KNOMMU_TLBFLUSH_H
2#define _M68KNOMMU_TLBFLUSH_H
3
4/*
5 * Copyright (C) 2000 Lineo, David McCullough <davidm@uclinux.org>
6 * Copyright (C) 2000-2002, Greg Ungerer <gerg@snapgear.com>
7 */
8
9#include <asm/setup.h>
10
11/*
12 * flush all user-space atc entries.
13 */
14static inline void __flush_tlb(void)
15{
16 BUG();
17}
18
19static inline void __flush_tlb_one(unsigned long addr)
20{
21 BUG();
22}
23
24#define flush_tlb() __flush_tlb()
25
26/*
27 * flush all atc entries (both kernel and user-space entries).
28 */
29static inline void flush_tlb_all(void)
30{
31 BUG();
32}
33
34static inline void flush_tlb_mm(struct mm_struct *mm)
35{
36 BUG();
37}
38
39static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long addr)
40{
41 BUG();
42}
43
44static inline void flush_tlb_range(struct mm_struct *mm,
45 unsigned long start, unsigned long end)
46{
47 BUG();
48}
49
50static inline void flush_tlb_kernel_page(unsigned long addr)
51{
52 BUG();
53}
54
55#endif /* _M68KNOMMU_TLBFLUSH_H */
diff --git a/arch/m68k/include/asm/ucontext.h b/arch/m68k/include/asm/ucontext.h
index b53cd160c0b3..e4e22669edc0 100644
--- a/arch/m68k/include/asm/ucontext.h
+++ b/arch/m68k/include/asm/ucontext.h
@@ -1,5 +1,30 @@
1#ifdef __uClinux__ 1#ifndef _M68K_UCONTEXT_H
2#include "ucontext_no.h" 2#define _M68K_UCONTEXT_H
3#else 3
4#include "ucontext_mm.h" 4typedef int greg_t;
5#define NGREG 18
6typedef greg_t gregset_t[NGREG];
7
8typedef struct fpregset {
9 int f_fpcntl[3];
10 int f_fpregs[8*3];
11} fpregset_t;
12
13struct mcontext {
14 int version;
15 gregset_t gregs;
16 fpregset_t fpregs;
17};
18
19#define MCONTEXT_VERSION 2
20
21struct ucontext {
22 unsigned long uc_flags;
23 struct ucontext *uc_link;
24 stack_t uc_stack;
25 struct mcontext uc_mcontext;
26 unsigned long uc_filler[80];
27 sigset_t uc_sigmask; /* mask last for extensibility */
28};
29
5#endif 30#endif
diff --git a/arch/m68k/include/asm/ucontext_mm.h b/arch/m68k/include/asm/ucontext_mm.h
deleted file mode 100644
index e4e22669edc0..000000000000
--- a/arch/m68k/include/asm/ucontext_mm.h
+++ /dev/null
@@ -1,30 +0,0 @@
1#ifndef _M68K_UCONTEXT_H
2#define _M68K_UCONTEXT_H
3
4typedef int greg_t;
5#define NGREG 18
6typedef greg_t gregset_t[NGREG];
7
8typedef struct fpregset {
9 int f_fpcntl[3];
10 int f_fpregs[8*3];
11} fpregset_t;
12
13struct mcontext {
14 int version;
15 gregset_t gregs;
16 fpregset_t fpregs;
17};
18
19#define MCONTEXT_VERSION 2
20
21struct ucontext {
22 unsigned long uc_flags;
23 struct ucontext *uc_link;
24 stack_t uc_stack;
25 struct mcontext uc_mcontext;
26 unsigned long uc_filler[80];
27 sigset_t uc_sigmask; /* mask last for extensibility */
28};
29
30#endif
diff --git a/arch/m68k/include/asm/ucontext_no.h b/arch/m68k/include/asm/ucontext_no.h
deleted file mode 100644
index 713a27f901cd..000000000000
--- a/arch/m68k/include/asm/ucontext_no.h
+++ /dev/null
@@ -1,32 +0,0 @@
1#ifndef _M68KNOMMU_UCONTEXT_H
2#define _M68KNOMMU_UCONTEXT_H
3
4typedef int greg_t;
5#define NGREG 18
6typedef greg_t gregset_t[NGREG];
7
8typedef struct fpregset {
9 int f_pcr;
10 int f_psr;
11 int f_fpiaddr;
12 int f_fpregs[8][3];
13} fpregset_t;
14
15struct mcontext {
16 int version;
17 gregset_t gregs;
18 fpregset_t fpregs;
19};
20
21#define MCONTEXT_VERSION 2
22
23struct ucontext {
24 unsigned long uc_flags;
25 struct ucontext *uc_link;
26 stack_t uc_stack;
27 struct mcontext uc_mcontext;
28 unsigned long uc_filler[80];
29 sigset_t uc_sigmask; /* mask last for extensibility */
30};
31
32#endif
diff --git a/arch/m68k/include/asm/unaligned.h b/arch/m68k/include/asm/unaligned.h
index c640bba3bdf4..019caa740c21 100644
--- a/arch/m68k/include/asm/unaligned.h
+++ b/arch/m68k/include/asm/unaligned.h
@@ -1,5 +1,25 @@
1#ifdef __uClinux__ 1#ifndef _ASM_M68K_UNALIGNED_H
2#include "unaligned_no.h" 2#define _ASM_M68K_UNALIGNED_H
3
4
5#ifdef CONFIG_COLDFIRE
6#include <linux/unaligned/be_struct.h>
7#include <linux/unaligned/le_byteshift.h>
8#include <linux/unaligned/generic.h>
9
10#define get_unaligned __get_unaligned_be
11#define put_unaligned __put_unaligned_be
12
3#else 13#else
4#include "unaligned_mm.h" 14/*
15 * The m68k can do unaligned accesses itself.
16 */
17#include <linux/unaligned/access_ok.h>
18#include <linux/unaligned/generic.h>
19
20#define get_unaligned __get_unaligned_be
21#define put_unaligned __put_unaligned_be
22
5#endif 23#endif
24
25#endif /* _ASM_M68K_UNALIGNED_H */
diff --git a/arch/m68k/include/asm/unaligned_mm.h b/arch/m68k/include/asm/unaligned_mm.h
deleted file mode 100644
index 77698f2dc33c..000000000000
--- a/arch/m68k/include/asm/unaligned_mm.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef _ASM_M68K_UNALIGNED_H
2#define _ASM_M68K_UNALIGNED_H
3
4/*
5 * The m68k can do unaligned accesses itself.
6 */
7#include <linux/unaligned/access_ok.h>
8#include <linux/unaligned/generic.h>
9
10#define get_unaligned __get_unaligned_be
11#define put_unaligned __put_unaligned_be
12
13#endif /* _ASM_M68K_UNALIGNED_H */
diff --git a/arch/m68k/include/asm/unaligned_no.h b/arch/m68k/include/asm/unaligned_no.h
deleted file mode 100644
index eb1ea4cb9a59..000000000000
--- a/arch/m68k/include/asm/unaligned_no.h
+++ /dev/null
@@ -1,25 +0,0 @@
1#ifndef _ASM_M68KNOMMU_UNALIGNED_H
2#define _ASM_M68KNOMMU_UNALIGNED_H
3
4
5#ifdef CONFIG_COLDFIRE
6#include <linux/unaligned/be_struct.h>
7#include <linux/unaligned/le_byteshift.h>
8#include <linux/unaligned/generic.h>
9
10#define get_unaligned __get_unaligned_be
11#define put_unaligned __put_unaligned_be
12
13#else
14/*
15 * The m68k can do unaligned accesses itself.
16 */
17#include <linux/unaligned/access_ok.h>
18#include <linux/unaligned/generic.h>
19
20#define get_unaligned __get_unaligned_be
21#define put_unaligned __put_unaligned_be
22
23#endif
24
25#endif /* _ASM_M68KNOMMU_UNALIGNED_H */
diff --git a/arch/m68k/kernel/time.c b/arch/m68k/kernel/time.c
index 7db41594d7b6..54d980795fc4 100644
--- a/arch/m68k/kernel/time.c
+++ b/arch/m68k/kernel/time.c
@@ -18,6 +18,7 @@
18#include <linux/string.h> 18#include <linux/string.h>
19#include <linux/mm.h> 19#include <linux/mm.h>
20#include <linux/rtc.h> 20#include <linux/rtc.h>
21#include <linux/platform_device.h>
21 22
22#include <asm/machdep.h> 23#include <asm/machdep.h>
23#include <asm/io.h> 24#include <asm/io.h>
@@ -159,3 +160,20 @@ int do_settimeofday(struct timespec *tv)
159} 160}
160 161
161EXPORT_SYMBOL(do_settimeofday); 162EXPORT_SYMBOL(do_settimeofday);
163
164
165static int __init rtc_init(void)
166{
167 struct platform_device *pdev;
168
169 if (!mach_hwclk)
170 return -ENODEV;
171
172 pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0);
173 if (IS_ERR(pdev))
174 return PTR_ERR(pdev);
175
176 return 0;
177}
178
179module_init(rtc_init);
diff --git a/arch/m68knommu/Makefile b/arch/m68knommu/Makefile
index fd0fb303d885..ce404bc9ccbd 100644
--- a/arch/m68knommu/Makefile
+++ b/arch/m68knommu/Makefile
@@ -88,18 +88,18 @@ export PLATFORM BOARD MODEL CPUCLASS
88# 88#
89# Some CFLAG additions based on specific CPU type. 89# Some CFLAG additions based on specific CPU type.
90# 90#
91cflags-$(CONFIG_M5206) := -m5200 91cflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200)
92cflags-$(CONFIG_M5206e) := -m5200 92cflags-$(CONFIG_M5206e) := $(call cc-option,-m5206e,-m5200)
93cflags-$(CONFIG_M520x) := -m5307 93cflags-$(CONFIG_M520x) := $(call cc-option,-mcpu=5208,-m5200)
94cflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307) 94cflags-$(CONFIG_M523x) := $(call cc-option,-mcpu=523x,-m5307)
95cflags-$(CONFIG_M5249) := -m5200 95cflags-$(CONFIG_M5249) := $(call cc-option,-mcpu=5249,-m5200)
96cflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307) 96cflags-$(CONFIG_M5271) := $(call cc-option,-mcpu=5271,-m5307)
97cflags-$(CONFIG_M5272) := -m5307 97cflags-$(CONFIG_M5272) := $(call cc-option,-mcpu=5271,-m5200)
98cflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307) 98cflags-$(CONFIG_M5275) := $(call cc-option,-mcpu=5275,-m5307)
99cflags-$(CONFIG_M528x) := $(call cc-option,-m528x,-m5307) 99cflags-$(CONFIG_M528x) := $(call cc-option,-m528x,-m5307)
100cflags-$(CONFIG_M5307) := -m5307 100cflags-$(CONFIG_M5307) := $(call cc-option,-m5307,-m5200)
101cflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307) 101cflags-$(CONFIG_M532x) := $(call cc-option,-mcpu=532x,-m5307)
102cflags-$(CONFIG_M5407) := -m5200 102cflags-$(CONFIG_M5407) := $(call cc-option,-m5407,-m5200)
103cflags-$(CONFIG_M68328) := -m68000 103cflags-$(CONFIG_M68328) := -m68000
104cflags-$(CONFIG_M68EZ328) := -m68000 104cflags-$(CONFIG_M68EZ328) := -m68000
105cflags-$(CONFIG_M68VZ328) := -m68000 105cflags-$(CONFIG_M68VZ328) := -m68000
diff --git a/arch/m68knommu/kernel/dma.c b/arch/m68knommu/kernel/dma.c
index e10eafc52789..936125806638 100644
--- a/arch/m68knommu/kernel/dma.c
+++ b/arch/m68knommu/kernel/dma.c
@@ -9,10 +9,11 @@
9#include <linux/mm.h> 9#include <linux/mm.h>
10#include <linux/string.h> 10#include <linux/string.h>
11#include <linux/device.h> 11#include <linux/device.h>
12#include <linux/dma-mapping.h>
12#include <asm/io.h> 13#include <asm/io.h>
13 14
14void *dma_alloc_coherent(struct device *dev, size_t size, 15void *dma_alloc_coherent(struct device *dev, size_t size,
15 dma_addr_t *dma_handle, int gfp) 16 dma_addr_t *dma_handle, gfp_t gfp)
16{ 17{
17 void *ret; 18 void *ret;
18 /* ignore region specifiers */ 19 /* ignore region specifiers */
@@ -34,3 +35,8 @@ void dma_free_coherent(struct device *dev, size_t size,
34{ 35{
35 free_pages((unsigned long)vaddr, get_order(size)); 36 free_pages((unsigned long)vaddr, get_order(size));
36} 37}
38
39void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle, size_t size, enum dma_data_direction dir)
40{
41}
42
diff --git a/arch/m68knommu/kernel/irq.c b/arch/m68knommu/kernel/irq.c
index bba1bb48a21f..56e0f4c55a67 100644
--- a/arch/m68knommu/kernel/irq.c
+++ b/arch/m68knommu/kernel/irq.c
@@ -23,7 +23,7 @@ asmlinkage void do_IRQ(int irq, struct pt_regs *regs)
23 struct pt_regs *oldregs = set_irq_regs(regs); 23 struct pt_regs *oldregs = set_irq_regs(regs);
24 24
25 irq_enter(); 25 irq_enter();
26 __do_IRQ(irq); 26 generic_handle_irq(irq);
27 irq_exit(); 27 irq_exit();
28 28
29 set_irq_regs(oldregs); 29 set_irq_regs(oldregs);
diff --git a/arch/m68knommu/mm/init.c b/arch/m68knommu/mm/init.c
index 3bf249c53e41..7befc0c357e0 100644
--- a/arch/m68knommu/mm/init.c
+++ b/arch/m68knommu/mm/init.c
@@ -111,11 +111,7 @@ void __init paging_init(void)
111 { 111 {
112 unsigned long zones_size[MAX_NR_ZONES] = {0, }; 112 unsigned long zones_size[MAX_NR_ZONES] = {0, };
113 113
114 zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT; 114 zones_size[ZONE_DMA] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
115 zones_size[ZONE_NORMAL] = (end_mem - PAGE_OFFSET) >> PAGE_SHIFT;
116#ifdef CONFIG_HIGHMEM
117 zones_size[ZONE_HIGHMEM] = 0;
118#endif
119 free_area_init(zones_size); 115 free_area_init(zones_size);
120 } 116 }
121} 117}
diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c
index d299f7b8768a..9eab19d01eb1 100644
--- a/arch/m68knommu/platform/5249/config.c
+++ b/arch/m68knommu/platform/5249/config.c
@@ -32,7 +32,8 @@ static struct mcf_platform_uart m5249_uart_platform[] = {
32 { 32 {
33 .mapbase = MCF_MBAR + MCFUART_BASE2, 33 .mapbase = MCF_MBAR + MCFUART_BASE2,
34 .irq = 74, 34 .irq = 74,
35 } 35 },
36 { },
36}; 37};
37 38
38static struct platform_device m5249_uart = { 39static struct platform_device m5249_uart = {
@@ -50,12 +51,12 @@ static struct platform_device *m5249_devices[] __initdata = {
50static void __init m5249_uart_init_line(int line, int irq) 51static void __init m5249_uart_init_line(int line, int irq)
51{ 52{
52 if (line == 0) { 53 if (line == 0) {
53 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); 54 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
54 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); 55 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR);
55 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); 56 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
56 } else if (line == 1) { 57 } else if (line == 1) {
57 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); 58 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
58 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); 59 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR);
59 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); 60 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
60 } 61 }
61} 62}
diff --git a/arch/m68knommu/platform/5307/config.c b/arch/m68knommu/platform/5307/config.c
index 724faf05852a..44803bf70a6e 100644
--- a/arch/m68knommu/platform/5307/config.c
+++ b/arch/m68knommu/platform/5307/config.c
@@ -65,12 +65,12 @@ static struct platform_device *m5307_devices[] __initdata = {
65static void __init m5307_uart_init_line(int line, int irq) 65static void __init m5307_uart_init_line(int line, int irq)
66{ 66{
67 if (line == 0) { 67 if (line == 0) {
68 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); 68 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
69 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); 69 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR);
70 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); 70 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
71 } else if (line == 1) { 71 } else if (line == 1) {
72 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); 72 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
73 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); 73 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR);
74 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); 74 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
75 } 75 }
76} 76}
diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c
index 648b8b778211..0ee8c1a200c8 100644
--- a/arch/m68knommu/platform/5407/config.c
+++ b/arch/m68knommu/platform/5407/config.c
@@ -56,12 +56,12 @@ static struct platform_device *m5407_devices[] __initdata = {
56static void __init m5407_uart_init_line(int line, int irq) 56static void __init m5407_uart_init_line(int line, int irq)
57{ 57{
58 if (line == 0) { 58 if (line == 0) {
59 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); 59 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
60 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); 60 writeb(irq, MCF_MBAR + MCFUART_BASE1 + MCFUART_UIVR);
61 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); 61 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
62 } else if (line == 1) { 62 } else if (line == 1) {
63 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); 63 writeb(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
64 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); 64 writeb(irq, MCF_MBAR + MCFUART_BASE2 + MCFUART_UIVR);
65 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); 65 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
66 } 66 }
67} 67}
diff --git a/arch/m68knommu/platform/coldfire/Makefile b/arch/m68knommu/platform/coldfire/Makefile
index 4f416a91a829..1bcb9372353f 100644
--- a/arch/m68knommu/platform/coldfire/Makefile
+++ b/arch/m68knommu/platform/coldfire/Makefile
@@ -14,7 +14,7 @@
14 14
15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1 15asflags-$(CONFIG_FULLDEBUG) := -DDEBUGGER_COMPATIBLE_CACHE=1
16 16
17obj-$(CONFIG_COLDFIRE) += dma.o entry.o vectors.o 17obj-$(CONFIG_COLDFIRE) += clk.o dma.o entry.o vectors.o
18obj-$(CONFIG_M5206) += timers.o 18obj-$(CONFIG_M5206) += timers.o
19obj-$(CONFIG_M5206e) += timers.o 19obj-$(CONFIG_M5206e) += timers.o
20obj-$(CONFIG_M520x) += pit.o 20obj-$(CONFIG_M520x) += pit.o
diff --git a/arch/m68knommu/platform/coldfire/clk.c b/arch/m68knommu/platform/coldfire/clk.c
new file mode 100644
index 000000000000..7cdbf445b28f
--- /dev/null
+++ b/arch/m68knommu/platform/coldfire/clk.c
@@ -0,0 +1,40 @@
1/***************************************************************************/
2
3/*
4 * clk.c -- general ColdFire CPU kernel clk handling
5 *
6 * Copyright (C) 2009, Greg Ungerer (gerg@snapgear.com)
7 */
8
9/***************************************************************************/
10
11#include <linux/kernel.h>
12#include <linux/clk.h>
13#include <asm/coldfire.h>
14
15/***************************************************************************/
16
17struct clk *clk_get(struct device *dev, const char *id)
18{
19 return NULL;
20}
21
22int clk_enable(struct clk *clk)
23{
24 return 0;
25}
26
27void clk_disable(struct clk *clk)
28{
29}
30
31void clk_put(struct clk *clk)
32{
33}
34
35unsigned long clk_get_rate(struct clk *clk)
36{
37 return MCF_CLK;
38}
39
40/***************************************************************************/
diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
index aacf11d33723..9038f39d9d73 100644
--- a/arch/parisc/Kconfig
+++ b/arch/parisc/Kconfig
@@ -9,9 +9,13 @@ config PARISC
9 def_bool y 9 def_bool y
10 select HAVE_IDE 10 select HAVE_IDE
11 select HAVE_OPROFILE 11 select HAVE_OPROFILE
12 select HAVE_FUNCTION_TRACER if 64BIT
13 select HAVE_FUNCTION_GRAPH_TRACER if 64BIT
14 select HAVE_FUNCTION_TRACE_MCOUNT_TEST if 64BIT
12 select RTC_CLASS 15 select RTC_CLASS
13 select RTC_DRV_PARISC 16 select RTC_DRV_GENERIC
14 select INIT_ALL_POSSIBLE 17 select INIT_ALL_POSSIBLE
18 select BUG
15 help 19 help
16 The PA-RISC microprocessor is designed by Hewlett-Packard and used 20 The PA-RISC microprocessor is designed by Hewlett-Packard and used
17 in many of their workstations & servers (HP9000 700 and 800 series, 21 in many of their workstations & servers (HP9000 700 and 800 series,
@@ -75,6 +79,9 @@ config GENERIC_HARDIRQS
75config GENERIC_IRQ_PROBE 79config GENERIC_IRQ_PROBE
76 def_bool y 80 def_bool y
77 81
82config HAVE_LATENCYTOP_SUPPORT
83 def_bool y
84
78config IRQ_PER_CPU 85config IRQ_PER_CPU
79 bool 86 bool
80 default y 87 default y
@@ -83,6 +90,9 @@ config IRQ_PER_CPU
83config PM 90config PM
84 bool 91 bool
85 92
93config STACKTRACE_SUPPORT
94 def_bool y
95
86config ISA_DMA_API 96config ISA_DMA_API
87 bool 97 bool
88 98
diff --git a/arch/parisc/Makefile b/arch/parisc/Makefile
index 0d428278356d..da6f66901c92 100644
--- a/arch/parisc/Makefile
+++ b/arch/parisc/Makefile
@@ -56,7 +56,9 @@ cflags-y += -mdisable-fpregs
56 56
57# Without this, "ld -r" results in .text sections that are too big 57# Without this, "ld -r" results in .text sections that are too big
58# (> 0x40000) for branches to reach stubs. 58# (> 0x40000) for branches to reach stubs.
59cflags-y += -ffunction-sections 59ifndef CONFIG_FUNCTION_TRACER
60 cflags-y += -ffunction-sections
61endif
60 62
61# select which processor to optimise for 63# select which processor to optimise for
62cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100 64cflags-$(CONFIG_PA7100) += -march=1.1 -mschedule=7100
diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
index edbfe25c5fc1..ada3e5364d82 100644
--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
@@ -25,7 +25,7 @@
25 * Since "a" is usually an address, use one spinlock per cacheline. 25 * Since "a" is usually an address, use one spinlock per cacheline.
26 */ 26 */
27# define ATOMIC_HASH_SIZE 4 27# define ATOMIC_HASH_SIZE 4
28# define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) a)/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ])) 28# define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
29 29
30extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned; 30extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
31 31
@@ -222,13 +222,13 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
222 222
223#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 223#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
224 224
225#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)i),(v)))) 225#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)(i)),(v))))
226#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)i),(v)))) 226#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)(i)),(v))))
227#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) 227#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v))))
228#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) 228#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v))))
229 229
230#define atomic_add_return(i,v) (__atomic_add_return( ((int)i),(v))) 230#define atomic_add_return(i,v) (__atomic_add_return( ((int)(i)),(v)))
231#define atomic_sub_return(i,v) (__atomic_add_return(-((int)i),(v))) 231#define atomic_sub_return(i,v) (__atomic_add_return(-((int)(i)),(v)))
232#define atomic_inc_return(v) (__atomic_add_return( 1,(v))) 232#define atomic_inc_return(v) (__atomic_add_return( 1,(v)))
233#define atomic_dec_return(v) (__atomic_add_return( -1,(v))) 233#define atomic_dec_return(v) (__atomic_add_return( -1,(v)))
234 234
@@ -289,13 +289,13 @@ atomic64_read(const atomic64_t *v)
289 return v->counter; 289 return v->counter;
290} 290}
291 291
292#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)i),(v)))) 292#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)(i)),(v))))
293#define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)i),(v)))) 293#define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)(i)),(v))))
294#define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v)))) 294#define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v))))
295#define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v)))) 295#define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v))))
296 296
297#define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)i),(v))) 297#define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)(i)),(v)))
298#define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)i),(v))) 298#define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)(i)),(v)))
299#define atomic64_inc_return(v) (__atomic64_add_return( 1,(v))) 299#define atomic64_inc_return(v) (__atomic64_add_return( 1,(v)))
300#define atomic64_dec_return(v) (__atomic64_add_return( -1,(v))) 300#define atomic64_dec_return(v) (__atomic64_add_return( -1,(v)))
301 301
diff --git a/arch/parisc/include/asm/cacheflush.h b/arch/parisc/include/asm/cacheflush.h
index b7ca6dc7fddc..724395143f26 100644
--- a/arch/parisc/include/asm/cacheflush.h
+++ b/arch/parisc/include/asm/cacheflush.h
@@ -97,6 +97,9 @@ void mark_rodata_ro(void);
97 97
98#ifdef CONFIG_PA8X00 98#ifdef CONFIG_PA8X00
99/* Only pa8800, pa8900 needs this */ 99/* Only pa8800, pa8900 needs this */
100
101#include <asm/kmap_types.h>
102
100#define ARCH_HAS_KMAP 103#define ARCH_HAS_KMAP
101 104
102void kunmap_parisc(void *addr); 105void kunmap_parisc(void *addr);
diff --git a/arch/parisc/include/asm/elf.h b/arch/parisc/include/asm/elf.h
index 7fa675799e6d..9c802eb4be84 100644
--- a/arch/parisc/include/asm/elf.h
+++ b/arch/parisc/include/asm/elf.h
@@ -168,6 +168,16 @@ typedef struct elf64_fdesc {
168 __u64 gp; 168 __u64 gp;
169} Elf64_Fdesc; 169} Elf64_Fdesc;
170 170
171#ifdef __KERNEL__
172
173#ifdef CONFIG_64BIT
174#define Elf_Fdesc Elf64_Fdesc
175#else
176#define Elf_Fdesc Elf32_Fdesc
177#endif /*CONFIG_64BIT*/
178
179#endif /*__KERNEL__*/
180
171/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ 181/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */
172 182
173#define PT_HP_TLS (PT_LOOS + 0x0) 183#define PT_HP_TLS (PT_LOOS + 0x0)
diff --git a/arch/parisc/include/asm/ftrace.h b/arch/parisc/include/asm/ftrace.h
new file mode 100644
index 000000000000..2fa05dd6aeee
--- /dev/null
+++ b/arch/parisc/include/asm/ftrace.h
@@ -0,0 +1,25 @@
1#ifndef _ASM_PARISC_FTRACE_H
2#define _ASM_PARISC_FTRACE_H
3
4#ifndef __ASSEMBLY__
5extern void mcount(void);
6
7/*
8 * Stack of return addresses for functions of a thread.
9 * Used in struct thread_info
10 */
11struct ftrace_ret_stack {
12 unsigned long ret;
13 unsigned long func;
14 unsigned long long calltime;
15};
16
17/*
18 * Primary handler of a function return.
19 * It relays on ftrace_return_to_handler.
20 * Defined in entry.S
21 */
22extern void return_to_handler(void);
23#endif /* __ASSEMBLY__ */
24
25#endif /* _ASM_PARISC_FTRACE_H */
diff --git a/arch/parisc/include/asm/page.h b/arch/parisc/include/asm/page.h
index c3941f09a878..7bc5125d7d4c 100644
--- a/arch/parisc/include/asm/page.h
+++ b/arch/parisc/include/asm/page.h
@@ -36,16 +36,7 @@ void clear_user_page(void *page, unsigned long vaddr, struct page *pg);
36 */ 36 */
37#define STRICT_MM_TYPECHECKS 37#define STRICT_MM_TYPECHECKS
38#ifdef STRICT_MM_TYPECHECKS 38#ifdef STRICT_MM_TYPECHECKS
39typedef struct { unsigned long pte; 39typedef struct { unsigned long pte; } pte_t; /* either 32 or 64bit */
40#if !defined(CONFIG_64BIT)
41 unsigned long future_flags;
42 /* XXX: it's possible to remove future_flags and change BITS_PER_PTE_ENTRY
43 to 2, but then strangely the identical 32bit kernel boots on a
44 c3000(pa20), but not any longer on a 715(pa11).
45 Still investigating... HelgeD.
46 */
47#endif
48} pte_t; /* either 32 or 64bit */
49 40
50/* NOTE: even on 64 bits, these entries are __u32 because we allocate 41/* NOTE: even on 64 bits, these entries are __u32 because we allocate
51 * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */ 42 * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */
@@ -111,7 +102,7 @@ extern int npmem_ranges;
111#define BITS_PER_PMD_ENTRY 2 102#define BITS_PER_PMD_ENTRY 2
112#define BITS_PER_PGD_ENTRY 2 103#define BITS_PER_PGD_ENTRY 2
113#else 104#else
114#define BITS_PER_PTE_ENTRY 3 105#define BITS_PER_PTE_ENTRY 2
115#define BITS_PER_PMD_ENTRY 2 106#define BITS_PER_PMD_ENTRY 2
116#define BITS_PER_PGD_ENTRY BITS_PER_PMD_ENTRY 107#define BITS_PER_PGD_ENTRY BITS_PER_PMD_ENTRY
117#endif 108#endif
diff --git a/arch/parisc/include/asm/pdc.h b/arch/parisc/include/asm/pdc.h
index 430f1aeea0b8..4ca510b3c6f8 100644
--- a/arch/parisc/include/asm/pdc.h
+++ b/arch/parisc/include/asm/pdc.h
@@ -49,6 +49,8 @@
49#define PDC_MODEL_CPU_ID 6 /* returns cpu-id (only newer machines!) */ 49#define PDC_MODEL_CPU_ID 6 /* returns cpu-id (only newer machines!) */
50#define PDC_MODEL_CAPABILITIES 7 /* returns OS32/OS64-flags */ 50#define PDC_MODEL_CAPABILITIES 7 /* returns OS32/OS64-flags */
51/* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */ 51/* Values for PDC_MODEL_CAPABILITIES non-equivalent virtual aliasing support */
52#define PDC_MODEL_OS64 (1 << 0)
53#define PDC_MODEL_OS32 (1 << 1)
52#define PDC_MODEL_IOPDIR_FDC (1 << 2) 54#define PDC_MODEL_IOPDIR_FDC (1 << 2)
53#define PDC_MODEL_NVA_MASK (3 << 4) 55#define PDC_MODEL_NVA_MASK (3 << 4)
54#define PDC_MODEL_NVA_SUPPORTED (0 << 4) 56#define PDC_MODEL_NVA_SUPPORTED (0 << 4)
@@ -341,6 +343,8 @@
341 343
342#ifdef __KERNEL__ 344#ifdef __KERNEL__
343 345
346#include <asm/page.h> /* for __PAGE_OFFSET */
347
344extern int pdc_type; 348extern int pdc_type;
345 349
346/* Values for pdc_type */ 350/* Values for pdc_type */
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index 470a4b88124d..a27d2e200fb2 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -50,11 +50,7 @@
50 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e)) 50 printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, (unsigned long)pgd_val(e))
51 51
52/* This is the size of the initially mapped kernel memory */ 52/* This is the size of the initially mapped kernel memory */
53#ifdef CONFIG_64BIT
54#define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */ 53#define KERNEL_INITIAL_ORDER 24 /* 0 to 1<<24 = 16MB */
55#else
56#define KERNEL_INITIAL_ORDER 23 /* 0 to 1<<23 = 8MB */
57#endif
58#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER) 54#define KERNEL_INITIAL_SIZE (1 << KERNEL_INITIAL_ORDER)
59 55
60#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB) 56#if defined(CONFIG_64BIT) && defined(CONFIG_PARISC_PAGE_SIZE_4KB)
@@ -91,16 +87,25 @@
91 87
92/* Definitions for 1st level */ 88/* Definitions for 1st level */
93#define PGDIR_SHIFT (PMD_SHIFT + BITS_PER_PMD) 89#define PGDIR_SHIFT (PMD_SHIFT + BITS_PER_PMD)
90#if (PGDIR_SHIFT + PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY) > BITS_PER_LONG
91#define BITS_PER_PGD (BITS_PER_LONG - PGDIR_SHIFT)
92#else
94#define BITS_PER_PGD (PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY) 93#define BITS_PER_PGD (PAGE_SHIFT + PGD_ORDER - BITS_PER_PGD_ENTRY)
94#endif
95#define PGDIR_SIZE (1UL << PGDIR_SHIFT) 95#define PGDIR_SIZE (1UL << PGDIR_SHIFT)
96#define PGDIR_MASK (~(PGDIR_SIZE-1)) 96#define PGDIR_MASK (~(PGDIR_SIZE-1))
97#define PTRS_PER_PGD (1UL << BITS_PER_PGD) 97#define PTRS_PER_PGD (1UL << BITS_PER_PGD)
98#define USER_PTRS_PER_PGD PTRS_PER_PGD 98#define USER_PTRS_PER_PGD PTRS_PER_PGD
99 99
100#ifdef CONFIG_64BIT
100#define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD) 101#define MAX_ADDRBITS (PGDIR_SHIFT + BITS_PER_PGD)
101#define MAX_ADDRESS (1UL << MAX_ADDRBITS) 102#define MAX_ADDRESS (1UL << MAX_ADDRBITS)
102
103#define SPACEID_SHIFT (MAX_ADDRBITS - 32) 103#define SPACEID_SHIFT (MAX_ADDRBITS - 32)
104#else
105#define MAX_ADDRBITS (BITS_PER_LONG)
106#define MAX_ADDRESS (1UL << MAX_ADDRBITS)
107#define SPACEID_SHIFT 0
108#endif
104 109
105/* This calculates the number of initial pages we need for the initial 110/* This calculates the number of initial pages we need for the initial
106 * page tables */ 111 * page tables */
diff --git a/arch/parisc/include/asm/smp.h b/arch/parisc/include/asm/smp.h
index 6ef4b7867b1b..21eb45a52629 100644
--- a/arch/parisc/include/asm/smp.h
+++ b/arch/parisc/include/asm/smp.h
@@ -29,7 +29,8 @@ extern void smp_send_reschedule(int cpu);
29extern void smp_send_all_nop(void); 29extern void smp_send_all_nop(void);
30 30
31extern void arch_send_call_function_single_ipi(int cpu); 31extern void arch_send_call_function_single_ipi(int cpu);
32extern void arch_send_call_function_ipi(cpumask_t mask); 32extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
33#define arch_send_call_function_ipi_mask arch_send_call_function_ipi_mask
33 34
34#endif /* !ASSEMBLY */ 35#endif /* !ASSEMBLY */
35 36
diff --git a/arch/parisc/kernel/Makefile b/arch/parisc/kernel/Makefile
index 016d3fc4111c..67db0722e6ca 100644
--- a/arch/parisc/kernel/Makefile
+++ b/arch/parisc/kernel/Makefile
@@ -11,10 +11,25 @@ obj-y := cache.o pacache.o setup.o traps.o time.o irq.o \
11 process.o processor.o pdc_cons.o pdc_chassis.o unwind.o \ 11 process.o processor.o pdc_cons.o pdc_chassis.o unwind.o \
12 topology.o 12 topology.o
13 13
14ifdef CONFIG_FUNCTION_TRACER
15# Do not profile debug and lowlevel utilities
16CFLAGS_REMOVE_ftrace.o = -pg
17CFLAGS_REMOVE_cache.o = -pg
18CFLAGS_REMOVE_irq.o = -pg
19CFLAGS_REMOVE_pacache.o = -pg
20CFLAGS_REMOVE_perf.o = -pg
21CFLAGS_REMOVE_traps.o = -pg
22CFLAGS_REMOVE_unaligned.o = -pg
23CFLAGS_REMOVE_unwind.o = -pg
24endif
25
14obj-$(CONFIG_SMP) += smp.o 26obj-$(CONFIG_SMP) += smp.o
15obj-$(CONFIG_PA11) += pci-dma.o 27obj-$(CONFIG_PA11) += pci-dma.o
16obj-$(CONFIG_PCI) += pci.o 28obj-$(CONFIG_PCI) += pci.o
17obj-$(CONFIG_MODULES) += module.o 29obj-$(CONFIG_MODULES) += module.o
18obj-$(CONFIG_64BIT) += binfmt_elf32.o sys_parisc32.o signal32.o 30obj-$(CONFIG_64BIT) += binfmt_elf32.o sys_parisc32.o signal32.o
31obj-$(CONFIG_STACKTRACE)+= stacktrace.o
19# only supported for PCX-W/U in 64-bit mode at the moment 32# only supported for PCX-W/U in 64-bit mode at the moment
20obj-$(CONFIG_64BIT) += perf.o perf_asm.o 33obj-$(CONFIG_64BIT) += perf.o perf_asm.o
34obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o
35obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 0db9fdcb7709..ae3e70cd1e14 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -505,6 +505,18 @@
505 STREG \pte,0(\ptep) 505 STREG \pte,0(\ptep)
506 .endm 506 .endm
507 507
508 /* bitshift difference between a PFN (based on kernel's PAGE_SIZE)
509 * to a CPU TLB 4k PFN (4k => 12 bits to shift) */
510 #define PAGE_ADD_SHIFT (PAGE_SHIFT-12)
511
512 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */
513 .macro convert_for_tlb_insert20 pte
514 extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58)+PAGE_ADD_SHIFT,\
515 64-PAGE_SHIFT-PAGE_ADD_SHIFT,\pte
516 depdi _PAGE_SIZE_ENCODING_DEFAULT,63,\
517 (63-58)+PAGE_ADD_SHIFT,\pte
518 .endm
519
508 /* Convert the pte and prot to tlb insertion values. How 520 /* Convert the pte and prot to tlb insertion values. How
509 * this happens is quite subtle, read below */ 521 * this happens is quite subtle, read below */
510 .macro make_insert_tlb spc,pte,prot 522 .macro make_insert_tlb spc,pte,prot
@@ -544,8 +556,7 @@
544 depi 1,12,1,\prot 556 depi 1,12,1,\prot
545 557
546 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */ 558 /* Drop prot bits and convert to page addr for iitlbt and idtlbt */
547 extrd,u \pte,(63-ASM_PFN_PTE_SHIFT)+(63-58),64-PAGE_SHIFT,\pte 559 convert_for_tlb_insert20 \pte
548 depdi _PAGE_SIZE_ENCODING_DEFAULT,63,63-58,\pte
549 .endm 560 .endm
550 561
551 /* Identical macro to make_insert_tlb above, except it 562 /* Identical macro to make_insert_tlb above, except it
@@ -563,8 +574,8 @@
563 574
564 /* Get rid of prot bits and convert to page addr for iitlba */ 575 /* Get rid of prot bits and convert to page addr for iitlba */
565 576
566 depi _PAGE_SIZE_ENCODING_DEFAULT,31,ASM_PFN_PTE_SHIFT,\pte 577 depi 0,31,ASM_PFN_PTE_SHIFT,\pte
567 extru \pte,24,25,\pte 578 SHRREG \pte,(ASM_PFN_PTE_SHIFT-(31-26)),\pte
568 .endm 579 .endm
569 580
570 /* This is for ILP32 PA2.0 only. The TLB insertion needs 581 /* This is for ILP32 PA2.0 only. The TLB insertion needs
@@ -1244,10 +1255,9 @@ nadtlb_check_flush_20w:
1244 depdi,z 7,7,3,prot 1255 depdi,z 7,7,3,prot
1245 depdi 1,10,1,prot 1256 depdi 1,10,1,prot
1246 1257
1247 /* Get rid of prot bits and convert to page addr for idtlbt */ 1258 /* Drop prot bits from pte and convert to page addr for idtlbt */
1259 convert_for_tlb_insert20 pte
1248 1260
1249 depdi 0,63,12,pte
1250 extrd,u pte,56,52,pte
1251 idtlbt pte,prot 1261 idtlbt pte,prot
1252 1262
1253 rfir 1263 rfir
@@ -1337,8 +1347,8 @@ nadtlb_check_flush_11:
1337 1347
1338 /* Get rid of prot bits and convert to page addr for idtlba */ 1348 /* Get rid of prot bits and convert to page addr for idtlba */
1339 1349
1340 depi 0,31,12,pte 1350 depi 0,31,ASM_PFN_PTE_SHIFT,pte
1341 extru pte,24,25,pte 1351 SHRREG pte,(ASM_PFN_PTE_SHIFT-(31-26)),pte
1342 1352
1343 mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */ 1353 mfsp %sr1,t0 /* Save sr1 so we can use it in tlb inserts */
1344 mtsp spc,%sr1 1354 mtsp spc,%sr1
@@ -1403,10 +1413,9 @@ nadtlb_check_flush_20:
1403 depdi,z 7,7,3,prot 1413 depdi,z 7,7,3,prot
1404 depdi 1,10,1,prot 1414 depdi 1,10,1,prot
1405 1415
1406 /* Get rid of prot bits and convert to page addr for idtlbt */ 1416 /* Drop prot bits from pte and convert to page addr for idtlbt */
1417 convert_for_tlb_insert20 pte
1407 1418
1408 depdi 0,63,12,pte
1409 extrd,u pte,56,32,pte
1410 idtlbt pte,prot 1419 idtlbt pte,prot
1411 1420
1412 rfir 1421 rfir
@@ -2176,6 +2185,33 @@ syscall_do_resched:
2176ENDPROC(syscall_exit) 2185ENDPROC(syscall_exit)
2177 2186
2178 2187
2188#ifdef CONFIG_FUNCTION_TRACER
2189 .import ftrace_function_trampoline,code
2190ENTRY(_mcount)
2191 copy %r3, %arg2
2192 b ftrace_function_trampoline
2193 nop
2194ENDPROC(_mcount)
2195
2196ENTRY(return_to_handler)
2197 load32 return_trampoline, %rp
2198 copy %ret0, %arg0
2199 copy %ret1, %arg1
2200 b ftrace_return_to_handler
2201 nop
2202return_trampoline:
2203 copy %ret0, %rp
2204 copy %r23, %ret0
2205 copy %r24, %ret1
2206
2207.globl ftrace_stub
2208ftrace_stub:
2209 bv %r0(%rp)
2210 nop
2211ENDPROC(return_to_handler)
2212#endif /* CONFIG_FUNCTION_TRACER */
2213
2214
2179get_register: 2215get_register:
2180 /* 2216 /*
2181 * get_register is used by the non access tlb miss handlers to 2217 * get_register is used by the non access tlb miss handlers to
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index f6d241238a78..4c247e02d9b1 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -527,7 +527,11 @@ int pdc_model_capabilities(unsigned long *capabilities)
527 pdc_result[0] = 0; /* preset zero (call may not be implemented!) */ 527 pdc_result[0] = 0; /* preset zero (call may not be implemented!) */
528 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0); 528 retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0);
529 convert_to_wide(pdc_result); 529 convert_to_wide(pdc_result);
530 *capabilities = pdc_result[0]; 530 if (retval == PDC_OK) {
531 *capabilities = pdc_result[0];
532 } else {
533 *capabilities = PDC_MODEL_OS32;
534 }
531 spin_unlock_irqrestore(&pdc_lock, flags); 535 spin_unlock_irqrestore(&pdc_lock, flags);
532 536
533 return retval; 537 return retval;
diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c
new file mode 100644
index 000000000000..9877372ffdba
--- /dev/null
+++ b/arch/parisc/kernel/ftrace.c
@@ -0,0 +1,185 @@
1/*
2 * Code for tracing calls in Linux kernel.
3 * Copyright (C) 2009 Helge Deller <deller@gmx.de>
4 *
5 * based on code for x86 which is:
6 * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
7 *
8 * future possible enhancements:
9 * - add CONFIG_DYNAMIC_FTRACE
10 * - add CONFIG_STACK_TRACER
11 */
12
13#include <linux/init.h>
14#include <linux/ftrace.h>
15
16#include <asm/sections.h>
17#include <asm/ftrace.h>
18
19
20
21#ifdef CONFIG_FUNCTION_GRAPH_TRACER
22
23/* Add a function return address to the trace stack on thread info.*/
24static int push_return_trace(unsigned long ret, unsigned long long time,
25 unsigned long func, int *depth)
26{
27 int index;
28
29 if (!current->ret_stack)
30 return -EBUSY;
31
32 /* The return trace stack is full */
33 if (current->curr_ret_stack == FTRACE_RETFUNC_DEPTH - 1) {
34 atomic_inc(&current->trace_overrun);
35 return -EBUSY;
36 }
37
38 index = ++current->curr_ret_stack;
39 barrier();
40 current->ret_stack[index].ret = ret;
41 current->ret_stack[index].func = func;
42 current->ret_stack[index].calltime = time;
43 *depth = index;
44
45 return 0;
46}
47
48/* Retrieve a function return address to the trace stack on thread info.*/
49static void pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret)
50{
51 int index;
52
53 index = current->curr_ret_stack;
54
55 if (unlikely(index < 0)) {
56 ftrace_graph_stop();
57 WARN_ON(1);
58 /* Might as well panic, otherwise we have no where to go */
59 *ret = (unsigned long)
60 dereference_function_descriptor(&panic);
61 return;
62 }
63
64 *ret = current->ret_stack[index].ret;
65 trace->func = current->ret_stack[index].func;
66 trace->calltime = current->ret_stack[index].calltime;
67 trace->overrun = atomic_read(&current->trace_overrun);
68 trace->depth = index;
69 barrier();
70 current->curr_ret_stack--;
71
72}
73
74/*
75 * Send the trace to the ring-buffer.
76 * @return the original return address.
77 */
78unsigned long ftrace_return_to_handler(unsigned long retval0,
79 unsigned long retval1)
80{
81 struct ftrace_graph_ret trace;
82 unsigned long ret;
83
84 pop_return_trace(&trace, &ret);
85 trace.rettime = cpu_clock(raw_smp_processor_id());
86 ftrace_graph_return(&trace);
87
88 if (unlikely(!ret)) {
89 ftrace_graph_stop();
90 WARN_ON(1);
91 /* Might as well panic. What else to do? */
92 ret = (unsigned long)
93 dereference_function_descriptor(&panic);
94 }
95
96 /* HACK: we hand over the old functions' return values
97 in %r23 and %r24. Assembly in entry.S will take care
98 and move those to their final registers %ret0 and %ret1 */
99 asm( "copy %0, %%r23 \n\t"
100 "copy %1, %%r24 \n" : : "r" (retval0), "r" (retval1) );
101
102 return ret;
103}
104
105/*
106 * Hook the return address and push it in the stack of return addrs
107 * in current thread info.
108 */
109void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr)
110{
111 unsigned long old;
112 unsigned long long calltime;
113 struct ftrace_graph_ent trace;
114
115 if (unlikely(atomic_read(&current->tracing_graph_pause)))
116 return;
117
118 old = *parent;
119 *parent = (unsigned long)
120 dereference_function_descriptor(&return_to_handler);
121
122 if (unlikely(!__kernel_text_address(old))) {
123 ftrace_graph_stop();
124 *parent = old;
125 WARN_ON(1);
126 return;
127 }
128
129 calltime = cpu_clock(raw_smp_processor_id());
130
131 if (push_return_trace(old, calltime,
132 self_addr, &trace.depth) == -EBUSY) {
133 *parent = old;
134 return;
135 }
136
137 trace.func = self_addr;
138
139 /* Only trace if the calling function expects to */
140 if (!ftrace_graph_entry(&trace)) {
141 current->curr_ret_stack--;
142 *parent = old;
143 }
144}
145
146#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
147
148
149void ftrace_function_trampoline(unsigned long parent,
150 unsigned long self_addr,
151 unsigned long org_sp_gr3)
152{
153 extern ftrace_func_t ftrace_trace_function;
154
155 if (function_trace_stop)
156 return;
157
158 if (ftrace_trace_function != ftrace_stub) {
159 ftrace_trace_function(parent, self_addr);
160 return;
161 }
162#ifdef CONFIG_FUNCTION_GRAPH_TRACER
163 if (ftrace_graph_entry && ftrace_graph_return) {
164 unsigned long sp;
165 unsigned long *parent_rp;
166
167 asm volatile ("copy %%r30, %0" : "=r"(sp));
168 /* sanity check: is stack pointer which we got from
169 assembler function in entry.S in a reasonable
170 range compared to current stack pointer? */
171 if ((sp - org_sp_gr3) > 0x400)
172 return;
173
174 /* calculate pointer to %rp in stack */
175 parent_rp = (unsigned long *) org_sp_gr3 - 0x10;
176 /* sanity check: parent_rp should hold parent */
177 if (*parent_rp != parent)
178 return;
179
180 prepare_ftrace_return(parent_rp, self_addr);
181 return;
182 }
183#endif
184}
185
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c
index 1c740f5cbd63..4ea4229d765c 100644
--- a/arch/parisc/kernel/irq.c
+++ b/arch/parisc/kernel/irq.c
@@ -311,12 +311,12 @@ unsigned long txn_alloc_addr(unsigned int virt_irq)
311 next_cpu++; /* assign to "next" CPU we want this bugger on */ 311 next_cpu++; /* assign to "next" CPU we want this bugger on */
312 312
313 /* validate entry */ 313 /* validate entry */
314 while ((next_cpu < NR_CPUS) && 314 while ((next_cpu < nr_cpu_ids) &&
315 (!per_cpu(cpu_data, next_cpu).txn_addr || 315 (!per_cpu(cpu_data, next_cpu).txn_addr ||
316 !cpu_online(next_cpu))) 316 !cpu_online(next_cpu)))
317 next_cpu++; 317 next_cpu++;
318 318
319 if (next_cpu >= NR_CPUS) 319 if (next_cpu >= nr_cpu_ids)
320 next_cpu = 0; /* nothing else, assign monarch */ 320 next_cpu = 0; /* nothing else, assign monarch */
321 321
322 return txn_affinity_addr(virt_irq, next_cpu); 322 return txn_affinity_addr(virt_irq, next_cpu);
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c
index 9013243cecca..ecd1c5024447 100644
--- a/arch/parisc/kernel/module.c
+++ b/arch/parisc/kernel/module.c
@@ -61,9 +61,7 @@
61#include <linux/string.h> 61#include <linux/string.h>
62#include <linux/kernel.h> 62#include <linux/kernel.h>
63#include <linux/bug.h> 63#include <linux/bug.h>
64#include <linux/uaccess.h>
65 64
66#include <asm/sections.h>
67#include <asm/unwind.h> 65#include <asm/unwind.h>
68 66
69#if 0 67#if 0
@@ -115,8 +113,6 @@ struct got_entry {
115 Elf32_Addr addr; 113 Elf32_Addr addr;
116}; 114};
117 115
118#define Elf_Fdesc Elf32_Fdesc
119
120struct stub_entry { 116struct stub_entry {
121 Elf32_Word insns[2]; /* each stub entry has two insns */ 117 Elf32_Word insns[2]; /* each stub entry has two insns */
122}; 118};
@@ -125,8 +121,6 @@ struct got_entry {
125 Elf64_Addr addr; 121 Elf64_Addr addr;
126}; 122};
127 123
128#define Elf_Fdesc Elf64_Fdesc
129
130struct stub_entry { 124struct stub_entry {
131 Elf64_Word insns[4]; /* each stub entry has four insns */ 125 Elf64_Word insns[4]; /* each stub entry has four insns */
132}; 126};
@@ -916,15 +910,3 @@ void module_arch_cleanup(struct module *mod)
916 deregister_unwind_table(mod); 910 deregister_unwind_table(mod);
917 module_bug_cleanup(mod); 911 module_bug_cleanup(mod);
918} 912}
919
920#ifdef CONFIG_64BIT
921void *dereference_function_descriptor(void *ptr)
922{
923 Elf64_Fdesc *desc = ptr;
924 void *p;
925
926 if (!probe_kernel_address(&desc->addr, p))
927 ptr = p;
928 return ptr;
929}
930#endif
diff --git a/arch/parisc/kernel/parisc_ksyms.c b/arch/parisc/kernel/parisc_ksyms.c
index 0eecfbbc59cd..df653663d3db 100644
--- a/arch/parisc/kernel/parisc_ksyms.c
+++ b/arch/parisc/kernel/parisc_ksyms.c
@@ -153,5 +153,10 @@ EXPORT_SYMBOL(node_data);
153EXPORT_SYMBOL(pfnnid_map); 153EXPORT_SYMBOL(pfnnid_map);
154#endif 154#endif
155 155
156#ifdef CONFIG_FUNCTION_TRACER
157extern void _mcount(void);
158EXPORT_SYMBOL(_mcount);
159#endif
160
156/* from pacache.S -- needed for copy_page */ 161/* from pacache.S -- needed for copy_page */
157EXPORT_SYMBOL(copy_user_page_asm); 162EXPORT_SYMBOL(copy_user_page_asm);
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c
index 8aa591ed9127..6f69101f90bb 100644
--- a/arch/parisc/kernel/process.c
+++ b/arch/parisc/kernel/process.c
@@ -46,14 +46,15 @@
46#include <linux/stddef.h> 46#include <linux/stddef.h>
47#include <linux/unistd.h> 47#include <linux/unistd.h>
48#include <linux/kallsyms.h> 48#include <linux/kallsyms.h>
49#include <linux/uaccess.h>
49 50
50#include <asm/io.h> 51#include <asm/io.h>
51#include <asm/asm-offsets.h> 52#include <asm/asm-offsets.h>
52#include <asm/pdc.h> 53#include <asm/pdc.h>
53#include <asm/pdc_chassis.h> 54#include <asm/pdc_chassis.h>
54#include <asm/pgalloc.h> 55#include <asm/pgalloc.h>
55#include <asm/uaccess.h>
56#include <asm/unwind.h> 56#include <asm/unwind.h>
57#include <asm/sections.h>
57 58
58/* 59/*
59 * The idle thread. There's no useful work to be 60 * The idle thread. There's no useful work to be
@@ -231,8 +232,8 @@ sys_clone(unsigned long clone_flags, unsigned long usp,
231 232
232 However, these last 3 args are only examined 233 However, these last 3 args are only examined
233 if the proper flags are set. */ 234 if the proper flags are set. */
234 int __user *child_tidptr; 235 int __user *parent_tidptr = (int __user *)regs->gr[24];
235 int __user *parent_tidptr; 236 int __user *child_tidptr = (int __user *)regs->gr[22];
236 237
237 /* usp must be word aligned. This also prevents users from 238 /* usp must be word aligned. This also prevents users from
238 * passing in the value 1 (which is the signal for a special 239 * passing in the value 1 (which is the signal for a special
@@ -243,16 +244,6 @@ sys_clone(unsigned long clone_flags, unsigned long usp,
243 if (usp == 0) 244 if (usp == 0)
244 usp = regs->gr[30]; 245 usp = regs->gr[30];
245 246
246 if (clone_flags & CLONE_PARENT_SETTID)
247 parent_tidptr = (int __user *)regs->gr[24];
248 else
249 parent_tidptr = NULL;
250
251 if (clone_flags & (CLONE_CHILD_SETTID | CLONE_CHILD_CLEARTID))
252 child_tidptr = (int __user *)regs->gr[22];
253 else
254 child_tidptr = NULL;
255
256 return do_fork(clone_flags, usp, regs, 0, parent_tidptr, child_tidptr); 247 return do_fork(clone_flags, usp, regs, 0, parent_tidptr, child_tidptr);
257} 248}
258 249
@@ -400,3 +391,15 @@ get_wchan(struct task_struct *p)
400 } while (count++ < 16); 391 } while (count++ < 16);
401 return 0; 392 return 0;
402} 393}
394
395#ifdef CONFIG_64BIT
396void *dereference_function_descriptor(void *ptr)
397{
398 Elf64_Fdesc *desc = ptr;
399 void *p;
400
401 if (!probe_kernel_address(&desc->addr, p))
402 ptr = p;
403 return ptr;
404}
405#endif
diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c
index ecb609342feb..e09d0f7fb6b0 100644
--- a/arch/parisc/kernel/processor.c
+++ b/arch/parisc/kernel/processor.c
@@ -100,8 +100,8 @@ static int __cpuinit processor_probe(struct parisc_device *dev)
100 struct cpuinfo_parisc *p; 100 struct cpuinfo_parisc *p;
101 101
102#ifdef CONFIG_SMP 102#ifdef CONFIG_SMP
103 if (num_online_cpus() >= NR_CPUS) { 103 if (num_online_cpus() >= nr_cpu_ids) {
104 printk(KERN_INFO "num_online_cpus() >= NR_CPUS\n"); 104 printk(KERN_INFO "num_online_cpus() >= nr_cpu_ids\n");
105 return 1; 105 return 1;
106 } 106 }
107#else 107#else
@@ -214,7 +214,7 @@ static int __cpuinit processor_probe(struct parisc_device *dev)
214 */ 214 */
215#ifdef CONFIG_SMP 215#ifdef CONFIG_SMP
216 if (cpuid) { 216 if (cpuid) {
217 cpu_set(cpuid, cpu_present_map); 217 set_cpu_present(cpuid, true);
218 cpu_up(cpuid); 218 cpu_up(cpuid);
219 } 219 }
220#endif 220#endif
@@ -364,6 +364,13 @@ show_cpuinfo (struct seq_file *m, void *v)
364 boot_cpu_data.cpu_hz / 1000000, 364 boot_cpu_data.cpu_hz / 1000000,
365 boot_cpu_data.cpu_hz % 1000000 ); 365 boot_cpu_data.cpu_hz % 1000000 );
366 366
367 seq_printf(m, "capabilities\t:");
368 if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS32)
369 seq_printf(m, " os32");
370 if (boot_cpu_data.pdc.capabilities & PDC_MODEL_OS64)
371 seq_printf(m, " os64");
372 seq_printf(m, "\n");
373
367 seq_printf(m, "model\t\t: %s\n" 374 seq_printf(m, "model\t\t: %s\n"
368 "model name\t: %s\n", 375 "model name\t: %s\n",
369 boot_cpu_data.pdc.sys_model_name, 376 boot_cpu_data.pdc.sys_model_name,
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 9995d7ed5819..1fd0f0cec037 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -31,6 +31,7 @@
31#include <linux/err.h> 31#include <linux/err.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include <linux/bitops.h> 33#include <linux/bitops.h>
34#include <linux/ftrace.h>
34 35
35#include <asm/system.h> 36#include <asm/system.h>
36#include <asm/atomic.h> 37#include <asm/atomic.h>
@@ -113,14 +114,14 @@ halt_processor(void)
113{ 114{
114 /* REVISIT : redirect I/O Interrupts to another CPU? */ 115 /* REVISIT : redirect I/O Interrupts to another CPU? */
115 /* REVISIT : does PM *know* this CPU isn't available? */ 116 /* REVISIT : does PM *know* this CPU isn't available? */
116 cpu_clear(smp_processor_id(), cpu_online_map); 117 set_cpu_online(smp_processor_id(), false);
117 local_irq_disable(); 118 local_irq_disable();
118 for (;;) 119 for (;;)
119 ; 120 ;
120} 121}
121 122
122 123
123irqreturn_t 124irqreturn_t __irq_entry
124ipi_interrupt(int irq, void *dev_id) 125ipi_interrupt(int irq, void *dev_id)
125{ 126{
126 int this_cpu = smp_processor_id(); 127 int this_cpu = smp_processor_id();
@@ -214,11 +215,11 @@ ipi_send(int cpu, enum ipi_message_type op)
214} 215}
215 216
216static void 217static void
217send_IPI_mask(cpumask_t mask, enum ipi_message_type op) 218send_IPI_mask(const struct cpumask *mask, enum ipi_message_type op)
218{ 219{
219 int cpu; 220 int cpu;
220 221
221 for_each_cpu_mask(cpu, mask) 222 for_each_cpu(cpu, mask)
222 ipi_send(cpu, op); 223 ipi_send(cpu, op);
223} 224}
224 225
@@ -257,7 +258,7 @@ smp_send_all_nop(void)
257 send_IPI_allbutself(IPI_NOP); 258 send_IPI_allbutself(IPI_NOP);
258} 259}
259 260
260void arch_send_call_function_ipi(cpumask_t mask) 261void arch_send_call_function_ipi_mask(const struct cpumask *mask)
261{ 262{
262 send_IPI_mask(mask, IPI_CALL_FUNC); 263 send_IPI_mask(mask, IPI_CALL_FUNC);
263} 264}
@@ -296,13 +297,14 @@ smp_cpu_init(int cpunum)
296 mb(); 297 mb();
297 298
298 /* Well, support 2.4 linux scheme as well. */ 299 /* Well, support 2.4 linux scheme as well. */
299 if (cpu_test_and_set(cpunum, cpu_online_map)) 300 if (cpu_isset(cpunum, cpu_online_map))
300 { 301 {
301 extern void machine_halt(void); /* arch/parisc.../process.c */ 302 extern void machine_halt(void); /* arch/parisc.../process.c */
302 303
303 printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum); 304 printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum);
304 machine_halt(); 305 machine_halt();
305 } 306 }
307 set_cpu_online(cpunum, true);
306 308
307 /* Initialise the idle task for this CPU */ 309 /* Initialise the idle task for this CPU */
308 atomic_inc(&init_mm.mm_count); 310 atomic_inc(&init_mm.mm_count);
@@ -424,8 +426,8 @@ void __init smp_prepare_boot_cpu(void)
424 /* Setup BSP mappings */ 426 /* Setup BSP mappings */
425 printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor); 427 printk(KERN_INFO "SMP: bootstrap CPU ID is %d\n", bootstrap_processor);
426 428
427 cpu_set(bootstrap_processor, cpu_online_map); 429 set_cpu_online(bootstrap_processor, true);
428 cpu_set(bootstrap_processor, cpu_present_map); 430 set_cpu_present(bootstrap_processor, true);
429} 431}
430 432
431 433
@@ -436,8 +438,7 @@ void __init smp_prepare_boot_cpu(void)
436*/ 438*/
437void __init smp_prepare_cpus(unsigned int max_cpus) 439void __init smp_prepare_cpus(unsigned int max_cpus)
438{ 440{
439 cpus_clear(cpu_present_map); 441 init_cpu_present(cpumask_of(0));
440 cpu_set(0, cpu_present_map);
441 442
442 parisc_max_cpus = max_cpus; 443 parisc_max_cpus = max_cpus;
443 if (!max_cpus) 444 if (!max_cpus)
diff --git a/arch/parisc/kernel/stacktrace.c b/arch/parisc/kernel/stacktrace.c
new file mode 100644
index 000000000000..2fe914c5f533
--- /dev/null
+++ b/arch/parisc/kernel/stacktrace.c
@@ -0,0 +1,63 @@
1/*
2 * Stack trace management functions
3 *
4 * Copyright (C) 2009 Helge Deller <deller@gmx.de>
5 * based on arch/x86/kernel/stacktrace.c by Ingo Molnar <mingo@redhat.com>
6 * and parisc unwind functions by Randolph Chung <tausq@debian.org>
7 *
8 * TODO: Userspace stacktrace (CONFIG_USER_STACKTRACE_SUPPORT)
9 */
10#include <linux/module.h>
11#include <linux/stacktrace.h>
12
13#include <asm/unwind.h>
14
15static void dump_trace(struct task_struct *task, struct stack_trace *trace)
16{
17 struct unwind_frame_info info;
18
19 /* initialize unwind info */
20 if (task == current) {
21 unsigned long sp;
22 struct pt_regs r;
23HERE:
24 asm volatile ("copy %%r30, %0" : "=r"(sp));
25 memset(&r, 0, sizeof(struct pt_regs));
26 r.iaoq[0] = (unsigned long)&&HERE;
27 r.gr[2] = (unsigned long)__builtin_return_address(0);
28 r.gr[30] = sp;
29 unwind_frame_init(&info, task, &r);
30 } else {
31 unwind_frame_init_from_blocked_task(&info, task);
32 }
33
34 /* unwind stack and save entries in stack_trace struct */
35 trace->nr_entries = 0;
36 while (trace->nr_entries < trace->max_entries) {
37 if (unwind_once(&info) < 0 || info.ip == 0)
38 break;
39
40 if (__kernel_text_address(info.ip))
41 trace->entries[trace->nr_entries++] = info.ip;
42 }
43}
44
45
46/*
47 * Save stack-backtrace addresses into a stack_trace buffer.
48 */
49void save_stack_trace(struct stack_trace *trace)
50{
51 dump_trace(current, trace);
52 if (trace->nr_entries < trace->max_entries)
53 trace->entries[trace->nr_entries++] = ULONG_MAX;
54}
55EXPORT_SYMBOL_GPL(save_stack_trace);
56
57void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
58{
59 dump_trace(tsk, trace);
60 if (trace->nr_entries < trace->max_entries)
61 trace->entries[trace->nr_entries++] = ULONG_MAX;
62}
63EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index 69b6eebc466e..59fc1a43ec3e 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -365,17 +365,51 @@ tracesys_sigexit:
365 365
366 366
367 /********************************************************* 367 /*********************************************************
368 Light-weight-syscall code 368 32/64-bit Light-Weight-Syscall ABI
369 369
370 r20 - lws number 370 * - Indicates a hint for userspace inline asm
371 r26,r25,r24,r23,r22 - Input registers 371 implementations.
372 r28 - Function return register
373 r21 - Error code.
374 372
375 Scracth: Any of the above that aren't being 373 Syscall number (caller-saves)
376 currently used, including r1. 374 - %r20
375 * In asm clobber.
377 376
378 Return pointer: r31 (Not usable) 377 Argument registers (caller-saves)
378 - %r26, %r25, %r24, %r23, %r22
379 * In asm input.
380
381 Return registers (caller-saves)
382 - %r28 (return), %r21 (errno)
383 * In asm output.
384
385 Caller-saves registers
386 - %r1, %r27, %r29
387 - %r2 (return pointer)
388 - %r31 (ble link register)
389 * In asm clobber.
390
391 Callee-saves registers
392 - %r3-%r18
393 - %r30 (stack pointer)
394 * Not in asm clobber.
395
396 If userspace is 32-bit:
397 Callee-saves registers
398 - %r19 (32-bit PIC register)
399
400 Differences from 32-bit calling convention:
401 - Syscall number in %r20
402 - Additional argument register %r22 (arg4)
403 - Callee-saves %r19.
404
405 If userspace is 64-bit:
406 Callee-saves registers
407 - %r27 (64-bit PIC register)
408
409 Differences from 64-bit calling convention:
410 - Syscall number in %r20
411 - Additional argument register %r22 (arg4)
412 - Callee-saves %r27.
379 413
380 Error codes returned by entry path: 414 Error codes returned by entry path:
381 415
@@ -473,7 +507,8 @@ lws_compare_and_swap64:
473 b,n lws_compare_and_swap 507 b,n lws_compare_and_swap
474#else 508#else
475 /* If we are not a 64-bit kernel, then we don't 509 /* If we are not a 64-bit kernel, then we don't
476 * implement having 64-bit input registers 510 * have 64-bit input registers, and calling
511 * the 64-bit LWS CAS returns ENOSYS.
477 */ 512 */
478 b,n lws_exit_nosys 513 b,n lws_exit_nosys
479#endif 514#endif
@@ -635,12 +670,15 @@ END(sys_call_table64)
635 /* 670 /*
636 All light-weight-syscall atomic operations 671 All light-weight-syscall atomic operations
637 will use this set of locks 672 will use this set of locks
673
674 NOTE: The lws_lock_start symbol must be
675 at least 16-byte aligned for safe use
676 with ldcw.
638 */ 677 */
639 .section .data 678 .section .data
640 .align PAGE_SIZE 679 .align PAGE_SIZE
641ENTRY(lws_lock_start) 680ENTRY(lws_lock_start)
642 /* lws locks */ 681 /* lws locks */
643 .align 16
644 .rept 16 682 .rept 16
645 /* Keep locks aligned at 16-bytes */ 683 /* Keep locks aligned at 16-bytes */
646 .word 1 684 .word 1
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index e75cae6072c5..d4dd05674c62 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -24,6 +24,7 @@
24#include <linux/profile.h> 24#include <linux/profile.h>
25#include <linux/clocksource.h> 25#include <linux/clocksource.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/ftrace.h>
27 28
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/io.h> 30#include <asm/io.h>
@@ -53,7 +54,7 @@ static unsigned long clocktick __read_mostly; /* timer cycles per tick */
53 * held off for an arbitrarily long period of time by interrupts being 54 * held off for an arbitrarily long period of time by interrupts being
54 * disabled, so we may miss one or more ticks. 55 * disabled, so we may miss one or more ticks.
55 */ 56 */
56irqreturn_t timer_interrupt(int irq, void *dev_id) 57irqreturn_t __irq_entry timer_interrupt(int irq, void *dev_id)
57{ 58{
58 unsigned long now; 59 unsigned long now;
59 unsigned long next_tick; 60 unsigned long next_tick;
@@ -216,14 +217,14 @@ void __init start_cpu_itimer(void)
216 per_cpu(cpu_data, cpu).it_value = next_tick; 217 per_cpu(cpu_data, cpu).it_value = next_tick;
217} 218}
218 219
219static struct platform_device rtc_parisc_dev = { 220static struct platform_device rtc_generic_dev = {
220 .name = "rtc-parisc", 221 .name = "rtc-generic",
221 .id = -1, 222 .id = -1,
222}; 223};
223 224
224static int __init rtc_init(void) 225static int __init rtc_init(void)
225{ 226{
226 if (platform_device_register(&rtc_parisc_dev) < 0) 227 if (platform_device_register(&rtc_generic_dev) < 0)
227 printk(KERN_ERR "unable to register rtc device...\n"); 228 printk(KERN_ERR "unable to register rtc device...\n");
228 229
229 /* not necessarily an error */ 230 /* not necessarily an error */
diff --git a/arch/parisc/kernel/traps.c b/arch/parisc/kernel/traps.c
index ba658d2086f7..c32f5d6d778e 100644
--- a/arch/parisc/kernel/traps.c
+++ b/arch/parisc/kernel/traps.c
@@ -247,6 +247,8 @@ void die_if_kernel(char *str, struct pt_regs *regs, long err)
247 247
248 oops_in_progress = 1; 248 oops_in_progress = 1;
249 249
250 oops_enter();
251
250 /* Amuse the user in a SPARC fashion */ 252 /* Amuse the user in a SPARC fashion */
251 if (err) printk( 253 if (err) printk(
252KERN_CRIT " _______________________________ \n" 254KERN_CRIT " _______________________________ \n"
@@ -293,6 +295,7 @@ KERN_CRIT " || ||\n");
293 panic("Fatal exception"); 295 panic("Fatal exception");
294 } 296 }
295 297
298 oops_exit();
296 do_exit(SIGSEGV); 299 do_exit(SIGSEGV);
297} 300}
298 301
@@ -494,7 +497,7 @@ void parisc_terminate(char *msg, struct pt_regs *regs, int code, unsigned long o
494 panic(msg); 497 panic(msg);
495} 498}
496 499
497void handle_interruption(int code, struct pt_regs *regs) 500void notrace handle_interruption(int code, struct pt_regs *regs)
498{ 501{
499 unsigned long fault_address = 0; 502 unsigned long fault_address = 0;
500 unsigned long fault_space = 0; 503 unsigned long fault_space = 0;
diff --git a/arch/parisc/kernel/vmlinux.lds.S b/arch/parisc/kernel/vmlinux.lds.S
index 1a3b6ccd3620..fd2cc4fd2b65 100644
--- a/arch/parisc/kernel/vmlinux.lds.S
+++ b/arch/parisc/kernel/vmlinux.lds.S
@@ -54,6 +54,8 @@ SECTIONS
54 TEXT_TEXT 54 TEXT_TEXT
55 SCHED_TEXT 55 SCHED_TEXT
56 LOCK_TEXT 56 LOCK_TEXT
57 KPROBES_TEXT
58 IRQENTRY_TEXT
57 *(.text.do_softirq) 59 *(.text.do_softirq)
58 *(.text.sys_exit) 60 *(.text.sys_exit)
59 *(.text.do_sigaltstack) 61 *(.text.do_sigaltstack)
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 9d704d9831d1..4356ceb1e366 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -456,6 +456,13 @@ void __init mem_init(void)
456{ 456{
457 int codesize, reservedpages, datasize, initsize; 457 int codesize, reservedpages, datasize, initsize;
458 458
459 /* Do sanity checks on page table constants */
460 BUILD_BUG_ON(PTE_ENTRY_SIZE != sizeof(pte_t));
461 BUILD_BUG_ON(PMD_ENTRY_SIZE != sizeof(pmd_t));
462 BUILD_BUG_ON(PGD_ENTRY_SIZE != sizeof(pgd_t));
463 BUILD_BUG_ON(PAGE_SHIFT + BITS_PER_PTE + BITS_PER_PMD + BITS_PER_PGD
464 > BITS_PER_LONG);
465
459 high_memory = __va((max_pfn << PAGE_SHIFT)); 466 high_memory = __va((max_pfn << PAGE_SHIFT));
460 467
461#ifndef CONFIG_DISCONTIGMEM 468#ifndef CONFIG_DISCONTIGMEM
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index 67f1812698d2..cdb6fd814de8 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -50,6 +50,9 @@ enum ps3_param_av_multi_out {
50 50
51enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void); 51enum ps3_param_av_multi_out ps3_os_area_get_av_multi_out(void);
52 52
53extern u64 ps3_os_area_get_rtc_diff(void);
54extern void ps3_os_area_set_rtc_diff(u64 rtc_diff);
55
53/* dma routines */ 56/* dma routines */
54 57
55enum ps3_dma_page_size { 58enum ps3_dma_page_size {
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index c9564031a2a9..926ea864e34f 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1127,3 +1127,19 @@ void div128_by_32(u64 dividend_high, u64 dividend_low,
1127 dr->result_low = ((u64)y << 32) + z; 1127 dr->result_low = ((u64)y << 32) + z;
1128 1128
1129} 1129}
1130
1131static int __init rtc_init(void)
1132{
1133 struct platform_device *pdev;
1134
1135 if (!ppc_md.get_rtc_time)
1136 return -ENODEV;
1137
1138 pdev = platform_device_register_simple("rtc-generic", -1, NULL, 0);
1139 if (IS_ERR(pdev))
1140 return PTR_ERR(pdev);
1141
1142 return 0;
1143}
1144
1145module_init(rtc_init);
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c
index e1c83c23b435..86e392b1b049 100644
--- a/arch/powerpc/platforms/ps3/os-area.c
+++ b/arch/powerpc/platforms/ps3/os-area.c
@@ -808,6 +808,7 @@ u64 ps3_os_area_get_rtc_diff(void)
808{ 808{
809 return saved_params.rtc_diff; 809 return saved_params.rtc_diff;
810} 810}
811EXPORT_SYMBOL(ps3_os_area_get_rtc_diff);
811 812
812/** 813/**
813 * ps3_os_area_set_rtc_diff - Set the rtc diff value. 814 * ps3_os_area_set_rtc_diff - Set the rtc diff value.
@@ -823,6 +824,7 @@ void ps3_os_area_set_rtc_diff(u64 rtc_diff)
823 os_area_queue_work(); 824 os_area_queue_work();
824 } 825 }
825} 826}
827EXPORT_SYMBOL(ps3_os_area_set_rtc_diff);
826 828
827/** 829/**
828 * ps3_os_area_get_av_multi_out - Returns the default video mode. 830 * ps3_os_area_get_av_multi_out - Returns the default video mode.
diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
index 235c13ebacd9..136aa0637d9c 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -64,8 +64,6 @@ int ps3_set_rtc_time(struct rtc_time *time);
64 64
65void __init ps3_os_area_save_params(void); 65void __init ps3_os_area_save_params(void);
66void __init ps3_os_area_init(void); 66void __init ps3_os_area_init(void);
67u64 ps3_os_area_get_rtc_diff(void);
68void ps3_os_area_set_rtc_diff(u64 rtc_diff);
69 67
70/* spu */ 68/* spu */
71 69
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index 3331ccbb8d38..66181821322a 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -270,8 +270,6 @@ define_machine(ps3) {
270 .init_IRQ = ps3_init_IRQ, 270 .init_IRQ = ps3_init_IRQ,
271 .panic = ps3_panic, 271 .panic = ps3_panic,
272 .get_boot_time = ps3_get_boot_time, 272 .get_boot_time = ps3_get_boot_time,
273 .set_rtc_time = ps3_set_rtc_time,
274 .get_rtc_time = ps3_get_rtc_time,
275 .set_dabr = ps3_set_dabr, 273 .set_dabr = ps3_set_dabr,
276 .calibrate_decr = ps3_calibrate_decr, 274 .calibrate_decr = ps3_calibrate_decr,
277 .progress = ps3_progress, 275 .progress = ps3_progress,
diff --git a/arch/powerpc/platforms/ps3/time.c b/arch/powerpc/platforms/ps3/time.c
index d0daf7d6d3b2..b178a1e66c91 100644
--- a/arch/powerpc/platforms/ps3/time.c
+++ b/arch/powerpc/platforms/ps3/time.c
@@ -19,6 +19,7 @@
19 */ 19 */
20 20
21#include <linux/kernel.h> 21#include <linux/kernel.h>
22#include <linux/platform_device.h>
22 23
23#include <asm/rtc.h> 24#include <asm/rtc.h>
24#include <asm/lv1call.h> 25#include <asm/lv1call.h>
@@ -74,23 +75,20 @@ static u64 read_rtc(void)
74 return rtc_val; 75 return rtc_val;
75} 76}
76 77
77int ps3_set_rtc_time(struct rtc_time *tm) 78unsigned long __init ps3_get_boot_time(void)
78{ 79{
79 u64 now = mktime(tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, 80 return read_rtc() + ps3_os_area_get_rtc_diff();
80 tm->tm_hour, tm->tm_min, tm->tm_sec);
81
82 ps3_os_area_set_rtc_diff(now - read_rtc());
83 return 0;
84} 81}
85 82
86void ps3_get_rtc_time(struct rtc_time *tm) 83static int __init ps3_rtc_init(void)
87{ 84{
88 to_tm(read_rtc() + ps3_os_area_get_rtc_diff(), tm); 85 struct platform_device *pdev;
89 tm->tm_year -= 1900;
90 tm->tm_mon -= 1;
91}
92 86
93unsigned long __init ps3_get_boot_time(void) 87 pdev = platform_device_register_simple("rtc-ps3", -1, NULL, 0);
94{ 88 if (IS_ERR(pdev))
95 return read_rtc() + ps3_os_area_get_rtc_diff(); 89 return PTR_ERR(pdev);
90
91 return 0;
96} 92}
93
94module_init(ps3_rtc_init);
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index d42f826a8ab9..f934225fd8ef 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -22,6 +22,7 @@
22#include "linux/kernel.h" 22#include "linux/kernel.h"
23#include "linux/module.h" 23#include "linux/module.h"
24#include "linux/blkdev.h" 24#include "linux/blkdev.h"
25#include "linux/ata.h"
25#include "linux/hdreg.h" 26#include "linux/hdreg.h"
26#include "linux/init.h" 27#include "linux/init.h"
27#include "linux/cdrom.h" 28#include "linux/cdrom.h"
@@ -1308,16 +1309,15 @@ static int ubd_ioctl(struct block_device *bdev, fmode_t mode,
1308 unsigned int cmd, unsigned long arg) 1309 unsigned int cmd, unsigned long arg)
1309{ 1310{
1310 struct ubd *ubd_dev = bdev->bd_disk->private_data; 1311 struct ubd *ubd_dev = bdev->bd_disk->private_data;
1311 struct hd_driveid ubd_id = { 1312 u16 ubd_id[ATA_ID_WORDS];
1312 .cyls = 0,
1313 .heads = 128,
1314 .sectors = 32,
1315 };
1316 1313
1317 switch (cmd) { 1314 switch (cmd) {
1318 struct cdrom_volctrl volume; 1315 struct cdrom_volctrl volume;
1319 case HDIO_GET_IDENTITY: 1316 case HDIO_GET_IDENTITY:
1320 ubd_id.cyls = ubd_dev->size / (128 * 32 * 512); 1317 memset(&ubd_id, 0, ATA_ID_WORDS * 2);
1318 ubd_id[ATA_ID_CYLS] = ubd_dev->size / (128 * 32 * 512);
1319 ubd_id[ATA_ID_HEADS] = 128;
1320 ubd_id[ATA_ID_SECTORS] = 32;
1321 if(copy_to_user((char __user *) arg, (char *) &ubd_id, 1321 if(copy_to_user((char __user *) arg, (char *) &ubd_id,
1322 sizeof(ubd_id))) 1322 sizeof(ubd_id)))
1323 return -EFAULT; 1323 return -EFAULT;
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 748e50a1a152..3f27e5c0c9c9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1837,8 +1837,8 @@ config PCI_MMCONFIG
1837 1837
1838config DMAR 1838config DMAR
1839 bool "Support for DMA Remapping Devices (EXPERIMENTAL)" 1839 bool "Support for DMA Remapping Devices (EXPERIMENTAL)"
1840 depends on X86_64 && PCI_MSI && ACPI && EXPERIMENTAL 1840 depends on PCI_MSI && ACPI && EXPERIMENTAL
1841 ---help--- 1841 help
1842 DMA remapping (DMAR) devices support enables independent address 1842 DMA remapping (DMAR) devices support enables independent address
1843 translations for Direct Memory Access (DMA) from devices. 1843 translations for Direct Memory Access (DMA) from devices.
1844 These DMA remapping devices are reported via ACPI tables 1844 These DMA remapping devices are reported via ACPI tables
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c
index c5962fe3796f..a97db99dad52 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/arch/x86/kernel/amd_iommu.c
@@ -1928,6 +1928,12 @@ static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom,
1928 return paddr; 1928 return paddr;
1929} 1929}
1930 1930
1931static int amd_iommu_domain_has_cap(struct iommu_domain *domain,
1932 unsigned long cap)
1933{
1934 return 0;
1935}
1936
1931static struct iommu_ops amd_iommu_ops = { 1937static struct iommu_ops amd_iommu_ops = {
1932 .domain_init = amd_iommu_domain_init, 1938 .domain_init = amd_iommu_domain_init,
1933 .domain_destroy = amd_iommu_domain_destroy, 1939 .domain_destroy = amd_iommu_domain_destroy,
@@ -1936,5 +1942,6 @@ static struct iommu_ops amd_iommu_ops = {
1936 .map = amd_iommu_map_range, 1942 .map = amd_iommu_map_range,
1937 .unmap = amd_iommu_unmap_range, 1943 .unmap = amd_iommu_unmap_range,
1938 .iova_to_phys = amd_iommu_iova_to_phys, 1944 .iova_to_phys = amd_iommu_iova_to_phys,
1945 .domain_has_cap = amd_iommu_domain_has_cap,
1939}; 1946};
1940 1947
diff --git a/arch/x86/mm/highmem_32.c b/arch/x86/mm/highmem_32.c
index 5bc5d1688c1c..8126e8d1a2a4 100644
--- a/arch/x86/mm/highmem_32.c
+++ b/arch/x86/mm/highmem_32.c
@@ -40,7 +40,6 @@ void *kmap_atomic_prot(struct page *page, enum km_type type, pgprot_t prot)
40 40
41 debug_kmap_atomic(type); 41 debug_kmap_atomic(type);
42 42
43 debug_kmap_atomic(type);
44 idx = type + KM_TYPE_NR*smp_processor_id(); 43 idx = type + KM_TYPE_NR*smp_processor_id();
45 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); 44 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
46 BUG_ON(!pte_none(*(kmap_pte-idx))); 45 BUG_ON(!pte_none(*(kmap_pte-idx)));
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c
index bff0c9032f8c..e331f77348a7 100644
--- a/arch/x86/mm/iomap_32.c
+++ b/arch/x86/mm/iomap_32.c
@@ -39,6 +39,7 @@ void *kmap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot)
39 39
40 pagefault_disable(); 40 pagefault_disable();
41 41
42 debug_kmap_atomic(type);
42 idx = type + KM_TYPE_NR * smp_processor_id(); 43 idx = type + KM_TYPE_NR * smp_processor_id();
43 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); 44 vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
44 set_pte(kmap_pte - idx, pfn_pte(pfn, prot)); 45 set_pte(kmap_pte - idx, pfn_pte(pfn, prot));
@@ -72,7 +73,6 @@ iounmap_atomic(void *kvaddr, enum km_type type)
72 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; 73 unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK;
73 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id(); 74 enum fixed_addresses idx = type + KM_TYPE_NR*smp_processor_id();
74 75
75 debug_kmap_atomic(type);
76 /* 76 /*
77 * Force other mappings to Oops if they'll try to access this pte 77 * Force other mappings to Oops if they'll try to access this pte
78 * without first remap it. Keeping stale mappings around is a bad idea 78 * without first remap it. Keeping stale mappings around is a bad idea
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c
index f234a37bd428..f1817f71e009 100644
--- a/arch/x86/pci/i386.c
+++ b/arch/x86/pci/i386.c
@@ -258,24 +258,7 @@ void pcibios_set_master(struct pci_dev *dev)
258 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); 258 pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat);
259} 259}
260 260
261static void pci_unmap_page_range(struct vm_area_struct *vma)
262{
263 u64 addr = (u64)vma->vm_pgoff << PAGE_SHIFT;
264 free_memtype(addr, addr + vma->vm_end - vma->vm_start);
265}
266
267static void pci_track_mmap_page_range(struct vm_area_struct *vma)
268{
269 u64 addr = (u64)vma->vm_pgoff << PAGE_SHIFT;
270 unsigned long flags = pgprot_val(vma->vm_page_prot)
271 & _PAGE_CACHE_MASK;
272
273 reserve_memtype(addr, addr + vma->vm_end - vma->vm_start, flags, NULL);
274}
275
276static struct vm_operations_struct pci_mmap_ops = { 261static struct vm_operations_struct pci_mmap_ops = {
277 .open = pci_track_mmap_page_range,
278 .close = pci_unmap_page_range,
279 .access = generic_access_phys, 262 .access = generic_access_phys,
280}; 263};
281 264
@@ -283,11 +266,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
283 enum pci_mmap_state mmap_state, int write_combine) 266 enum pci_mmap_state mmap_state, int write_combine)
284{ 267{
285 unsigned long prot; 268 unsigned long prot;
286 u64 addr = vma->vm_pgoff << PAGE_SHIFT;
287 unsigned long len = vma->vm_end - vma->vm_start;
288 unsigned long flags;
289 unsigned long new_flags;
290 int retval;
291 269
292 /* I/O space cannot be accessed via normal processor loads and 270 /* I/O space cannot be accessed via normal processor loads and
293 * stores on this platform. 271 * stores on this platform.
@@ -308,30 +286,6 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
308 286
309 vma->vm_page_prot = __pgprot(prot); 287 vma->vm_page_prot = __pgprot(prot);
310 288
311 flags = pgprot_val(vma->vm_page_prot) & _PAGE_CACHE_MASK;
312 retval = reserve_memtype(addr, addr + len, flags, &new_flags);
313 if (retval)
314 return retval;
315
316 if (flags != new_flags) {
317 if (!is_new_memtype_allowed(flags, new_flags)) {
318 free_memtype(addr, addr+len);
319 return -EINVAL;
320 }
321 flags = new_flags;
322 vma->vm_page_prot = __pgprot(
323 (pgprot_val(vma->vm_page_prot) & ~_PAGE_CACHE_MASK) |
324 flags);
325 }
326
327 if (((vma->vm_pgoff < max_low_pfn_mapped) ||
328 (vma->vm_pgoff >= (1UL<<(32 - PAGE_SHIFT)) &&
329 vma->vm_pgoff < max_pfn_mapped)) &&
330 ioremap_change_attr((unsigned long)__va(addr), len, flags)) {
331 free_memtype(addr, addr + len);
332 return -EINVAL;
333 }
334
335 if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, 289 if (io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
336 vma->vm_end - vma->vm_start, 290 vma->vm_end - vma->vm_start,
337 vma->vm_page_prot)) 291 vma->vm_page_prot))