]> err.no Git - linux-2.6/commitdiff
Merge master.kernel.org:/pub/scm/linux/kernel/git/paulus/ppc64-2.6
authorLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 17:38:02 +0000 (10:38 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 9 Sep 2005 17:38:02 +0000 (10:38 -0700)
65 files changed:
arch/ppc/kernel/syscalls.c
arch/ppc64/Makefile
arch/ppc64/boot/Makefile
arch/ppc64/boot/main.c
arch/ppc64/kernel/bpa_iic.c
arch/ppc64/kernel/eeh.c
arch/ppc64/kernel/iomap.c
arch/ppc64/kernel/iommu.c
arch/ppc64/kernel/maple_pci.c
arch/ppc64/kernel/misc.S
arch/ppc64/kernel/pSeries_iommu.c
arch/ppc64/kernel/pci.c
arch/ppc64/kernel/pci.h
arch/ppc64/kernel/pci_dn.c
arch/ppc64/kernel/pci_iommu.c
arch/ppc64/kernel/pmac_feature.c
arch/ppc64/kernel/pmac_pci.c
arch/ppc64/kernel/prom.c
arch/ppc64/kernel/rtas_pci.c
arch/ppc64/kernel/sys_ppc32.c
arch/ppc64/kernel/syscalls.c
arch/ppc64/kernel/u3_iommu.c
arch/ppc64/kernel/udbg.c
arch/ppc64/mm/init.c
drivers/pci/hotplug/rpadlpar_core.c
drivers/pci/hotplug/rpaphp_pci.c
drivers/video/offb.c
include/asm-powerpc/8253pit.h
include/asm-powerpc/agp.h
include/asm-powerpc/bugs.h
include/asm-powerpc/errno.h
include/asm-powerpc/ioctl.h
include/asm-powerpc/ioctls.h
include/asm-powerpc/linkage.h
include/asm-powerpc/mc146818rtc.h
include/asm-powerpc/mman.h
include/asm-powerpc/module.h
include/asm-powerpc/msgbuf.h [moved from include/asm-ppc/msgbuf.h with 64% similarity]
include/asm-powerpc/namei.h
include/asm-powerpc/param.h [moved from include/asm-ppc/param.h with 70% similarity]
include/asm-powerpc/poll.h
include/asm-powerpc/sembuf.h
include/asm-powerpc/setup.h [new file with mode: 0644]
include/asm-powerpc/shmbuf.h
include/asm-powerpc/shmparam.h
include/asm-powerpc/siginfo.h
include/asm-powerpc/socket.h
include/asm-powerpc/sockios.h
include/asm-powerpc/string.h
include/asm-powerpc/termbits.h
include/asm-powerpc/termios.h
include/asm-powerpc/timex.h [moved from include/asm-ppc/timex.h with 53% similarity]
include/asm-powerpc/topology.h [moved from include/asm-ppc64/topology.h with 92% similarity]
include/asm-powerpc/unaligned.h
include/asm-powerpc/user.h [moved from include/asm-ppc/user.h with 92% similarity]
include/asm-ppc/setup.h [deleted file]
include/asm-ppc/topology.h [deleted file]
include/asm-ppc64/msgbuf.h [deleted file]
include/asm-ppc64/param.h [deleted file]
include/asm-ppc64/pci-bridge.h
include/asm-ppc64/prom.h
include/asm-ppc64/segment.h [deleted file]
include/asm-ppc64/setup.h [deleted file]
include/asm-ppc64/timex.h [deleted file]
include/asm-ppc64/user.h [deleted file]

index 124313ce3c09055fe8ce73d680bc190196b08033..127f040de9de7ab8a1f6235f4f326db971ad20b6 100644 (file)
 #include <asm/ipc.h>
 #include <asm/semaphore.h>
 
-void
-check_bugs(void)
-{
-}
 
 /*
  * sys_ipc() is the de-multiplexer for the SysV IPC calls..
index 8189953a372c93b6579f150359facb604cb4af46..a91daa324e888464c825a42f6ecb252df291025b 100644 (file)
@@ -89,11 +89,12 @@ drivers-$(CONFIG_OPROFILE)  += arch/ppc64/oprofile/
 
 boot := arch/ppc64/boot
 
-boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd
-boottarget-$(CONFIG_PPC_MAPLE) := zImage zImage.initrd
-boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
-boottarget-$(CONFIG_PPC_BPA) := zImage zImage.initrd
-$(boottarget-y): vmlinux
+boottargets-$(CONFIG_PPC_PSERIES) += zImage zImage.initrd
+boottargets-$(CONFIG_PPC_PMAC) += zImage.vmode zImage.initrd.vmode
+boottargets-$(CONFIG_PPC_MAPLE) += zImage zImage.initrd
+boottargets-$(CONFIG_PPC_ISERIES) += vmlinux.sminitrd vmlinux.initrd vmlinux.sm
+boottargets-$(CONFIG_PPC_BPA) += zImage zImage.initrd
+$(boottargets-y): vmlinux
        $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage
@@ -131,10 +132,12 @@ include3/asm:
        $(Q)ln -fsn $(srctree)/include/asm-powerpc include3/asm
 
 define archhelp
-  echo  '* zImage       - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
-  echo  '  zImage.initrd- Compressed kernel image with initrd attached,'
-  echo  '                 sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
-  echo  '                 (arch/$(ARCH)/boot/zImage.initrd)'
+  echo  '  zImage.vmode        - Compressed kernel image (arch/$(ARCH)/boot/zImage.vmode)'
+  echo  '  zImage.initrd.vmode - Compressed kernel image with initrd attached,'
+  echo  '                        sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
+  echo  '                        (arch/$(ARCH)/boot/zImage.initrd.vmode)'
+  echo  '  zImage              - zImage for pSeries machines'
+  echo  '  zImage.initrd       - zImage with initrd for pSeries machines'
 endef
 
 CLEAN_FILES += include/asm-ppc64/offsets.h
index 2c5f5e73d00c76d3e4a56e8f721656c926aa55e9..33fdc8710891589973dfcee2bc7978bc01359b6e 100644 (file)
@@ -37,6 +37,9 @@ quiet_cmd_bootcc = BOOTCC  $@
 quiet_cmd_bootas = BOOTAS  $@
       cmd_bootas = $(CROSS32CC) -Wp,-MD,$(depfile) $(BOOTAFLAGS) -c -o $@ $<
 
+quiet_cmd_bootld = BOOTLD  $@
+      cmd_bootld = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(2)
+
 $(patsubst %.c,%.o, $(filter %.c, $(src-boot))): %.o: %.c
        $(call if_changed_dep,bootcc)
 $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S
@@ -53,7 +56,7 @@ src-sec = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.c, $(section)))
 gz-sec  = $(foreach section, $(1), $(patsubst %,$(obj)/kernel-%.gz, $(section)))
 
 hostprogs-y            := addnote addRamDisk
-targets                += zImage zImage.initrd imagesize.c \
+targets                += zImage.vmode zImage.initrd.vmode zImage zImage.initrd imagesize.c \
                           $(patsubst $(obj)/%,%, $(call obj-sec, $(required) $(initrd))) \
                           $(patsubst $(obj)/%,%, $(call src-sec, $(required) $(initrd))) \
                           $(patsubst $(obj)/%,%, $(call gz-sec, $(required) $(initrd))) \
@@ -63,7 +66,7 @@ extra-y                       := initrd.o
 quiet_cmd_ramdisk = RAMDISK $@
       cmd_ramdisk = $(obj)/addRamDisk $(obj)/ramdisk.image.gz $< $@
 
-quiet_cmd_stripvm = STRIP $@
+quiet_cmd_stripvm = STRIP   $@
       cmd_stripvm = $(STRIP) -s $< -o $@
 
 vmlinux.strip: vmlinux FORCE
@@ -71,12 +74,20 @@ vmlinux.strip: vmlinux FORCE
 $(obj)/vmlinux.initrd: vmlinux.strip $(obj)/addRamDisk $(obj)/ramdisk.image.gz FORCE
        $(call if_changed,ramdisk)
 
-addsection = $(CROSS32OBJCOPY) $(1) \
-               --add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $(1)))=$(patsubst %.o,%.gz, $(1)) \
-               --set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $(1)))=$(OBJCOPYFLAGS)
+quiet_cmd_addsection = ADDSEC  $@
+      cmd_addsection = $(CROSS32OBJCOPY) $@ \
+               --add-section=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(patsubst %.o,%.gz, $@) \
+               --set-section-flags=.kernel:$(strip $(patsubst $(obj)/kernel-%.o,%, $@))=$(OBJCOPYFLAGS)
+
+quiet_cmd_imagesize = GENSIZE $@
+      cmd_imagesize = ls -l vmlinux.strip | \
+               awk '{printf "/* generated -- do not edit! */\n" "unsigned long vmlinux_filesize = %d;\n", $$5}' \
+               > $(obj)/imagesize.c && \
+               $(CROSS_COMPILE)nm -n vmlinux | tail -n 1 | \
+               awk '{printf "unsigned long vmlinux_memsize = 0x%s;\n", substr($$1,8)}' >> $(obj)/imagesize.c
 
-quiet_cmd_addnote = ADDNOTE $@ 
-      cmd_addnote = $(CROSS32LD) $(BOOTLFLAGS) -o $@ $(obj-boot) && $(obj)/addnote $@
+quiet_cmd_addnote = ADDNOTE $@
+      cmd_addnote = $(obj)/addnote $@
 
 $(call gz-sec, $(required)): $(obj)/kernel-%.gz: % FORCE
        $(call if_changed,gzip)
@@ -85,28 +96,30 @@ $(obj)/kernel-initrd.gz: $(obj)/ramdisk.image.gz
        cp -f $(obj)/ramdisk.image.gz $@
 
 $(call src-sec, $(required) $(initrd)): $(obj)/kernel-%.c: $(obj)/kernel-%.gz FORCE
-       touch $@
+       @touch $@
 
 $(call obj-sec, $(required) $(initrd)): $(obj)/kernel-%.o: $(obj)/kernel-%.c FORCE
        $(call if_changed_dep,bootcc)
-       $(call addsection, $@)
+       $(call cmd,addsection)
+
+$(obj)/zImage.vmode: obj-boot += $(call obj-sec, $(required))
+$(obj)/zImage.vmode: $(call obj-sec, $(required)) $(obj-boot) FORCE
+       $(call cmd,bootld,$(obj-boot))
+
+$(obj)/zImage.initrd.vmode: obj-boot += $(call obj-sec, $(required) $(initrd))
+$(obj)/zImage.initrd.vmode: $(call obj-sec, $(required) $(initrd)) $(obj-boot) FORCE
+       $(call cmd,bootld,$(obj-boot))
 
-$(obj)/zImage: obj-boot += $(call obj-sec, $(required))
-$(obj)/zImage: $(call obj-sec, $(required)) $(obj-boot) $(obj)/addnote FORCE
+$(obj)/zImage: $(obj)/zImage.vmode $(obj)/addnote FORCE
+       @cp -f $< $@
        $(call if_changed,addnote)
 
-$(obj)/zImage.initrd: obj-boot += $(call obj-sec, $(required) $(initrd))
-$(obj)/zImage.initrd: $(call obj-sec, $(required) $(initrd)) $(obj-boot) $(obj)/addnote FORCE
+$(obj)/zImage.initrd: $(obj)/zImage.initrd.vmode $(obj)/addnote FORCE
+       @cp -f $< $@
        $(call if_changed,addnote)
 
 $(obj)/imagesize.c: vmlinux.strip
-       @echo Generating $@
-       ls -l vmlinux.strip | \
-       awk '{printf "/* generated -- do not edit! */\n" \
-               "unsigned long vmlinux_filesize = %d;\n", $$5}' > $(obj)/imagesize.c
-       $(CROSS_COMPILE)nm -n vmlinux | tail -n 1 | \
-       awk '{printf "unsigned long vmlinux_memsize = 0x%s;\n", substr($$1,8)}' \
-               >> $(obj)/imagesize.c
+       $(call cmd,imagesize)
 
 install: $(CONFIGURE) $(BOOTIMAGE)
        sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" "$(BOOTIMAGE)"
index 99e68cfbe6883b9ee0e6f249a6d4ba9b30ae59a2..f7ec19a2d0b0e2e55a5652d9ac30550570038280 100644 (file)
@@ -23,7 +23,8 @@ extern void flush_cache(void *, unsigned long);
 
 /* Value picked to match that used by yaboot */
 #define PROG_START     0x01400000
-#define RAM_END                (256<<20) // Fixme: use OF */
+#define RAM_END                (512<<20) // Fixme: use OF */
+#define        ONE_MB          0x100000
 
 static char *avail_ram;
 static char *begin_avail, *end_avail;
@@ -32,6 +33,7 @@ static unsigned int heap_use;
 static unsigned int heap_max;
 
 extern char _start[];
+extern char _end[];
 extern char _vmlinux_start[];
 extern char _vmlinux_end[];
 extern char _initrd_start[];
@@ -58,13 +60,13 @@ typedef void (*kernel_entry_t)( unsigned long,
 
 #undef DEBUG
 
-static unsigned long claim_base = PROG_START;
+static unsigned long claim_base;
 
 static unsigned long try_claim(unsigned long size)
 {
        unsigned long addr = 0;
 
-       for(; claim_base < RAM_END; claim_base += 0x100000) {
+       for(; claim_base < RAM_END; claim_base += ONE_MB) {
 #ifdef DEBUG
                printf("    trying: 0x%08lx\n\r", claim_base);
 #endif
@@ -95,7 +97,26 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
        if (getprop(chosen_handle, "stdin", &stdin, sizeof(stdin)) != 4)
                exit();
 
-       printf("\n\rzImage starting: loaded at 0x%x\n\r", (unsigned)_start);
+       printf("\n\rzImage starting: loaded at 0x%lx\n\r", (unsigned long) _start);
+
+       /*
+        * The first available claim_base must be above the end of the
+        * the loaded kernel wrapper file (_start to _end includes the
+        * initrd image if it is present) and rounded up to a nice
+        * 1 MB boundary for good measure.
+        */
+
+       claim_base = _ALIGN_UP((unsigned long)_end, ONE_MB);
+
+#if defined(PROG_START)
+       /*
+        * Maintain a "magic" minimum address. This keeps some older
+        * firmware platforms running.
+        */
+
+       if (claim_base < PROG_START)
+               claim_base = PROG_START;
+#endif
 
        /*
         * Now we try to claim some memory for the kernel itself
@@ -105,7 +126,7 @@ void start(unsigned long a1, unsigned long a2, void *promptr)
         * size... In practice we add 1Mb, that is enough, but we should really
         * consider fixing the Makefile to put a _raw_ kernel in there !
         */
-       vmlinux_memsize += 0x100000;
+       vmlinux_memsize += ONE_MB;
        printf("Allocating 0x%lx bytes for kernel ...\n\r", vmlinux_memsize);
        vmlinux.addr = try_claim(vmlinux_memsize);
        if (vmlinux.addr == 0) {
index c8f3dc3fad70a4e65341ef9e514e9835a1cf2c38..0aaa878e19d36767861cba4b7da846c833675d78 100644 (file)
@@ -205,6 +205,18 @@ static struct iic_regs __iomem *find_iic(int cpu)
 }
 
 #ifdef CONFIG_SMP
+
+/* Use the highest interrupt priorities for IPI */
+static inline int iic_ipi_to_irq(int ipi)
+{
+       return IIC_IPI_OFFSET + IIC_NUM_IPIS - 1 - ipi;
+}
+
+static inline int iic_irq_to_ipi(int irq)
+{
+       return IIC_NUM_IPIS - 1 - (irq - IIC_IPI_OFFSET);
+}
+
 void iic_setup_cpu(void)
 {
        out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
@@ -212,18 +224,20 @@ void iic_setup_cpu(void)
 
 void iic_cause_IPI(int cpu, int mesg)
 {
-       out_be64(&per_cpu(iic, cpu).regs->generate, mesg);
+       out_be64(&per_cpu(iic, cpu).regs->generate, (IIC_NUM_IPIS - 1 - mesg) << 4);
 }
 
 static irqreturn_t iic_ipi_action(int irq, void *dev_id, struct pt_regs *regs)
 {
-
-       smp_message_recv(irq - IIC_IPI_OFFSET, regs);
+       smp_message_recv(iic_irq_to_ipi(irq), regs);
        return IRQ_HANDLED;
 }
 
-static void iic_request_ipi(int irq, const char *name)
+static void iic_request_ipi(int ipi, const char *name)
 {
+       int irq;
+
+       irq = iic_ipi_to_irq(ipi);
        /* IPIs are marked SA_INTERRUPT as they must run with irqs
         * disabled */
        get_irq_desc(irq)->handler = &iic_pic;
@@ -233,10 +247,10 @@ static void iic_request_ipi(int irq, const char *name)
 
 void iic_request_IPIs(void)
 {
-       iic_request_ipi(IIC_IPI_OFFSET + PPC_MSG_CALL_FUNCTION, "IPI-call");
-       iic_request_ipi(IIC_IPI_OFFSET + PPC_MSG_RESCHEDULE, "IPI-resched");
+       iic_request_ipi(PPC_MSG_CALL_FUNCTION, "IPI-call");
+       iic_request_ipi(PPC_MSG_RESCHEDULE, "IPI-resched");
 #ifdef CONFIG_DEBUGGER
-       iic_request_ipi(IIC_IPI_OFFSET + PPC_MSG_DEBUGGER_BREAK, "IPI-debug");
+       iic_request_ipi(PPC_MSG_DEBUGGER_BREAK, "IPI-debug");
 #endif /* CONFIG_DEBUGGER */
 }
 #endif /* CONFIG_SMP */
index 4c857a6516fc30814bcd4121d2d2c536bf0eaaf5..ba93fd731222fa96190c12f985a34756717f3e43 100644 (file)
@@ -254,6 +254,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
 static void __pci_addr_cache_insert_device(struct pci_dev *dev)
 {
        struct device_node *dn;
+       struct pci_dn *pdn;
        int i;
        int inserted = 0;
 
@@ -265,8 +266,9 @@ static void __pci_addr_cache_insert_device(struct pci_dev *dev)
        }
 
        /* Skip any devices for which EEH is not enabled. */
-       if (!(dn->eeh_mode & EEH_MODE_SUPPORTED) ||
-           dn->eeh_mode & EEH_MODE_NOCHECK) {
+       pdn = dn->data;
+       if (!(pdn->eeh_mode & EEH_MODE_SUPPORTED) ||
+           pdn->eeh_mode & EEH_MODE_NOCHECK) {
 #ifdef DEBUG
                printk(KERN_INFO "PCI: skip building address cache for=%s\n",
                       pci_name(dev));
@@ -415,6 +417,7 @@ int eeh_unregister_notifier(struct notifier_block *nb)
 static int read_slot_reset_state(struct device_node *dn, int rets[])
 {
        int token, outputs;
+       struct pci_dn *pdn = dn->data;
 
        if (ibm_read_slot_reset_state2 != RTAS_UNKNOWN_SERVICE) {
                token = ibm_read_slot_reset_state2;
@@ -424,8 +427,8 @@ static int read_slot_reset_state(struct device_node *dn, int rets[])
                outputs = 3;
        }
 
-       return rtas_call(token, 3, outputs, rets, dn->eeh_config_addr,
-                        BUID_HI(dn->phb->buid), BUID_LO(dn->phb->buid));
+       return rtas_call(token, 3, outputs, rets, pdn->eeh_config_addr,
+                        BUID_HI(pdn->phb->buid), BUID_LO(pdn->phb->buid));
 }
 
 /**
@@ -534,6 +537,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
        unsigned long flags;
        int rc, reset_state;
        struct eeh_event  *event;
+       struct pci_dn *pdn;
 
        __get_cpu_var(total_mmio_ffs)++;
 
@@ -542,14 +546,15 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
 
        if (!dn)
                return 0;
+       pdn = dn->data;
 
        /* Access to IO BARs might get this far and still not want checking. */
-       if (!(dn->eeh_mode & EEH_MODE_SUPPORTED) ||
-           dn->eeh_mode & EEH_MODE_NOCHECK) {
+       if (!pdn->eeh_capable || !(pdn->eeh_mode & EEH_MODE_SUPPORTED) ||
+           pdn->eeh_mode & EEH_MODE_NOCHECK) {
                return 0;
        }
 
-       if (!dn->eeh_config_addr) {
+       if (!pdn->eeh_config_addr) {
                return 0;
        }
 
@@ -557,7 +562,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
         * If we already have a pending isolation event for this
         * slot, we know it's bad already, we don't need to check...
         */
-       if (dn->eeh_mode & EEH_MODE_ISOLATED) {
+       if (pdn->eeh_mode & EEH_MODE_ISOLATED) {
                atomic_inc(&eeh_fail_count);
                if (atomic_read(&eeh_fail_count) >= EEH_MAX_FAILS) {
                        /* re-read the slot reset state */
@@ -582,7 +587,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
        }
 
        /* prevent repeated reports of this failure */
-       dn->eeh_mode |= EEH_MODE_ISOLATED;
+       pdn->eeh_mode |= EEH_MODE_ISOLATED;
 
        reset_state = rets[0];
 
@@ -590,9 +595,9 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
        memset(slot_errbuf, 0, eeh_error_buf_size);
 
        rc = rtas_call(ibm_slot_error_detail,
-                      8, 1, NULL, dn->eeh_config_addr,
-                      BUID_HI(dn->phb->buid),
-                      BUID_LO(dn->phb->buid), NULL, 0,
+                      8, 1, NULL, pdn->eeh_config_addr,
+                      BUID_HI(pdn->phb->buid),
+                      BUID_LO(pdn->phb->buid), NULL, 0,
                       virt_to_phys(slot_errbuf),
                       eeh_error_buf_size,
                       1 /* Temporary Error */);
@@ -679,8 +684,9 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
        u32 *device_id = (u32 *)get_property(dn, "device-id", NULL);
        u32 *regs;
        int enable;
+       struct pci_dn *pdn = dn->data;
 
-       dn->eeh_mode = 0;
+       pdn->eeh_mode = 0;
 
        if (status && strcmp(status, "ok") != 0)
                return NULL;    /* ignore devices with bad status */
@@ -691,7 +697,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
 
        /* There is nothing to check on PCI to ISA bridges */
        if (dn->type && !strcmp(dn->type, "isa")) {
-               dn->eeh_mode |= EEH_MODE_NOCHECK;
+               pdn->eeh_mode |= EEH_MODE_NOCHECK;
                return NULL;
        }
 
@@ -708,7 +714,7 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
                enable = 0;
 
        if (!enable)
-               dn->eeh_mode |= EEH_MODE_NOCHECK;
+               pdn->eeh_mode |= EEH_MODE_NOCHECK;
 
        /* Ok... see if this device supports EEH.  Some do, some don't,
         * and the only way to find out is to check each and every one. */
@@ -721,8 +727,8 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
                                EEH_ENABLE);
                if (ret == 0) {
                        eeh_subsystem_enabled = 1;
-                       dn->eeh_mode |= EEH_MODE_SUPPORTED;
-                       dn->eeh_config_addr = regs[0];
+                       pdn->eeh_mode |= EEH_MODE_SUPPORTED;
+                       pdn->eeh_config_addr = regs[0];
 #ifdef DEBUG
                        printk(KERN_DEBUG "EEH: %s: eeh enabled\n", dn->full_name);
 #endif
@@ -730,10 +736,11 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
 
                        /* This device doesn't support EEH, but it may have an
                         * EEH parent, in which case we mark it as supported. */
-                       if (dn->parent && (dn->parent->eeh_mode & EEH_MODE_SUPPORTED)) {
+                       if (dn->parent && dn->parent->data
+                           && (PCI_DN(dn->parent)->eeh_mode & EEH_MODE_SUPPORTED)) {
                                /* Parent supports EEH. */
-                               dn->eeh_mode |= EEH_MODE_SUPPORTED;
-                               dn->eeh_config_addr = dn->parent->eeh_config_addr;
+                               pdn->eeh_mode |= EEH_MODE_SUPPORTED;
+                               pdn->eeh_config_addr = PCI_DN(dn->parent)->eeh_config_addr;
                                return NULL;
                        }
                }
@@ -790,11 +797,13 @@ void __init eeh_init(void)
        for (phb = of_find_node_by_name(NULL, "pci"); phb;
             phb = of_find_node_by_name(phb, "pci")) {
                unsigned long buid;
+               struct pci_dn *pci;
 
                buid = get_phb_buid(phb);
-               if (buid == 0)
+               if (buid == 0 || phb->data == NULL)
                        continue;
 
+               pci = phb->data;
                info.buid_lo = BUID_LO(buid);
                info.buid_hi = BUID_HI(buid);
                traverse_pci_devices(phb, early_enable_eeh, &info);
@@ -823,9 +832,9 @@ void eeh_add_device_early(struct device_node *dn)
        struct pci_controller *phb;
        struct eeh_early_enable_info info;
 
-       if (!dn)
+       if (!dn || !dn->data)
                return;
-       phb = dn->phb;
+       phb = PCI_DN(dn)->phb;
        if (NULL == phb || 0 == phb->buid) {
                printk(KERN_WARNING "EEH: Expected buid but found none\n");
                return;
index 09a3062309e7bbe612b7b6af37d4b488954879be..6160c8dbb7c50245a682f028514a6bb1a73b1f97 100644 (file)
@@ -22,13 +22,23 @@ unsigned int fastcall ioread16(void __iomem *addr)
 {
        return readw(addr);
 }
+unsigned int fastcall ioread16be(void __iomem *addr)
+{
+       return in_be16(addr);
+}
 unsigned int fastcall ioread32(void __iomem *addr)
 {
        return readl(addr);
 }
+unsigned int fastcall ioread32be(void __iomem *addr)
+{
+       return in_be32(addr);
+}
 EXPORT_SYMBOL(ioread8);
 EXPORT_SYMBOL(ioread16);
+EXPORT_SYMBOL(ioread16be);
 EXPORT_SYMBOL(ioread32);
+EXPORT_SYMBOL(ioread32be);
 
 void fastcall iowrite8(u8 val, void __iomem *addr)
 {
@@ -38,13 +48,23 @@ void fastcall iowrite16(u16 val, void __iomem *addr)
 {
        writew(val, addr);
 }
+void fastcall iowrite16be(u16 val, void __iomem *addr)
+{
+       out_be16(addr, val);
+}
 void fastcall iowrite32(u32 val, void __iomem *addr)
 {
        writel(val, addr);
 }
+void fastcall iowrite32be(u32 val, void __iomem *addr)
+{
+       out_be32(addr, val);
+}
 EXPORT_SYMBOL(iowrite8);
 EXPORT_SYMBOL(iowrite16);
+EXPORT_SYMBOL(iowrite16be);
 EXPORT_SYMBOL(iowrite32);
+EXPORT_SYMBOL(iowrite32be);
 
 /*
  * These are the "repeat read/write" functions. Note the
index 845eebd1e28de803904778c7ed1dc39fb61a7abc..9032b6bfe036af0c2a615b11158d88502c367e29 100644 (file)
@@ -438,7 +438,8 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl)
 
 void iommu_free_table(struct device_node *dn)
 {
-       struct iommu_table *tbl = dn->iommu_table;
+       struct pci_dn *pdn = dn->data;
+       struct iommu_table *tbl = pdn->iommu_table;
        unsigned long bitmap_sz, i;
        unsigned int order;
 
index 53993999b265ac491728202c5fb7f62557bea522..5a8b4d8c2dd62042e8b67a237fa51d89b8797884 100644 (file)
@@ -447,9 +447,9 @@ void __init maple_pci_init(void)
         */
        if (u3_agp) {
                struct device_node *np = u3_agp->arch_data;
-               np->busno = 0xf0;
+               PCI_DN(np)->busno = 0xf0;
                for (np = np->child; np; np = np->sibling)
-                       np->busno = 0xf0;
+                       PCI_DN(np)->busno = 0xf0;
        }
 
        /* Tell pci.c to use the common resource allocation mecanism */
index 6d860c1d9fa0849f44fab1856d77932d3a35fed3..c047663eb48d14c9bf6e09f5f15b32a3f00bdf8c 100644 (file)
@@ -1431,9 +1431,9 @@ _GLOBAL(sys_call_table)
        .llong .sys_ni_syscall          /* 195 - 32bit only stat64 */
        .llong .sys_ni_syscall          /* 32bit only lstat64 */
        .llong .sys_ni_syscall          /* 32bit only fstat64 */
-       .llong .sys_ni_syscall          /* 32bit only pciconfig_read */
-       .llong .sys_ni_syscall          /* 32bit only pciconfig_write */
-       .llong .sys_ni_syscall          /* 32bit only pciconfig_iobase */
+       .llong .sys_pciconfig_read
+       .llong .sys_pciconfig_write
+       .llong .sys_pciconfig_iobase    /* 200 - pciconfig_iobase */
        .llong .sys_ni_syscall          /* reserved for MacOnLinux */
        .llong .sys_getdents64
        .llong .sys_pivot_root
index 9d5e1e7fc38962f26fdce0838d82d68f562e67f9..f0fd7fbd6531cd01fb8984d2c81e82a25825b484 100644 (file)
@@ -295,7 +295,7 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
                                      struct iommu_table *tbl,
                                      unsigned int *dma_window)
 {
-       tbl->it_busno  = dn->bussubno;
+       tbl->it_busno  = PCI_DN(dn)->bussubno;
 
        /* TODO: Parse field size properties properly. */
        tbl->it_size   = (((unsigned long)dma_window[4] << 32) |
@@ -311,6 +311,7 @@ static void iommu_table_setparms_lpar(struct pci_controller *phb,
 static void iommu_bus_setup_pSeries(struct pci_bus *bus)
 {
        struct device_node *dn, *pdn;
+       struct pci_dn *pci;
        struct iommu_table *tbl;
 
        DBG("iommu_bus_setup_pSeries, bus %p, bus->self %p\n", bus, bus->self);
@@ -325,6 +326,7 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
         */
 
        dn = pci_bus_to_OF_node(bus);
+       pci = dn->data;
 
        if (!bus->self) {
                /* Root bus */
@@ -341,18 +343,18 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
                                 * alltogether. This leaves 768MB for the window.
                                 */
                                DBG("PHB has io-hole, reserving 256MB\n");
-                               dn->phb->dma_window_size = 3 << 28;
-                               dn->phb->dma_window_base_cur = 1 << 28;
+                               pci->phb->dma_window_size = 3 << 28;
+                               pci->phb->dma_window_base_cur = 1 << 28;
                        } else {
                                /* 1GB window by default */
-                               dn->phb->dma_window_size = 1 << 30;
-                               dn->phb->dma_window_base_cur = 0;
+                               pci->phb->dma_window_size = 1 << 30;
+                               pci->phb->dma_window_base_cur = 0;
                        }
 
                        tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
 
-                       iommu_table_setparms(dn->phb, dn, tbl);
-                       dn->iommu_table = iommu_init_table(tbl);
+                       iommu_table_setparms(pci->phb, dn, tbl);
+                       pci->iommu_table = iommu_init_table(tbl);
                } else {
                        /* Do a 128MB table at root. This is used for the IDE
                         * controller on some SMP-mode POWER4 machines. It
@@ -363,16 +365,16 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
                         * Allocate at offset 128MB to avoid having to deal
                         * with ISA holes; 128MB table for IDE is plenty.
                         */
-                       dn->phb->dma_window_size = 1 << 27;
-                       dn->phb->dma_window_base_cur = 1 << 27;
+                       pci->phb->dma_window_size = 1 << 27;
+                       pci->phb->dma_window_base_cur = 1 << 27;
 
                        tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
 
-                       iommu_table_setparms(dn->phb, dn, tbl);
-                       dn->iommu_table = iommu_init_table(tbl);
+                       iommu_table_setparms(pci->phb, dn, tbl);
+                       pci->iommu_table = iommu_init_table(tbl);
 
                        /* All child buses have 256MB tables */
-                       dn->phb->dma_window_size = 1 << 28;
+                       pci->phb->dma_window_size = 1 << 28;
                }
        } else {
                pdn = pci_bus_to_OF_node(bus->parent);
@@ -386,12 +388,12 @@ static void iommu_bus_setup_pSeries(struct pci_bus *bus)
 
                        tbl = kmalloc(sizeof(struct iommu_table), GFP_KERNEL);
 
-                       iommu_table_setparms(dn->phb, dn, tbl);
+                       iommu_table_setparms(pci->phb, dn, tbl);
 
-                       dn->iommu_table = iommu_init_table(tbl);
+                       pci->iommu_table = iommu_init_table(tbl);
                } else {
                        /* Lower than first child or under python, use parent table */
-                       dn->iommu_table = pdn->iommu_table;
+                       pci->iommu_table = PCI_DN(pdn)->iommu_table;
                }
        }
 }
@@ -401,6 +403,7 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
 {
        struct iommu_table *tbl;
        struct device_node *dn, *pdn;
+       struct pci_dn *ppci;
        unsigned int *dma_window = NULL;
 
        DBG("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n", bus, bus->self);
@@ -419,22 +422,24 @@ static void iommu_bus_setup_pSeriesLP(struct pci_bus *bus)
                return;
        }
 
-       if (!pdn->iommu_table) {
+       ppci = pdn->data;
+       if (!ppci->iommu_table) {
                /* Bussubno hasn't been copied yet.
                 * Do it now because iommu_table_setparms_lpar needs it.
                 */
-               pdn->bussubno = bus->number;
+
+               ppci->bussubno = bus->number;
 
                tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table),
                                                    GFP_KERNEL);
        
-               iommu_table_setparms_lpar(pdn->phb, pdn, tbl, dma_window);
+               iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window);
 
-               pdn->iommu_table = iommu_init_table(tbl);
+               ppci->iommu_table = iommu_init_table(tbl);
        }
 
        if (pdn != dn)
-               dn->iommu_table = pdn->iommu_table;
+               PCI_DN(dn)->iommu_table = ppci->iommu_table;
 }
 
 
@@ -449,11 +454,11 @@ static void iommu_dev_setup_pSeries(struct pci_dev *dev)
         */
        mydn = dn = pci_device_to_OF_node(dev);
 
-       while (dn && dn->iommu_table == NULL)
+       while (dn && dn->data && PCI_DN(dn)->iommu_table == NULL)
                dn = dn->parent;
 
-       if (dn) {
-               mydn->iommu_table = dn->iommu_table;
+       if (dn && dn->data) {
+               PCI_DN(mydn)->iommu_table = PCI_DN(dn)->iommu_table;
        } else {
                DBG("iommu_dev_setup_pSeries, dev %p (%s) has no iommu table\n", dev, dev->pretty_name);
        }
@@ -463,10 +468,11 @@ static int iommu_reconfig_notifier(struct notifier_block *nb, unsigned long acti
 {
        int err = NOTIFY_OK;
        struct device_node *np = node;
+       struct pci_dn *pci = np->data;
 
        switch (action) {
        case PSERIES_RECONFIG_REMOVE:
-               if (np->iommu_table &&
+               if (pci->iommu_table &&
                    get_property(np, "ibm,dma-window", NULL))
                        iommu_free_table(np);
                break;
@@ -486,6 +492,7 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
        struct device_node *pdn, *dn;
        struct iommu_table *tbl;
        int *dma_window = NULL;
+       struct pci_dn *pci;
 
        DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, dev->pretty_name);
 
@@ -497,8 +504,10 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
         */
        dn = pci_device_to_OF_node(dev);
 
-       for (pdn = dn; pdn && !pdn->iommu_table; pdn = pdn->parent) {
-               dma_window = (unsigned int *)get_property(pdn, "ibm,dma-window", NULL);
+       for (pdn = dn; pdn && pdn->data && !PCI_DN(pdn)->iommu_table;
+            pdn = pdn->parent) {
+               dma_window = (unsigned int *)
+                       get_property(pdn, "ibm,dma-window", NULL);
                if (dma_window)
                        break;
        }
@@ -515,20 +524,21 @@ static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev)
                DBG("Found DMA window, allocating table\n");
        }
 
-       if (!pdn->iommu_table) {
+       pci = pdn->data;
+       if (!pci->iommu_table) {
                /* iommu_table_setparms_lpar needs bussubno. */
-               pdn->bussubno = pdn->phb->bus->number;
+               pci->bussubno = pci->phb->bus->number;
 
                tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table),
                                                    GFP_KERNEL);
 
-               iommu_table_setparms_lpar(pdn->phb, pdn, tbl, dma_window);
+               iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window);
 
-               pdn->iommu_table = iommu_init_table(tbl);
+               pci->iommu_table = iommu_init_table(tbl);
        }
 
        if (pdn != dn)
-               dn->iommu_table = pdn->iommu_table;
+               PCI_DN(dn)->iommu_table = pci->iommu_table;
 }
 
 static void iommu_bus_setup_null(struct pci_bus *b) { }
index b5ca7d8347e2ec2e9f3838650f437d97d5242871..8447dcc2c2b3f7db34086a997030c7d92742dd0a 100644 (file)
@@ -21,6 +21,7 @@
 #include <linux/bootmem.h>
 #include <linux/mm.h>
 #include <linux/list.h>
+#include <linux/syscalls.h>
 
 #include <asm/processor.h>
 #include <asm/io.h>
@@ -837,9 +838,11 @@ int pcibios_scan_all_fns(struct pci_bus *bus, int devfn)
         * device tree.  If they are then we need to scan all the
         * functions of this slot.
         */
-       for (dn = busdn->child; dn; dn = dn->sibling)
-               if ((dn->devfn >> 3) == (devfn >> 3))
+       for (dn = busdn->child; dn; dn = dn->sibling) {
+              struct pci_dn *pdn = dn->data;
+              if (pdn && (pdn->devfn >> 3) == (devfn >> 3))
                        return 1;
+       }
 
        return 0;
 }
@@ -982,3 +985,62 @@ void pci_resource_to_user(const struct pci_dev *dev, int bar,
 }
 
 #endif /* CONFIG_PPC_MULTIPLATFORM */
+
+
+#define IOBASE_BRIDGE_NUMBER   0
+#define IOBASE_MEMORY          1
+#define IOBASE_IO              2
+#define IOBASE_ISA_IO          3
+#define IOBASE_ISA_MEM         4
+
+long sys_pciconfig_iobase(long which, unsigned long in_bus,
+                         unsigned long in_devfn)
+{
+       struct pci_controller* hose;
+       struct list_head *ln;
+       struct pci_bus *bus = NULL;
+       struct device_node *hose_node;
+
+       /* Argh ! Please forgive me for that hack, but that's the
+        * simplest way to get existing XFree to not lockup on some
+        * G5 machines... So when something asks for bus 0 io base
+        * (bus 0 is HT root), we return the AGP one instead.
+        */
+#ifdef CONFIG_PPC_PMAC
+       if (systemcfg->platform == PLATFORM_POWERMAC &&
+           machine_is_compatible("MacRISC4"))
+               if (in_bus == 0)
+                       in_bus = 0xf0;
+#endif /* CONFIG_PPC_PMAC */
+
+       /* That syscall isn't quite compatible with PCI domains, but it's
+        * used on pre-domains setup. We return the first match
+        */
+
+       for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
+               bus = pci_bus_b(ln);
+               if (in_bus >= bus->number && in_bus < (bus->number + bus->subordinate))
+                       break;
+               bus = NULL;
+       }
+       if (bus == NULL || bus->sysdata == NULL)
+               return -ENODEV;
+
+       hose_node = (struct device_node *)bus->sysdata;
+       hose = PCI_DN(hose_node)->phb;
+
+       switch (which) {
+       case IOBASE_BRIDGE_NUMBER:
+               return (long)hose->first_busno;
+       case IOBASE_MEMORY:
+               return (long)hose->pci_mem_offset;
+       case IOBASE_IO:
+               return (long)hose->io_base_phys;
+       case IOBASE_ISA_IO:
+               return (long)isa_io_base;
+       case IOBASE_ISA_MEM:
+               return -EINVAL;
+       }
+
+       return -EOPNOTSUPP;
+}
index 26be78b13af1923877c8ea75d764dc39881a0d43..5eb2cc32056674fd7cca58764bd8a918944e0c86 100644 (file)
@@ -34,7 +34,6 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
 
 void pci_devs_phb_init(void);
 void pci_devs_phb_init_dynamic(struct pci_controller *phb);
-struct device_node *fetch_dev_dn(struct pci_dev *dev);
 
 /* PCI address cache management routines */
 void pci_addr_cache_insert_device(struct pci_dev *dev);
index ec345462afc3f2660a5b5b541fdce902bf96a93d..a86389d07d5783c0ec0b0ea11863dad2a58d0605 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/pci.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/bootmem.h>
 
 #include <asm/io.h>
 #include <asm/prom.h>
@@ -40,16 +42,26 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
        struct pci_controller *phb = data;
        int *type = (int *)get_property(dn, "ibm,pci-config-space-type", NULL);
        u32 *regs;
-
-       dn->phb = phb;
+       struct pci_dn *pdn;
+
+       if (phb->is_dynamic)
+               pdn = kmalloc(sizeof(*pdn), GFP_KERNEL);
+       else
+               pdn = alloc_bootmem(sizeof(*pdn));
+       if (pdn == NULL)
+               return NULL;
+       memset(pdn, 0, sizeof(*pdn));
+       dn->data = pdn;
+       pdn->node = dn;
+       pdn->phb = phb;
        regs = (u32 *)get_property(dn, "reg", NULL);
        if (regs) {
                /* First register entry is addr (00BBSS00)  */
-               dn->busno = (regs[0] >> 16) & 0xff;
-               dn->devfn = (regs[0] >> 8) & 0xff;
+               pdn->busno = (regs[0] >> 16) & 0xff;
+               pdn->devfn = (regs[0] >> 8) & 0xff;
        }
 
-       dn->pci_ext_config_space = (type && *type == 1);
+       pdn->pci_ext_config_space = (type && *type == 1);
        return NULL;
 }
 
@@ -112,10 +124,15 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
 void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
 {
        struct device_node * dn = (struct device_node *) phb->arch_data;
+       struct pci_dn *pdn;
 
        /* PHB nodes themselves must not match */
-       dn->devfn = dn->busno = -1;
-       dn->phb = phb;
+       update_dn_pci_info(dn, phb);
+       pdn = dn->data;
+       if (pdn) {
+               pdn->devfn = pdn->busno = -1;
+               pdn->phb = phb;
+       }
 
        /* Update dn->phb ptrs for new phb and children devices */
        traverse_pci_devices(dn, update_dn_pci_info, phb);
@@ -123,14 +140,17 @@ void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
 
 /*
  * Traversal func that looks for a <busno,devfcn> value.
- * If found, the device_node is returned (thus terminating the traversal).
+ * If found, the pci_dn is returned (thus terminating the traversal).
  */
 static void *is_devfn_node(struct device_node *dn, void *data)
 {
        int busno = ((unsigned long)data >> 8) & 0xff;
        int devfn = ((unsigned long)data) & 0xff;
+       struct pci_dn *pci = dn->data;
 
-       return ((devfn == dn->devfn) && (busno == dn->busno)) ? dn : NULL;
+       if (pci && (devfn == pci->devfn) && (busno == pci->busno))
+               return dn;
+       return NULL;
 }
 
 /*
@@ -149,13 +169,10 @@ static void *is_devfn_node(struct device_node *dn, void *data)
 struct device_node *fetch_dev_dn(struct pci_dev *dev)
 {
        struct device_node *orig_dn = dev->sysdata;
-       struct pci_controller *phb = orig_dn->phb; /* assume same phb as orig_dn */
-       struct device_node *phb_dn;
        struct device_node *dn;
        unsigned long searchval = (dev->bus->number << 8) | dev->devfn;
 
-       phb_dn = phb->arch_data;
-       dn = traverse_pci_devices(phb_dn, is_devfn_node, (void *)searchval);
+       dn = traverse_pci_devices(orig_dn, is_devfn_node, (void *)searchval);
        if (dn)
                dev->sysdata = dn;
        return dn;
@@ -165,11 +182,13 @@ EXPORT_SYMBOL(fetch_dev_dn);
 static int pci_dn_reconfig_notifier(struct notifier_block *nb, unsigned long action, void *node)
 {
        struct device_node *np = node;
+       struct pci_dn *pci;
        int err = NOTIFY_OK;
 
        switch (action) {
        case PSERIES_RECONFIG_ADD:
-               update_dn_pci_info(np, np->parent->phb);
+               pci = np->parent->data;
+               update_dn_pci_info(np, pci->phb);
                break;
        default:
                err = NOTIFY_DONE;
index ef0a62b916be5e2e809d36a9b056468be46b572e..14647e09c9cda2b9f12cb5b6021cb497534afa23 100644 (file)
@@ -66,7 +66,7 @@ static inline struct iommu_table *devnode_table(struct device *dev)
 #endif /* CONFIG_PPC_ISERIES */
 
 #ifdef CONFIG_PPC_MULTIPLATFORM
-       return PCI_GET_DN(pdev)->iommu_table;
+       return PCI_DN(PCI_GET_DN(pdev))->iommu_table;
 #endif /* CONFIG_PPC_MULTIPLATFORM */
 }
 
index 98ed2bccab1af06425be213c23242014b8b2af8e..eb4e6c3f694d73881855dde00cf16b801b4f5987 100644 (file)
@@ -674,6 +674,7 @@ void __init pmac_check_ht_link(void)
 #if 0 /* Disabled for now */
        u32     ufreq, freq, ucfg, cfg;
        struct device_node *pcix_node;
+       struct pci_dn *pdn;
        u8      px_bus, px_devfn;
        struct pci_controller *px_hose;
 
@@ -687,9 +688,10 @@ void __init pmac_check_ht_link(void)
                printk("No PCI-X bridge found\n");
                return;
        }
-       px_hose = pcix_node->phb;
-       px_bus = pcix_node->busno;
-       px_devfn = pcix_node->devfn;
+       pdn = pcix_node->data;
+       px_hose = pdn->phb;
+       px_bus = pdn->busno;
+       px_devfn = pdn->devfn;
        
        early_read_config_dword(px_hose, px_bus, px_devfn, 0xc4, &cfg);
        early_read_config_dword(px_hose, px_bus, px_devfn, 0xcc, &freq);
index 71fe911ad1839c265c1a36ae4a409a7a278ab572..d37bff2d7d40c3ae9af84e8b9d047fa53766bdb2 100644 (file)
@@ -242,7 +242,7 @@ static int u3_ht_skip_device(struct pci_controller *hose,
        else
                busdn = hose->arch_data;
        for (dn = busdn->child; dn; dn = dn->sibling)
-               if (dn->devfn == devfn)
+               if (dn->data && PCI_DN(dn)->devfn == devfn)
                        break;
        if (dn == NULL)
                return -1;
@@ -746,9 +746,9 @@ void __init pmac_pci_init(void)
         */
        if (u3_agp) {
                struct device_node *np = u3_agp->arch_data;
-               np->busno = 0xf0;
+               PCI_DN(np)->busno = 0xf0;
                for (np = np->child; np; np = np->sibling)
-                       np->busno = 0xf0;
+                       PCI_DN(np)->busno = 0xf0;
        }
 
        pmac_check_ht_link();
index 6ad5a8467f87f1aed705aa793e6f1175e42f207d..7035deb6de9289996636c0741d705008b985fe7a 100644 (file)
@@ -1733,6 +1733,7 @@ static void of_node_release(struct kref *kref)
        kfree(node->intrs);
        kfree(node->addrs);
        kfree(node->full_name);
+       kfree(node->data);
        kfree(node);
 }
 
index 1dccadaddd1d094551f0528fb2c747d2afac8773..4a9719b48abeb807b29a28c576035dd6a49577dd 100644 (file)
@@ -48,7 +48,7 @@ static int write_pci_config;
 static int ibm_read_pci_config;
 static int ibm_write_pci_config;
 
-static int config_access_valid(struct device_node *dn, int where)
+static int config_access_valid(struct pci_dn *dn, int where)
 {
        if (where < 256)
                return 1;
@@ -78,15 +78,17 @@ static int rtas_read_config(struct device_node *dn, int where, int size, u32 *va
        int returnval = -1;
        unsigned long buid, addr;
        int ret;
+       struct pci_dn *pdn;
 
-       if (!dn)
+       if (!dn || !dn->data)
                return PCIBIOS_DEVICE_NOT_FOUND;
-       if (!config_access_valid(dn, where))
+       pdn = dn->data;
+       if (!config_access_valid(pdn, where))
                return PCIBIOS_BAD_REGISTER_NUMBER;
 
-       addr = ((where & 0xf00) << 20) | (dn->busno << 16) |
-               (dn->devfn << 8) | (where & 0xff);
-       buid = dn->phb->buid;
+       addr = ((where & 0xf00) << 20) | (pdn->busno << 16) |
+               (pdn->devfn << 8) | (where & 0xff);
+       buid = pdn->phb->buid;
        if (buid) {
                ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval,
                                addr, buid >> 32, buid & 0xffffffff, size);
@@ -98,8 +100,8 @@ static int rtas_read_config(struct device_node *dn, int where, int size, u32 *va
        if (ret)
                return PCIBIOS_DEVICE_NOT_FOUND;
 
-       if (returnval == EEH_IO_ERROR_VALUE(size)
-           && eeh_dn_check_failure (dn, NULL))
+       if (returnval == EEH_IO_ERROR_VALUE(size) &&
+           eeh_dn_check_failure (dn, NULL))
                return PCIBIOS_DEVICE_NOT_FOUND;
 
        return PCIBIOS_SUCCESSFUL;
@@ -118,24 +120,28 @@ static int rtas_pci_read_config(struct pci_bus *bus,
 
        /* Search only direct children of the bus */
        for (dn = busdn->child; dn; dn = dn->sibling)
-               if (dn->devfn == devfn && of_device_available(dn))
+               if (dn->data && PCI_DN(dn)->devfn == devfn
+                   && of_device_available(dn))
                        return rtas_read_config(dn, where, size, val);
+
        return PCIBIOS_DEVICE_NOT_FOUND;
 }
 
-static int rtas_write_config(struct device_node *dn, int where, int size, u32 val)
+int rtas_write_config(struct device_node *dn, int where, int size, u32 val)
 {
        unsigned long buid, addr;
        int ret;
+       struct pci_dn *pdn;
 
-       if (!dn)
+       if (!dn || !dn->data)
                return PCIBIOS_DEVICE_NOT_FOUND;
-       if (!config_access_valid(dn, where))
+       pdn = dn->data;
+       if (!config_access_valid(pdn, where))
                return PCIBIOS_BAD_REGISTER_NUMBER;
 
-       addr = ((where & 0xf00) << 20) | (dn->busno << 16) |
-               (dn->devfn << 8) | (where & 0xff);
-       buid = dn->phb->buid;
+       addr = ((where & 0xf00) << 20) | (pdn->busno << 16) |
+               (pdn->devfn << 8) | (where & 0xff);
+       buid = pdn->phb->buid;
        if (buid) {
                ret = rtas_call(ibm_write_pci_config, 5, 1, NULL, addr, buid >> 32, buid & 0xffffffff, size, (ulong) val);
        } else {
@@ -161,7 +167,8 @@ static int rtas_pci_write_config(struct pci_bus *bus,
 
        /* Search only direct children of the bus */
        for (dn = busdn->child; dn; dn = dn->sibling)
-               if (dn->devfn == devfn && of_device_available(dn))
+               if (dn->data && PCI_DN(dn)->devfn == devfn
+                   && of_device_available(dn))
                        return rtas_write_config(dn, where, size, val);
        return PCIBIOS_DEVICE_NOT_FOUND;
 }
index 214914a95a504e546a48837995bebfa9571a7eb1..e93c134589108c79a11d716af39dd77ea79d547e 100644 (file)
@@ -708,62 +708,9 @@ asmlinkage int sys32_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubu
                                   compat_ptr(ubuf));
 }
 
-#define IOBASE_BRIDGE_NUMBER   0
-#define IOBASE_MEMORY          1
-#define IOBASE_IO              2
-#define IOBASE_ISA_IO          3
-#define IOBASE_ISA_MEM         4
-
 asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn)
 {
-#ifdef CONFIG_PCI
-       struct pci_controller* hose;
-       struct list_head *ln;
-       struct pci_bus *bus = NULL;
-       struct device_node *hose_node;
-
-       /* Argh ! Please forgive me for that hack, but that's the
-        * simplest way to get existing XFree to not lockup on some
-        * G5 machines... So when something asks for bus 0 io base
-        * (bus 0 is HT root), we return the AGP one instead.
-        */
-#ifdef CONFIG_PPC_PMAC
-       if (systemcfg->platform == PLATFORM_POWERMAC &&
-           machine_is_compatible("MacRISC4"))
-               if (in_bus == 0)
-                       in_bus = 0xf0;
-#endif /* CONFIG_PPC_PMAC */
-
-       /* That syscall isn't quite compatible with PCI domains, but it's
-        * used on pre-domains setup. We return the first match
-        */
-
-       for (ln = pci_root_buses.next; ln != &pci_root_buses; ln = ln->next) {
-               bus = pci_bus_b(ln);
-               if (in_bus >= bus->number && in_bus < (bus->number + bus->subordinate))
-                       break;
-               bus = NULL;
-       }
-       if (bus == NULL || bus->sysdata == NULL)
-               return -ENODEV;
-
-       hose_node = (struct device_node *)bus->sysdata;
-       hose = hose_node->phb;
-
-       switch (which) {
-       case IOBASE_BRIDGE_NUMBER:
-               return (long)hose->first_busno;
-       case IOBASE_MEMORY:
-               return (long)hose->pci_mem_offset;
-       case IOBASE_IO:
-               return (long)hose->io_base_phys;
-       case IOBASE_ISA_IO:
-               return (long)isa_io_base;
-       case IOBASE_ISA_MEM:
-               return -EINVAL;
-       }
-#endif /* CONFIG_PCI */
-       return -EOPNOTSUPP;
+       return sys_pciconfig_iobase(which, in_bus, in_devfn);
 }
 
 
index a8cbb202b8cd482f8deb05e68287341600c44637..05f16633bd2c8c0176cdc7611b6f62a2b4617c0a 100644 (file)
 
 extern unsigned long wall_jiffies;
 
-void
-check_bugs(void)
-{
-}
 
 /*
  * sys_ipc() is the de-multiplexer for the SysV IPC calls..
index b6e3bca4102dbc6208239e9097f58e3287e03e50..41ea09cb9ac760a2e437bace58b372041850a10f 100644 (file)
@@ -276,7 +276,7 @@ static void iommu_dev_setup_u3(struct pci_dev *dev)
        dn = pci_device_to_OF_node(dev);
 
        if (dn)
-               dn->iommu_table = &iommu_table_u3;
+               PCI_DN(dn)->iommu_table = &iommu_table_u3;
 }
 
 static void iommu_bus_setup_u3(struct pci_bus *bus)
@@ -291,7 +291,7 @@ static void iommu_bus_setup_u3(struct pci_bus *bus)
        dn = pci_bus_to_OF_node(bus);
 
        if (dn)
-               dn->iommu_table = &iommu_table_u3;
+               PCI_DN(dn)->iommu_table = &iommu_table_u3;
 }
 
 static void iommu_dev_setup_null(struct pci_dev *dev) { }
index ed6766e21f5a4c5df82405b2ac5530aec54f4e36..d49c3613c8ece531898535748256ec5af39796bb 100644 (file)
@@ -158,14 +158,20 @@ static struct console udbg_console = {
        .index  = -1,
 };
 
+static int early_console_initialized;
+
 void __init disable_early_printk(void)
 {
+       if (!early_console_initialized)
+               return;
        unregister_console(&udbg_console);
+       early_console_initialized = 0;
 }
 
 /* called by setup_system */
 void register_early_udbg_console(void)
 {
+       early_console_initialized = 1;
        register_console(&udbg_console);
 }
 
index a14ab87df49114dbc9d02566b5014d4e91d0b939..c2157c9c3acbfc585f1cf3a729a28be861564259 100644 (file)
@@ -554,12 +554,12 @@ void __init do_init_bootmem(void)
         * present.
         */
        for (i=0; i < lmb.memory.cnt; i++)
-               free_bootmem(lmb_start_pfn(&lmb.memory, i),
+               free_bootmem(lmb.memory.region[i].base,
                             lmb_size_bytes(&lmb.memory, i));
 
        /* reserve the sections we're already using */
        for (i=0; i < lmb.reserved.cnt; i++)
-               reserve_bootmem(lmb_start_pfn(&lmb.reserved, i),
+               reserve_bootmem(lmb.reserved.region[i].base,
                                lmb_size_bytes(&lmb.reserved, i));
 
        for (i=0; i < lmb.memory.cnt; i++)
index 4ada15111af0849fafd69769d31d189942ab43c1..ad1017da8656c350c5b6390aa25e74d1ac7e4b0d 100644 (file)
@@ -134,7 +134,8 @@ static void rpadlpar_claim_one_bus(struct pci_bus *b)
 static int pci_add_secondary_bus(struct device_node *dn,
                struct pci_dev *bridge_dev)
 {
-       struct pci_controller *hose = dn->phb;
+       struct pci_dn *pdn = dn->data;
+       struct pci_controller *hose = pdn->phb;
        struct pci_bus *child;
        u8 sec_busno;
 
@@ -159,7 +160,7 @@ static int pci_add_secondary_bus(struct device_node *dn,
        if (hose->last_busno < child->number)
                hose->last_busno = child->number;
 
-       dn->bussubno = child->number;
+       pdn->bussubno = child->number;
 
        /* ioremap() for child bus, which may or may not succeed */
        remap_bus_range(child);
@@ -183,11 +184,12 @@ static struct pci_dev *dlpar_find_new_dev(struct pci_bus *parent,
 
 static struct pci_dev *dlpar_pci_add_bus(struct device_node *dn)
 {
-       struct pci_controller *hose = dn->phb;
+       struct pci_dn *pdn = dn->data;
+       struct pci_controller *hose = pdn->phb;
        struct pci_dev *dev = NULL;
 
        /* Scan phb bus for EADS device, adding new one to bus->devices */
-       if (!pci_scan_single_device(hose->bus, dn->devfn)) {
+       if (!pci_scan_single_device(hose->bus, pdn->devfn)) {
                printk(KERN_ERR "%s: found no device on bus\n", __FUNCTION__);
                return NULL;
        }
@@ -269,6 +271,7 @@ static int dlpar_remove_root_bus(struct pci_controller *phb)
 static int dlpar_remove_phb(char *drc_name, struct device_node *dn)
 {
        struct slot *slot;
+       struct pci_dn *pdn;
        int rc = 0;
 
        if (!rpaphp_find_pci_bus(dn))
@@ -285,12 +288,13 @@ static int dlpar_remove_phb(char *drc_name, struct device_node *dn)
                }
        }
 
-       BUG_ON(!dn->phb);
-       rc = dlpar_remove_root_bus(dn->phb);
+       pdn = dn->data;
+       BUG_ON(!pdn || !pdn->phb);
+       rc = dlpar_remove_root_bus(pdn->phb);
        if (rc < 0)
                return rc;
 
-       dn->phb = NULL;
+       pdn->phb = NULL;
 
        return 0;
 }
@@ -299,7 +303,7 @@ static int dlpar_add_phb(char *drc_name, struct device_node *dn)
 {
        struct pci_controller *phb;
 
-       if (dn->phb) {
+       if (PCI_DN(dn)->phb) {
                /* PHB already exists */
                return -EINVAL;
        }
index 17a0279ebcb9faf0e3b0c42229d145392aa4cd4c..49e4d10a6488ea79dadb4f4ee324b5ef361e0966 100644 (file)
@@ -51,10 +51,12 @@ static struct pci_bus *find_bus_among_children(struct pci_bus *bus,
 
 struct pci_bus *rpaphp_find_pci_bus(struct device_node *dn)
 {
-       if (!dn->phb || !dn->phb->bus)
+       struct pci_dn *pdn = dn->data;
+
+       if (!pdn  || !pdn->phb || !pdn->phb->bus)
                return NULL;
 
-       return find_bus_among_children(dn->phb->bus, dn);
+       return find_bus_among_children(pdn->phb->bus, dn);
 }
 EXPORT_SYMBOL_GPL(rpaphp_find_pci_bus);
 
@@ -229,7 +231,7 @@ rpaphp_pci_config_slot(struct pci_bus *bus)
        if (!dn || !dn->child)
                return NULL;
 
-       slotno = PCI_SLOT(dn->child->devfn);
+       slotno = PCI_SLOT(PCI_DN(dn->child)->devfn);
 
        /* pci_scan_slot should find all children */
        num = pci_scan_slot(bus, PCI_DEVFN(slotno, 0));
index 42a6591e863f8af3c3d52ead6f4d3e94f1efe801..611922c0b22fbb8e4906be82b85c446c5351a1a4 100644 (file)
@@ -363,7 +363,7 @@ static void __init offb_init_nodriver(struct device_node *dp)
                address = (u_long) dp->addrs[i].address;
 
 #ifdef CONFIG_PPC64
-               address += dp->phb->pci_mem_offset;
+               address += ((struct pci_dn *)dp->data)->phb->pci_mem_offset;
 #endif
 
                /* kludge for valkyrie */
index 862708a749b0fb1383c1d83551fc09ae26e5a2cd..b70d6e53b303519a7e22ae6eb43e28be6dbd2f4b 100644 (file)
@@ -1,10 +1,10 @@
+#ifndef _ASM_POWERPC_8253PIT_H
+#define _ASM_POWERPC_8253PIT_H
+
 /*
  * 8253/8254 Programmable Interval Timer
  */
 
-#ifndef _8253PIT_H
-#define _8253PIT_H
-
 #define PIT_TICK_RATE  1193182UL
 
-#endif
+#endif /* _ASM_POWERPC_8253PIT_H */
index ca9e423307f4c881f177260b83b390cebb61a1ff..885b4631a6cf047560c40a5be44c8fc173cbd606 100644 (file)
@@ -1,10 +1,8 @@
-#ifndef AGP_H
-#define AGP_H 1
+#ifndef _ASM_POWERPC_AGP_H
+#define _ASM_POWERPC_AGP_H
 
 #include <asm/io.h>
 
-/* nothing much needed here */
-
 #define map_page_into_agp(page)
 #define unmap_page_from_agp(page)
 #define flush_agp_mappings()
@@ -20,4 +18,4 @@
 #define free_gatt_pages(table, order)  \
        free_pages((unsigned long)(table), (order))
 
-#endif
+#endif /* _ASM_POWERPC_AGP_H */
index 310187d0e33ac21303e629b74917dec3d3ddcbeb..42fdb73e3068557061afa3064d0fa5e049e7615f 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_BUGS_H
-#define _POWERPC_BUGS_H
+#ifndef _ASM_POWERPC_BUGS_H
+#define _ASM_POWERPC_BUGS_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -13,6 +13,6 @@
  * architecture-dependent bugs.
  */
 
-extern void check_bugs(void);
+static inline void check_bugs(void) { }
 
-#endif /* _POWERPC_BUGS_H */
+#endif /* _ASM_POWERPC_BUGS_H */
index 19f20bd41ae6184e4851fbf638f05c25de19a612..8c145fd17d8678afee558d61327175d25a292bf1 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _PPC_ERRNO_H
-#define _PPC_ERRNO_H
+#ifndef _ASM_POWERPC_ERRNO_H
+#define _ASM_POWERPC_ERRNO_H
 
 #include <asm-generic/errno.h>
 
@@ -8,4 +8,4 @@
 
 #define _LAST_ERRNO    516
 
-#endif
+#endif /* _ASM_POWERPC_ERRNO_H */
index 93c6acfdd0fdfc868a4cd49f56648559dd720053..8eb99848c40247b3d86a9012b3e13de9fdff652e 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _PPC_IOCTL_H
-#define _PPC_IOCTL_H
+#ifndef _ASM_POWERPC_IOCTL_H
+#define _ASM_POWERPC_IOCTL_H
 
 
 /*
@@ -66,4 +66,4 @@ extern unsigned int __invalid_size_argument_for_IOC;
 #define IOCSIZE_MASK   (_IOC_SIZEMASK << _IOC_SIZESHIFT)
 #define IOCSIZE_SHIFT  (_IOC_SIZESHIFT)
 
-#endif
+#endif /* _ASM_POWERPC_IOCTL_H */
index f5b7f2b055e77753a65edbdda0832cc23bc4e530..5b94ff489b8b42c4d8bded2b088e1c62438d0d6b 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ASM_PPC_IOCTLS_H
-#define _ASM_PPC_IOCTLS_H
+#ifndef _ASM_POWERPC_IOCTLS_H
+#define _ASM_POWERPC_IOCTLS_H
 
 #include <asm/ioctl.h>
 
 #define TIOCMIWAIT     0x545C  /* wait for a change on serial input line(s) */
 #define TIOCGICOUNT    0x545D  /* read serial port inline interrupt counts */
 
-#endif /* _ASM_PPC_IOCTLS_H */
+#endif /* _ASM_POWERPC_IOCTLS_H */
index 291c2d01c44f29dad20f7623783b8bad362eaddf..e1c4ac1cc4bab0c4260e31043a78a5ee03dbff4b 100644 (file)
@@ -1,6 +1,6 @@
-#ifndef __ASM_LINKAGE_H
-#define __ASM_LINKAGE_H
+#ifndef _ASM_POWERPC_LINKAGE_H
+#define _ASM_POWERPC_LINKAGE_H
 
 /* Nothing to see here... */
 
-#endif
+#endif /* _ASM_POWERPC_LINKAGE_H */
index a5619a2a1393b3c532f2f4b4199eb5556523b33f..f2741c8b59a1de0ed8bba2c1d14ca4b1d46d2d82 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_MC146818RTC_H
-#define _POWERPC_MC146818RTC_H
+#ifndef _ASM_POWERPC_MC146818RTC_H
+#define _ASM_POWERPC_MC146818RTC_H
 
 /*
  * Machine dependent access functions for RTC registers.
@@ -33,4 +33,4 @@ outb_p((val),RTC_PORT(1)); \
 })
 
 #endif /* __KERNEL__ */
-#endif /* _POWERPC_MC146818RTC_H */
+#endif /* _ASM_POWERPC_MC146818RTC_H */
index f2d55988d749db110f974266f624d6b89bf447e3..f5e5342fcac52f94761089e9b4c12f0aebb23b96 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_MMAN_H
-#define _POWERPC_MMAN_H
+#ifndef _ASM_POWERPC_MMAN_H
+#define _ASM_POWERPC_MMAN_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -49,4 +49,4 @@
 #define MAP_ANON       MAP_ANONYMOUS
 #define MAP_FILE       0
 
-#endif /* _POWERPC_MMAN_H */
+#endif /* _ASM_POWERPC_MMAN_H */
index 4438f4fd65246c108a0a6f58d235dcc5c49dab9c..7ecd05e0305196d3e4b387ec3a56d5f2bfc1519b 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_MODULE_H
-#define _POWERPC_MODULE_H
+#ifndef _ASM_POWERPC_MODULE_H
+#define _ASM_POWERPC_MODULE_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -74,4 +74,4 @@ struct exception_table_entry;
 void sort_ex_table(struct exception_table_entry *start,
                   struct exception_table_entry *finish);
 
-#endif /* _POWERPC_MODULE_H */
+#endif /* _ASM_POWERPC_MODULE_H */
similarity index 64%
rename from include/asm-ppc/msgbuf.h
rename to include/asm-powerpc/msgbuf.h
index 1053452a9376206902a599a99829d1550239a6b7..dd76743c7537428cdac3969cafe592a68d49b929 100644 (file)
@@ -1,17 +1,25 @@
-#ifndef _PPC_MSGBUF_H
-#define _PPC_MSGBUF_H
+#ifndef _ASM_POWERPC_MSGBUF_H
+#define _ASM_POWERPC_MSGBUF_H
 
 /*
- * The msqid64_ds structure for the PPC architecture.
+ * The msqid64_ds structure for the PowerPC architecture.
+ * Note extra padding because this structure is passed back and forth
+ * between kernel and user space.
  */
 
 struct msqid64_ds {
        struct ipc64_perm msg_perm;
+#ifndef __powerpc64__
        unsigned int    __unused1;
+#endif
        __kernel_time_t msg_stime;      /* last msgsnd time */
+#ifndef __powerpc64__
        unsigned int    __unused2;
+#endif
        __kernel_time_t msg_rtime;      /* last msgrcv time */
+#ifndef __powerpc64__
        unsigned int    __unused3;
+#endif
        __kernel_time_t msg_ctime;      /* last change time */
        unsigned long  msg_cbytes;      /* current number of bytes on queue */
        unsigned long  msg_qnum;        /* number of messages in queue */
@@ -22,4 +30,4 @@ struct msqid64_ds {
        unsigned long  __unused5;
 };
 
-#endif /* _PPC_MSGBUF_H */
+#endif /* _ASM_POWERPC_MSGBUF_H */
index 29c9ec832133fd518c492d21a2902fe9c7c67d10..657443474a6a15d924b4e983b16acf24a0de6cf6 100644 (file)
@@ -1,14 +1,14 @@
+#ifndef _ASM_POWERPC_NAMEI_H
+#define _ASM_POWERPC_NAMEI_H
+
+#ifdef __KERNEL__
+
 /*
- * include/asm-ppc/namei.h
  * Adapted from include/asm-alpha/namei.h
  *
  * Included from fs/namei.c
  */
 
-#ifdef __KERNEL__
-#ifndef __PPC_NAMEI_H
-#define __PPC_NAMEI_H
-
 /* This dummy routine maybe changed to something useful
  * for /usr/gnemul/ emulation stuff.
  * Look at asm-sparc/namei.h for details.
@@ -16,5 +16,5 @@
 
 #define __emul_prefix() NULL
 
-#endif /* __PPC_NAMEI_H */
-#endif /* __KERNEL__ */
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_NAMEI_H */
similarity index 70%
rename from include/asm-ppc/param.h
rename to include/asm-powerpc/param.h
index 6198b1657a455fd30b4ebfe31b6b3382db77953b..bdc724f70884609e85de0f7406c6e779a16c5ae5 100644 (file)
@@ -1,10 +1,10 @@
-#ifndef _ASM_PPC_PARAM_H
-#define _ASM_PPC_PARAM_H
+#ifndef _ASM_POWERPC_PARAM_H
+#define _ASM_POWERPC_PARAM_H
 
 #include <linux/config.h>
 
 #ifdef __KERNEL__
-#define HZ             CONFIG_HZ       /* internal timer frequency */
+#define HZ             CONFIG_HZ       /* internal kernel timer frequency */
 #define USER_HZ                100             /* for user interfaces in "ticks" */
 #define CLOCKS_PER_SEC (USER_HZ)       /* frequency at which times() counts */
 #endif /* __KERNEL__ */
@@ -21,4 +21,4 @@
 
 #define MAXHOSTNAMELEN 64      /* max length of hostname */
 
-#endif
+#endif /* _ASM_POWERPC_PARAM_H */
index be5024913c62c4ced082b86089c6cc770560fe3e..edd2054da86b49d3b83503b7aed2962ab3f416af 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __PPC_POLL_H
-#define __PPC_POLL_H
+#ifndef _ASM_POWERPC_POLL_H
+#define _ASM_POWERPC_POLL_H
 
 #define POLLIN         0x0001
 #define POLLPRI                0x0002
@@ -20,4 +20,4 @@ struct pollfd {
        short revents;
 };
 
-#endif
+#endif /* _ASM_POWERPC_POLL_H */
index c98fc18fe805f491c14808df0baba1fe2954bcf8..99a41938ae3db94fe42c31e48d6c42b5c2b00d70 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SEMBUF_H
-#define _POWERPC_SEMBUF_H
+#ifndef _ASM_POWERPC_SEMBUF_H
+#define _ASM_POWERPC_SEMBUF_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -33,4 +33,4 @@ struct semid64_ds {
        unsigned long   __unused4;
 };
 
-#endif /* _POWERPC_SEMBUF_H */
+#endif /* _ASM_POWERPC_SEMBUF_H */
diff --git a/include/asm-powerpc/setup.h b/include/asm-powerpc/setup.h
new file mode 100644 (file)
index 0000000..3d9740a
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _ASM_POWERPC_SETUP_H
+#define _ASM_POWERPC_SETUP_H
+
+#ifdef __KERNEL__
+
+#define COMMAND_LINE_SIZE      512
+
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_SETUP_H */
index 29632db3b1788634528fee93eacf06234671a067..8efa39698b6c8aa88a509c75d2110749164e7989 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SHMBUF_H
-#define _POWERPC_SHMBUF_H
+#ifndef _ASM_POWERPC_SHMBUF_H
+#define _ASM_POWERPC_SHMBUF_H
 
 /*
  * This program is free software; you can redistribute it and/or
 
 struct shmid64_ds {
        struct ipc64_perm       shm_perm;       /* operation perms */
-#ifndef __power64__
+#ifndef __powerpc64__
        unsigned long           __unused1;
 #endif
        __kernel_time_t         shm_atime;      /* last attach time */
-#ifndef __power64__
+#ifndef __powerpc64__
        unsigned long           __unused2;
 #endif
        __kernel_time_t         shm_dtime;      /* last detach time */
-#ifndef __power64__
+#ifndef __powerpc64__
        unsigned long           __unused3;
 #endif
        __kernel_time_t         shm_ctime;      /* last change time */
-#ifndef __power64__
+#ifndef __powerpc64__
        unsigned long           __unused4;
 #endif
        size_t                  shm_segsz;      /* size of segment (bytes) */
@@ -56,4 +56,4 @@ struct shminfo64 {
        unsigned long   __unused4;
 };
 
-#endif /* _POWERPC_SHMBUF_H */
+#endif /* _ASM_POWERPC_SHMBUF_H */
index d6250602ae642d7ec3d61329df63257351474a77..5cda42a6d39ed411a801d7fe231216cbd1c578aa 100644 (file)
@@ -1,6 +1,6 @@
-#ifndef _PPC_SHMPARAM_H
-#define _PPC_SHMPARAM_H
+#ifndef _ASM_POWERPC_SHMPARAM_H
+#define _ASM_POWERPC_SHMPARAM_H
 
 #define        SHMLBA PAGE_SIZE                 /* attach addr a multiple of this */
 
-#endif /* _PPC_SHMPARAM_H */
+#endif /* _ASM_POWERPC_SHMPARAM_H */
index ae70b8010b199da3ea9cabde0ad0e1283343ff28..538ea8ef509b99f4d2ec3350d64e12bd27450332 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SIGINFO_H
-#define _POWERPC_SIGINFO_H
+#ifndef _ASM_POWERPC_SIGINFO_H
+#define _ASM_POWERPC_SIGINFO_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -15,4 +15,4 @@
 
 #include <asm-generic/siginfo.h>
 
-#endif /* _POWERPC_SIGINFO_H */
+#endif /* _ASM_POWERPC_SIGINFO_H */
index 51a0cf5ee9f0e054b02b5f7dc36fda5c26ae16a2..e4b8177d4acc48313dbb905bbf59400d659f0253 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SOCKET_H
-#define _POWERPC_SOCKET_H
+#ifndef _ASM_POWERPC_SOCKET_H
+#define _ASM_POWERPC_SOCKET_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -56,4 +56,4 @@
 
 #define SO_PEERSEC             31
 
-#endif /* _POWERPC_SOCKET_H */
+#endif /* _ASM_POWERPC_SOCKET_H */
index ef7ff664167e894e8a8851c4f5e383fc44ca7189..590078d8ed28da51c46bcfbfbd03fc87b2962b3a 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_SOCKIOS_H
-#define _POWERPC_SOCKIOS_H
+#ifndef _ASM_POWERPC_SOCKIOS_H
+#define _ASM_POWERPC_SOCKIOS_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -16,4 +16,4 @@
 #define SIOCATMARK     0x8905
 #define SIOCGSTAMP     0x8906          /* Get stamp */
 
-#endif /* _POWERPC_SOCKIOS_H */
+#endif /* _ASM_POWERPC_SOCKIOS_H */
index 225575997392a99db649a8018f58297450e35cfa..8606a696c088187ae65457c905f5a492b4ad2ac1 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _PPC_STRING_H_
-#define _PPC_STRING_H_
+#ifndef _ASM_POWERPC_STRING_H
+#define _ASM_POWERPC_STRING_H
 
 #ifdef __KERNEL__
 
@@ -29,4 +29,4 @@ extern void * memchr(const void *,int,__kernel_size_t);
 
 #endif /* __KERNEL__ */
 
-#endif
+#endif /* _ASM_POWERPC_STRING_H */
index 2c5bf85a8c3c2c30a8a36ea8b0ccba15e0b26d03..ebf6055481dcb0f4547ecd5c9f1d6e7c1afea896 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_TERMBITS_H
-#define _POWERPC_TERMBITS_H
+#ifndef _ASM_POWERPC_TERMBITS_H
+#define _ASM_POWERPC_TERMBITS_H
 
 /*
  * This program is free software; you can redistribute it and/or
@@ -188,4 +188,4 @@ struct termios {
 #define        TCSADRAIN       1
 #define        TCSAFLUSH       2
 
-#endif /* _POWERPC_TERMBITS_H */
+#endif /* _ASM_POWERPC_TERMBITS_H */
index 237533bb0e9f1a3e640c4906d8b350deafd315b9..c5b8e5358f830c337d026ea3f1c68bc345a35178 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _POWERPC_TERMIOS_H
-#define _POWERPC_TERMIOS_H
+#ifndef _ASM_POWERPC_TERMIOS_H
+#define _ASM_POWERPC_TERMIOS_H
 
 /*
  * Liberally adapted from alpha/termios.h.  In particular, the c_cc[]
@@ -233,4 +233,4 @@ struct termio {
 
 #endif /* __KERNEL__ */
 
-#endif /* _POWERPC_TERMIOS_H */
+#endif /* _ASM_POWERPC_TERMIOS_H */
similarity index 53%
rename from include/asm-ppc/timex.h
rename to include/asm-powerpc/timex.h
index cffc8712077c4068c648bb8babe58356050bf18f..51c5b316be55e7ae7125e3c6587ea258414d0666 100644 (file)
@@ -1,11 +1,11 @@
+#ifndef _ASM_POWERPC_TIMEX_H
+#define _ASM_POWERPC_TIMEX_H
+
+#ifdef __KERNEL__
+
 /*
- * include/asm-ppc/timex.h
- *
- * ppc architecture timex specifications
+ * PowerPC architecture timex specifications
  */
-#ifdef __KERNEL__
-#ifndef _ASMppc_TIMEX_H
-#define _ASMppc_TIMEX_H
 
 #include <linux/config.h>
 #include <asm/cputable.h>
 
 typedef unsigned long cycles_t;
 
-/*
- * For the "cycle" counter we use the timebase lower half.
- * Currently only used on SMP.
- */
-
 static inline cycles_t get_cycles(void)
 {
-       cycles_t ret = 0;
+       cycles_t ret;
+
+#ifdef __powerpc64__
+
+       __asm__ __volatile__("mftb %0" : "=r" (ret) : );
+
+#else
+       /*
+        * For the "cycle" counter we use the timebase lower half.
+        * Currently only used on SMP.
+        */
+
+       ret = 0;
 
        __asm__ __volatile__(
                "98:    mftb %0\n"
@@ -33,8 +40,10 @@ static inline cycles_t get_cycles(void)
                "       .long 99b\n"
                ".previous"
                : "=r" (ret) : "i" (CPU_FTR_601));
+#endif
+
        return ret;
 }
 
-#endif
-#endif /* __KERNEL__ */
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_TIMEX_H */
similarity index 92%
rename from include/asm-ppc64/topology.h
rename to include/asm-powerpc/topology.h
index 1e9b1907323069f2acc3e446f32a43fcd909eb4a..2512e3836bf4de90ba130054b7a889920ab5031b 100644 (file)
@@ -1,11 +1,12 @@
-#ifndef _ASM_PPC64_TOPOLOGY_H
-#define _ASM_PPC64_TOPOLOGY_H
+#ifndef _ASM_POWERPC_TOPOLOGY_H
+#define _ASM_POWERPC_TOPOLOGY_H
 
 #include <linux/config.h>
-#include <asm/mmzone.h>
 
 #ifdef CONFIG_NUMA
 
+#include <asm/mmzone.h>
+
 static inline int cpu_to_node(int cpu)
 {
        int node;
@@ -66,4 +67,4 @@ static inline int node_to_first_cpu(int node)
 
 #endif /* CONFIG_NUMA */
 
-#endif /* _ASM_PPC64_TOPOLOGY_H */
+#endif /* _ASM_POWERPC_TOPOLOGY_H */
index 45520d9b85d1184a84bd830af980e1b4eed5c02b..6c95dfa2652f332cbdcf73b04565d7c3e546cad0 100644 (file)
@@ -1,6 +1,7 @@
+#ifndef _ASM_POWERPC_UNALIGNED_H
+#define _ASM_POWERPC_UNALIGNED_H
+
 #ifdef __KERNEL__
-#ifndef __PPC_UNALIGNED_H
-#define __PPC_UNALIGNED_H
 
 /*
  * The PowerPC can do unaligned accesses itself in big endian mode.
@@ -14,5 +15,5 @@
 
 #define put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
 
-#endif
-#endif /* __KERNEL__ */
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_UNALIGNED_H */
similarity index 92%
rename from include/asm-ppc/user.h
rename to include/asm-powerpc/user.h
index d662b215137098acc262a29dd32d4827839f6480..e59ade4b3dfb1fdf3d1e10a9ea49b8d79fa7db8d 100644 (file)
@@ -1,13 +1,14 @@
-#ifdef __KERNEL__
-#ifndef _PPC_USER_H
-#define _PPC_USER_H
+#ifndef _ASM_POWERPC_USER_H
+#define _ASM_POWERPC_USER_H
 
-/* Adapted from <asm-alpha/user.h> */
+#ifdef __KERNEL__
 
-#include <linux/ptrace.h>
+#include <asm/ptrace.h>
 #include <asm/page.h>
 
 /*
+ * Adapted from <asm-alpha/user.h>
+ *
  * Core file format: The core file is written in such a way that gdb
  * can understand it and provide useful information to the user (under
  * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
@@ -50,5 +51,5 @@ struct user {
 #define HOST_DATA_START_ADDR   (u.start_data)
 #define HOST_STACK_END_ADDR    (u.start_stack + u.u_ssize * NBPG)
 
-#endif /* _PPC_USER_H */
-#endif /* __KERNEL__ */
+#endif /* __KERNEL__ */
+#endif /* _ASM_POWERPC_USER_H */
diff --git a/include/asm-ppc/setup.h b/include/asm-ppc/setup.h
deleted file mode 100644 (file)
index d2d19ee..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifdef __KERNEL__
-#ifndef _PPC_SETUP_H
-#define _PPC_SETUP_H
-
-#define m68k_num_memory num_memory
-#define m68k_memory memory
-
-#include <asm-m68k/setup.h>
-/* We have a bigger command line buffer. */
-#undef COMMAND_LINE_SIZE
-#define COMMAND_LINE_SIZE      512
-
-#endif /* _PPC_SETUP_H */
-#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/topology.h b/include/asm-ppc/topology.h
deleted file mode 100644 (file)
index 6a029bb..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _ASM_PPC_TOPOLOGY_H
-#define _ASM_PPC_TOPOLOGY_H
-
-#include <asm-generic/topology.h>
-
-#endif /* _ASM_PPC_TOPOLOGY_H */
diff --git a/include/asm-ppc64/msgbuf.h b/include/asm-ppc64/msgbuf.h
deleted file mode 100644 (file)
index 31c1cbf..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef _PPC64_MSGBUF_H
-#define _PPC64_MSGBUF_H
-
-/* 
- * The msqid64_ds structure for the PPC architecture.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-struct msqid64_ds {
-       struct ipc64_perm msg_perm;
-       __kernel_time_t msg_stime;      /* last msgsnd time */
-       __kernel_time_t msg_rtime;      /* last msgrcv time */
-       __kernel_time_t msg_ctime;      /* last change time */
-       unsigned long  msg_cbytes;      /* current number of bytes on queue */
-       unsigned long  msg_qnum;        /* number of messages in queue */
-       unsigned long  msg_qbytes;      /* max number of bytes on queue */
-       __kernel_pid_t msg_lspid;       /* pid of last msgsnd */
-       __kernel_pid_t msg_lrpid;       /* last receive pid */
-       unsigned long  __unused1;
-       unsigned long  __unused2;
-};
-
-#endif /* _PPC64_MSGBUF_H */
diff --git a/include/asm-ppc64/param.h b/include/asm-ppc64/param.h
deleted file mode 100644 (file)
index 76c212d..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _ASM_PPC64_PARAM_H
-#define _ASM_PPC64_PARAM_H
-
-#include <linux/config.h>
-
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#ifdef __KERNEL__
-# define HZ            CONFIG_HZ       /* Internal kernel timer frequency */
-# define USER_HZ       100             /* .. some user interfaces are in "ticks" */
-# define CLOCKS_PER_SEC        (USER_HZ)       /* like times() */
-#endif
-
-#ifndef HZ
-#define HZ 100
-#endif
-
-#define EXEC_PAGESIZE  4096
-
-#ifndef NOGROUP
-#define NOGROUP                (-1)
-#endif
-
-#define MAXHOSTNAMELEN 64      /* max length of hostname */
-
-#endif /* _ASM_PPC64_PARAM_H */
index c4f9023ea5ed8a64e0a6f15f2c8c441f49312929..6b4a5b1f695e916cf72b38f29ec44f8ed1e132ec 100644 (file)
@@ -48,19 +48,52 @@ struct pci_controller {
        unsigned long dma_window_size;
 };
 
+/*
+ * PCI stuff, for nodes representing PCI devices, pointed to
+ * by device_node->data.
+ */
+struct pci_controller;
+struct iommu_table;
+
+struct pci_dn {
+       int     busno;                  /* for pci devices */
+       int     bussubno;               /* for pci devices */
+       int     devfn;                  /* for pci devices */
+       int     eeh_mode;               /* See eeh.h for possible EEH_MODEs */
+       int     eeh_config_addr;
+       int     eeh_capable;            /* from firmware */
+       int     eeh_check_count;        /* # times driver ignored error */
+       int     eeh_freeze_count;       /* # times this device froze up. */
+       int     eeh_is_bridge;          /* device is pci-to-pci bridge */
+
+       int     pci_ext_config_space;   /* for pci devices */
+       struct  pci_controller *phb;    /* for pci devices */
+       struct  iommu_table *iommu_table;       /* for phb's or bridges */
+       struct  pci_dev *pcidev;        /* back-pointer to the pci device */
+       struct  device_node *node;      /* back-pointer to the device_node */
+       u32     config_space[16];       /* saved PCI config space */
+};
+
+/* Get the pointer to a device_node's pci_dn */
+#define PCI_DN(dn)     ((struct pci_dn *) (dn)->data)
+
 struct device_node *fetch_dev_dn(struct pci_dev *dev);
 
-/* Get a device_node from a pci_dev.  This code must be fast except in the case
- * where the sysdata is incorrect and needs to be fixed up (hopefully just once)
+/* Get a device_node from a pci_dev.  This code must be fast except
+ * in the case where the sysdata is incorrect and needs to be fixed
+ * up (this will only happen once).
+ * In this case the sysdata will have been inherited from a PCI host
+ * bridge or a PCI-PCI bridge further up the tree, so it will point
+ * to a valid struct pci_dn, just not the one we want.
  */
 static inline struct device_node *pci_device_to_OF_node(struct pci_dev *dev)
 {
        struct device_node *dn = dev->sysdata;
+       struct pci_dn *pdn = dn->data;
 
-       if (dn->devfn == dev->devfn && dn->busno == dev->bus->number)
+       if (pdn && pdn->devfn == dev->devfn && pdn->busno == dev->bus->number)
                return dn;      /* fast path.  sysdata is good */
-       else
-               return fetch_dev_dn(dev);
+       return fetch_dev_dn(dev);
 }
 
 static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
@@ -83,7 +116,7 @@ static inline struct pci_controller *pci_bus_to_host(struct pci_bus *bus)
        struct device_node *busdn = bus->sysdata;
 
        BUG_ON(busdn == NULL);
-       return busdn->phb;
+       return PCI_DN(busdn)->phb;
 }
 
 #endif
index dc5330b3950963266887091034cb82b53b7e1135..c02ec1d6b909725b89acdb31c3b6eee99e015116 100644 (file)
@@ -116,14 +116,6 @@ struct property {
        struct property *next;
 };
 
-/* NOTE: the device_node contains PCI specific info for pci devices.
- * This perhaps could be hung off the device_node with another struct,
- * but for now it is directly in the node.  The phb ptr is a good
- * indication of a real PCI node.  Other nodes leave these fields zeroed.
- */
-struct pci_controller;
-struct iommu_table;
-
 struct device_node {
        char    *name;
        char    *type;
@@ -135,16 +127,6 @@ struct device_node {
        struct  interrupt_info *intrs;
        char    *full_name;
 
-       /* PCI stuff probably doesn't belong here */
-       int     busno;                  /* for pci devices */
-       int     bussubno;               /* for pci devices */
-       int     devfn;                  /* for pci devices */
-       int     eeh_mode;               /* See eeh.h for possible EEH_MODEs */
-       int     eeh_config_addr;
-       int     pci_ext_config_space;   /* for pci devices */
-       struct  pci_controller *phb;    /* for pci devices */
-       struct  iommu_table *iommu_table;       /* for phb's or bridges */
-
        struct  property *properties;
        struct  device_node *parent;
        struct  device_node *child;
@@ -154,6 +136,7 @@ struct device_node {
        struct  proc_dir_entry *pde;    /* this node's proc directory */
        struct  kref kref;
        unsigned long _flags;
+       void    *data;
 };
 
 extern struct device_node *of_chosen;
diff --git a/include/asm-ppc64/segment.h b/include/asm-ppc64/segment.h
deleted file mode 100644 (file)
index d80fb68..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __PPC64_SEGMENT_H
-#define __PPC64_SEGMENT_H
-
-/* Only here because we have some old header files that expect it.. */
-
-#endif /* __PPC64_SEGMENT_H */
diff --git a/include/asm-ppc64/setup.h b/include/asm-ppc64/setup.h
deleted file mode 100644 (file)
index b257b83..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _PPC_SETUP_H
-#define _PPC_SETUP_H
-
-#define COMMAND_LINE_SIZE 512
-
-#endif /* _PPC_SETUP_H */
diff --git a/include/asm-ppc64/timex.h b/include/asm-ppc64/timex.h
deleted file mode 100644 (file)
index 8db4da4..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * linux/include/asm-ppc/timex.h
- *
- * PPC64 architecture timex specifications
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-#ifndef _ASMPPC64_TIMEX_H
-#define _ASMPPC64_TIMEX_H
-
-#define CLOCK_TICK_RATE        1193180 /* Underlying HZ */
-
-typedef unsigned long cycles_t;
-
-static inline cycles_t get_cycles(void)
-{
-       cycles_t ret;
-
-       __asm__ __volatile__("mftb %0" : "=r" (ret) : );
-       return ret;
-}
-
-#endif
diff --git a/include/asm-ppc64/user.h b/include/asm-ppc64/user.h
deleted file mode 100644 (file)
index d7d6554..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _PPC_USER_H
-#define _PPC_USER_H
-
-/* Adapted from <asm-alpha/user.h> 
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#include <asm/ptrace.h>
-#include <asm/page.h>
-
-/*
- * Core file format: The core file is written in such a way that gdb
- * can understand it and provide useful information to the user (under
- * linux we use the `trad-core' bfd, NOT the osf-core).  The file contents
- * are as follows:
- *
- *  upage: 1 page consisting of a user struct that tells gdb
- *     what is present in the file.  Directly after this is a
- *     copy of the task_struct, which is currently not used by gdb,
- *     but it may come in handy at some point.  All of the registers
- *     are stored as part of the upage.  The upage should always be
- *     only one page long.
- *  data: The data segment follows next.  We use current->end_text to
- *     current->brk to pick up all of the user variables, plus any memory
- *     that may have been sbrk'ed.  No attempt is made to determine if a
- *     page is demand-zero or if a page is totally unused, we just cover
- *     the entire range.  All of the addresses are rounded in such a way
- *     that an integral number of pages is written.
- *  stack: We need the stack information in order to get a meaningful
- *     backtrace.  We need to write the data from usp to
- *     current->start_stack, so we round each of these in order to be able
- *     to write an integer number of pages.
- */
-struct user {
-       struct pt_regs  regs;                   /* entire machine state */
-       size_t          u_tsize;                /* text size (pages) */
-       size_t          u_dsize;                /* data size (pages) */
-       size_t          u_ssize;                /* stack size (pages) */
-       unsigned long   start_code;             /* text starting address */
-       unsigned long   start_data;             /* data starting address */
-       unsigned long   start_stack;            /* stack starting address */
-       long int        signal;                 /* signal causing core dump */
-       struct regs *   u_ar0;                  /* help gdb find registers */
-       unsigned long   magic;                  /* identifies a core file */
-       char            u_comm[32];             /* user command name */
-};
-
-#define NBPG                   PAGE_SIZE
-#define UPAGES                 1
-#define HOST_TEXT_START_ADDR   (u.start_code)
-#define HOST_DATA_START_ADDR   (u.start_data)
-#define HOST_STACK_END_ADDR    (u.start_stack + u.u_ssize * NBPG)
-
-#endif /* _PPC_USER_H */