Remove patches not listed anymore in the series file.
svn path=/dists/trunk/linux-2.6/; revision=4947
This commit is contained in:
parent
310ffa9bf6
commit
89c4356650
|
@ -1,282 +0,0 @@
|
|||
arch/m68k/kernel/Makefile | 4 -
|
||||
arch/m68k/kernel/dma.c | 112 +++++++++++++++++++++++++++++++++++++++++
|
||||
include/asm-m68k/dma-mapping.h | 63 ++++++++++++++++++++---
|
||||
include/asm-m68k/scatterlist.h | 9 +--
|
||||
4 files changed, 175 insertions(+), 13 deletions(-)
|
||||
|
||||
Index: linux-tmp/include/asm-m68k/scatterlist.h
|
||||
===================================================================
|
||||
--- linux-tmp.orig/include/asm-m68k/scatterlist.h 2005-06-04 21:57:39.000000000 +0200
|
||||
+++ linux-tmp/include/asm-m68k/scatterlist.h 2005-06-04 21:57:50.000000000 +0200
|
||||
@@ -2,18 +2,17 @@
|
||||
#define _M68K_SCATTERLIST_H
|
||||
|
||||
struct scatterlist {
|
||||
- /* These two are only valid if ADDRESS member of this
|
||||
- * struct is NULL.
|
||||
- */
|
||||
struct page *page;
|
||||
unsigned int offset;
|
||||
-
|
||||
unsigned int length;
|
||||
|
||||
- __u32 dvma_address; /* A place to hang host-specific addresses at. */
|
||||
+ __u32 dma_address; /* A place to hang host-specific addresses at. */
|
||||
};
|
||||
|
||||
/* This is bogus and should go away. */
|
||||
#define ISA_DMA_THRESHOLD (0x00ffffff)
|
||||
|
||||
+#define sg_dma_address(sg) ((sg)->dma_address)
|
||||
+#define sg_dma_len(sg) ((sg)->length)
|
||||
+
|
||||
#endif /* !(_M68K_SCATTERLIST_H) */
|
||||
Index: linux-tmp/arch/m68k/kernel/Makefile
|
||||
===================================================================
|
||||
--- linux-tmp.orig/arch/m68k/kernel/Makefile 2005-06-04 21:57:39.000000000 +0200
|
||||
+++ linux-tmp/arch/m68k/kernel/Makefile 2005-06-04 21:57:50.000000000 +0200
|
||||
@@ -9,8 +9,8 @@ else
|
||||
endif
|
||||
extra-y += vmlinux.lds
|
||||
|
||||
-obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \
|
||||
- sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
|
||||
+obj-y := entry.o process.o traps.o ints.o dma.o signal.o ptrace.o \
|
||||
+ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
|
||||
|
||||
obj-$(CONFIG_PCI) += bios32.o
|
||||
obj-$(CONFIG_MODULES) += module.o
|
||||
Index: linux-tmp/arch/m68k/kernel/dma.c
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ linux-tmp/arch/m68k/kernel/dma.c 2005-06-04 22:30:41.495377370 +0200
|
||||
@@ -0,0 +1,112 @@
|
||||
+
|
||||
+#include <linux/dma-mapping.h>
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/vmalloc.h>
|
||||
+
|
||||
+#include <asm/pgalloc.h>
|
||||
+#include <asm/scatterlist.h>
|
||||
+
|
||||
+void *dma_alloc_coherent(struct device *dev, size_t size,
|
||||
+ dma_addr_t *handle, int flag)
|
||||
+{
|
||||
+ struct page *page, **map;
|
||||
+ pgprot_t pgprot;
|
||||
+ void *addr;
|
||||
+ int i, order;
|
||||
+
|
||||
+ pr_debug("dma_alloc_coherent: %d,%x\n", size, flag);
|
||||
+
|
||||
+ size = PAGE_ALIGN(size);
|
||||
+ order = get_order(size);
|
||||
+
|
||||
+ page = alloc_pages(flag, order);
|
||||
+ if (!page)
|
||||
+ return NULL;
|
||||
+
|
||||
+ *handle = page_to_phys(page);
|
||||
+ map = kmalloc(sizeof(struct page *) << order, flag);
|
||||
+ if (!map) {
|
||||
+ __free_pages(page, order);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ order = 1 << order;
|
||||
+ size >>= PAGE_SHIFT;
|
||||
+ map[0] = page;
|
||||
+ for (i = 1; i < size; i++) {
|
||||
+ map[i] = page + i;
|
||||
+ get_page(map[i]);
|
||||
+ }
|
||||
+ for (; i < order; i++)
|
||||
+ __free_page(page + i);
|
||||
+ pgprot = __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_DIRTY);
|
||||
+ if (CPU_IS_040_OR_060)
|
||||
+ pgprot_val(pgprot) |= _PAGE_GLOBAL040 | _PAGE_NOCACHE_S;
|
||||
+ else
|
||||
+ pgprot_val(pgprot) |= _PAGE_NOCACHE030;
|
||||
+ addr = vmap(map, size, flag, pgprot);
|
||||
+ kfree(map);
|
||||
+
|
||||
+ return addr;
|
||||
+}
|
||||
+
|
||||
+void dma_free_coherent(struct device *dev, size_t size,
|
||||
+ void *addr, dma_addr_t handle)
|
||||
+{
|
||||
+ vfree(addr);
|
||||
+}
|
||||
+
|
||||
+inline void dma_sync_single_for_device(struct device *dev, dma_addr_t handle, size_t size,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ if (dir == DMA_TO_DEVICE)
|
||||
+ cache_push(handle, size);
|
||||
+ else if (dir == DMA_FROM_DEVICE)
|
||||
+ cache_clear(handle, size);
|
||||
+}
|
||||
+
|
||||
+void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < nents; sg++, i++)
|
||||
+ dma_sync_single_for_device(dev, sg->dma_address, sg->length, dir);
|
||||
+}
|
||||
+
|
||||
+dma_addr_t dma_map_single(struct device *dev, void *addr, size_t size,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ dma_addr_t handle = virt_to_bus(addr);
|
||||
+ dma_sync_single_for_device(dev, handle, size, dir);
|
||||
+ return handle;
|
||||
+}
|
||||
+
|
||||
+dma_addr_t dma_map_page(struct device *dev, struct page *page,
|
||||
+ unsigned long offset, size_t size,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ dma_addr_t handle = page_to_phys(page) + offset;
|
||||
+ dma_sync_single_for_device(dev, handle, size, dir);
|
||||
+ return handle;
|
||||
+}
|
||||
+
|
||||
+int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
|
||||
+ enum dma_data_direction dir)
|
||||
+{
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 0; i < nents; sg++, i++) {
|
||||
+ sg->dma_address = page_to_phys(sg->page) + sg->offset;
|
||||
+ dma_sync_single_for_device(dev, sg->dma_address, sg->length, dir);
|
||||
+ }
|
||||
+ return nents;
|
||||
+}
|
||||
+
|
||||
+EXPORT_SYMBOL(dma_alloc_coherent);
|
||||
+EXPORT_SYMBOL(dma_free_coherent);
|
||||
+EXPORT_SYMBOL(dma_map_single);
|
||||
+EXPORT_SYMBOL(dma_map_page);
|
||||
+EXPORT_SYMBOL(dma_map_sg);
|
||||
+EXPORT_SYMBOL(dma_sync_single_for_device);
|
||||
+EXPORT_SYMBOL(dma_sync_sg_for_device);
|
||||
Index: linux-tmp/include/asm-m68k/dma-mapping.h
|
||||
===================================================================
|
||||
--- linux-tmp.orig/include/asm-m68k/dma-mapping.h 2005-06-04 21:57:39.000000000 +0200
|
||||
+++ linux-tmp/include/asm-m68k/dma-mapping.h 2005-06-04 21:57:50.000000000 +0200
|
||||
@@ -1,12 +1,63 @@
|
||||
#ifndef _M68K_DMA_MAPPING_H
|
||||
#define _M68K_DMA_MAPPING_H
|
||||
|
||||
-#include <linux/config.h>
|
||||
+struct scatterlist;
|
||||
|
||||
-#ifdef CONFIG_PCI
|
||||
-#include <asm-generic/dma-mapping.h>
|
||||
-#else
|
||||
-#include <asm-generic/dma-mapping-broken.h>
|
||||
-#endif
|
||||
+static inline int dma_supported(struct device *dev, u64 mask)
|
||||
+{
|
||||
+ return 1;
|
||||
+}
|
||||
+
|
||||
+static inline int dma_set_mask(struct device *dev, u64 mask)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+extern void *dma_alloc_coherent(struct device *, size_t,
|
||||
+ dma_addr_t *, int);
|
||||
+extern void dma_free_coherent(struct device *, size_t,
|
||||
+ void *, dma_addr_t);
|
||||
+
|
||||
+extern dma_addr_t dma_map_single(struct device *, void *, size_t,
|
||||
+ enum dma_data_direction);
|
||||
+static inline void dma_unmap_single(struct device *dev, dma_addr_t addr,
|
||||
+ size_t size, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+extern dma_addr_t dma_map_page(struct device *, struct page *,
|
||||
+ unsigned long, size_t size,
|
||||
+ enum dma_data_direction);
|
||||
+static inline void dma_unmap_page(struct device *dev, dma_addr_t address,
|
||||
+ size_t size, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+extern int dma_map_sg(struct device *, struct scatterlist *, int,
|
||||
+ enum dma_data_direction);
|
||||
+static inline void dma_unmap_sg(struct device *dev, struct scatterlist *sg,
|
||||
+ int nhwentries, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+extern void dma_sync_single_for_device(struct device *, dma_addr_t, size_t,
|
||||
+ enum dma_data_direction);
|
||||
+extern void dma_sync_sg_for_device(struct device *, struct scatterlist *, int,
|
||||
+ enum dma_data_direction);
|
||||
+
|
||||
+static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t handle,
|
||||
+ size_t size, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static inline void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
|
||||
+ int nents, enum dma_data_direction dir)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static inline int dma_mapping_error(dma_addr_t handle)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
|
||||
#endif /* _M68K_DMA_MAPPING_H */
|
||||
diff -pur -X /home/roman/nodiff linux-tmp/arch/m68k/apollo/Makefile linux/arch/m68k/apollo/Makefile
|
||||
--- linux-tmp/arch/m68k/apollo/Makefile 2002-12-17 00:58:44.000000000 +0100
|
||||
+++ linux/arch/m68k/apollo/Makefile 2005-06-10 23:28:12.000000000 +0200
|
||||
@@ -2,4 +2,4 @@
|
||||
# Makefile for Linux arch/m68k/amiga source directory
|
||||
#
|
||||
|
||||
-obj-y := config.o dn_ints.o dma.o
|
||||
+obj-y := config.o dn_ints.o
|
||||
diff -pur -X /home/roman/nodiff linux-tmp/drivers/scsi/sun3x_esp.c linux/drivers/scsi/sun3x_esp.c
|
||||
--- linux-tmp/drivers/scsi/sun3x_esp.c 2004-12-30 00:48:46.000000000 +0100
|
||||
+++ linux/drivers/scsi/sun3x_esp.c 2005-06-11 02:43:27.000000000 +0200
|
||||
@@ -334,11 +334,11 @@ static void dma_mmu_get_scsi_sgl (struct
|
||||
struct scatterlist *sg = sp->SCp.buffer;
|
||||
|
||||
while (sz >= 0) {
|
||||
- sg[sz].dvma_address = dvma_map((unsigned long)page_address(sg[sz].page) +
|
||||
+ sg[sz].dma_address = dvma_map((unsigned long)page_address(sg[sz].page) +
|
||||
sg[sz].offset, sg[sz].length);
|
||||
sz--;
|
||||
}
|
||||
- sp->SCp.ptr=(char *)((unsigned long)sp->SCp.buffer->dvma_address);
|
||||
+ sp->SCp.ptr=(char *)((unsigned long)sp->SCp.buffer->dma_address);
|
||||
}
|
||||
|
||||
static void dma_mmu_release_scsi_one (struct NCR_ESP *esp, Scsi_Cmnd *sp)
|
||||
@@ -352,14 +352,14 @@ static void dma_mmu_release_scsi_sgl (st
|
||||
struct scatterlist *sg = (struct scatterlist *)sp->buffer;
|
||||
|
||||
while(sz >= 0) {
|
||||
- dvma_unmap((char *)sg[sz].dvma_address);
|
||||
+ dvma_unmap((char *)sg[sz].dma_address);
|
||||
sz--;
|
||||
}
|
||||
}
|
||||
|
||||
static void dma_advance_sg (Scsi_Cmnd *sp)
|
||||
{
|
||||
- sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dvma_address);
|
||||
+ sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dma_address);
|
||||
}
|
||||
|
||||
static int sun3x_esp_release(struct Scsi_Host *instance)
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,664 +0,0 @@
|
|||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/cacheflush.h linux-2.6.13/include/asm-m68k/cacheflush.h
|
||||
--- linux-2.6.13-i386/include/asm-m68k/cacheflush.h 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/include/asm-m68k/cacheflush.h 2005-08-30 16:36:03.000000000 +0200
|
||||
@@ -130,20 +130,25 @@
|
||||
#define flush_dcache_mmap_lock(mapping) do { } while (0)
|
||||
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
|
||||
#define flush_icache_page(vma, page) __flush_page_to_ram(page_address(page))
|
||||
-#define flush_icache_user_range(vma,pg,adr,len) do { } while (0)
|
||||
-
|
||||
-#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
|
||||
- do { \
|
||||
- flush_cache_page(vma, vaddr, page_to_pfn(page));\
|
||||
- memcpy(dst, src, len); \
|
||||
- } while (0)
|
||||
-
|
||||
-#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
|
||||
- do { \
|
||||
- flush_cache_page(vma, vaddr, page_to_pfn(page));\
|
||||
- memcpy(dst, src, len); \
|
||||
- } while (0)
|
||||
|
||||
+extern void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
|
||||
+ unsigned long addr, int len);
|
||||
extern void flush_icache_range(unsigned long address, unsigned long endaddr);
|
||||
|
||||
+static inline void copy_to_user_page(struct vm_area_struct *vma,
|
||||
+ struct page *page, unsigned long vaddr,
|
||||
+ void *dst, void *src, int len)
|
||||
+{
|
||||
+ flush_cache_page(vma, vaddr, page_to_pfn(page));
|
||||
+ memcpy(dst, src, len);
|
||||
+ flush_icache_user_range(vma, page, vaddr, len);
|
||||
+}
|
||||
+static inline void copy_from_user_page(struct vm_area_struct *vma,
|
||||
+ struct page *page, unsigned long vaddr,
|
||||
+ void *dst, void *src, int len)
|
||||
+{
|
||||
+ flush_cache_page(vma, vaddr, page_to_pfn(page));
|
||||
+ memcpy(dst, src, len);
|
||||
+}
|
||||
+
|
||||
#endif /* _M68K_CACHEFLUSH_H */
|
||||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/io.h linux-2.6.13/include/asm-m68k/io.h
|
||||
--- linux-2.6.13-i386/include/asm-m68k/io.h 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/include/asm-m68k/io.h 2005-06-19 16:35:42.000000000 +0200
|
||||
@@ -324,8 +324,6 @@
|
||||
#define writel(val,addr) out_le32((addr),(val))
|
||||
#endif
|
||||
|
||||
-#define mmiowb()
|
||||
-
|
||||
static inline void *ioremap(unsigned long physaddr, unsigned long size)
|
||||
{
|
||||
return __ioremap(physaddr, size, IOMAP_NOCACHE_SER);
|
||||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/processor.h linux-2.6.13/include/asm-m68k/processor.h
|
||||
--- linux-2.6.13-i386/include/asm-m68k/processor.h 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/include/asm-m68k/processor.h 2005-05-30 16:33:26.000000000 +0200
|
||||
@@ -14,6 +14,7 @@
|
||||
#define current_text_addr() ({ __label__ _l; _l: &&_l;})
|
||||
|
||||
#include <linux/config.h>
|
||||
+#include <linux/thread_info.h>
|
||||
#include <asm/segment.h>
|
||||
#include <asm/fpu.h>
|
||||
#include <asm/ptrace.h>
|
||||
@@ -55,17 +56,6 @@
|
||||
#endif
|
||||
#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr)
|
||||
|
||||
-struct task_work {
|
||||
- unsigned char sigpending;
|
||||
- unsigned char notify_resume; /* request for notification on
|
||||
- userspace execution resumption */
|
||||
- char need_resched;
|
||||
- unsigned char delayed_trace; /* single step a syscall */
|
||||
- unsigned char syscall_trace; /* count of syscall interceptors */
|
||||
- unsigned char memdie; /* task was selected to be killed */
|
||||
- unsigned char pad[2];
|
||||
-};
|
||||
-
|
||||
struct thread_struct {
|
||||
unsigned long ksp; /* kernel stack pointer */
|
||||
unsigned long usp; /* user stack pointer */
|
||||
@@ -78,7 +68,7 @@
|
||||
unsigned long fp[8*3];
|
||||
unsigned long fpcntl[3]; /* fp control regs */
|
||||
unsigned char fpstate[FPSTATESIZE]; /* floating point state */
|
||||
- struct task_work work;
|
||||
+ struct thread_info info;
|
||||
};
|
||||
|
||||
#define INIT_THREAD { \
|
||||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/serial.h linux-2.6.13/include/asm-m68k/serial.h
|
||||
--- linux-2.6.13-i386/include/asm-m68k/serial.h 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/include/asm-m68k/serial.h 2005-08-30 16:36:03.000000000 +0200
|
||||
@@ -26,9 +26,11 @@
|
||||
#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_ISA
|
||||
#define SERIAL_PORT_DFNS \
|
||||
/* UART CLK PORT IRQ FLAGS */ \
|
||||
{ 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
|
||||
{ 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
|
||||
{ 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
|
||||
{ 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
|
||||
+#endif
|
||||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/string.h linux-2.6.13/include/asm-m68k/string.h
|
||||
--- linux-2.6.13-i386/include/asm-m68k/string.h 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/include/asm-m68k/string.h 2005-08-30 16:36:03.000000000 +0200
|
||||
@@ -80,43 +80,6 @@
|
||||
return( (char *) s);
|
||||
}
|
||||
|
||||
-#if 0
|
||||
-#define __HAVE_ARCH_STRPBRK
|
||||
-static inline char *strpbrk(const char *cs,const char *ct)
|
||||
-{
|
||||
- const char *sc1,*sc2;
|
||||
-
|
||||
- for( sc1 = cs; *sc1 != '\0'; ++sc1)
|
||||
- for( sc2 = ct; *sc2 != '\0'; ++sc2)
|
||||
- if (*sc1 == *sc2)
|
||||
- return((char *) sc1);
|
||||
- return( NULL );
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
-#if 0
|
||||
-#define __HAVE_ARCH_STRSPN
|
||||
-static inline size_t strspn(const char *s, const char *accept)
|
||||
-{
|
||||
- const char *p;
|
||||
- const char *a;
|
||||
- size_t count = 0;
|
||||
-
|
||||
- for (p = s; *p != '\0'; ++p)
|
||||
- {
|
||||
- for (a = accept; *a != '\0'; ++a)
|
||||
- if (*p == *a)
|
||||
- break;
|
||||
- if (*a == '\0')
|
||||
- return count;
|
||||
- else
|
||||
- ++count;
|
||||
- }
|
||||
-
|
||||
- return count;
|
||||
-}
|
||||
-#endif
|
||||
-
|
||||
/* strstr !! */
|
||||
|
||||
#define __HAVE_ARCH_STRLEN
|
||||
@@ -173,370 +136,18 @@
|
||||
}
|
||||
|
||||
#define __HAVE_ARCH_MEMSET
|
||||
-/*
|
||||
- * This is really ugly, but its highly optimizatiable by the
|
||||
- * compiler and is meant as compensation for gcc's missing
|
||||
- * __builtin_memset(). For the 680[23]0 it might be worth considering
|
||||
- * the optimal number of misaligned writes compared to the number of
|
||||
- * tests'n'branches needed to align the destination address. The
|
||||
- * 680[46]0 doesn't really care due to their copy-back caches.
|
||||
- * 10/09/96 - Jes Sorensen
|
||||
- */
|
||||
-static inline void * __memset_g(void * s, int c, size_t count)
|
||||
-{
|
||||
- void *xs = s;
|
||||
- size_t temp;
|
||||
-
|
||||
- if (!count)
|
||||
- return xs;
|
||||
-
|
||||
- c &= 0xff;
|
||||
- c |= c << 8;
|
||||
- c |= c << 16;
|
||||
-
|
||||
- if (count < 36){
|
||||
- long *ls = s;
|
||||
-
|
||||
- switch(count){
|
||||
- case 32: case 33: case 34: case 35:
|
||||
- *ls++ = c;
|
||||
- case 28: case 29: case 30: case 31:
|
||||
- *ls++ = c;
|
||||
- case 24: case 25: case 26: case 27:
|
||||
- *ls++ = c;
|
||||
- case 20: case 21: case 22: case 23:
|
||||
- *ls++ = c;
|
||||
- case 16: case 17: case 18: case 19:
|
||||
- *ls++ = c;
|
||||
- case 12: case 13: case 14: case 15:
|
||||
- *ls++ = c;
|
||||
- case 8: case 9: case 10: case 11:
|
||||
- *ls++ = c;
|
||||
- case 4: case 5: case 6: case 7:
|
||||
- *ls++ = c;
|
||||
- break;
|
||||
- default:
|
||||
- break;
|
||||
- }
|
||||
- s = ls;
|
||||
- if (count & 0x02){
|
||||
- short *ss = s;
|
||||
- *ss++ = c;
|
||||
- s = ss;
|
||||
- }
|
||||
- if (count & 0x01){
|
||||
- char *cs = s;
|
||||
- *cs++ = c;
|
||||
- s = cs;
|
||||
- }
|
||||
- return xs;
|
||||
- }
|
||||
-
|
||||
- if ((long) s & 1)
|
||||
- {
|
||||
- char *cs = s;
|
||||
- *cs++ = c;
|
||||
- s = cs;
|
||||
- count--;
|
||||
- }
|
||||
- if (count > 2 && (long) s & 2)
|
||||
- {
|
||||
- short *ss = s;
|
||||
- *ss++ = c;
|
||||
- s = ss;
|
||||
- count -= 2;
|
||||
- }
|
||||
- temp = count >> 2;
|
||||
- if (temp)
|
||||
- {
|
||||
- long *ls = s;
|
||||
- temp--;
|
||||
- do
|
||||
- *ls++ = c;
|
||||
- while (temp--);
|
||||
- s = ls;
|
||||
- }
|
||||
- if (count & 2)
|
||||
- {
|
||||
- short *ss = s;
|
||||
- *ss++ = c;
|
||||
- s = ss;
|
||||
- }
|
||||
- if (count & 1)
|
||||
- {
|
||||
- char *cs = s;
|
||||
- *cs = c;
|
||||
- }
|
||||
- return xs;
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
- * __memset_page assumes that data is longword aligned. Most, if not
|
||||
- * all, of these page sized memsets are performed on page aligned
|
||||
- * areas, thus we do not need to check if the destination is longword
|
||||
- * aligned. Of course we suffer a serious performance loss if this is
|
||||
- * not the case but I think the risk of this ever happening is
|
||||
- * extremely small. We spend a lot of time clearing pages in
|
||||
- * get_empty_page() so I think it is worth it anyway. Besides, the
|
||||
- * 680[46]0 do not really care about misaligned writes due to their
|
||||
- * copy-back cache.
|
||||
- *
|
||||
- * The optimized case for the 680[46]0 is implemented using the move16
|
||||
- * instruction. My tests showed that this implementation is 35-45%
|
||||
- * faster than the original implementation using movel, the only
|
||||
- * caveat is that the destination address must be 16-byte aligned.
|
||||
- * 01/09/96 - Jes Sorensen
|
||||
- */
|
||||
-static inline void * __memset_page(void * s,int c,size_t count)
|
||||
-{
|
||||
- unsigned long data, tmp;
|
||||
- void *xs = s;
|
||||
-
|
||||
- c = c & 255;
|
||||
- data = c | (c << 8);
|
||||
- data |= data << 16;
|
||||
-
|
||||
-#ifdef CPU_M68040_OR_M68060_ONLY
|
||||
-
|
||||
- if (((unsigned long) s) & 0x0f)
|
||||
- __memset_g(s, c, count);
|
||||
- else{
|
||||
- unsigned long *sp = s;
|
||||
- *sp++ = data;
|
||||
- *sp++ = data;
|
||||
- *sp++ = data;
|
||||
- *sp++ = data;
|
||||
-
|
||||
- __asm__ __volatile__("1:\t"
|
||||
- ".chip 68040\n\t"
|
||||
- "move16 %2@+,%0@+\n\t"
|
||||
- ".chip 68k\n\t"
|
||||
- "subqw #8,%2\n\t"
|
||||
- "subqw #8,%2\n\t"
|
||||
- "dbra %1,1b\n\t"
|
||||
- : "=a" (sp), "=d" (tmp)
|
||||
- : "a" (s), "0" (sp), "1" ((count - 16) / 16 - 1)
|
||||
- );
|
||||
- }
|
||||
-
|
||||
-#else
|
||||
- __asm__ __volatile__("1:\t"
|
||||
- "movel %2,%0@+\n\t"
|
||||
- "movel %2,%0@+\n\t"
|
||||
- "movel %2,%0@+\n\t"
|
||||
- "movel %2,%0@+\n\t"
|
||||
- "movel %2,%0@+\n\t"
|
||||
- "movel %2,%0@+\n\t"
|
||||
- "movel %2,%0@+\n\t"
|
||||
- "movel %2,%0@+\n\t"
|
||||
- "dbra %1,1b\n\t"
|
||||
- : "=a" (s), "=d" (tmp)
|
||||
- : "d" (data), "0" (s), "1" (count / 32 - 1)
|
||||
- );
|
||||
-#endif
|
||||
-
|
||||
- return xs;
|
||||
-}
|
||||
-
|
||||
-extern void *memset(void *,int,__kernel_size_t);
|
||||
-
|
||||
-#define __memset_const(s,c,count) \
|
||||
-((count==PAGE_SIZE) ? \
|
||||
- __memset_page((s),(c),(count)) : \
|
||||
- __memset_g((s),(c),(count)))
|
||||
-
|
||||
-#define memset(s, c, count) \
|
||||
-(__builtin_constant_p(count) ? \
|
||||
- __memset_const((s),(c),(count)) : \
|
||||
- __memset_g((s),(c),(count)))
|
||||
+extern void *memset(void *, int, __kernel_size_t);
|
||||
+#define memset(d, c, n) __builtin_memset(d, c, n)
|
||||
|
||||
#define __HAVE_ARCH_MEMCPY
|
||||
-extern void * memcpy(void *, const void *, size_t );
|
||||
-/*
|
||||
- * __builtin_memcpy() does not handle page-sized memcpys very well,
|
||||
- * thus following the same assumptions as for page-sized memsets, this
|
||||
- * function copies page-sized areas using an unrolled loop, without
|
||||
- * considering alignment.
|
||||
- *
|
||||
- * For the 680[46]0 only kernels we use the move16 instruction instead
|
||||
- * as it writes through the data-cache, invalidating the cache-lines
|
||||
- * touched. In this way we do not use up the entire data-cache (well,
|
||||
- * half of it on the 68060) by copying a page. An unrolled loop of two
|
||||
- * move16 instructions seem to the fastest. The only caveat is that
|
||||
- * both source and destination must be 16-byte aligned, if not we fall
|
||||
- * back to the generic memcpy function. - Jes
|
||||
- */
|
||||
-static inline void * __memcpy_page(void * to, const void * from, size_t count)
|
||||
-{
|
||||
- unsigned long tmp;
|
||||
- void *xto = to;
|
||||
-
|
||||
-#ifdef CPU_M68040_OR_M68060_ONLY
|
||||
-
|
||||
- if (((unsigned long) to | (unsigned long) from) & 0x0f)
|
||||
- return memcpy(to, from, count);
|
||||
-
|
||||
- __asm__ __volatile__("1:\t"
|
||||
- ".chip 68040\n\t"
|
||||
- "move16 %1@+,%0@+\n\t"
|
||||
- "move16 %1@+,%0@+\n\t"
|
||||
- ".chip 68k\n\t"
|
||||
- "dbra %2,1b\n\t"
|
||||
- : "=a" (to), "=a" (from), "=d" (tmp)
|
||||
- : "0" (to), "1" (from) , "2" (count / 32 - 1)
|
||||
- );
|
||||
-#else
|
||||
- __asm__ __volatile__("1:\t"
|
||||
- "movel %1@+,%0@+\n\t"
|
||||
- "movel %1@+,%0@+\n\t"
|
||||
- "movel %1@+,%0@+\n\t"
|
||||
- "movel %1@+,%0@+\n\t"
|
||||
- "movel %1@+,%0@+\n\t"
|
||||
- "movel %1@+,%0@+\n\t"
|
||||
- "movel %1@+,%0@+\n\t"
|
||||
- "movel %1@+,%0@+\n\t"
|
||||
- "dbra %2,1b\n\t"
|
||||
- : "=a" (to), "=a" (from), "=d" (tmp)
|
||||
- : "0" (to), "1" (from) , "2" (count / 32 - 1)
|
||||
- );
|
||||
-#endif
|
||||
- return xto;
|
||||
-}
|
||||
-
|
||||
-#define __memcpy_const(to, from, n) \
|
||||
-((n==PAGE_SIZE) ? \
|
||||
- __memcpy_page((to),(from),(n)) : \
|
||||
- __builtin_memcpy((to),(from),(n)))
|
||||
-
|
||||
-#define memcpy(to, from, n) \
|
||||
-(__builtin_constant_p(n) ? \
|
||||
- __memcpy_const((to),(from),(n)) : \
|
||||
- memcpy((to),(from),(n)))
|
||||
+extern void *memcpy(void *, const void *, __kernel_size_t);
|
||||
+#define memcpy(d, s, n) __builtin_memcpy(d, s, n)
|
||||
|
||||
#define __HAVE_ARCH_MEMMOVE
|
||||
-static inline void * memmove(void * dest,const void * src, size_t n)
|
||||
-{
|
||||
- void *xdest = dest;
|
||||
- size_t temp;
|
||||
-
|
||||
- if (!n)
|
||||
- return xdest;
|
||||
-
|
||||
- if (dest < src)
|
||||
- {
|
||||
- if ((long) dest & 1)
|
||||
- {
|
||||
- char *cdest = dest;
|
||||
- const char *csrc = src;
|
||||
- *cdest++ = *csrc++;
|
||||
- dest = cdest;
|
||||
- src = csrc;
|
||||
- n--;
|
||||
- }
|
||||
- if (n > 2 && (long) dest & 2)
|
||||
- {
|
||||
- short *sdest = dest;
|
||||
- const short *ssrc = src;
|
||||
- *sdest++ = *ssrc++;
|
||||
- dest = sdest;
|
||||
- src = ssrc;
|
||||
- n -= 2;
|
||||
- }
|
||||
- temp = n >> 2;
|
||||
- if (temp)
|
||||
- {
|
||||
- long *ldest = dest;
|
||||
- const long *lsrc = src;
|
||||
- temp--;
|
||||
- do
|
||||
- *ldest++ = *lsrc++;
|
||||
- while (temp--);
|
||||
- dest = ldest;
|
||||
- src = lsrc;
|
||||
- }
|
||||
- if (n & 2)
|
||||
- {
|
||||
- short *sdest = dest;
|
||||
- const short *ssrc = src;
|
||||
- *sdest++ = *ssrc++;
|
||||
- dest = sdest;
|
||||
- src = ssrc;
|
||||
- }
|
||||
- if (n & 1)
|
||||
- {
|
||||
- char *cdest = dest;
|
||||
- const char *csrc = src;
|
||||
- *cdest = *csrc;
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- dest = (char *) dest + n;
|
||||
- src = (const char *) src + n;
|
||||
- if ((long) dest & 1)
|
||||
- {
|
||||
- char *cdest = dest;
|
||||
- const char *csrc = src;
|
||||
- *--cdest = *--csrc;
|
||||
- dest = cdest;
|
||||
- src = csrc;
|
||||
- n--;
|
||||
- }
|
||||
- if (n > 2 && (long) dest & 2)
|
||||
- {
|
||||
- short *sdest = dest;
|
||||
- const short *ssrc = src;
|
||||
- *--sdest = *--ssrc;
|
||||
- dest = sdest;
|
||||
- src = ssrc;
|
||||
- n -= 2;
|
||||
- }
|
||||
- temp = n >> 2;
|
||||
- if (temp)
|
||||
- {
|
||||
- long *ldest = dest;
|
||||
- const long *lsrc = src;
|
||||
- temp--;
|
||||
- do
|
||||
- *--ldest = *--lsrc;
|
||||
- while (temp--);
|
||||
- dest = ldest;
|
||||
- src = lsrc;
|
||||
- }
|
||||
- if (n & 2)
|
||||
- {
|
||||
- short *sdest = dest;
|
||||
- const short *ssrc = src;
|
||||
- *--sdest = *--ssrc;
|
||||
- dest = sdest;
|
||||
- src = ssrc;
|
||||
- }
|
||||
- if (n & 1)
|
||||
- {
|
||||
- char *cdest = dest;
|
||||
- const char *csrc = src;
|
||||
- *--cdest = *--csrc;
|
||||
- }
|
||||
- }
|
||||
- return xdest;
|
||||
-}
|
||||
+extern void *memmove(void *, const void *, __kernel_size_t);
|
||||
|
||||
#define __HAVE_ARCH_MEMCMP
|
||||
-extern int memcmp(const void * ,const void * ,size_t );
|
||||
-#define memcmp(cs, ct, n) \
|
||||
-(__builtin_constant_p(n) ? \
|
||||
- __builtin_memcmp((cs),(ct),(n)) : \
|
||||
- memcmp((cs),(ct),(n)))
|
||||
-
|
||||
-#define __HAVE_ARCH_MEMCHR
|
||||
-static inline void *memchr(const void *cs, int c, size_t count)
|
||||
-{
|
||||
- /* Someone else can optimize this, I don't care - tonym@mac.linux-m68k.org */
|
||||
- unsigned char *ret = (unsigned char *)cs;
|
||||
- for(;count>0;count--,ret++)
|
||||
- if(*ret == c) return ret;
|
||||
-
|
||||
- return NULL;
|
||||
-}
|
||||
+extern int memcmp(const void *, const void *, __kernel_size_t);
|
||||
+#define memcmp(d, s, n) __builtin_memcmp(d, s, n)
|
||||
|
||||
#endif /* _M68K_STRING_H_ */
|
||||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/include/asm-m68k/thread_info.h linux-2.6.13/include/asm-m68k/thread_info.h
|
||||
--- linux-2.6.13-i386/include/asm-m68k/thread_info.h 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/include/asm-m68k/thread_info.h 2005-08-30 16:36:04.000000000 +0200
|
||||
@@ -2,17 +2,15 @@
|
||||
#define _ASM_M68K_THREAD_INFO_H
|
||||
|
||||
#include <asm/types.h>
|
||||
-#include <asm/processor.h>
|
||||
#include <asm/page.h>
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
+ unsigned long flags;
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
__u32 cpu; /* should always be 0 on m68k */
|
||||
struct restart_block restart_block;
|
||||
-
|
||||
- __u8 supervisor_stack[0];
|
||||
};
|
||||
|
||||
#define PREEMPT_ACTIVE 0x4000000
|
||||
@@ -28,91 +26,34 @@
|
||||
|
||||
/* THREAD_SIZE should be 8k, so handle differently for 4k and 8k machines */
|
||||
#if PAGE_SHIFT == 13 /* 8k machines */
|
||||
-#define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,0))
|
||||
-#define free_thread_info(ti) free_pages((unsigned long)(ti),0)
|
||||
+#define alloc_thread_stack(tsk) ((void *)__get_free_pages(GFP_KERNEL,0))
|
||||
+#define free_thread_stack(ti) free_pages((unsigned long)(ti),0)
|
||||
#else /* otherwise assume 4k pages */
|
||||
-#define alloc_thread_info(tsk) ((struct thread_info *)__get_free_pages(GFP_KERNEL,1))
|
||||
-#define free_thread_info(ti) free_pages((unsigned long)(ti),1)
|
||||
+#define alloc_thread_stack(tsk) ((void *)__get_free_pages(GFP_KERNEL,1))
|
||||
+#define free_thread_stack(ti) free_pages((unsigned long)(ti),1)
|
||||
#endif /* PAGE_SHIFT == 13 */
|
||||
|
||||
//#define init_thread_info (init_task.thread.info)
|
||||
#define init_stack (init_thread_union.stack)
|
||||
|
||||
-#define current_thread_info() (current->thread_info)
|
||||
+#define task_thread_info(tsk) (&(tsk)->thread.info)
|
||||
+#define current_thread_info() task_thread_info(current)
|
||||
|
||||
+#define setup_thread_stack(p, org) ({ \
|
||||
+ *(struct task_struct **)(p)->stack = (p); \
|
||||
+ task_thread_info(p)->task = (p); \
|
||||
+})
|
||||
|
||||
#define __HAVE_THREAD_FUNCTIONS
|
||||
|
||||
-#define TIF_SYSCALL_TRACE 0 /* syscall trace active */
|
||||
-#define TIF_DELAYED_TRACE 1 /* single step a syscall */
|
||||
-#define TIF_NOTIFY_RESUME 2 /* resumption notification requested */
|
||||
-#define TIF_SIGPENDING 3 /* signal pending */
|
||||
-#define TIF_NEED_RESCHED 4 /* rescheduling necessary */
|
||||
-#define TIF_MEMDIE 5
|
||||
-
|
||||
-extern int thread_flag_fixme(void);
|
||||
-
|
||||
-/*
|
||||
- * flag set/clear/test wrappers
|
||||
- * - pass TIF_xxxx constants to these functions
|
||||
+/* entry.S relies on these definitions!
|
||||
+ * bits 0-7 are tested at every exception exit
|
||||
+ * bits 8-15 are also tested at syscall exit
|
||||
*/
|
||||
-
|
||||
-#define __set_tsk_thread_flag(tsk, flag, val) ({ \
|
||||
- switch (flag) { \
|
||||
- case TIF_SIGPENDING: \
|
||||
- tsk->thread.work.sigpending = val; \
|
||||
- break; \
|
||||
- case TIF_NEED_RESCHED: \
|
||||
- tsk->thread.work.need_resched = val; \
|
||||
- break; \
|
||||
- case TIF_SYSCALL_TRACE: \
|
||||
- tsk->thread.work.syscall_trace = val; \
|
||||
- break; \
|
||||
- case TIF_MEMDIE: \
|
||||
- tsk->thread.work.memdie = val; \
|
||||
- break; \
|
||||
- default: \
|
||||
- thread_flag_fixme(); \
|
||||
- } \
|
||||
-})
|
||||
-
|
||||
-#define __get_tsk_thread_flag(tsk, flag) ({ \
|
||||
- int ___res; \
|
||||
- switch (flag) { \
|
||||
- case TIF_SIGPENDING: \
|
||||
- ___res = tsk->thread.work.sigpending; \
|
||||
- break; \
|
||||
- case TIF_NEED_RESCHED: \
|
||||
- ___res = tsk->thread.work.need_resched; \
|
||||
- break; \
|
||||
- case TIF_SYSCALL_TRACE: \
|
||||
- ___res = tsk->thread.work.syscall_trace;\
|
||||
- break; \
|
||||
- case TIF_MEMDIE: \
|
||||
- ___res = tsk->thread.work.memdie;\
|
||||
- break; \
|
||||
- default: \
|
||||
- ___res = thread_flag_fixme(); \
|
||||
- } \
|
||||
- ___res; \
|
||||
-})
|
||||
-
|
||||
-#define __get_set_tsk_thread_flag(tsk, flag, val) ({ \
|
||||
- int __res = __get_tsk_thread_flag(tsk, flag); \
|
||||
- __set_tsk_thread_flag(tsk, flag, val); \
|
||||
- __res; \
|
||||
-})
|
||||
-
|
||||
-#define set_tsk_thread_flag(tsk, flag) __set_tsk_thread_flag(tsk, flag, ~0)
|
||||
-#define clear_tsk_thread_flag(tsk, flag) __set_tsk_thread_flag(tsk, flag, 0)
|
||||
-#define test_and_set_tsk_thread_flag(tsk, flag) __get_set_tsk_thread_flag(tsk, flag, ~0)
|
||||
-#define test_tsk_thread_flag(tsk, flag) __get_tsk_thread_flag(tsk, flag)
|
||||
-
|
||||
-#define set_thread_flag(flag) set_tsk_thread_flag(current, flag)
|
||||
-#define clear_thread_flag(flag) clear_tsk_thread_flag(current, flag)
|
||||
-#define test_thread_flag(flag) test_tsk_thread_flag(current, flag)
|
||||
-
|
||||
-#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED)
|
||||
-#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED)
|
||||
+#define TIF_SIGPENDING 6 /* signal pending */
|
||||
+#define TIF_NEED_RESCHED 7 /* rescheduling necessary */
|
||||
+#define TIF_DELAYED_TRACE 14 /* single step a syscall */
|
||||
+#define TIF_SYSCALL_TRACE 15 /* syscall trace active */
|
||||
+#define TIF_MEMDIE 16
|
||||
|
||||
#endif /* _ASM_M68K_THREAD_INFO_H */
|
|
@ -1,101 +0,0 @@
|
|||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/kernel/exit.c linux-2.6.13/kernel/exit.c
|
||||
--- linux-2.6.13-i386/kernel/exit.c 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/kernel/exit.c 2005-08-30 16:36:41.000000000 +0200
|
||||
@@ -846,7 +846,7 @@
|
||||
if (group_dead && tsk->signal->leader)
|
||||
disassociate_ctty(1);
|
||||
|
||||
- module_put(tsk->thread_info->exec_domain->module);
|
||||
+ module_put(task_thread_info(tsk)->exec_domain->module);
|
||||
if (tsk->binfmt)
|
||||
module_put(tsk->binfmt->module);
|
||||
|
||||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/kernel/fork.c linux-2.6.13/kernel/fork.c
|
||||
--- linux-2.6.13-i386/kernel/fork.c 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/kernel/fork.c 2005-08-30 16:36:41.000000000 +0200
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
void free_task(struct task_struct *tsk)
|
||||
{
|
||||
- free_thread_info(tsk->thread_info);
|
||||
+ free_thread_stack(tsk->stack);
|
||||
free_task_struct(tsk);
|
||||
}
|
||||
EXPORT_SYMBOL(free_task);
|
||||
@@ -155,7 +155,7 @@
|
||||
static struct task_struct *dup_task_struct(struct task_struct *orig)
|
||||
{
|
||||
struct task_struct *tsk;
|
||||
- struct thread_info *ti;
|
||||
+ void *stack;
|
||||
|
||||
prepare_to_copy(orig);
|
||||
|
||||
@@ -163,16 +163,16 @@
|
||||
if (!tsk)
|
||||
return NULL;
|
||||
|
||||
- ti = alloc_thread_info(tsk);
|
||||
- if (!ti) {
|
||||
+ stack = alloc_thread_stack(tsk);
|
||||
+ if (!stack) {
|
||||
free_task_struct(tsk);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- *ti = *orig->thread_info;
|
||||
*tsk = *orig;
|
||||
- tsk->thread_info = ti;
|
||||
- ti->task = tsk;
|
||||
+ tsk->stack = stack;
|
||||
+ *(struct task_struct **)tsk->stack = tsk;
|
||||
+ setup_thread_stack(tsk, orig);
|
||||
|
||||
/* One for us, one for whoever does the "release_task()" (usually parent) */
|
||||
atomic_set(&tsk->usage,2);
|
||||
@@ -898,7 +898,7 @@
|
||||
if (nr_threads >= max_threads)
|
||||
goto bad_fork_cleanup_count;
|
||||
|
||||
- if (!try_module_get(p->thread_info->exec_domain->module))
|
||||
+ if (!try_module_get(task_thread_info(p)->exec_domain->module))
|
||||
goto bad_fork_cleanup_count;
|
||||
|
||||
if (p->binfmt && !try_module_get(p->binfmt->module))
|
||||
@@ -1151,7 +1151,7 @@
|
||||
if (p->binfmt)
|
||||
module_put(p->binfmt->module);
|
||||
bad_fork_cleanup_put_domain:
|
||||
- module_put(p->thread_info->exec_domain->module);
|
||||
+ module_put(task_thread_info(p)->exec_domain->module);
|
||||
bad_fork_cleanup_count:
|
||||
put_group_info(p->group_info);
|
||||
atomic_dec(&p->user->processes);
|
||||
diff -urN --exclude-from=/usr/src/exclude-file linux-2.6.13-i386/kernel/sched.c linux-2.6.13/kernel/sched.c
|
||||
--- linux-2.6.13-i386/kernel/sched.c 2005-08-29 01:41:01.000000000 +0200
|
||||
+++ linux-2.6.13/kernel/sched.c 2005-08-30 16:36:43.000000000 +0200
|
||||
@@ -4121,10 +4121,10 @@
|
||||
#endif
|
||||
#ifdef CONFIG_DEBUG_STACK_USAGE
|
||||
{
|
||||
- unsigned long * n = (unsigned long *) (p->thread_info+1);
|
||||
+ unsigned long * n = end_of_stack(p);
|
||||
while (!*n)
|
||||
n++;
|
||||
- free = (unsigned long) n - (unsigned long)(p->thread_info+1);
|
||||
+ free = (unsigned long) n - (unsigned long) end_of_stack(p);
|
||||
}
|
||||
#endif
|
||||
printk("%5lu %5d %6d ", free, p->pid, p->parent->pid);
|
||||
@@ -4204,9 +4204,9 @@
|
||||
|
||||
/* Set the preempt count _outside_ the spinlocks! */
|
||||
#if defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_BKL)
|
||||
- idle->thread_info->preempt_count = (idle->lock_depth >= 0);
|
||||
+ task_thread_info(idle)->preempt_count = (idle->lock_depth >= 0);
|
||||
#else
|
||||
- idle->thread_info->preempt_count = 0;
|
||||
+ task_thread_info(idle)->preempt_count = 0;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,243 +0,0 @@
|
|||
# Description: Fixes g4 l2 cache flush and MSR erratas.
|
||||
# Patch author: Jacob Pan.
|
||||
# Rediffed for 2.6.12 by Sven Luther <luther@debian.org>
|
||||
# Upstream status: under review by benh.
|
||||
|
||||
. $(dirname $0)/DPATCH
|
||||
|
||||
@DPATCH@
|
||||
--- linux-kernel-2.6.12-2.6.12/./arch/ppc/kernel/cputable.c.orig 2005-06-17 19:48:29.000000000 +0000
|
||||
+++ linux-kernel-2.6.12-2.6.12/./arch/ppc/kernel/cputable.c 2005-07-16 12:09:33.000000000 +0000
|
||||
@@ -380,7 +380,7 @@
|
||||
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
|
||||
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
- CPU_FTR_NEED_COHERENT,
|
||||
+ CPU_FTR_NEED_COHERENT | CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -397,7 +397,7 @@
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP |
|
||||
- CPU_FTR_NEED_COHERENT,
|
||||
+ CPU_FTR_NEED_COHERENT | CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -413,7 +413,8 @@
|
||||
CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
- CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT,
|
||||
+ CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT |
|
||||
+ CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -428,7 +429,8 @@
|
||||
CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB |
|
||||
CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
- CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
|
||||
+ CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT |
|
||||
+ CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -445,7 +447,8 @@
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP |
|
||||
- CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS,
|
||||
+ CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS |
|
||||
+ CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -462,7 +465,7 @@
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
|
||||
- CPU_FTR_NEED_COHERENT,
|
||||
+ CPU_FTR_NEED_COHERENT | CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -479,7 +482,8 @@
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
|
||||
- CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
|
||||
+ CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC |
|
||||
+ CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -496,7 +500,8 @@
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
|
||||
- CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC,
|
||||
+ CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC |
|
||||
+ CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -513,7 +518,7 @@
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR |
|
||||
CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 |
|
||||
CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS |
|
||||
- CPU_FTR_NEED_COHERENT,
|
||||
+ CPU_FTR_NEED_COHERENT | CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -529,7 +534,8 @@
|
||||
CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR |
|
||||
CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE |
|
||||
CPU_FTR_SPEC7450 | CPU_FTR_NAP_DISABLE_L2_PR |
|
||||
- CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT,
|
||||
+ CPU_FTR_HAS_HIGH_BATS | CPU_FTR_NEED_COHERENT |
|
||||
+ CPU_FTR_HWFLUSH_L2_CACHE,
|
||||
.cpu_user_features = COMMON_PPC | PPC_FEATURE_ALTIVEC_COMP,
|
||||
.icache_bsize = 32,
|
||||
.dcache_bsize = 32,
|
||||
@@ -537,7 +543,7 @@
|
||||
.cpu_setup = __setup_cpu_745x
|
||||
},
|
||||
{ /* 82xx (8240, 8245, 8260 are all 603e cores) */
|
||||
- .pvr_mask = 0x7fff0000,
|
||||
+ .pvr_mask = 0x7fff0000,
|
||||
.pvr_value = 0x00810000,
|
||||
.cpu_name = "82xx",
|
||||
.cpu_features = CPU_FTR_COMMON |
|
||||
--- linux-kernel-2.6.12-2.6.12/./arch/ppc/kernel/l2cr.S.orig 2005-06-17 19:48:29.000000000 +0000
|
||||
+++ linux-kernel-2.6.12-2.6.12/./arch/ppc/kernel/l2cr.S 2005-07-16 11:50:39.000000000 +0000
|
||||
@@ -36,7 +36,9 @@
|
||||
several months. The L2CR is similar, but I'm going
|
||||
to assume the user of this functions knows what they
|
||||
are doing.
|
||||
-
|
||||
+ June 17, 2004.
|
||||
+ - JPAN: Fixed 745X L3 cache enablement routine, also use HW flush assist.
|
||||
+
|
||||
Author: Terry Greeniaus (tgree@phys.ualberta.ca)
|
||||
Please e-mail updates to this file to me, thanks!
|
||||
*/
|
||||
@@ -155,9 +157,7 @@
|
||||
Don't do this unless you accomodate all processor variations.
|
||||
The bit moved on the 7450.....
|
||||
****/
|
||||
-
|
||||
- /* TODO: use HW flush assist when available */
|
||||
-
|
||||
+BEGIN_FTR_SECTION
|
||||
lis r4,0x0002
|
||||
mtctr r4
|
||||
li r4,0
|
||||
@@ -176,7 +176,23 @@
|
||||
dcbf 0,r4
|
||||
addi r4,r4,32 /* Go to start of next cache line */
|
||||
bdnz 1b
|
||||
+END_FTR_SECTION_IFCLR(CPU_FTR_HWFLUSH_L2_CACHE)
|
||||
|
||||
+BEGIN_FTR_SECTION
|
||||
+ /* Use HW flush assist, MPC7447A errata #3 */
|
||||
+ oris r4,r4,0x0010 /* Set L2CR[IONLY/11] = 1 */
|
||||
+ oris r4,r4,0x0001 /* Set L2CR[DONLY/15] = 1 */
|
||||
+ mtspr SPRN_L2CR,r4 /* Lock the L2 */
|
||||
+ sync
|
||||
+ ori r4,r4,0x0800 /* Set L2CR[L2HWF/20] = 1 */
|
||||
+ mtspr SPRN_L2CR,r4 /* Flush the L2 */
|
||||
+1:
|
||||
+ mfspr r4,SPRN_L2CR
|
||||
+ andi. r4,r4,0x0800 /* L2HWF still set? */
|
||||
+ bne 1b
|
||||
+ sync /* sync to clear the store queues before L3 flush (UM step 5)*/
|
||||
+END_FTR_SECTION_IFSET(CPU_FTR_HWFLUSH_L2_CACHE)
|
||||
+
|
||||
2:
|
||||
/* Set up the L2CR configuration bits (and switch L2 off) */
|
||||
/* CPU errata: Make sure the mtspr below is already in the
|
||||
@@ -293,17 +309,18 @@
|
||||
|
||||
/* Flush the cache.
|
||||
*/
|
||||
-
|
||||
- /* TODO: use HW flush assist */
|
||||
-
|
||||
- lis r4,0x0008
|
||||
- mtctr r4
|
||||
- li r4,0
|
||||
-1:
|
||||
- lwzx r0,r0,r4
|
||||
- dcbf 0,r4
|
||||
- addi r4,r4,32 /* Go to start of next cache line */
|
||||
- bdnz 1b
|
||||
+ /* use HW flush assist. (UM 3.6.3.1.5) */
|
||||
+ mfspr r4, SPRN_L3CR
|
||||
+ oris r4,r4,0x0040 /* Set L3CR[L3IO/9] = 1. */
|
||||
+ ori r4,r4,0x0040 /* Set L3CR[L3DO/29] = 1.*/
|
||||
+ mtspr 1018,r4 /* Lock the L3 by making IONLY and DONLY */
|
||||
+ ori r4,r4,0x0800 /* Set L3CR[L3HWF/20] for hardware flush */
|
||||
+ mtspr SPRN_L3CR,r4
|
||||
+flush_745x_L3_poll:
|
||||
+ mfspr r4,SPRN_L3CR
|
||||
+ rlwinm. r4,r4,0,20,20
|
||||
+ bne flush_745x_L3_poll
|
||||
+ sync /* Clear the store queues per procedure (UM step 8) */
|
||||
|
||||
2:
|
||||
/* Set up the L3CR configuration bits (and switch L3 off) */
|
||||
@@ -349,8 +366,8 @@
|
||||
cmplwi r5,0
|
||||
beq 4f
|
||||
|
||||
- /* Enable the cache */
|
||||
- oris r3,r3,(L3CR_L3E | L3CR_L3CLKEN)@h
|
||||
+ /* enable L3 clock */
|
||||
+ oris r3,r3,(L3CR_L3CLKEN)@h
|
||||
mtspr SPRN_L3CR,r3
|
||||
sync
|
||||
|
||||
@@ -358,6 +375,15 @@
|
||||
li r0,256
|
||||
mtctr r0
|
||||
1: bdnz 1b
|
||||
+
|
||||
+ /* Clear MSSSR0 which may cause parity error */
|
||||
+ xor r5,r5,r5
|
||||
+ mtspr 1015, r5
|
||||
+
|
||||
+ /* Enable L3 cache */
|
||||
+ oris r3,r3,(L3CR_L3E)@h
|
||||
+ mtspr SPRN_L3CR,r3
|
||||
+ sync
|
||||
|
||||
/* Restore MSR (restores EE and DR bits to original state) */
|
||||
4: SYNC
|
||||
--- linux-kernel-2.6.12-2.6.12/./arch/ppc/kernel/traps.c.orig 2005-06-17 19:48:29.000000000 +0000
|
||||
+++ linux-kernel-2.6.12-2.6.12/./arch/ppc/kernel/traps.c 2005-07-16 11:50:39.000000000 +0000
|
||||
@@ -307,7 +307,9 @@
|
||||
case 0x80000:
|
||||
printk("Machine check signal\n");
|
||||
break;
|
||||
- case 0: /* for 601 */
|
||||
+ case 0: /* for 601 and 744x */
|
||||
+ printk("Transfer error ack signal if 601, or MCP if 744x \n");
|
||||
+ break;
|
||||
case 0x40000:
|
||||
case 0x140000: /* 7450 MSS error and TEA */
|
||||
printk("Transfer error ack signal\n");
|
||||
--- linux-kernel-2.6.12-2.6.12/./include/asm-ppc/cputable.h.orig 2005-06-17 19:48:29.000000000 +0000
|
||||
+++ linux-kernel-2.6.12-2.6.12/./include/asm-ppc/cputable.h 2005-07-16 11:52:01.000000000 +0000
|
||||
@@ -89,6 +89,7 @@
|
||||
#define CPU_FTR_NEED_COHERENT 0x00020000
|
||||
#define CPU_FTR_NO_BTIC 0x00040000
|
||||
#define CPU_FTR_BIG_PHYS 0x00080000
|
||||
+#define CPU_FTR_HWFLUSH_L2_CACHE 0x00100000
|
||||
|
||||
#ifdef __ASSEMBLY__
|
||||
|
|
@ -1,442 +0,0 @@
|
|||
# Description: Adds a new OF-based serial driver instead of the bit-banging # one.
|
||||
# Patch author: David Woodhouse <dwmw2@infradead.org>
|
||||
# Upstream status: Well, this should replace the hacky workaround
|
||||
# introduced in the powerpc-serial patch. not yet enabled though as i am
|
||||
# unsure how this will work on PReP hardware.
|
||||
|
||||
--- linux-2.6.12/drivers/serial/Makefile~ 2005-08-11 13:51:50.000000000 +0100
|
||||
+++ linux-2.6.12/drivers/serial/Makefile 2005-08-15 21:08:49.000000000 +0100
|
||||
@@ -22,6 +22,7 @@ obj-$(CONFIG_SERIAL_8250_ACCENT) += 8250
|
||||
obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o
|
||||
obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o
|
||||
obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o
|
||||
+obj-$(CONFIG_SERIAL_8250_OF) += 8250_of.o
|
||||
obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o
|
||||
obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o
|
||||
obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o
|
||||
--- linux-2.6.12/drivers/serial/8250_of.c~ 2005-08-15 21:14:27.000000000 +0100
|
||||
+++ linux-2.6.12/drivers/serial/8250_of.c 2005-08-15 21:20:59.000000000 +0100
|
||||
@@ -0,0 +1,199 @@
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/serial.h>
|
||||
+#include <linux/serial_8250.h>
|
||||
+#include <linux/config.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/pci.h>
|
||||
+#include <asm/serial.h>
|
||||
+#include <asm/prom.h>
|
||||
+
|
||||
+#if 0
|
||||
+#define DBG(fmt...) printk(KERN_DEBUG fmt)
|
||||
+#else
|
||||
+#define DBG(fmt) do { } while (0)
|
||||
+#endif
|
||||
+
|
||||
+/*
|
||||
+ * This function can be used by platforms to "find" legacy serial ports.
|
||||
+ * It works for "serial" nodes under an "isa" node, and will try to
|
||||
+ * respect the "ibm,aix-loc" property if any. It works with up to 8
|
||||
+ * ports.
|
||||
+ */
|
||||
+
|
||||
+#define MAX_LEGACY_SERIAL_PORTS 8
|
||||
+static int ports_probed = 0;
|
||||
+
|
||||
+static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
|
||||
+static unsigned int old_serial_count;
|
||||
+
|
||||
+void __init generic_find_legacy_serial_ports(u64 *physport,
|
||||
+ unsigned int *default_speed)
|
||||
+{
|
||||
+ struct device_node *np;
|
||||
+ u32 *sizeprop;
|
||||
+
|
||||
+ struct isa_reg_property {
|
||||
+ u32 space;
|
||||
+ u32 address;
|
||||
+ u32 size;
|
||||
+ };
|
||||
+
|
||||
+ DBG(" -> generic_find_legacy_serial_port()\n");
|
||||
+ ports_probed = 1;
|
||||
+
|
||||
+ *physport = 0;
|
||||
+ if (default_speed)
|
||||
+ *default_speed = 0;
|
||||
+
|
||||
+ np = of_find_node_by_path("/");
|
||||
+ if (!np)
|
||||
+ return;
|
||||
+
|
||||
+ /* First fill our array */
|
||||
+ for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
|
||||
+ struct device_node *isa, *pci;
|
||||
+ struct isa_reg_property *reg;
|
||||
+ unsigned long phys_size, addr_size;
|
||||
+ u64 io_base;
|
||||
+ u32 *rangesp;
|
||||
+ u32 *interrupts, *clk, *spd;
|
||||
+ char *typep;
|
||||
+ int index, rlen, rentsize;
|
||||
+
|
||||
+ /* Ok, first check if it's under an "isa" parent */
|
||||
+ isa = of_get_parent(np);
|
||||
+ if (!isa || strcmp(isa->name, "isa")) {
|
||||
+ DBG("%s: no isa parent found\n", np->full_name);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ /* Now look for an "ibm,aix-loc" property that gives us ordering
|
||||
+ * if any...
|
||||
+ */
|
||||
+ typep = (char *)get_property(np, "ibm,aix-loc", NULL);
|
||||
+
|
||||
+ /* Get the ISA port number */
|
||||
+ reg = (struct isa_reg_property *)get_property(np, "reg", NULL);
|
||||
+ if (reg == NULL)
|
||||
+ goto next_port;
|
||||
+ /* We assume the interrupt number isn't translated ... */
|
||||
+ interrupts = (u32 *)get_property(np, "interrupts", NULL);
|
||||
+ /* get clock freq. if present */
|
||||
+ clk = (u32 *)get_property(np, "clock-frequency", NULL);
|
||||
+ /* get default speed if present */
|
||||
+ spd = (u32 *)get_property(np, "current-speed", NULL);
|
||||
+ /* Default to locate at end of array */
|
||||
+ index = old_serial_count; /* end of the array by default */
|
||||
+
|
||||
+ /* If we have a location index, then use it */
|
||||
+ if (typep && *typep == 'S') {
|
||||
+ index = simple_strtol(typep+1, NULL, 0) - 1;
|
||||
+ /* if index is out of range, use end of array instead */
|
||||
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
|
||||
+ index = old_serial_count;
|
||||
+ /* if our index is still out of range, that mean that
|
||||
+ * array is full, we could scan for a free slot but that
|
||||
+ * make little sense to bother, just skip the port
|
||||
+ */
|
||||
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
|
||||
+ goto next_port;
|
||||
+ if (index >= old_serial_count)
|
||||
+ old_serial_count = index + 1;
|
||||
+ /* Check if there is a port who already claimed our slot */
|
||||
+ if (serial_ports[index].iobase != 0) {
|
||||
+ /* if we still have some room, move it, else override */
|
||||
+ if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) {
|
||||
+ DBG("Moved legacy port %d -> %d\n", index,
|
||||
+ old_serial_count);
|
||||
+ serial_ports[old_serial_count++] =
|
||||
+ serial_ports[index];
|
||||
+ } else {
|
||||
+ DBG("Replacing legacy port %d\n", index);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ if (index >= MAX_LEGACY_SERIAL_PORTS)
|
||||
+ goto next_port;
|
||||
+ if (index >= old_serial_count)
|
||||
+ old_serial_count = index + 1;
|
||||
+
|
||||
+ /* Now fill the entry */
|
||||
+ memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port));
|
||||
+ serial_ports[index].uartclk = (clk && *clk) ? *clk : BASE_BAUD * 16;
|
||||
+ serial_ports[index].iobase = reg->address;
|
||||
+ serial_ports[index].irq = interrupts ? interrupts[0] : 0;
|
||||
+ serial_ports[index].flags = ASYNC_BOOT_AUTOCONF;
|
||||
+
|
||||
+ DBG("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n",
|
||||
+ index,
|
||||
+ serial_ports[index].iobase,
|
||||
+ serial_ports[index].irq,
|
||||
+ serial_ports[index].uartclk);
|
||||
+
|
||||
+ /* Get phys address of IO reg for port 1 */
|
||||
+ if (index != 0)
|
||||
+ goto next_port;
|
||||
+
|
||||
+ pci = of_get_parent(isa);
|
||||
+ if (!pci) {
|
||||
+ DBG("%s: no pci parent found\n", np->full_name);
|
||||
+ goto next_port;
|
||||
+ }
|
||||
+
|
||||
+ rangesp = (u32 *)get_property(pci, "ranges", &rlen);
|
||||
+ if (rangesp == NULL) {
|
||||
+ of_node_put(pci);
|
||||
+ goto next_port;
|
||||
+ }
|
||||
+ rlen /= 4;
|
||||
+
|
||||
+ /* we need the #size-cells of the PCI bridge node itself */
|
||||
+ phys_size = 1;
|
||||
+ sizeprop = (u32 *)get_property(pci, "#size-cells", NULL);
|
||||
+ if (sizeprop != NULL)
|
||||
+ phys_size = *sizeprop;
|
||||
+ /* we need the parent #addr-cells */
|
||||
+ addr_size = prom_n_addr_cells(pci);
|
||||
+ rentsize = 3 + addr_size + phys_size;
|
||||
+ io_base = 0;
|
||||
+ for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) {
|
||||
+ if (((rangesp[0] >> 24) & 0x3) != 1)
|
||||
+ continue; /* not IO space */
|
||||
+ io_base = rangesp[3];
|
||||
+ if (addr_size == 2)
|
||||
+ io_base = (io_base << 32) | rangesp[4];
|
||||
+ }
|
||||
+ if (io_base != 0) {
|
||||
+ *physport = io_base + reg->address;
|
||||
+ if (default_speed && spd)
|
||||
+ *default_speed = *spd;
|
||||
+ }
|
||||
+ of_node_put(pci);
|
||||
+ next_port:
|
||||
+ of_node_put(isa);
|
||||
+ }
|
||||
+
|
||||
+ DBG(" <- generic_find_legacy_serial_port()\n");
|
||||
+}
|
||||
+
|
||||
+static struct platform_device serial_device = {
|
||||
+ .name = "serial8250",
|
||||
+ .id = 0,
|
||||
+ .dev = {
|
||||
+ .platform_data = serial_ports,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+static int __init serial_dev_init(void)
|
||||
+{
|
||||
+ u64 phys;
|
||||
+ unsigned int spd;
|
||||
+
|
||||
+ if (!ports_probed)
|
||||
+ generic_find_legacy_serial_ports(&phys, &spd);
|
||||
+ return platform_device_register(&serial_device);
|
||||
+}
|
||||
+arch_initcall(serial_dev_init);
|
||||
+
|
||||
+
|
||||
--- linux-2.6.12/drivers/serial/Kconfig~ 2005-08-11 13:51:50.000000000 +0100
|
||||
+++ linux-2.6.12/drivers/serial/Kconfig 2005-08-15 21:13:41.000000000 +0100
|
||||
@@ -77,6 +77,11 @@ config SERIAL_8250_CS
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
+config SERIAL_8250_OF
|
||||
+ bool
|
||||
+ default y
|
||||
+ depends on PPC_OF && SERIAL_8250 != n
|
||||
+
|
||||
config SERIAL_8250_ACPI
|
||||
bool "8250/16550 device discovery via ACPI namespace"
|
||||
default y if IA64
|
||||
--- linux-2.6.12/arch/ppc64/kernel/setup.c~ 2005-08-11 13:52:04.000000000 +0100
|
||||
+++ linux-2.6.12/arch/ppc64/kernel/setup.c 2005-08-15 20:27:25.000000000 +0100
|
||||
@@ -1147,186 +1147,6 @@ void __init setup_default_decr(void)
|
||||
lpaca->next_jiffy_update_tb = get_tb() + tb_ticks_per_jiffy;
|
||||
}
|
||||
|
||||
-#ifndef CONFIG_PPC_ISERIES
|
||||
-/*
|
||||
- * This function can be used by platforms to "find" legacy serial ports.
|
||||
- * It works for "serial" nodes under an "isa" node, and will try to
|
||||
- * respect the "ibm,aix-loc" property if any. It works with up to 8
|
||||
- * ports.
|
||||
- */
|
||||
-
|
||||
-#define MAX_LEGACY_SERIAL_PORTS 8
|
||||
-static struct plat_serial8250_port serial_ports[MAX_LEGACY_SERIAL_PORTS+1];
|
||||
-static unsigned int old_serial_count;
|
||||
-
|
||||
-void __init generic_find_legacy_serial_ports(u64 *physport,
|
||||
- unsigned int *default_speed)
|
||||
-{
|
||||
- struct device_node *np;
|
||||
- u32 *sizeprop;
|
||||
-
|
||||
- struct isa_reg_property {
|
||||
- u32 space;
|
||||
- u32 address;
|
||||
- u32 size;
|
||||
- };
|
||||
- struct pci_reg_property {
|
||||
- struct pci_address addr;
|
||||
- u32 size_hi;
|
||||
- u32 size_lo;
|
||||
- };
|
||||
-
|
||||
- DBG(" -> generic_find_legacy_serial_port()\n");
|
||||
-
|
||||
- *physport = 0;
|
||||
- if (default_speed)
|
||||
- *default_speed = 0;
|
||||
-
|
||||
- np = of_find_node_by_path("/");
|
||||
- if (!np)
|
||||
- return;
|
||||
-
|
||||
- /* First fill our array */
|
||||
- for (np = NULL; (np = of_find_node_by_type(np, "serial"));) {
|
||||
- struct device_node *isa, *pci;
|
||||
- struct isa_reg_property *reg;
|
||||
- unsigned long phys_size, addr_size, io_base;
|
||||
- u32 *rangesp;
|
||||
- u32 *interrupts, *clk, *spd;
|
||||
- char *typep;
|
||||
- int index, rlen, rentsize;
|
||||
-
|
||||
- /* Ok, first check if it's under an "isa" parent */
|
||||
- isa = of_get_parent(np);
|
||||
- if (!isa || strcmp(isa->name, "isa")) {
|
||||
- DBG("%s: no isa parent found\n", np->full_name);
|
||||
- continue;
|
||||
- }
|
||||
-
|
||||
- /* Now look for an "ibm,aix-loc" property that gives us ordering
|
||||
- * if any...
|
||||
- */
|
||||
- typep = (char *)get_property(np, "ibm,aix-loc", NULL);
|
||||
-
|
||||
- /* Get the ISA port number */
|
||||
- reg = (struct isa_reg_property *)get_property(np, "reg", NULL);
|
||||
- if (reg == NULL)
|
||||
- goto next_port;
|
||||
- /* We assume the interrupt number isn't translated ... */
|
||||
- interrupts = (u32 *)get_property(np, "interrupts", NULL);
|
||||
- /* get clock freq. if present */
|
||||
- clk = (u32 *)get_property(np, "clock-frequency", NULL);
|
||||
- /* get default speed if present */
|
||||
- spd = (u32 *)get_property(np, "current-speed", NULL);
|
||||
- /* Default to locate at end of array */
|
||||
- index = old_serial_count; /* end of the array by default */
|
||||
-
|
||||
- /* If we have a location index, then use it */
|
||||
- if (typep && *typep == 'S') {
|
||||
- index = simple_strtol(typep+1, NULL, 0) - 1;
|
||||
- /* if index is out of range, use end of array instead */
|
||||
- if (index >= MAX_LEGACY_SERIAL_PORTS)
|
||||
- index = old_serial_count;
|
||||
- /* if our index is still out of range, that mean that
|
||||
- * array is full, we could scan for a free slot but that
|
||||
- * make little sense to bother, just skip the port
|
||||
- */
|
||||
- if (index >= MAX_LEGACY_SERIAL_PORTS)
|
||||
- goto next_port;
|
||||
- if (index >= old_serial_count)
|
||||
- old_serial_count = index + 1;
|
||||
- /* Check if there is a port who already claimed our slot */
|
||||
- if (serial_ports[index].iobase != 0) {
|
||||
- /* if we still have some room, move it, else override */
|
||||
- if (old_serial_count < MAX_LEGACY_SERIAL_PORTS) {
|
||||
- DBG("Moved legacy port %d -> %d\n", index,
|
||||
- old_serial_count);
|
||||
- serial_ports[old_serial_count++] =
|
||||
- serial_ports[index];
|
||||
- } else {
|
||||
- DBG("Replacing legacy port %d\n", index);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- if (index >= MAX_LEGACY_SERIAL_PORTS)
|
||||
- goto next_port;
|
||||
- if (index >= old_serial_count)
|
||||
- old_serial_count = index + 1;
|
||||
-
|
||||
- /* Now fill the entry */
|
||||
- memset(&serial_ports[index], 0, sizeof(struct plat_serial8250_port));
|
||||
- serial_ports[index].uartclk = clk ? *clk : BASE_BAUD * 16;
|
||||
- serial_ports[index].iobase = reg->address;
|
||||
- serial_ports[index].irq = interrupts ? interrupts[0] : 0;
|
||||
- serial_ports[index].flags = ASYNC_BOOT_AUTOCONF;
|
||||
-
|
||||
- DBG("Added legacy port, index: %d, port: %x, irq: %d, clk: %d\n",
|
||||
- index,
|
||||
- serial_ports[index].iobase,
|
||||
- serial_ports[index].irq,
|
||||
- serial_ports[index].uartclk);
|
||||
-
|
||||
- /* Get phys address of IO reg for port 1 */
|
||||
- if (index != 0)
|
||||
- goto next_port;
|
||||
-
|
||||
- pci = of_get_parent(isa);
|
||||
- if (!pci) {
|
||||
- DBG("%s: no pci parent found\n", np->full_name);
|
||||
- goto next_port;
|
||||
- }
|
||||
-
|
||||
- rangesp = (u32 *)get_property(pci, "ranges", &rlen);
|
||||
- if (rangesp == NULL) {
|
||||
- of_node_put(pci);
|
||||
- goto next_port;
|
||||
- }
|
||||
- rlen /= 4;
|
||||
-
|
||||
- /* we need the #size-cells of the PCI bridge node itself */
|
||||
- phys_size = 1;
|
||||
- sizeprop = (u32 *)get_property(pci, "#size-cells", NULL);
|
||||
- if (sizeprop != NULL)
|
||||
- phys_size = *sizeprop;
|
||||
- /* we need the parent #addr-cells */
|
||||
- addr_size = prom_n_addr_cells(pci);
|
||||
- rentsize = 3 + addr_size + phys_size;
|
||||
- io_base = 0;
|
||||
- for (;rlen >= rentsize; rlen -= rentsize,rangesp += rentsize) {
|
||||
- if (((rangesp[0] >> 24) & 0x3) != 1)
|
||||
- continue; /* not IO space */
|
||||
- io_base = rangesp[3];
|
||||
- if (addr_size == 2)
|
||||
- io_base = (io_base << 32) | rangesp[4];
|
||||
- }
|
||||
- if (io_base != 0) {
|
||||
- *physport = io_base + reg->address;
|
||||
- if (default_speed && spd)
|
||||
- *default_speed = *spd;
|
||||
- }
|
||||
- of_node_put(pci);
|
||||
- next_port:
|
||||
- of_node_put(isa);
|
||||
- }
|
||||
-
|
||||
- DBG(" <- generic_find_legacy_serial_port()\n");
|
||||
-}
|
||||
-
|
||||
-static struct platform_device serial_device = {
|
||||
- .name = "serial8250",
|
||||
- .id = 0,
|
||||
- .dev = {
|
||||
- .platform_data = serial_ports,
|
||||
- },
|
||||
-};
|
||||
-
|
||||
-static int __init serial_dev_init(void)
|
||||
-{
|
||||
- return platform_device_register(&serial_device);
|
||||
-}
|
||||
-arch_initcall(serial_dev_init);
|
||||
-
|
||||
-#endif /* CONFIG_PPC_ISERIES */
|
||||
|
||||
int check_legacy_ioport(unsigned long base_port)
|
||||
{
|
||||
--- linux-2.6.12/include/asm-ppc/pc_serial.h~ 2005-08-15 21:19:32.000000000 +0100
|
||||
+++ linux-2.6.12/include/asm-ppc/pc_serial.h 2005-08-15 21:20:24.000000000 +0100
|
||||
@@ -26,18 +26,3 @@
|
||||
#define RS_TABLE_SIZE 4
|
||||
#endif
|
||||
|
||||
-/* Standard COM flags (except for COM4, because of the 8514 problem) */
|
||||
-#ifdef CONFIG_SERIAL_DETECT_IRQ
|
||||
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
|
||||
-#define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
|
||||
-#else
|
||||
-#define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
|
||||
-#define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
|
||||
-#endif
|
||||
-
|
||||
-#define SERIAL_PORT_DFNS \
|
||||
- /* UART CLK PORT IRQ FLAGS */ \
|
||||
- { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
|
||||
- { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
|
||||
- { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
|
||||
- { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
|
|
@ -22,4 +22,3 @@
|
|||
+ m68k-spinlock.patch
|
||||
+ sparc64-atyfb-xl-gr.patch
|
||||
+ powerpc-arch-default-powerpc.patch
|
||||
|
||||
|
|
Loading…
Reference in New Issue