From: SUGIOKA T. <su...@it...> - 2003-03-22 06:58:32
|
Hi, Here is a patch to fix some minor problems in order to compile against 2.4.20. I'll commit if no objection. * AGAINST-2.4.20-pre11: Removed. * AGAINST-2.4.20: New file. * include/asm-sh/ide.h (ide_init_default_hwifs): Clear 'hw' before calling ide_init_hwif_ports. (select_t,control_t): Support big endian. * include/asm-sh/pci.h (pci_dev): Declared. (PCI_DMA_BUS_IS_PHYS): Defined. * include/asm-sh/scatterlist.h (struct scatterlist): Add new members (page, offset, dma_address). * include/asm-sh/types.h (dma64_addr_t): Defined. * mm/memory.c (mark_dirty_kiobuf): Call set_page_dirty() instead of SetPageDirty(). Index: include/asm-sh/ide.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/ide.h,v retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1.2.1 ide.h --- include/asm-sh/ide.h 23 Oct 2002 00:57:47 -0000 1.1.1.1.2.1 +++ include/asm-sh/ide.h 22 Mar 2003 06:04:00 -0000 @@ -100,6 +100,7 @@ int index; for(index = 0; index < MAX_HWIFS; index++) { + memset(&hw, 0, sizeof hw); ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL); hw.irq = ide_default_irq(ide_default_io_base(index)); ide_register_hw(&hw, NULL); @@ -110,23 +111,40 @@ typedef union { unsigned all : 8; /* all of the bits together */ struct { +#ifdef __LITTLE_ENDIAN__ unsigned head : 4; /* always zeros here */ unsigned unit : 1; /* drive select number, 0 or 1 */ unsigned bit5 : 1; /* always 1 */ unsigned lba : 1; /* using LBA instead of CHS */ unsigned bit7 : 1; /* always 1 */ +#else + unsigned bit7 : 1; /* always 1 */ + unsigned lba : 1; /* using LBA instead of CHS */ + unsigned bit5 : 1; /* always 1 */ + unsigned unit : 1; /* drive select number, 0 or 1 */ + unsigned head : 4; /* always zeros here */ +#endif } b; } select_t; typedef union { unsigned all : 8; /* all of the bits together */ struct { +#ifdef __LITTLE_ENDIAN__ unsigned bit0 : 1; unsigned nIEN : 1; /* device INTRQ to host */ unsigned SRST : 1; /* host soft reset bit */ unsigned bit3 : 1; /* ATA-2 thingy */ unsigned reserved456 : 3; unsigned HOB : 1; /* 48-bit address ordering */ +#else + unsigned HOB : 1; /* 48-bit address ordering */ + unsigned reserved456 : 3; + unsigned bit3 : 1; /* ATA-2 thingy */ + unsigned SRST : 1; /* host soft reset bit */ + unsigned nIEN : 1; /* device INTRQ to host */ + unsigned bit0 : 1; +#endif } b; } control_t; Index: include/asm-sh/pci.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/pci.h,v retrieving revision 1.1.1.1.2.2 diff -u -r1.1.1.1.2.2 pci.h --- include/asm-sh/pci.h 26 Feb 2002 11:42:29 -0000 1.1.1.1.2.2 +++ include/asm-sh/pci.h 22 Mar 2003 06:04:00 -0000 @@ -50,6 +50,14 @@ #include <linux/string.h> #include <asm/io.h> +struct pci_dev; + +/* 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 (1) + /* 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). Index: include/asm-sh/scatterlist.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/scatterlist.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 scatterlist.h --- include/asm-sh/scatterlist.h 15 Oct 2001 20:45:11 -0000 1.1.1.1 +++ include/asm-sh/scatterlist.h 22 Mar 2003 06:04:00 -0000 @@ -2,7 +2,12 @@ #define __ASM_SH_SCATTERLIST_H struct scatterlist { - char * address; /* Location data is to be transferred to */ + char * address; /* Location data is to be transferred to, NULL for + * highmem page */ + struct page * page; /* Location for highmem page, if any */ + unsigned int offset;/* for highmem, page offset */ + + dma_addr_t dma_address; unsigned int length; }; Index: include/asm-sh/types.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/types.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 types.h --- include/asm-sh/types.h 15 Oct 2001 20:45:09 -0000 1.1.1.1 +++ include/asm-sh/types.h 22 Mar 2003 06:04:00 -0000 @@ -44,6 +44,7 @@ /* Dma addresses are 32-bits wide. */ typedef u32 dma_addr_t; +typedef u64 dma64_addr_t; #endif /* __KERNEL__ */ Index: mm/memory.c =================================================================== RCS file: /cvsroot/linuxsh/linux/mm/memory.c,v retrieving revision 1.1.1.1.2.7 diff -u -r1.1.1.1.2.7 memory.c --- mm/memory.c 24 Oct 2002 05:52:59 -0000 1.1.1.1.2.7 +++ mm/memory.c 22 Mar 2003 06:04:01 -0000 @@ -586,6 +586,8 @@ * occurs, the number of bytes read into memory may be less than the * size of the kiobuf, so we have to stop marking pages dirty once the * requested byte count has been reached. + * + * Must be called from process context - set_page_dirty() takes VFS locks. */ void mark_dirty_kiobuf(struct kiobuf *iobuf, int bytes) @@ -603,7 +605,7 @@ page = iobuf->maplist[index]; if (!PageReserved(page)) - SetPageDirty(page); + set_page_dirty(page); remaining -= (PAGE_SIZE - offset); offset = 0; ---- SUGIOKA Toshinobu |