summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2003-01-04 07:21:30 +1100
committerPaul Mackerras <paulus@samba.org>2003-01-04 07:21:30 +1100
commite8c2590042ecda10fbc8f63030a0f3f940064375 (patch)
treeefd48f94c2cf433b5c3efd4e6dddaa35ee28ab6f /include
parentb49863dd66d6dfa2fec6cd96127a27a0c1206536 (diff)
parentd127326dbb20263629dd70d85f4a329bb35fbf6b (diff)
Merge samba.org:/home/paulus/kernel/linux-2.5
into samba.org:/home/paulus/kernel/for-linus-ppc
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/arch-iop310/memory.h1
-rw-r--r--include/asm-arm/current.h2
-rw-r--r--include/asm-arm/dma-mapping.h304
-rw-r--r--include/asm-arm/io.h10
-rw-r--r--include/asm-arm/irq.h3
-rw-r--r--include/asm-arm/mach/irq.h4
-rw-r--r--include/asm-arm/pci.h244
-rw-r--r--include/asm-arm/proc-armv/locks.h8
-rw-r--r--include/asm-arm/proc-armv/uaccess.h47
-rw-r--r--include/asm-arm/semaphore.h20
-rw-r--r--include/asm-arm/thread_info.h20
-rw-r--r--include/asm-arm/uaccess.h11
-rw-r--r--include/asm-arm/unistd.h1
-rw-r--r--include/asm-i386/elf.h6
-rw-r--r--include/asm-i386/system.h6
-rw-r--r--include/asm-ppc/module.h13
-rw-r--r--include/asm-ppc64/compat.h36
-rw-r--r--include/asm-ppc64/page.h2
-rw-r--r--include/asm-ppc64/pgtable.h4
-rw-r--r--include/asm-ppc64/ppc32.h64
-rw-r--r--include/asm-ppc64/prom.h11
-rw-r--r--include/asm-ppc64/smp.h2
-rw-r--r--include/asm-ppc64/tlb.h4
-rw-r--r--include/asm-ppc64/topology.h2
-rw-r--r--include/asm-ppc64/xics.h18
-rw-r--r--include/linux/fb.h1
-rw-r--r--include/linux/moduleloader.h19
-rw-r--r--include/net/irda/vlsi_ir.h7
-rw-r--r--include/video/tgafb.h1
29 files changed, 559 insertions, 312 deletions
diff --git a/include/asm-arm/arch-iop310/memory.h b/include/asm-arm/arch-iop310/memory.h
index e61bc5ddc48a..f4ae41eb9adb 100644
--- a/include/asm-arm/arch-iop310/memory.h
+++ b/include/asm-arm/arch-iop310/memory.h
@@ -6,6 +6,7 @@
#define __ASM_ARCH_MEMORY_H
#include <linux/config.h>
+#include <asm/arch/iop310.h>
/*
* Task size: 3GB
diff --git a/include/asm-arm/current.h b/include/asm-arm/current.h
index 921ee95e0d92..b3d68cd03f73 100644
--- a/include/asm-arm/current.h
+++ b/include/asm-arm/current.h
@@ -1,7 +1,7 @@
#ifndef _ASMARM_CURRENT_H
#define _ASMARM_CURRENT_H
-#include <asm/thread_info.h>
+#include <linux/thread_info.h>
static inline struct task_struct *get_current(void) __attribute__ (( __const__ ));
diff --git a/include/asm-arm/dma-mapping.h b/include/asm-arm/dma-mapping.h
index e7e16901f686..dd85f46611e7 100644
--- a/include/asm-arm/dma-mapping.h
+++ b/include/asm-arm/dma-mapping.h
@@ -1 +1,303 @@
-#include <asm-generic/dma-mapping.h>
+#ifndef ASMARM_DMA_MAPPING_H
+#define ASMARM_DMA_MAPPING_H
+
+#ifdef __KERNEL__
+
+#include <linux/config.h>
+#include <linux/mm.h> /* need struct page */
+
+#include <asm/scatterlist.h>
+
+/*
+ * DMA-consistent mapping functions. These allocate/free a region of
+ * uncached, unwrite-buffered mapped memory space for use with DMA
+ * devices. This is the "generic" version. The PCI specific version
+ * is in pci.h
+ */
+extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle);
+extern void consistent_free(void *vaddr, size_t size, dma_addr_t handle);
+extern void consistent_sync(void *kaddr, size_t size, int rw);
+
+/*
+ * For SA-1111 these functions are "magic" and utilize bounce
+ * bufferes as needed to work around SA-1111 DMA bugs.
+ */
+dma_addr_t sa1111_map_single(void *, size_t, int);
+void sa1111_unmap_single(dma_addr_t, size_t, int);
+int sa1111_map_sg(struct scatterlist *, int, int);
+void sa1111_unmap_sg(struct scatterlist *, int, int);
+void sa1111_dma_sync_single(dma_addr_t, size_t, int);
+void sa1111_dma_sync_sg(struct scatterlist *, int, int);
+
+#ifdef CONFIG_SA1111
+
+extern struct bus_type sa1111_bus_type;
+
+#define dmadev_is_sa1111(dev) ((dev)->bus == &sa1111_bus_type)
+
+#else
+#define dmadev_is_sa1111(dev) (0)
+#endif
+
+/*
+ * Return whether the given device DMA address mask can be supported
+ * properly. For example, if your device can only drive the low 24-bits
+ * during PCI bus mastering, then you would pass 0x00ffffff as the mask
+ * to this function.
+ */
+static inline int dma_supported(struct device *dev, u64 mask)
+{
+ return 1;
+}
+
+static inline int dma_set_mask(struct device *dev, u64 dma_mask)
+{
+ if (!dev->dma_mask || !dma_supported(dev, dma_mask))
+ return -EIO;
+
+ *dev->dma_mask = dma_mask;
+
+ return 0;
+}
+
+static inline int dma_get_cache_alignment(void)
+{
+ return 32;
+}
+
+static inline int dma_is_consistent(dma_addr_t handle)
+{
+ return 0;
+}
+
+/**
+ * dma_alloc_coherent - allocate consistent memory for DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @size: required memory size
+ * @handle: bus-specific DMA address
+ *
+ * Allocate some uncached, unbuffered memory for a device for
+ * performing DMA. This function allocates pages, and will
+ * return the CPU-viewed address, and sets @handle to be the
+ * device-viewed address.
+ */
+static inline void *
+dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle)
+{
+ int gfp = GFP_KERNEL;
+
+ if (dev == NULL || dmadev_is_sa1111(dev) || *dev->dma_mask != 0xffffffff)
+ gfp |= GFP_DMA;
+
+ return consistent_alloc(gfp, size, handle);
+}
+
+/**
+ * dma_free_coherent - free memory allocated by dma_alloc_coherent
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @size: size of memory originally requested in dma_alloc_coherent
+ * @cpu_addr: CPU-view address returned from dma_alloc_coherent
+ * @handle: device-view address returned from dma_alloc_coherent
+ *
+ * Free (and unmap) a DMA buffer previously allocated by
+ * dma_alloc_coherent().
+ *
+ * References to memory and mappings associated with cpu_addr/handle
+ * during and after this call executing are illegal.
+ */
+static inline void
+dma_free_coherent(struct device *dev, size_t size, void *cpu_addr,
+ dma_addr_t handle)
+{
+ consistent_free(cpu_addr, size, handle);
+}
+
+/**
+ * dma_map_single - map a single buffer for streaming DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @cpu_addr: CPU direct mapped address of buffer
+ * @size: size of buffer to map
+ * @dir: DMA transfer direction
+ *
+ * Ensure that any data held in the cache is appropriately discarded
+ * or written back.
+ *
+ * The device owns this memory once this call has completed. The CPU
+ * can regain ownership by calling dma_unmap_single() or dma_sync_single().
+ */
+static inline dma_addr_t
+dma_map_single(struct device *dev, void *cpu_addr, size_t size,
+ enum dma_data_direction dir)
+{
+ if (dmadev_is_sa1111(dev))
+ return sa1111_map_single(cpu_addr, size, dir);
+
+ consistent_sync(cpu_addr, size, dir);
+ return __virt_to_bus((unsigned long)cpu_addr);
+}
+
+/**
+ * dma_unmap_single - unmap a single buffer previously mapped
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @handle: DMA address of buffer
+ * @size: size of buffer to map
+ * @dir: DMA transfer direction
+ *
+ * Unmap a single streaming mode DMA translation. The handle and size
+ * must match what was provided in the previous dma_map_single() call.
+ * All other usages are undefined.
+ *
+ * After this call, reads by the CPU to the buffer are guaranteed to see
+ * whatever the device wrote there.
+ */
+static inline void
+dma_unmap_single(struct device *dev, dma_addr_t handle, size_t size,
+ enum dma_data_direction dir)
+{
+ if (dmadev_is_sa1111(dev))
+ sa1111_unmap_single(handle, size, dir);
+
+ /* nothing to do */
+}
+
+#if 0
+static inline dma_addr_t
+dma_map_page(struct device *dev, struct page *page, unsigned long off,
+ size_t size, enum dma_data_direction dir)
+{
+ /* fixme */
+}
+
+static inline void
+dma_unmap_page(struct device *dev, dma_addr_t handle, size_t size,
+ enum dma_data_direction dir)
+{
+ /* fixme */
+}
+#endif
+
+/**
+ * dma_map_sg - map a set of SG buffers for streaming mode DMA
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @sg: list of buffers
+ * @nents: number of buffers to map
+ * @dir: DMA transfer direction
+ *
+ * Map a set of buffers described by scatterlist in streaming
+ * mode for DMA. This is the scather-gather version of the
+ * above pci_map_single interface. Here the scatter gather list
+ * elements are each tagged with the appropriate dma address
+ * and length. They are obtained via sg_dma_{address,length}(SG).
+ *
+ * NOTE: An implementation may be able to use a smaller number of
+ * DMA address/length pairs than there are SG table elements.
+ * (for example via virtual mapping capabilities)
+ * The routine returns the number of addr/length pairs actually
+ * used, at most nents.
+ *
+ * Device ownership issues as mentioned above for pci_map_single are
+ * the same here.
+ */
+static inline int
+dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
+ enum dma_data_direction dir)
+{
+ int i;
+
+ if (dmadev_is_sa1111(dev))
+ return sa1111_map_sg(sg, nents, dir);
+
+ for (i = 0; i < nents; i++, sg++) {
+ char *virt;
+
+ sg->dma_address = page_to_bus(sg->page) + sg->offset;
+ virt = page_address(sg->page) + sg->offset;
+ consistent_sync(virt, sg->length, dir);
+ }
+
+ return nents;
+}
+
+/**
+ * dma_unmap_sg - unmap a set of SG buffers mapped by dma_map_sg
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @sg: list of buffers
+ * @nents: number of buffers to map
+ * @dir: DMA transfer direction
+ *
+ * Unmap a set of streaming mode DMA translations.
+ * Again, CPU read rules concerning calls here are the same as for
+ * pci_unmap_single() above.
+ */
+static inline void
+dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
+ enum dma_data_direction dir)
+{
+ if (dmadev_is_sa1111(dev)) {
+ sa1111_unmap_sg(sg, nents, dir);
+ return;
+ }
+
+ /* nothing to do */
+}
+
+/**
+ * dma_sync_single
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @handle: DMA address of buffer
+ * @size: size of buffer to map
+ * @dir: DMA transfer direction
+ *
+ * Make physical memory consistent for a single streaming mode DMA
+ * translation after a transfer.
+ *
+ * If you perform a pci_map_single() but wish to interrogate the
+ * buffer using the cpu, yet do not wish to teardown the PCI dma
+ * mapping, you must call this function before doing so. At the
+ * next point you give the PCI dma address back to the card, the
+ * device again owns the buffer.
+ */
+static inline void
+dma_sync_single(struct device *dev, dma_addr_t handle, size_t size,
+ enum dma_data_direction dir)
+{
+ if (dmadev_is_sa1111(dev)) {
+ sa1111_dma_sync_single(handle, size, dir);
+ return;
+ }
+
+ consistent_sync((void *)__bus_to_virt(handle), size, dir);
+}
+
+/**
+ * dma_sync_sg
+ * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
+ * @sg: list of buffers
+ * @nents: number of buffers to map
+ * @dir: DMA transfer direction
+ *
+ * Make physical memory consistent for a set of streaming
+ * mode DMA translations after a transfer.
+ *
+ * The same as pci_dma_sync_single but for a scatter-gather list,
+ * same rules and usage.
+ */
+static inline void
+dma_sync_sg(struct device *dev, struct scatterlist *sg, int nents,
+ enum dma_data_direction dir)
+{
+ int i;
+
+ if (dmadev_is_sa1111(dev)) {
+ sa1111_dma_sync_sg(sg, nents, dir);
+ return;
+ }
+
+ for (i = 0; i < nents; i++, sg++) {
+ char *virt = page_address(sg->page) + sg->offset;
+ consistent_sync(virt, sg->length, dir);
+ }
+}
+
+#endif /* __KERNEL__ */
+#endif
diff --git a/include/asm-arm/io.h b/include/asm-arm/io.h
index 11aa8ea1d9e2..1dc1dd5d611a 100644
--- a/include/asm-arm/io.h
+++ b/include/asm-arm/io.h
@@ -268,16 +268,6 @@ extern void __iounmap(void *addr);
#endif
/*
- * DMA-consistent mapping functions. These allocate/free a region of
- * uncached, unwrite-buffered mapped memory space for use with DMA
- * devices. This is the "generic" version. The PCI specific version
- * is in pci.h
- */
-extern void *consistent_alloc(int gfp, size_t size, dma_addr_t *handle);
-extern void consistent_free(void *vaddr, size_t size, dma_addr_t handle);
-extern void consistent_sync(void *vaddr, size_t size, int rw);
-
-/*
* can the hardware map this into one segment or not, given no other
* constraints.
*/
diff --git a/include/asm-arm/irq.h b/include/asm-arm/irq.h
index f47774aab014..6a3af2bb3b1d 100644
--- a/include/asm-arm/irq.h
+++ b/include/asm-arm/irq.h
@@ -40,7 +40,8 @@ extern void enable_irq(unsigned int);
#define IRQT_PROBE (1 << 4)
int set_irq_type(unsigned int irq, unsigned int type);
-
+void disable_irq_wake(unsigned int irq);
+void enable_irq_wake(unsigned int irq);
int setup_irq(unsigned int, struct irqaction *);
#endif
diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h
index d9971858d9cd..60ce4643c027 100644
--- a/include/asm-arm/mach/irq.h
+++ b/include/asm-arm/mach/irq.h
@@ -40,6 +40,10 @@ struct irqchip {
* Set the type of the IRQ.
*/
int (*type)(unsigned int, unsigned int);
+ /*
+ * Set wakeup-enable on the selected IRQ
+ */
+ int (*wake)(unsigned int, unsigned int);
};
struct irqdesc {
diff --git a/include/asm-arm/pci.h b/include/asm-arm/pci.h
index aa08b2c39232..7760592d853f 100644
--- a/include/asm-arm/pci.h
+++ b/include/asm-arm/pci.h
@@ -3,36 +3,20 @@
#ifdef __KERNEL__
#include <linux/config.h>
-#include <linux/mm.h> /* bah! */
+#include <linux/dma-mapping.h>
-#include <asm/arch/hardware.h>
-#include <asm/scatterlist.h>
-#include <asm/page.h>
-#include <asm/io.h>
-
-struct pci_dev;
+#include <asm/hardware.h> /* for PCIBIOS_MIN_* */
+#ifdef CONFIG_SA1111
/*
- * For SA-1111 these functions are "magic" and utilize bounce
- * buffers as need to workaround SA-1111 DMA bugs. They are called in
- * place of their pci_* counterparts when dev_is_sa1111() returns true.
+ * Keep the SA1111 DMA-mapping tricks until the USB layer gets
+ * properly converted to the new DMA-mapping API, at which time
+ * most of this file can die.
*/
-dma_addr_t sa1111_map_single(struct pci_dev *, void *, size_t, int);
-void sa1111_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
-int sa1111_map_sg(struct pci_dev *, struct scatterlist *, int, int);
-void sa1111_unmap_sg(struct pci_dev *, struct scatterlist *, int, int);
-void sa1111_dma_sync_single(struct pci_dev *, dma_addr_t, size_t, int);
-void sa1111_dma_sync_sg(struct pci_dev *, struct scatterlist *, int, int);
-
-#ifdef CONFIG_SA1111
-
#define SA1111_FAKE_PCIDEV ((struct pci_dev *) 1111)
-#define dev_is_sa1111(dev) (dev == SA1111_FAKE_PCIDEV)
-
+#define pcidev_is_sa1111(dev) (dev == SA1111_FAKE_PCIDEV)
#else
-
-#define dev_is_sa1111(dev) (0)
-
+#define pcidev_is_sa1111(dev) (0)
#endif
@@ -46,200 +30,116 @@ static inline void pcibios_penalize_isa_irq(int irq)
/* We don't do dynamic PCI IRQ allocation */
}
-/* The PCI address space does equal the physical memory
- * address space. The networking and block device layers use
- * this boolean for bounce buffer decisions.
+/*
+ * The PCI address space does equal the physical memory address space.
+ * The networking and block device layers use this boolean for bounce
+ * buffer decisions.
*/
#define PCI_DMA_BUS_IS_PHYS (0)
-/* Allocate and map kernel buffer using consistent mode DMA for a device.
- * hwdev should be valid struct pci_dev pointer for PCI devices,
- * NULL for PCI-like buses (ISA, EISA).
- * Returns non-NULL cpu-view pointer to the buffer if successful and
- * sets *dma_addrp to the pci side dma address as well, else *dma_addrp
- * is undefined.
- */
-extern void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *handle);
+static inline void *
+pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *handle)
+{
+ int gfp = GFP_KERNEL;
+
+ if (hwdev == NULL || pcidev_is_sa1111(hwdev) ||
+ hwdev->dma_mask != 0xffffffff)
+ gfp |= GFP_DMA;
+
+ return consistent_alloc(gfp, size, handle);
+}
-/* Free and unmap a consistent DMA buffer.
- * cpu_addr is what was returned from pci_alloc_consistent,
- * size must be the same as what as passed into pci_alloc_consistent,
- * and likewise dma_addr must be the same as what *dma_addrp was set to.
- *
- * References to the memory and mappings associated with cpu_addr/dma_addr
- * past this call are illegal.
- */
static inline void
pci_free_consistent(struct pci_dev *hwdev, size_t size, void *vaddr,
- dma_addr_t dma_handle)
+ dma_addr_t handle)
{
- consistent_free(vaddr, size, dma_handle);
+ dma_free_coherent(hwdev ? &hwdev->dev : NULL, size, vaddr, handle);
}
-/* Map a single buffer of the indicated size for DMA in streaming mode.
- * The 32-bit bus address to use is returned.
- *
- * Once the device is given the dma address, the device owns this memory
- * until either pci_unmap_single or pci_dma_sync_single is performed.
- */
static inline dma_addr_t
-pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
+pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int dir)
{
- if (dev_is_sa1111(hwdev))
- return sa1111_map_single(hwdev, ptr, size, direction);
+ if (pcidev_is_sa1111(hwdev))
+ return sa1111_map_single(ptr, size, dir);
- consistent_sync(ptr, size, direction);
- return virt_to_bus(ptr);
+ return dma_map_single(hwdev ? &hwdev->dev : NULL, ptr, size, dir);
}
-/* Unmap a single streaming mode DMA translation. The dma_addr and size
- * must match what was provided for in a previous pci_map_single call. All
- * other usages are undefined.
- *
- * After this call, reads by the cpu to the buffer are guarenteed to see
- * whatever the device wrote there.
- */
static inline void
-pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction)
+pci_unmap_single(struct pci_dev *hwdev, dma_addr_t handle, size_t size, int dir)
{
- if (dev_is_sa1111(hwdev))
- sa1111_unmap_single(hwdev, dma_addr, size, direction);
+ if (pcidev_is_sa1111(hwdev)) {
+ sa1111_unmap_single(handle, size, dir);
+ return;
+ }
- /* nothing to do */
+ return dma_unmap_single(hwdev ? &hwdev->dev : NULL, handle, size, dir);
}
-/*
- * Whether pci_unmap_{single,page} is a nop depends upon the
- * configuration.
- */
-#if defined(CONFIG_PCI) || defined(CONFIG_SA1111)
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
-#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
-#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
-#else
-#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
-#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
-#define pci_unmap_addr(PTR, ADDR_NAME) (0)
-#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
-#define pci_unmap_len(PTR, LEN_NAME) (0)
-#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
-#endif /* CONFIG_PCI */
-
-/* Map a set of buffers described by scatterlist in streaming
- * mode for DMA. This is the scather-gather version of the
- * above pci_map_single interface. Here the scatter gather list
- * elements are each tagged with the appropriate dma address
- * and length. They are obtained via sg_dma_{address,length}(SG).
- *
- * NOTE: An implementation may be able to use a smaller number of
- * DMA address/length pairs than there are SG table elements.
- * (for example via virtual mapping capabilities)
- * The routine returns the number of addr/length pairs actually
- * used, at most nents.
- *
- * Device ownership issues as mentioned above for pci_map_single are
- * the same here.
- */
static inline int
-pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction)
+pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int dir)
{
- int i;
-
- if (dev_is_sa1111(hwdev))
- return sa1111_map_sg(hwdev, sg, nents, direction);
-
- for (i = 0; i < nents; i++, sg++) {
- char *virt;
-
- sg->dma_address = page_to_bus(sg->page) + sg->offset;
- virt = page_address(sg->page) + sg->offset;
- consistent_sync(virt, sg->length, direction);
- }
+ if (pcidev_is_sa1111(hwdev))
+ return sa1111_map_sg(sg, nents, dir);
- return nents;
+ return dma_map_sg(hwdev ? &hwdev->dev : NULL, sg, nents, dir);
}
-/* Unmap a set of streaming mode DMA translations.
- * Again, cpu read rules concerning calls here are the same as for
- * pci_unmap_single() above.
- */
static inline void
-pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int direction)
+pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nents, int dir)
{
- if (dev_is_sa1111(hwdev)) {
- sa1111_unmap_sg(hwdev, sg, nents, direction);
+ if (pcidev_is_sa1111(hwdev)) {
+ sa1111_unmap_sg(sg, nents, dir);
return;
}
- /* nothing to do */
+ return dma_unmap_sg(hwdev ? &hwdev->dev : NULL, sg, nents, dir);
}
-/* Make physical memory consistent for a single
- * streaming mode DMA translation after a transfer.
- *
- * If you perform a pci_map_single() but wish to interrogate the
- * buffer using the cpu, yet do not wish to teardown the PCI dma
- * mapping, you must call this function before doing so. At the
- * next point you give the PCI dma address back to the card, the
- * device again owns the buffer.
- */
static inline void
-pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t dma_handle, size_t size, int direction)
+pci_dma_sync_single(struct pci_dev *hwdev, dma_addr_t handle, size_t size, int dir)
{
- if (dev_is_sa1111(hwdev)) {
- sa1111_dma_sync_single(hwdev, dma_handle, size, direction);
+ if (pcidev_is_sa1111(hwdev)) {
+ sa1111_dma_sync_single(handle, size, dir);
return;
}
- consistent_sync(bus_to_virt(dma_handle), size, direction);
+ return dma_sync_single(hwdev ? &hwdev->dev : NULL, handle, size, dir);
}
-/* Make physical memory consistent for a set of streaming
- * mode DMA translations after a transfer.
- *
- * The same as pci_dma_sync_single but for a scatter-gather list,
- * same rules and usage.
- */
static inline void
-pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction)
+pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int dir)
{
- int i;
-
- if (dev_is_sa1111(hwdev)) {
- sa1111_dma_sync_sg(hwdev, sg, nelems, direction);
+ if (pcidev_is_sa1111(hwdev)) {
+ sa1111_dma_sync_sg(sg, nelems, dir);
return;
}
- for (i = 0; i < nelems; i++, sg++) {
- char *virt = page_address(sg->page) + sg->offset;
- consistent_sync(virt, sg->length, direction);
- }
+ return dma_sync_sg(hwdev ? &hwdev->dev : NULL, sg, nelems, dir);
}
-/* Return whether the given PCI device DMA address mask can
- * be supported properly. For example, if your device can
- * only drive the low 24-bits during PCI bus mastering, then
- * you would pass 0x00ffffff as the mask to this function.
- */
static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
{
return 1;
}
-/* This isn't fine. */
+/*
+ * We don't support DAC DMA cycles.
+ */
#define pci_dac_dma_supported(pci_dev, mask) (0)
-/* Return the index of the PCI controller for device PDEV. */
+/*
+ * Return the index of the PCI controller for device PDEV.
+ */
#define pci_controller_num(PDEV) (0)
#if defined(CONFIG_SA1111) && !defined(CONFIG_PCI)
-/* SA-1111 needs these prototypes even when !defined(CONFIG_PCI) */
-
-/* kmem_cache style wrapper around pci_alloc_consistent() */
+/*
+ * SA-1111 needs these prototypes even when !defined(CONFIG_PCI)
+ *
+ * kmem_cache style wrapper around pci_alloc_consistent()
+ */
struct pci_pool *pci_pool_create (const char *name, struct pci_dev *dev,
size_t size, size_t align, size_t allocation);
void pci_pool_destroy (struct pci_pool *pool);
@@ -248,6 +148,26 @@ void *pci_pool_alloc (struct pci_pool *pool, int flags, dma_addr_t *handle);
void pci_pool_free (struct pci_pool *pool, void *vaddr, dma_addr_t addr);
#endif
+/*
+ * Whether pci_unmap_{single,page} is a nop depends upon the
+ * configuration.
+ */
+#if defined(CONFIG_PCI) || defined(CONFIG_SA1111)
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME) dma_addr_t ADDR_NAME;
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME) __u32 LEN_NAME;
+#define pci_unmap_addr(PTR, ADDR_NAME) ((PTR)->ADDR_NAME)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) (((PTR)->ADDR_NAME) = (VAL))
+#define pci_unmap_len(PTR, LEN_NAME) ((PTR)->LEN_NAME)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) (((PTR)->LEN_NAME) = (VAL))
+#else
+#define DECLARE_PCI_UNMAP_ADDR(ADDR_NAME)
+#define DECLARE_PCI_UNMAP_LEN(LEN_NAME)
+#define pci_unmap_addr(PTR, ADDR_NAME) (0)
+#define pci_unmap_addr_set(PTR, ADDR_NAME, VAL) do { } while (0)
+#define pci_unmap_len(PTR, LEN_NAME) (0)
+#define pci_unmap_len_set(PTR, LEN_NAME, VAL) do { } while (0)
+#endif
+
#define HAVE_PCI_MMAP
extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma,
enum pci_mmap_state mmap_state, int write_combine);
diff --git a/include/asm-arm/proc-armv/locks.h b/include/asm-arm/proc-armv/locks.h
index d649d4c51220..d96dede22cc2 100644
--- a/include/asm-arm/proc-armv/locks.h
+++ b/include/asm-arm/proc-armv/locks.h
@@ -27,7 +27,7 @@
" blmi " #fail \
: \
: "r" (ptr), "I" (1) \
- : "ip", "lr", "cc"); \
+ : "ip", "lr", "cc", "memory"); \
})
#define __down_op_ret(ptr,fail) \
@@ -48,7 +48,7 @@
" mov %0, ip" \
: "=&r" (ret) \
: "r" (ptr), "I" (1) \
- : "ip", "lr", "cc"); \
+ : "ip", "lr", "cc", "memory"); \
ret; \
})
@@ -94,7 +94,7 @@
" blne " #fail \
: \
: "r" (ptr), "I" (RW_LOCK_BIAS) \
- : "ip", "lr", "cc"); \
+ : "ip", "lr", "cc", "memory"); \
})
#define __up_op_write(ptr,wake) \
@@ -112,7 +112,7 @@
" blcs " #wake \
: \
: "r" (ptr), "I" (RW_LOCK_BIAS) \
- : "ip", "lr", "cc"); \
+ : "ip", "lr", "cc", "memory"); \
})
#define __down_op_read(ptr,fail) \
diff --git a/include/asm-arm/proc-armv/uaccess.h b/include/asm-arm/proc-armv/uaccess.h
index fa765b32daf3..1162e2f9e047 100644
--- a/include/asm-arm/proc-armv/uaccess.h
+++ b/include/asm-arm/proc-armv/uaccess.h
@@ -37,7 +37,7 @@ static inline void set_fs (mm_segment_t fs)
: "cc"); \
(flag == 0); })
-#define __put_user_asm_byte(x,addr,err) \
+#define __put_user_asm_byte(x,__pu_addr,err) \
__asm__ __volatile__( \
"1: strbt %1,[%2],#0\n" \
"2:\n" \
@@ -51,27 +51,26 @@ static inline void set_fs (mm_segment_t fs)
" .long 1b, 3b\n" \
" .previous" \
: "=r" (err) \
- : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err))
+ : "r" (x), "r" (__pu_addr), "i" (-EFAULT), "0" (err) \
+ : "cc")
#ifndef __ARMEB__
-#define __put_user_asm_half(x,addr,err) \
+#define __put_user_asm_half(x,__pu_addr,err) \
({ \
unsigned long __temp = (unsigned long)(x); \
- unsigned long __ptr = (unsigned long)(addr); \
- __put_user_asm_byte(__temp, __ptr, err); \
- __put_user_asm_byte(__temp >> 8, __ptr + 1, err); \
+ __put_user_asm_byte(__temp, __pu_addr, err); \
+ __put_user_asm_byte(__temp >> 8, __pu_addr + 1, err); \
})
#else
-#define __put_user_asm_half(x,addr,err) \
+#define __put_user_asm_half(x,__pu_addr,err) \
({ \
unsigned long __temp = (unsigned long)(x); \
- unsigned long __ptr = (unsigned long)(addr); \
- __put_user_asm_byte(__temp >> 8, __ptr, err); \
- __put_user_asm_byte(__temp, __ptr + 1, err); \
+ __put_user_asm_byte(__temp >> 8, __pu_addr, err); \
+ __put_user_asm_byte(__temp, __pu_addr + 1, err); \
})
#endif
-#define __put_user_asm_word(x,addr,err) \
+#define __put_user_asm_word(x,__pu_addr,err) \
__asm__ __volatile__( \
"1: strt %1,[%2],#0\n" \
"2:\n" \
@@ -85,7 +84,31 @@ static inline void set_fs (mm_segment_t fs)
" .long 1b, 3b\n" \
" .previous" \
: "=r" (err) \
- : "r" (x), "r" (addr), "i" (-EFAULT), "0" (err))
+ : "r" (x), "r" (__pu_addr), "i" (-EFAULT), "0" (err))
+
+#define __put_user_asm_dword(x,__pu_addr,err) \
+({ \
+ unsigned long long __temp = (unsigned long long)x; \
+ __asm__ __volatile__( \
+ "1: strt %1, [%2], #0\n" \
+ "2: strt %3, [%4], #0\n" \
+ "3:\n" \
+ " .section .fixup,\"ax\"\n" \
+ " .align 2\n" \
+ "4: mov %0, %5\n" \
+ " b 3b\n" \
+ " .previous\n" \
+ " .section __ex_table,\"a\"\n" \
+ " .align 3\n" \
+ " .long 1b, 4b\n" \
+ " .long 2b, 4b\n" \
+ " .previous" \
+ : "=r" (err) \
+ : "r" (__temp), "r" (__pu_addr), \
+ "r" (__temp >> 32), "r" (__pu_addr + 4), \
+ "i" (-EFAULT), "0" (err) \
+ : "cc"); \
+})
#define __get_user_asm_byte(x,addr,err) \
__asm__ __volatile__( \
diff --git a/include/asm-arm/semaphore.h b/include/asm-arm/semaphore.h
index fb73d9752319..34412c203747 100644
--- a/include/asm-arm/semaphore.h
+++ b/include/asm-arm/semaphore.h
@@ -22,19 +22,18 @@ struct semaphore {
};
#if WAITQUEUE_DEBUG
-# define __SEM_DEBUG_INIT(name) \
- , (long)&(name).__magic
+# define __SEM_DEBUG_INIT(name) .__magic = (long)&(name).__magic
#else
# define __SEM_DEBUG_INIT(name)
#endif
-#define __SEMAPHORE_INIT(name,count) \
- { ATOMIC_INIT(count), 0, \
- __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
- __SEM_DEBUG_INIT(name) }
+#define __SEMAPHORE_INIT(name,cnt) { \
+ .count = ATOMIC_INIT(cnt), \
+ .wait = __WAIT_QUEUE_HEAD_INITIALIZER((name).wait), \
+ __SEM_DEBUG_INIT(name) \
+}
-#define __MUTEX_INITIALIZER(name) \
- __SEMAPHORE_INIT(name,1)
+#define __MUTEX_INITIALIZER(name) __SEMAPHORE_INIT(name,1)
#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
struct semaphore name = __SEMAPHORE_INIT(name,count)
@@ -62,6 +61,11 @@ static inline void init_MUTEX_LOCKED(struct semaphore *sem)
sema_init(sem, 0);
}
+static inline int sema_count(struct semaphore *sem)
+{
+ return atomic_read(&sem->count);
+}
+
/*
* special register calling convention
*/
diff --git a/include/asm-arm/thread_info.h b/include/asm-arm/thread_info.h
index 1991b807b3ce..8ca864104452 100644
--- a/include/asm-arm/thread_info.h
+++ b/include/asm-arm/thread_info.h
@@ -51,17 +51,21 @@ struct thread_info {
__u32 cpu; /* cpu */
__u32 cpu_domain; /* cpu domain */
struct cpu_context_save cpu_context; /* cpu context */
+ struct restart_block restart_block;
union fp_state fpstate;
};
-#define INIT_THREAD_INFO(tsk) \
-{ \
- task: &tsk, \
- exec_domain: &default_exec_domain, \
- flags: 0, \
- preempt_count: 0, \
- addr_limit: KERNEL_DS, \
- INIT_EXTRA_THREAD_INFO, \
+#define INIT_THREAD_INFO(tsk) \
+{ \
+ .task = &tsk, \
+ .exec_domain = &default_exec_domain, \
+ .flags = 0, \
+ .preempt_count = 1, \
+ .addr_limit = KERNEL_DS, \
+ .restart_block = { \
+ .fn = do_no_restart_syscall, \
+ }, \
+ INIT_EXTRA_THREAD_INFO, \
}
#define init_thread_info (init_thread_union.thread_info)
diff --git a/include/asm-arm/uaccess.h b/include/asm-arm/uaccess.h
index bc6853b22177..d21892660de0 100644
--- a/include/asm-arm/uaccess.h
+++ b/include/asm-arm/uaccess.h
@@ -81,7 +81,7 @@ extern int __get_user_bad(void);
const register typeof(*(p)) *__p asm("r0") = (p); \
register typeof(*(p)) __r1 asm("r1"); \
register int __e asm("r0"); \
- switch (sizeof(*(p))) { \
+ switch (sizeof(*(__p))) { \
case 1: \
__get_user_x(__r1, __p, __e, 1, "lr"); \
break; \
@@ -120,7 +120,7 @@ extern int __put_user_bad(void);
const register typeof(*(p)) __r1 asm("r1") = (x); \
const register typeof(*(p)) *__p asm("r0") = (p); \
register int __e asm("r0"); \
- switch (sizeof(*(p))) { \
+ switch (sizeof(*(__p))) { \
case 1: \
__put_user_x(__r1, __p, __e, 1, "r2", "lr"); \
break; \
@@ -256,14 +256,15 @@ static inline long strnlen_user(const char *s, long n)
#define __put_user_nocheck(x,ptr,size) \
({ \
long __pu_err = 0; \
- __typeof__(*(ptr)) *__pu_addr = (ptr); \
+ unsigned long __pu_addr = (unsigned long)(ptr); \
__put_user_size((x),__pu_addr,(size),__pu_err); \
__pu_err; \
})
#define __put_user_nocheck_error(x,ptr,size,err) \
({ \
- __put_user_size((x),(ptr),(size),err); \
+ unsigned long __pu_addr = (unsigned long)(ptr); \
+ __put_user_size((x),__pu_addr,(size),err); \
(void) 0; \
})
@@ -273,6 +274,7 @@ do { \
case 1: __get_user_asm_byte(x,ptr,retval); break; \
case 2: __get_user_asm_half(x,ptr,retval); break; \
case 4: __get_user_asm_word(x,ptr,retval); break; \
+ case 8: __get_user_asm_dword(x,ptr,retval); break; \
default: (x) = __get_user_bad(); \
} \
} while (0)
@@ -283,6 +285,7 @@ do { \
case 1: __put_user_asm_byte(x,ptr,retval); break; \
case 2: __put_user_asm_half(x,ptr,retval); break; \
case 4: __put_user_asm_word(x,ptr,retval); break; \
+ case 8: __put_user_asm_dword(x,ptr,retval); break; \
default: __put_user_bad(); \
} \
} while (0)
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index d61495103715..a5dc6bb96720 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -25,6 +25,7 @@
* This file contains the system call numbers.
*/
+#define __NR_restart_syscall (__NR_SYSCALL_BASE+ 0)
#define __NR_exit (__NR_SYSCALL_BASE+ 1)
#define __NR_fork (__NR_SYSCALL_BASE+ 2)
#define __NR_read (__NR_SYSCALL_BASE+ 3)
diff --git a/include/asm-i386/elf.h b/include/asm-i386/elf.h
index f7ad699487b4..73f4067e3995 100644
--- a/include/asm-i386/elf.h
+++ b/include/asm-i386/elf.h
@@ -8,6 +8,7 @@
#include <asm/ptrace.h>
#include <asm/user.h>
#include <asm/processor.h>
+#include <asm/system.h> /* for savesegment */
#include <linux/utsname.h>
@@ -58,11 +59,6 @@ typedef struct user_fxsr_struct elf_fpxregset_t;
#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2)
-/* Wow, the "main" arch needs arch dependent functions too.. :) */
-
-#define savesegment(seg,value) \
- asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value)))
-
/* regs is struct pt_regs, pr_reg is elf_gregset_t (which is
now struct_user_regs, they are different) */
diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h
index e085e51e9d25..bdc4da98612c 100644
--- a/include/asm-i386/system.h
+++ b/include/asm-i386/system.h
@@ -95,6 +95,12 @@ static inline unsigned long _get_base(char * addr)
: :"m" (*(unsigned int *)&(value)))
/*
+ * Save a segment register away
+ */
+#define savesegment(seg, value) \
+ asm volatile("movl %%" #seg ",%0":"=m" (*(int *)&(value)))
+
+/*
* Clear and set 'TS' bit respectively
*/
#define clts() __asm__ __volatile__ ("clts")
diff --git a/include/asm-ppc/module.h b/include/asm-ppc/module.h
index 7d75a3e3e2ee..01ed28a9f30e 100644
--- a/include/asm-ppc/module.h
+++ b/include/asm-ppc/module.h
@@ -18,16 +18,17 @@ struct ppc_plt_entry
struct mod_arch_specific
{
- /* How much of the core is actually taken up with core (then
- we know the rest is for the PLT */
- unsigned int core_plt_offset;
-
- /* Same for init */
- unsigned int init_plt_offset;
+ /* Indices of PLT sections within module. */
+ unsigned int core_plt_section, init_plt_section;
};
#define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym
#define Elf_Ehdr Elf32_Ehdr
+/* Make empty sections for module_frob_arch_sections to expand. */
+#ifdef MODULE
+asm(".section .plt,\"ax\",@nobits; .align 3; .previous");
+asm(".section .init.plt,\"ax\",@nobits; .align 3; .previous");
+#endif
#endif /* _ASM_PPC_MODULE_H */
diff --git a/include/asm-ppc64/compat.h b/include/asm-ppc64/compat.h
index a397383110cd..8ad44c0e53d4 100644
--- a/include/asm-ppc64/compat.h
+++ b/include/asm-ppc64/compat.h
@@ -5,9 +5,25 @@
*/
#include <linux/types.h>
+#define COMPAT_USER_HZ 100
+
typedef u32 compat_size_t;
typedef s32 compat_ssize_t;
typedef s32 compat_time_t;
+typedef s32 compat_clock_t;
+typedef s32 compat_pid_t;
+typedef u32 compat_uid_t;
+typedef u32 compat_gid_t;
+typedef u32 compat_mode_t;
+typedef u32 compat_ino_t;
+typedef u32 compat_dev_t;
+typedef s32 compat_off_t;
+typedef s64 compat_loff_t;
+typedef s16 compat_nlink_t;
+typedef u16 compat_ipc_pid_t;
+typedef s32 compat_daddr_t;
+typedef u32 compat_caddr_t;
+typedef __kernel_fsid_t compat_fsid_t;
struct compat_timespec {
compat_time_t tv_sec;
@@ -19,4 +35,24 @@ struct compat_timeval {
s32 tv_usec;
};
+struct compat_stat {
+ compat_dev_t st_dev;
+ compat_ino_t st_ino;
+ compat_mode_t st_mode;
+ compat_nlink_t st_nlink;
+ compat_uid_t st_uid;
+ compat_gid_t st_gid;
+ compat_dev_t st_rdev;
+ compat_off_t st_size;
+ compat_off_t st_blksize;
+ compat_off_t st_blocks;
+ compat_time_t st_atime;
+ u32 __unused1;
+ compat_time_t st_mtime;
+ u32 __unused2;
+ compat_time_t st_ctime;
+ u32 __unused3;
+ u32 __unused4[2];
+};
+
#endif /* _ASM_PPC64_COMPAT_H */
diff --git a/include/asm-ppc64/page.h b/include/asm-ppc64/page.h
index 7eb130cd1ab8..feabff500b6c 100644
--- a/include/asm-ppc64/page.h
+++ b/include/asm-ppc64/page.h
@@ -48,7 +48,7 @@ static __inline__ void clear_page(void *addr)
lines = naca->dCacheL1LinesPerPage;
__asm__ __volatile__(
-" mtctr %1\n\
+ "mtctr %1 # clear_page\n\
1: dcbz 0,%0\n\
add %0,%0,%3\n\
bdnz+ 1b"
diff --git a/include/asm-ppc64/pgtable.h b/include/asm-ppc64/pgtable.h
index 80d3977cf73f..3b13d9cd1fd8 100644
--- a/include/asm-ppc64/pgtable.h
+++ b/include/asm-ppc64/pgtable.h
@@ -267,8 +267,8 @@ static inline unsigned long pte_update( pte_t *p, unsigned long clr,
{
unsigned long old, tmp;
- __asm__ __volatile__("\n\
-1: ldarx %0,0,%3 \n\
+ __asm__ __volatile__(
+ "1: ldarx %0,0,%3 # pte_update\n\
andc %1,%0,%4 \n\
or %1,%1,%5 \n\
stdcx. %1,0,%3 \n\
diff --git a/include/asm-ppc64/ppc32.h b/include/asm-ppc64/ppc32.h
index 1b39c4908205..5b7a8dc91bda 100644
--- a/include/asm-ppc64/ppc32.h
+++ b/include/asm-ppc64/ppc32.h
@@ -14,11 +14,6 @@
* 2 of the License, or (at your option) any later version.
*/
-#ifndef __KERNEL_STRICT_NAMES
-#include <linux/types.h>
-typedef __kernel_fsid_t __kernel_fsid_t32;
-#endif
-
/* Use this to get at 32-bit user passed pointers. */
/* Things to consider: the low-level assembly stub does
srl x, 0, x for first four arguments, so if you have
@@ -44,21 +39,6 @@ typedef __kernel_fsid_t __kernel_fsid_t32;
})
/* These are here to support 32-bit syscalls on a 64-bit kernel. */
-typedef int __kernel_ptrdiff_t32;
-typedef int __kernel_clock_t32;
-typedef int __kernel_pid_t32;
-typedef unsigned short __kernel_ipc_pid_t32;
-typedef unsigned int __kernel_uid_t32;
-typedef unsigned int __kernel_gid_t32;
-typedef unsigned int __kernel_dev_t32;
-typedef unsigned int __kernel_ino_t32;
-typedef unsigned int __kernel_mode_t32;
-typedef unsigned int __kernel_umode_t32;
-typedef short __kernel_nlink_t32;
-typedef int __kernel_daddr_t32;
-typedef int __kernel_off_t32;
-typedef unsigned int __kernel_caddr_t32;
-typedef int __kernel_loff_t32;
struct statfs32 {
int f_type;
@@ -68,7 +48,7 @@ struct statfs32 {
int f_bavail;
int f_files;
int f_ffree;
- __kernel_fsid_t32 f_fsid;
+ compat_fsid_t f_fsid;
int f_namelen; /* SunOS ignores this field. */
int f_spare[6];
};
@@ -88,8 +68,8 @@ typedef struct siginfo32 {
/* kill() */
struct {
- __kernel_pid_t32 _pid; /* sender's pid */
- __kernel_uid_t32 _uid; /* sender's uid */
+ compat_pid_t _pid; /* sender's pid */
+ compat_uid_t _uid; /* sender's uid */
} _kill;
/* POSIX.1b timers */
@@ -100,18 +80,18 @@ typedef struct siginfo32 {
/* POSIX.1b signals */
struct {
- __kernel_pid_t32 _pid; /* sender's pid */
- __kernel_uid_t32 _uid; /* sender's uid */
+ compat_pid_t _pid; /* sender's pid */
+ compat_uid_t _uid; /* sender's uid */
sigval_t32 _sigval;
} _rt;
/* SIGCHLD */
struct {
- __kernel_pid_t32 _pid; /* which child */
- __kernel_uid_t32 _uid; /* sender's uid */
+ compat_pid_t _pid; /* which child */
+ compat_uid_t _uid; /* sender's uid */
int _status; /* exit code */
- __kernel_clock_t32 _utime;
- __kernel_clock_t32 _stime;
+ compat_clock_t _utime;
+ compat_clock_t _stime;
} _sigchld;
/* SIGILL, SIGFPE, SIGSEGV, SIGBUS, SIGEMT */
@@ -164,32 +144,12 @@ typedef struct sigaltstack_32 {
struct flock32 {
short l_type;
short l_whence;
- __kernel_off_t32 l_start;
- __kernel_off_t32 l_len;
- __kernel_pid_t32 l_pid;
+ compat_off_t l_start;
+ compat_off_t l_len;
+ compat_pid_t l_pid;
short __unused;
};
-struct stat32 {
- __kernel_dev_t32 st_dev; /* 2 */
- __kernel_ino_t32 st_ino; /* 4 */
- __kernel_mode_t32 st_mode; /* 2 */
- short st_nlink; /* 2 */
- __kernel_uid_t32 st_uid; /* 2 */
- __kernel_gid_t32 st_gid; /* 2 */
- __kernel_dev_t32 st_rdev; /* 2 */
- __kernel_off_t32 st_size; /* 4 */
- __kernel_off_t32 st_blksize; /* 4 */
- __kernel_off_t32 st_blocks; /* 4 */
- compat_time_t st_atime; /* 4 */
- unsigned int __unused1; /* 4 */
- compat_time_t st_mtime; /* 4 */
- unsigned int __unused2; /* 4 */
- compat_time_t st_ctime; /* 4 */
- unsigned int __unused3; /* 4 */
- unsigned int __unused4[2]; /* 2*4 */
-};
-
struct sigcontext32 {
unsigned int _unused[4];
int signal;
diff --git a/include/asm-ppc64/prom.h b/include/asm-ppc64/prom.h
index dbe1889b3184..1af24acffb7e 100644
--- a/include/asm-ppc64/prom.h
+++ b/include/asm-ppc64/prom.h
@@ -155,12 +155,6 @@ struct prom_args {
prom_arg_t *rets; /* Pointer to return values in args[16]. */
};
-typedef struct {
- u32 printf; /* void (*printf)(char *, ...); */
- u32 memdump; /* void (*memdump)(unsigned char *, unsigned long); */
- u32 dummy; /* void (*dummy)(void); */
-} yaboot_debug_t;
-
struct prom_t {
unsigned long entry;
ihandle chosen;
@@ -171,9 +165,6 @@ struct prom_t {
unsigned long version;
unsigned long encode_phys_size;
struct bi_record *bi_recs;
-#ifdef DEBUG_YABOOT
- yaboot_debug_t *yaboot;
-#endif
};
extern struct prom_t prom;
@@ -183,7 +174,7 @@ extern int boot_cpuid;
/* Prototypes */
extern void abort(void);
extern unsigned long prom_init(unsigned long, unsigned long, unsigned long,
- unsigned long, unsigned long, yaboot_debug_t *);
+ unsigned long, unsigned long);
extern void prom_print(const char *msg);
extern void relocate_nodes(void);
extern void finish_device_tree(void);
diff --git a/include/asm-ppc64/smp.h b/include/asm-ppc64/smp.h
index e5df63d903ed..0dd474425342 100644
--- a/include/asm-ppc64/smp.h
+++ b/include/asm-ppc64/smp.h
@@ -52,7 +52,7 @@ static inline int num_online_cpus(void)
return nr;
}
-extern volatile unsigned long cpu_callin_map[NR_CPUS];
+extern volatile unsigned int cpu_callin_map[NR_CPUS];
#define smp_processor_id() (get_paca()->xPacaIndex)
diff --git a/include/asm-ppc64/tlb.h b/include/asm-ppc64/tlb.h
index b44c7a071892..2c0903092ffb 100644
--- a/include/asm-ppc64/tlb.h
+++ b/include/asm-ppc64/tlb.h
@@ -62,7 +62,7 @@ static inline void __tlb_remove_tlb_entry(mmu_gather_t *tlb, pte_t *ptep,
if (i == PPC64_TLB_BATCH_NR) {
int local = 0;
- if (tlb->mm->cpu_vm_mask == (1 << cpu))
+ if (tlb->mm->cpu_vm_mask == (1UL << cpu))
local = 1;
flush_hash_range(tlb->mm->context, i, local);
@@ -80,7 +80,7 @@ static inline void tlb_flush(struct free_pte_ctx *tlb)
struct ppc64_tlb_batch *batch = &ppc64_tlb_batch[cpu];
int local = 0;
- if (tlb->mm->cpu_vm_mask == (1 << smp_processor_id()))
+ if (tlb->mm->cpu_vm_mask == (1UL << smp_processor_id()))
local = 1;
flush_hash_range(tlb->mm->context, batch->index, local);
diff --git a/include/asm-ppc64/topology.h b/include/asm-ppc64/topology.h
index d70184399d76..66e2546216c7 100644
--- a/include/asm-ppc64/topology.h
+++ b/include/asm-ppc64/topology.h
@@ -41,7 +41,7 @@ static inline unsigned long __node_to_cpu_mask(int node)
for(cpu = 0; cpu < NR_CPUS; cpu++)
if (numa_cpu_lookup_table[cpu] == node)
- mask |= 1 << cpu;
+ mask |= 1UL << cpu;
return mask;
}
diff --git a/include/asm-ppc64/xics.h b/include/asm-ppc64/xics.h
new file mode 100644
index 000000000000..8db0fc4445ee
--- /dev/null
+++ b/include/asm-ppc64/xics.h
@@ -0,0 +1,18 @@
+/*
+ * arch/ppc64/kernel/xics.h
+ *
+ * Copyright 2000 IBM Corporation.
+ *
+ * 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 _PPC64_KERNEL_XICS_H
+#define _PPC64_KERNEL_XICS_H
+
+void xics_init_IRQ(void);
+int xics_get_irq(struct pt_regs *);
+
+#endif /* _PPC64_KERNEL_XICS_H */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 128e310b9f5d..8a4734f94463 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -425,6 +425,7 @@ struct fb_info {
#define fb_readb __raw_readb
#define fb_readw __raw_readw
#define fb_readl __raw_readl
+#define fb_readq __raw_readq
#define fb_writeb __raw_writeb
#define fb_writew __raw_writew
#define fb_writel __raw_writel
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index 928ae553ca37..5001ff39204d 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -15,20 +15,11 @@ unsigned long find_symbol_internal(Elf_Shdr *sechdrs,
/* These must be implemented by the specific architecture */
-/* Total size to allocate for the non-releasable code; return len or
- -error. mod->core_size is the current generic tally. */
-long module_core_size(const Elf_Ehdr *hdr,
- const Elf_Shdr *sechdrs,
- const char *secstrings,
- struct module *mod);
-
-/* Total size of (if any) sections to be freed after init. Return 0
- for none, len, or -error. mod->init_size is the current generic
- tally. */
-long module_init_size(const Elf_Ehdr *hdr,
- const Elf_Shdr *sechdrs,
- const char *secstrings,
- struct module *mod);
+/* Adjust arch-specific sections. Return 0 on success. */
+int module_frob_arch_sections(const Elf_Ehdr *hdr,
+ const Elf_Shdr *sechdrs,
+ const char *secstrings,
+ struct module *mod);
/* Allocator used for allocating struct module, core sections and init
sections. Returns NULL on failure. */
diff --git a/include/net/irda/vlsi_ir.h b/include/net/irda/vlsi_ir.h
index 32d30cbc0920..f2c66f9296ed 100644
--- a/include/net/irda/vlsi_ir.h
+++ b/include/net/irda/vlsi_ir.h
@@ -27,13 +27,6 @@
#ifndef IRDA_VLSI_FIR_H
#define IRDA_VLSI_FIR_H
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,4)
-#ifdef CONFIG_PROC_FS
-/* PDE() introduced in 2.5.4 */
-#define PDE(inode) ((inode)->u.generic_ip)
-#endif
-#endif
-
/*
* #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,xx)
*
diff --git a/include/video/tgafb.h b/include/video/tgafb.h
index 0e76dda6fc4d..23a1808045b2 100644
--- a/include/video/tgafb.h
+++ b/include/video/tgafb.h
@@ -47,6 +47,7 @@
#define TGA_VALID_REG 0x0070
#define TGA_CURSOR_XY_REG 0x0074
#define TGA_INTR_STAT_REG 0x007c
+#define TGA_DATA_REG 0x0080
#define TGA_RAMDAC_SETUP_REG 0x00c0
#define TGA_BLOCK_COLOR0_REG 0x0140
#define TGA_BLOCK_COLOR1_REG 0x0144