summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDave Jones <davej@tetrachloride.(none)>2003-01-08 17:45:50 -0100
committerDave Jones <davej@tetrachloride.(none)>2003-01-08 17:45:50 -0100
commit94dcf54f0bcc4e7458112d0a040070677f8edcac (patch)
tree4fd30c0bcfbaa65b878da4d65ec713fdba17d9c0 /include
parentd72c8aafbe183a8745419b3e2221d9513c1df3f6 (diff)
parent6f2f7e214998ba020ea4c30688a43ebd1ddf9cbd (diff)
Merge tetrachloride.(none):/mnt/stuff/kernel/2.5/bk-linus
into tetrachloride.(none):/mnt/stuff/kernel/2.5/agpgart
Diffstat (limited to 'include')
-rw-r--r--include/asm-ppc/bitops.h8
-rw-r--r--include/asm-ppc/cache.h3
-rw-r--r--include/asm-ppc/ibm403.h9
-rw-r--r--include/asm-ppc/ibm405.h21
-rw-r--r--include/asm-ppc/ibm4xx.h88
-rw-r--r--include/asm-ppc/ibm_ocp_pci.h56
-rw-r--r--include/asm-ppc/io.h3
-rw-r--r--include/asm-ppc/nvram.h4
-rw-r--r--include/asm-ppc/ocp.h205
-rw-r--r--include/asm-ppc/ocp_ids.h103
-rw-r--r--include/asm-ppc/page.h2
-rw-r--r--include/asm-ppc/param.h2
-rw-r--r--[-rwxr-xr-x]include/asm-ppc/ppc405_dma.h0
-rw-r--r--include/asm-ppc/ppc4xx_pic.h9
-rw-r--r--include/asm-ppc/signal.h5
-rw-r--r--include/asm-ppc/socket.h2
-rw-r--r--include/asm-ppc/termios.h2
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/compat.h2
-rw-r--r--include/linux/fs.h13
-rw-r--r--include/linux/nfs_page.h5
-rw-r--r--include/linux/sunrpc/auth.h8
22 files changed, 459 insertions, 93 deletions
diff --git a/include/asm-ppc/bitops.h b/include/asm-ppc/bitops.h
index e65a7f854dfe..da32a543c856 100644
--- a/include/asm-ppc/bitops.h
+++ b/include/asm-ppc/bitops.h
@@ -236,8 +236,6 @@ static __inline__ int ffz(unsigned long x)
return __ilog2(x & -x);
}
-#ifdef __KERNEL__
-
static inline int __ffs(unsigned long x)
{
return __ilog2(x & -x);
@@ -274,8 +272,6 @@ static __inline__ int fls(unsigned int x)
#define hweight16(x) generic_hweight16(x)
#define hweight8(x) generic_hweight8(x)
-#endif /* __KERNEL__ */
-
/*
* Find the first bit set in a 140-bit bitmap.
* The first 100 bits are unlikely to be set.
@@ -395,8 +391,6 @@ found_middle:
}
-#ifdef __KERNEL__
-
#define ext2_set_bit(nr, addr) __test_and_set_bit((nr) ^ 0x18, (unsigned long *)(addr))
#define ext2_clear_bit(nr, addr) __test_and_clear_bit((nr) ^ 0x18, (unsigned long *)(addr))
@@ -460,7 +454,5 @@ found_middle:
#define minix_test_bit(nr,addr) ext2_test_bit(nr,addr)
#define minix_find_first_zero_bit(addr,size) ext2_find_first_zero_bit(addr,size)
-#endif /* __KERNEL__ */
-
#endif /* _PPC_BITOPS_H */
#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/cache.h b/include/asm-ppc/cache.h
index 1f19b8ccffe9..bdb462100ba1 100644
--- a/include/asm-ppc/cache.h
+++ b/include/asm-ppc/cache.h
@@ -39,12 +39,11 @@
__section__(".data.cacheline_aligned")))
#endif
-#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
+#ifndef __ASSEMBLY__
extern void clean_dcache_range(unsigned long start, unsigned long stop);
extern void flush_dcache_range(unsigned long start, unsigned long stop);
extern void invalidate_dcache_range(unsigned long start, unsigned long stop);
extern void flush_dcache_all(void);
-
#endif /* __ASSEMBLY__ */
/* prep registers for L2 */
diff --git a/include/asm-ppc/ibm403.h b/include/asm-ppc/ibm403.h
index 7845871bdc08..83515ab507c5 100644
--- a/include/asm-ppc/ibm403.h
+++ b/include/asm-ppc/ibm403.h
@@ -1,8 +1,8 @@
/*
* ibm403.h
*
- * This was dirived from the ibm4xx.h and all 403 specific definitions
- * where moved here.
+ * This was derived from the ibm4xx.h and all 403 specific definitions
+ * were moved here.
*
* Armin Kuster <akuster@mvista.com>
* Tom Rini <trini@mvista.com>
@@ -30,11 +30,6 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Version 1.0 Oct 10, 2001 - A. Kuster
- * Initial version - moved 403 specific out of ibm4xx.h
- * Version 1.1 Oct 25, 2001 - T. Rini
- * Lots of cleanups.
*/
diff --git a/include/asm-ppc/ibm405.h b/include/asm-ppc/ibm405.h
index 4e9b8ce52b2d..f12ae76a5e69 100644
--- a/include/asm-ppc/ibm405.h
+++ b/include/asm-ppc/ibm405.h
@@ -29,12 +29,6 @@
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Version 1.0 (02/01/17) - A. Kuster
- * Initial version - moved 405 specific out of the other core.h's
- *
- * Version 1.0 (02/08/02) - A. Kuster
- * removed DCRN_UIC1_BASE to NP405L & H
*/
#ifdef __KERNEL__
@@ -56,6 +50,11 @@
#define ET_BUSERR 4
#define ET_BUSTO 6
+/* Clock and power management shifts for emacs */
+#define IBM_CPM_EMMII 0 /* Shift value for MII */
+#define IBM_CPM_EMRX 1 /* Shift value for recv */
+#define IBM_CPM_EMTX 2 /* Shift value for MAC */
+
#ifdef DCRN_CHCR_BASE
#define DCRN_CHCR0 (DCRN_CHCR_BASE + 0x0) /* Chip Control Register 1 */
#define DCRN_CHCR1 (DCRN_CHCR_BASE + 0x1) /* Chip Control Register 2 */
@@ -234,16 +233,6 @@
#define DCRN_MALRCBS0(base) ((base) + 0x60) /* Channel Rx 0 Channel Buffer Size */
#define DCRN_MALRCBS1(base) ((base) + 0x61) /* Channel Rx 1 Channel Buffer Size */
-/* EMAC DCRN's */
-#define DCRN_MALRXCTP2R(base) ((base) + 0x42) /* Channel Rx 2 Channel Table Pointer */
-#define DCRN_MALRXCTP3R(base) ((base) + 0x43) /* Channel Rx 3 Channel Table Pointer */
-#define DCRN_MALTXCTP4R(base) ((base) + 0x24) /* Channel Tx 4 Channel Table Pointer */
-#define DCRN_MALTXCTP5R(base) ((base) + 0x25) /* Channel Tx 5 Channel Table Pointer */
-#define DCRN_MALTXCTP6R(base) ((base) + 0x26) /* Channel Tx 6 Channel Table Pointer */
-#define DCRN_MALTXCTP7R(base) ((base) + 0x27) /* Channel Tx 7 Channel Table Pointer */
-#define DCRN_MALRCBS2(base) ((base) + 0x62) /* Channel Rx 2 Channel Buffer Size */
-#define DCRN_MALRCBS3(base) ((base) + 0x63) /* Channel Rx 3 Channel Buffer Size */
-
/* DCRN_MALCR */
#define MALCR_MMSR 0x80000000 /* MAL Software reset */
#define MALCR_PLBP_1 0x00400000 /* MAL reqest priority: */
diff --git a/include/asm-ppc/ibm4xx.h b/include/asm-ppc/ibm4xx.h
index 1ea4086c187d..4884067dbcd9 100644
--- a/include/asm-ppc/ibm4xx.h
+++ b/include/asm-ppc/ibm4xx.h
@@ -16,14 +16,56 @@
#include <linux/config.h>
+#ifdef CONFIG_4xx
+
+#ifndef __ASSEMBLY__
+
+/* Device Control Registers */
+
+#define stringify(s) tostring(s)
+#define tostring(s) #s
+
+#define mfdcr(rn) mfdcr_or_dflt(rn, 0)
+
+#define mfdcr_or_dflt(rn,default_rval) \
+ ({unsigned int rval; \
+ if (rn == 0) \
+ rval = default_rval; \
+ else \
+ asm volatile("mfdcr %0," stringify(rn) : "=r" (rval)); \
+ rval;})
+
+#define mtdcr(rn, v) \
+do { \
+ if (rn != 0) \
+ asm volatile("mtdcr " stringify(rn) ",%0" : : "r" (v)); \
+} while (0)
+
+/* R/W of indirect DCRs make use of standard naming conventions for DCRs */
+
+#define mfdcri(base, reg) \
+({ \
+ mtdcr(base##_CFGADDR, base##_##reg); \
+ mfdcr(base##_CFGDATA); \
+})
+
+#define mtdcri(base, reg, data) \
+do { \
+ mtdcr(base##_CFGADDR, base##_##reg); \
+ mtdcr(base##_CFGDATA, data); \
+} while (0)
+#endif /* __ASSEMBLY__ */
+
+#endif /* CONFIG_4xx */
+
#ifdef CONFIG_40x
#if defined(CONFIG_ASH)
#include <platforms/4xx/ash.h>
#endif
-#if defined (CONFIG_CEDER)
-#include <platforms/4xx/ceder.h>
+#if defined (CONFIG_CEDAR)
+#include <platforms/4xx/cedar.h>
#endif
#if defined(CONFIG_CPCI405)
@@ -50,12 +92,26 @@
#include <platforms/4xx/walnut.h>
#endif
+#ifndef __ASSEMBLY__
+
+/*
+ * The "residual" board information structure the boot loader passes
+ * into the kernel.
+ */
+extern bd_t __res;
+
+void ppc4xx_setup_arch(void);
+void ppc4xx_map_io(void);
+void ppc4xx_init_IRQ(void);
+void ppc4xx_init(unsigned long r3, unsigned long r4, unsigned long r5,
+ unsigned long r6, unsigned long r7);
+#endif
+
#ifndef PPC4xx_MACHINE_NAME
#define PPC4xx_MACHINE_NAME "Unidentified 4xx class"
#endif
-
/* IO_BASE is for PCI I/O.
* ISA not supported, just here to resolve copilation.
*/
@@ -66,33 +122,7 @@
#define PCI_DRAM_OFFSET 0
#endif
-/*
- * The "residual" board information structure the boot loader passes
- * into the kernel.
- */
-#ifndef __ASSEMBLY__
-extern unsigned char __res[];
-
-/* Device Control Registers */
-
-#define stringify(s) tostring(s)
-#define tostring(s) #s
-#define mfdcr(rn) mfdcr_or_dflt(rn, 0)
-
-#define mfdcr_or_dflt(rn,default_rval) \
- ({unsigned int rval; \
- if (rn == 0) \
- rval = default_rval; \
- else \
- asm volatile("mfdcr %0," stringify(rn) : "=r" (rval)); \
- rval;})
-
-#define mtdcr(rn, v) \
- {if (rn != 0) \
- asm volatile("mtdcr " stringify(rn) ",%0" : : "r" (v));}
-
-#endif /* __ASSEMBLY__ */
#endif /* CONFIG_40x */
#endif /* __ASM_IBM4XX_H__ */
#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/ibm_ocp_pci.h b/include/asm-ppc/ibm_ocp_pci.h
new file mode 100644
index 000000000000..c6a66e5d141c
--- /dev/null
+++ b/include/asm-ppc/ibm_ocp_pci.h
@@ -0,0 +1,56 @@
+/*
+ * ibm_ocp_pci.h
+ *
+ * This was derived from the ibm_ocp.h
+ *
+ * Current Maintainer
+ * Armin Kuster akuster@mvista.com
+ * AUg, 2002
+ *
+ *
+ * Copyright 2001-2002 MontaVista Softare Inc.
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifdef __KERNEL__
+#ifndef __ASM_IBM_OCP_PCI_H__
+#define __ASM_IBM_OCP_PCI_H__
+
+/* PCI 32 */
+
+struct pmm_regs {
+ u32 la;
+ u32 ma;
+ u32 pcila;
+ u32 pciha;
+};
+
+typedef struct pcil0_regs {
+ struct pmm_regs pmm[3];
+ u32 ptm1ms;
+ u32 ptm1la;
+ u32 ptm2ms;
+ u32 ptm2la;
+} pci0_t;
+
+#endif /* __ASM_IBM_OCP_PCI_H__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 09e041e964b1..29eaaae63187 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -193,7 +193,6 @@ extern void _outsl_ns(volatile u32 *port, const void *buf, int nl);
#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c))
#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c))
-#ifdef __KERNEL__
/*
* Map in an area of physical address space, for accessing
* I/O devices etc.
@@ -265,8 +264,6 @@ extern inline void * phys_to_virt(unsigned long address)
#define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
#define page_to_bus(page) (page_to_phys(page) + PCI_DRAM_OFFSET)
-#endif /* __KERNEL__ */
-
/*
* Enforce In-order Execution of I/O:
* Acts as a barrier to ensure all previous I/O accesses have
diff --git a/include/asm-ppc/nvram.h b/include/asm-ppc/nvram.h
index 47e4dfc74a77..d65bb55baf9d 100644
--- a/include/asm-ppc/nvram.h
+++ b/include/asm-ppc/nvram.h
@@ -31,8 +31,6 @@ enum {
pmac_nvram_NR /* MacOS Name Registry partition */
};
-#ifdef __KERNEL__
-
/* Return partition offset in nvram */
extern int pmac_get_partition(int partition);
@@ -40,8 +38,6 @@ extern int pmac_get_partition(int partition);
extern u8 pmac_xpram_read(int xpaddr);
extern void pmac_xpram_write(int xpaddr, u8 data);
-#endif /* __KERNEL__ */
-
/* Some offsets in XPRAM */
#define PMAC_XPRAM_MACHINE_LOC 0xe4
#define PMAC_XPRAM_SOUND_VOLUME 0x08
diff --git a/include/asm-ppc/ocp.h b/include/asm-ppc/ocp.h
new file mode 100644
index 000000000000..078a0d7d36fa
--- /dev/null
+++ b/include/asm-ppc/ocp.h
@@ -0,0 +1,205 @@
+/*
+ * ocp.h
+ *
+ *
+ * Current Maintainer
+ * Armin Kuster akuster@pacbell.net
+ * Jan, 2002
+ *
+ *
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifdef __KERNEL__
+#ifndef __OCP_H__
+#define __OCP_H__
+
+#include <linux/list.h>
+#include <linux/config.h>
+#include <linux/device.h>
+#include <linux/devfs_fs_kernel.h>
+
+#include <asm/ocp_ids.h>
+#include <asm/mmu.h> /* For phys_addr_t */
+#undef DEBUG
+/* #define DEBUG*/
+
+#ifdef DEBUG
+#define DBG(x...) printk(x)
+#else
+#define DBG(x...)
+#endif
+
+#define OCP_IRQ_NA -1 /* used when ocp device does not have an irq */
+#define OCP_IRQ_MUL -2 /* used for ocp devices with multiple irqs */
+#define OCP_NULL_TYPE 0 /* used to mark end of list */
+#define OCP_DEV_NA -1
+#define OCP_CPM_NA 0 /* No Clock or Power Management avaliable */
+
+#define OCP_ANY_ID (~0)
+
+
+extern struct list_head ocp_root_buses;
+extern struct list_head ocp_devices;
+
+struct ocp_device_id {
+ unsigned int vendor, device; /* Vendor and device ID or PCI_ANY_ID */
+ char name[16];
+ char desc[50];
+ unsigned long driver_data; /* Data private to the driver */
+};
+
+struct func_info {
+ char name[16];
+ char desc[50];
+};
+
+struct ocp_def {
+ unsigned int vendor;
+ unsigned int device;
+ phys_addr_t paddr;
+ int irq;
+ unsigned long pm;
+};
+
+
+/* Struct for single ocp device managment */
+struct ocp_device {
+ struct list_head global_list;
+ unsigned int num; /* instance of device */
+ char name[80]; /* device name */
+ unsigned int vendor;
+ unsigned int device;
+ phys_addr_t paddr;
+ int irq;
+ unsigned long pm;
+ void *ocpdev; /* driver data for this device */
+ struct ocp_driver *driver;
+ u32 current_state; /* Current operating state. In ACPI-speak,
+ this is D0-D3, D0 being fully functional,
+ and D3 being off. */
+ struct device dev;
+};
+
+struct ocp_driver {
+ struct list_head node;
+ char *name;
+ const struct ocp_device_id *id_table; /* NULL if wants all devices */
+ int (*probe) (struct ocp_device *dev); /* New device inserted */
+ void (*remove) (struct ocp_device *dev); /* Device removed (NULL if not a hot-plug capable driver) */
+ int (*save_state) (struct ocp_device *dev, u32 state); /* Save Device Context */
+ int (*suspend) (struct ocp_device *dev, u32 state); /* Device suspended */
+ int (*resume) (struct ocp_device *dev); /* Device woken up */
+ int (*enable_wake) (struct ocp_device *dev, u32 state, int enable); /* Enable wake event */
+ struct device_driver driver;
+};
+
+#define to_ocp_dev(n) container_of(n, struct ocp_device, dev)
+#define to_ocp_driver(n) container_of(n, struct ocp_driver, driver)
+
+extern int ocp_register_driver(struct ocp_driver *drv);
+extern void ocp_unregister_driver(struct ocp_driver *drv);
+
+#define ocp_dev_g(n) list_entry(n, struct ocp_device, global_list)
+
+#define ocp_for_each_dev(dev) \
+ for(dev = ocp_dev_g(ocp_devices.next); dev != ocp_dev_g(&ocp_devices); dev = ocp_dev_g(dev->global_list.next))
+
+/* Similar to the helpers above, these manipulate per-ocp_dev
+ * driver-specific data. Currently stored as ocp_dev::ocpdev,
+ * a void pointer, but it is not present on older kernels.
+ */
+static inline void *
+ocp_get_drvdata(struct ocp_device *pdev)
+{
+ return pdev->ocpdev;
+}
+
+static inline void
+ocp_set_drvdata(struct ocp_device *pdev, void *data)
+{
+ pdev->ocpdev = data;
+}
+
+/*
+ * a helper function which helps ensure correct pci_driver
+ * setup and cleanup for commonly-encountered hotplug/modular cases
+ *
+ * This MUST stay in a header, as it checks for -DMODULE
+ */
+static inline int ocp_module_init(struct ocp_driver *drv)
+{
+ int rc = ocp_register_driver(drv);
+
+ if (rc > 0)
+ return 0;
+
+ /* iff CONFIG_HOTPLUG and built into kernel, we should
+ * leave the driver around for future hotplug events.
+ * For the module case, a hotplug daemon of some sort
+ * should load a module in response to an insert event. */
+#if defined(CONFIG_HOTPLUG) && !defined(MODULE)
+ if (rc == 0)
+ return 0;
+#else
+ if (rc == 0)
+ rc = -ENODEV;
+#endif
+
+ /* if we get here, we need to clean up pci driver instance
+ * and return some sort of error */
+ ocp_unregister_driver (drv);
+
+ return rc;
+}
+
+#if defined (CONFIG_PM)
+/*
+ * This is right for the IBM 405 and 440 but will need to be
+ * generalized if the OCP stuff gets used on other processors.
+ */
+static inline void
+ocp_force_power_off(struct ocp_device *odev)
+{
+ mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) | odev->pm);
+}
+
+static inline void
+ocp_force_power_on(struct ocp_device *odev)
+{
+ mtdcr(DCRN_CPMFR, mfdcr(DCRN_CPMFR) & ~odev->pm);
+}
+#else
+#define ocp_force_power_off(x) (void)(x)
+#define ocp_force_power_on(x) (void)(x)
+#endif
+
+extern void ocp_init(void);
+extern struct bus_type ocp_bus_type;
+extern struct ocp_device *ocp_get_dev(unsigned int device, int index);
+extern unsigned int ocp_get_num(unsigned int device);
+
+extern int ocp_generic_suspend(struct ocp_device *pdev, u32 state);
+extern int ocp_generic_resume(struct ocp_device *pdev);
+
+#endif /* __OCP_H__ */
+#endif /* __KERNEL__ */
diff --git a/include/asm-ppc/ocp_ids.h b/include/asm-ppc/ocp_ids.h
new file mode 100644
index 000000000000..fc322ba7a1c5
--- /dev/null
+++ b/include/asm-ppc/ocp_ids.h
@@ -0,0 +1,103 @@
+/*
+ * FILE NAME: ocp_ids.h
+ *
+ * BRIEF MODULE DESCRIPTION:
+ * OCP device ids based on the ideas from PCI
+ *
+ * Maintained by: Armin <akuster@mvista.com>
+ *
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Version 1.0 08/22/02 -Armin
+ * initial release
+ */
+
+/*
+ * Vender device
+ * [xxxx] [xxxx]
+ *
+ * Keep in order, please
+ */
+
+/* Vendor IDs 0x0001 - 0xFFFF copied from pci_ids.h */
+
+#define OCP_VENDOR_INVALID 0x0000
+#define OCP_VENDOR_ARM 0x0004
+#define OCP_VENDOR_IBM 0x1014
+#define OCP_VENDOR_MOTOROLA 0x1057
+#define OCP_VENDOR_XILINX 0x10ee
+#define OCP_VENDOR_UNKNOWN 0xFFFF
+
+/* device identification */
+
+/* define type */
+#define OCP_FUNC_INVALID 0x0000
+
+/* system 0x0001 - 0x001F */
+#define OCP_FUNC_UIC 0x0001
+
+/* Timers 0x0020 - 0x002F */
+#define OCP_FUNC_GPT 0x0020 /* General purpose timers */
+#define OCP_FUNC_RTC 0x0021
+
+/* Serial 0x0030 - 0x006F*/
+#define OCP_FUNC_16550 0x0031
+#define OCP_FUNC_SSP 0x0032 /* sync serial port */
+#define OCP_FUNC_SCP 0x0033 /* serial controller port */
+#define OCP_FUNC_SCC 0x0034 /* serial contoller */
+#define OCP_FUNC_SCI 0x0035 /* Smart card */
+#define OCP_FUNC_IIC 0x0040
+#define OCP_FUNC_USB 0x0050
+#define OCP_FUNC_IR 0x0060
+
+/* Memory devices 0x0090 - 0x009F */
+#define OCP_FUNC_SDRAM 0x0091
+#define OCP_FUNC_DMA 0x0092
+
+/* Display 0x00A0 - 0x00AF */
+#define OCP_FUNC_VIDEO 0x00A0
+#define OCP_FUNC_LED 0x00A1
+#define OCP_FUNC_LCD 0x00A2
+
+/* Sound 0x00B0 - 0x00BF */
+#define OCP_FUNC_AUDIO 0x00B0
+
+/* Mass Storage 0x00C0 - 0xxCF */
+#define OCP_FUNC_IDE 0x00C0
+
+/* Misc 0x00D0 - 0x00DF*/
+#define OCP_FUNC_GPIO 0x00D0
+#define OCP_FUNC_ZMII 0x00D1
+
+/* Network 0x0200 - 0x02FF */
+#define OCP_FUNC_EMAC 0x0200
+
+/* Bridge devices 0xE00 - 0xEFF */
+#define OCP_FUNC_HOST 0x0E00
+#define OCP_FUNC_DCR 0x0E01
+#define OCP_FUNC_OPB 0x0E02
+#define OCP_FUNC_PHY 0x0E03
+#define OCP_FUNC_EXT 0x0E04
+#define OCP_FUNC_PCI 0x0E05
+#define OCP_FUNC_PLB 0x0E06
+
+#define OCP_FUNC_UNKNOWN 0xFFFF
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h
index 4834d006adb6..e0429c2b5bc7 100644
--- a/include/asm-ppc/page.h
+++ b/include/asm-ppc/page.h
@@ -62,7 +62,7 @@ typedef unsigned long pgprot_t;
/* align addr on a size boundry - adjust address up if needed -- Cort */
-#define _ALIGN(addr,size) (((addr)+size-1)&(~(size-1)))
+#define _ALIGN(addr,size) (((addr)+(size)-1)&(~((size)-1)))
/* to align the pointer to the (next) page boundary */
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
diff --git a/include/asm-ppc/param.h b/include/asm-ppc/param.h
index a0c23264d9f9..428a10582ac6 100644
--- a/include/asm-ppc/param.h
+++ b/include/asm-ppc/param.h
@@ -9,7 +9,7 @@
#define HZ 100 /* internal timer frequency */
#define USER_HZ 100 /* for user interfaces in "ticks" */
#define CLOCKS_PER_SEC (USER_HZ) /* frequency at which times() counts */
-#endif
+#endif /* __KERNEL__ */
#define EXEC_PAGESIZE 4096
diff --git a/include/asm-ppc/ppc405_dma.h b/include/asm-ppc/ppc405_dma.h
index eabdb2502e4a..eabdb2502e4a 100755..100644
--- a/include/asm-ppc/ppc405_dma.h
+++ b/include/asm-ppc/ppc405_dma.h
diff --git a/include/asm-ppc/ppc4xx_pic.h b/include/asm-ppc/ppc4xx_pic.h
index a9e936369bdb..24b0c0b7c505 100644
--- a/include/asm-ppc/ppc4xx_pic.h
+++ b/include/asm-ppc/ppc4xx_pic.h
@@ -17,11 +17,12 @@
/* External Global Variables */
extern struct hw_interrupt_type *ppc4xx_pic;
-
+extern unsigned int ibm4xxPIC_NumInitSenses;
+extern unsigned char *ibm4xxPIC_InitSenses;
/* Function Prototypes */
-extern void ppc4xx_pic_init(void);
-extern int ppc4xx_pic_get_irq(struct pt_regs *regs);
+extern void ppc4xx_pic_init(void);
+extern int ppc4xx_pic_get_irq(struct pt_regs *regs);
-#endif /* __PPC4XX_PIC_H__ */
+#endif /* __PPC4XX_PIC_H__ */
diff --git a/include/asm-ppc/signal.h b/include/asm-ppc/signal.h
index 4958b3f3547a..57c399154f43 100644
--- a/include/asm-ppc/signal.h
+++ b/include/asm-ppc/signal.h
@@ -111,7 +111,7 @@ typedef struct {
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
-#endif
+#endif /* __KERNEL__ */
#define SIG_BLOCK 0 /* for blocking signals */
#define SIG_UNBLOCK 1 /* for unblocking signals */
@@ -150,7 +150,6 @@ typedef struct sigaltstack {
#ifdef __KERNEL__
#include <asm/sigcontext.h>
-
-#endif
+#endif /* __KERNEL__ */
#endif
diff --git a/include/asm-ppc/socket.h b/include/asm-ppc/socket.h
index e020c82192dc..d513b3238efd 100644
--- a/include/asm-ppc/socket.h
+++ b/include/asm-ppc/socket.h
@@ -65,6 +65,6 @@
/* other similar things on the */
/* user level. */
#define SOCK_MAX (SOCK_PACKET+1)
-#endif
+#endif /* __KERNEL__ */
#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-ppc/termios.h b/include/asm-ppc/termios.h
index fe999e9cbca4..e9c7434dafe5 100644
--- a/include/asm-ppc/termios.h
+++ b/include/asm-ppc/termios.h
@@ -153,7 +153,7 @@ struct termio {
#ifdef __KERNEL__
/* ^C ^\ del ^U ^D 1 0 0 0 0 ^W ^R ^Z ^Q ^S ^V ^U */
#define INIT_C_CC "\003\034\177\025\004\001\000\000\000\000\027\022\032\021\023\026\025"
-#endif
+#endif /* __KERNEL__ */
/* modem lines */
#define TIOCM_LE 0x001
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 5683e383a4f2..ca324808509f 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -219,6 +219,8 @@ extern int bio_get_nr_vecs(struct block_device *);
extern struct bio *bio_map_user(struct block_device *, unsigned long,
unsigned int, int);
extern void bio_unmap_user(struct bio *, int);
+extern void bio_set_pages_dirty(struct bio *bio);
+extern void bio_check_pages_dirty(struct bio *bio);
#ifdef CONFIG_HIGHMEM
/*
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 39405f5a06ea..6a1ab40649f8 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -36,6 +36,8 @@ struct compat_tms {
extern int cp_compat_stat(struct kstat *, struct compat_stat *);
extern int get_compat_flock(struct flock *, struct compat_flock *);
extern int put_compat_flock(struct flock *, struct compat_flock *);
+extern int get_compat_timespec(struct timespec *, struct compat_timespec *);
+extern int put_compat_timespec(struct timespec *, struct compat_timespec *);
#endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 878f2d2e4a9f..821034d8745b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -276,6 +276,7 @@ struct iattr {
struct page;
struct address_space;
struct writeback_control;
+struct kiocb;
struct address_space_operations {
int (*writepage)(struct page *page, struct writeback_control *wbc);
@@ -301,7 +302,7 @@ struct address_space_operations {
sector_t (*bmap)(struct address_space *, sector_t);
int (*invalidatepage) (struct page *, unsigned long);
int (*releasepage) (struct page *, int);
- int (*direct_IO)(int, struct file *, const struct iovec *iov,
+ int (*direct_IO)(int, struct kiocb *, const struct iovec *iov,
loff_t offset, unsigned long nr_segs);
};
@@ -736,7 +737,6 @@ typedef int (*read_actor_t)(read_descriptor_t *, struct page *, unsigned long, u
* read, write, poll, fsync, readv, writev can be called
* without the big kernel lock held in all filesystems.
*/
-struct kiocb;
struct file_operations {
struct module *owner;
loff_t (*llseek) (struct file *, loff_t, int);
@@ -1234,6 +1234,8 @@ extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *);
extern ssize_t generic_file_write(struct file *, const char *, size_t, loff_t *);
extern ssize_t generic_file_aio_read(struct kiocb *, char *, size_t, loff_t);
extern ssize_t generic_file_aio_write(struct kiocb *, const char *, size_t, loff_t);
+extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *,
+ unsigned long, loff_t *);
extern ssize_t do_sync_read(struct file *filp, char *buf, size_t len, loff_t *ppos);
extern ssize_t do_sync_write(struct file *filp, const char *buf, size_t len, loff_t *ppos);
ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov,
@@ -1243,10 +1245,11 @@ extern void do_generic_mapping_read(struct address_space *, struct file_ra_state
loff_t *, read_descriptor_t *, read_actor_t);
extern void
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
-extern ssize_t generic_file_direct_IO(int rw, struct file *file,
+extern ssize_t generic_file_direct_IO(int rw, struct kiocb *iocb,
const struct iovec *iov, loff_t offset, unsigned long nr_segs);
-extern int generic_direct_IO(int rw, struct inode *inode, struct block_device *bdev,
- const struct iovec *iov, loff_t offset, unsigned long nr_segs, get_blocks_t *get_blocks);
+extern int blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
+ struct block_device *bdev, const struct iovec *iov, loff_t offset,
+ unsigned long nr_segs, get_blocks_t *get_blocks);
extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov,
unsigned long nr_segs, loff_t *ppos);
ssize_t generic_file_writev(struct file *filp, const struct iovec *iov,
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 5d0c8b4089d1..fb0a8e39e669 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -30,8 +30,9 @@ struct nfs_page {
struct rpc_cred *wb_cred;
struct page *wb_page; /* page to read in/write out */
wait_queue_head_t wb_wait; /* wait queue */
- unsigned long wb_index; /* Offset within mapping */
- unsigned int wb_offset, /* Offset within page */
+ unsigned long wb_index; /* Offset >> PAGE_CACHE_SHIFT */
+ unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
+ wb_pgbase, /* Start of page data */
wb_bytes, /* Length of request */
wb_count; /* reference count */
unsigned long wb_flags;
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 6106cf73da6b..5e481026fc7e 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -23,7 +23,7 @@
* Client user credentials
*/
struct rpc_cred {
- struct rpc_cred * cr_next; /* linked list */
+ struct list_head cr_hash; /* hash chain */
struct rpc_auth * cr_auth;
struct rpc_credops * cr_ops;
unsigned long cr_expire; /* when to gc */
@@ -49,7 +49,7 @@ struct rpc_cred {
#define RPC_CREDCACHE_NR 8
#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1)
struct rpc_auth {
- struct rpc_cred * au_credcache[RPC_CREDCACHE_NR];
+ struct list_head au_credcache[RPC_CREDCACHE_NR];
unsigned long au_expire; /* cache expiry interval */
unsigned long au_nextgc; /* next garbage collection */
unsigned int au_cslack; /* call cred size estimate */
@@ -101,8 +101,6 @@ struct rpc_cred * rpcauth_bindcred(struct rpc_task *);
void rpcauth_holdcred(struct rpc_task *);
void put_rpccred(struct rpc_cred *);
void rpcauth_unbindcred(struct rpc_task *);
-int rpcauth_matchcred(struct rpc_auth *,
- struct rpc_cred *, int);
u32 * rpcauth_marshcred(struct rpc_task *, u32 *);
u32 * rpcauth_checkverf(struct rpc_task *, u32 *);
int rpcauth_refreshcred(struct rpc_task *);
@@ -110,8 +108,6 @@ void rpcauth_invalcred(struct rpc_task *);
int rpcauth_uptodatecred(struct rpc_task *);
void rpcauth_init_credcache(struct rpc_auth *);
void rpcauth_free_credcache(struct rpc_auth *);
-void rpcauth_insert_credcache(struct rpc_auth *,
- struct rpc_cred *);
static inline
struct rpc_cred * get_rpccred(struct rpc_cred *cred)