From: NIIBE Y. <gn...@m1...> - 2002-06-26 06:57:49
|
To build the kernel, following fixes are needed. 2002-06-26 NIIBE Yutaka <gn...@m1...> * arch/sh/Makefile (archclean): Remove invoking make under subdirectory. (LINKFLAGS): Add adding 'jiffies' definition. * arch/sh/vmlinux.lds.S (jiffies): Removed. * arch/sh/mm/ioremap.c: Include <linux/mm.h> and <asm/page.h>. * arch/sh/mm/cache-sh4.c (copy_user_page, clear_user_page): Follow new API. * arch/sh/kernel/irq.c (show_interrupts): Use NR_CPUS (was: smp_num_cpus). * arch/sh/kernel/sh_ksyms.c: Don't include <asm/pgalloc.h>. * include/asm-sh/signal.h: Declare struct pt_regs. * include/asm-sh/pgtable.h (mk_pte): New definition using pfn_pte. * include/asm-sh/pgalloc.h (pmd_free_tlb): Fixed to have a argument tlb. (ptep_get_and_clear): Fixed the argurment to pfn_to_page. * include/asm-sh/pgtable-2level.h (pte_pfn): Fixed to access the member pte (was: pte_low). * include/asm-sh/page.h (VALID_PAGE): Removed. (PFN_START, pfn_to_page, page_to_pfn, virt_to_page, pfn_valid, virt_addr_valid): Defined. * include/asm-sh/siginfo.h: Remove unmatched #endif. Index: arch/sh/Makefile =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/Makefile,v retrieving revision 1.3 diff -u -3 -p -r1.3 Makefile --- arch/sh/Makefile 26 Jun 2002 01:44:06 -0000 1.3 +++ arch/sh/Makefile 26 Jun 2002 06:54:23 -0000 @@ -49,6 +49,12 @@ endif LINKSCRIPT = arch/sh/vmlinux.lds LINKFLAGS += -T $(word 1,$(LINKSCRIPT)) -e _stext +ifdef CONFIG_CPU_LITTLE_ENDIAN +LINKFLAGS += --defsym 'jiffies=jiffies_64' +else +LINKFLAGS += --defsym 'jiffies=jiffies_64+4' +endif + ifdef LOADADDR LINKFLAGS += -Ttext $(word 1,$(LOADADDR)) endif @@ -88,9 +94,6 @@ zdisk: vmlinux archclean: @$(MAKEBOOT) clean - $(MAKE) -C arch/$(ARCH)/kernel clean - $(MAKE) -C arch/$(ARCH)/stboards clean -# $(MAKE) -C arch/$(ARCH)/tools clean archmrproper: rm -f arch/sh/vmlinux.lds Index: arch/sh/vmlinux.lds.S =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/vmlinux.lds.S,v retrieving revision 1.4 diff -u -3 -p -r1.4 vmlinux.lds.S --- arch/sh/vmlinux.lds.S 23 May 2002 01:51:13 -0000 1.4 +++ arch/sh/vmlinux.lds.S 26 Jun 2002 06:54:23 -0000 @@ -5,10 +5,8 @@ #include <linux/config.h> #ifdef CONFIG_CPU_LITTLE_ENDIAN OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") -jiffies = jiffies_64; #else OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") -jiffies = jiffies_64 + 4; #endif OUTPUT_ARCH(sh) ENTRY(_start) Index: arch/sh/kernel/irq.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/irq.c,v retrieving revision 1.3 diff -u -3 -p -r1.3 irq.c --- arch/sh/kernel/irq.c 15 Jan 2002 07:59:52 -0000 1.3 +++ arch/sh/kernel/irq.c 26 Jun 2002 06:54:23 -0000 @@ -92,7 +92,7 @@ int show_interrupts(struct seq_file *p, struct irqaction * action; seq_puts(p, " "); - for (j=0; j<smp_num_cpus; j++) + for (j=0; j<NR_CPUS; j++) seq_printf(p, "CPU%d ",j); seq_putc(p, '\n'); Index: arch/sh/kernel/sh_ksyms.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/sh_ksyms.c,v retrieving revision 1.4 diff -u -3 -p -r1.4 sh_ksyms.c --- arch/sh/kernel/sh_ksyms.c 12 Apr 2002 04:26:28 -0000 1.4 +++ arch/sh/kernel/sh_ksyms.c 26 Jun 2002 06:54:23 -0000 @@ -19,7 +19,6 @@ #include <asm/io.h> #include <asm/hardirq.h> #include <asm/delay.h> -#include <asm/pgalloc.h> #include <asm/tlbflush.h> #include <asm/cacheflush.h> Index: arch/sh/mm/cache-sh4.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/mm/cache-sh4.c,v retrieving revision 1.14 diff -u -3 -p -r1.14 cache-sh4.c --- arch/sh/mm/cache-sh4.c 22 May 2002 07:37:02 -0000 1.14 +++ arch/sh/mm/cache-sh4.c 26 Jun 2002 06:54:23 -0000 @@ -414,11 +414,10 @@ void flush_icache_user_range(struct vm_a * clear_user_page * @to: P1 address * @address: U0 address to be mapped + * @page: page (virt_to_page(to)) */ -void clear_user_page(void *to, unsigned long address) +void clear_user_page(void *to, unsigned long address, struct page *page) { - struct page *page = virt_to_page(to); - __set_bit(PG_mapped, &page->flags); if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) clear_page(to); @@ -453,11 +452,11 @@ void clear_user_page(void *to, unsigned * @to: P1 address * @from: P1 address * @address: U0 address to be mapped + * @page: page (virt_to_page(to)) */ -void copy_user_page(void *to, void *from, unsigned long address) +void copy_user_page(void *to, void *from, unsigned long address, + struct page *page) { - struct page *page = virt_to_page(to); - __set_bit(PG_mapped, &page->flags); if (((address ^ (unsigned long)to) & CACHE_ALIAS) == 0) copy_page(to, from); Index: arch/sh/mm/ioremap.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/mm/ioremap.c,v retrieving revision 1.4 diff -u -3 -p -r1.4 ioremap.c --- arch/sh/mm/ioremap.c 22 May 2002 07:37:02 -0000 1.4 +++ arch/sh/mm/ioremap.c 26 Jun 2002 06:54:23 -0000 @@ -10,7 +10,9 @@ */ #include <linux/vmalloc.h> +#include <linux/mm.h> #include <asm/io.h> +#include <asm/page.h> #include <asm/pgalloc.h> #include <asm/cacheflush.h> #include <asm/tlbflush.h> Index: include/asm-sh/page.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/page.h,v retrieving revision 1.3 diff -u -3 -p -r1.3 page.h --- include/asm-sh/page.h 18 Jun 2002 03:36:24 -0000 1.3 +++ include/asm-sh/page.h 26 Jun 2002 06:54:23 -0000 @@ -31,6 +31,7 @@ extern void copy_page(void *to, void *fr #define clear_user_page(page, vaddr, pg) clear_page(page) #define copy_user_page(to, from, vaddr, pg) copy_page(to, from) #elif defined(__SH4__) +struct page; extern void clear_user_page(void *to, unsigned long address, struct page *pg); extern void copy_user_page(void *to, void *from, unsigned long address, struct page *pg); extern void __clear_user_page(void *to, void *orig_to); @@ -82,14 +83,20 @@ typedef struct { unsigned long pgprot; } #ifndef CONFIG_DISCONTIGMEM #define phys_to_page(phys) (mem_map + (((phys)-__MEMORY_START) >> PAGE_SHIFT)) -#define VALID_PAGE(page) ((page - mem_map) < max_mapnr) #define page_to_phys(page) (((page - mem_map) << PAGE_SHIFT) + __MEMORY_START) #endif +/* PFN start number, because of __MEMORY_START */ +#define PFN_START (__MEMORY_START >> PAGE_SHIFT) + +#define pfn_to_page(pfn) (mem_map + (pfn) - PFN_START) +#define page_to_pfn(page) ((unsigned long)((page) - mem_map) + PFN_START) +#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) +#define pfn_valid(pfn) (((pfn) - PFN_START) < max_mapnr) +#define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT) + #define VM_DATA_DEFAULT_FLAGS (VM_READ | VM_WRITE | VM_EXEC | \ VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC) - -#define virt_to_page(kaddr) phys_to_page(__pa(kaddr)) #ifndef __ASSEMBLY__ Index: include/asm-sh/pgalloc.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/pgalloc.h,v retrieving revision 1.9 diff -u -3 -p -r1.9 pgalloc.h --- include/asm-sh/pgalloc.h 23 May 2002 01:51:13 -0000 1.9 +++ include/asm-sh/pgalloc.h 26 Jun 2002 06:54:23 -0000 @@ -47,7 +47,7 @@ static inline void pte_free(struct page #define pmd_alloc_one(mm, addr) ({ BUG(); ((pmd_t *)2); }) #define pmd_free(x) do { } while (0) -#define pmd_free_tlb(x) do { } while (0) +#define pmd_free_tlb(tlb,x) do { } while (0) #define pgd_populate(mm, pmd, pte) BUG() #if defined(__SH4__) @@ -65,7 +65,7 @@ static inline pte_t ptep_get_and_clear(p struct page *page; unsigned long pfn = pte_pfn(pte); if (pfn_valid(pfn)) { - page = pfn_to_page(page); + page = pfn_to_page(pfn); if (!page->mapping || list_empty(&page->mapping->i_mmap_shared)) __clear_bit(PG_mapped, &page->flags); Index: include/asm-sh/pgtable-2level.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/pgtable-2level.h,v retrieving revision 1.2 diff -u -3 -p -r1.2 pgtable-2level.h --- include/asm-sh/pgtable-2level.h 18 Jun 2002 02:54:38 -0000 1.2 +++ include/asm-sh/pgtable-2level.h 26 Jun 2002 06:54:23 -0000 @@ -56,7 +56,7 @@ static inline pmd_t * pmd_offset(pgd_t * return (pmd_t *) dir; } -#define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT))) +#define pte_pfn(x) ((unsigned long)(((x).pte >> PAGE_SHIFT))) #define pfn_pte(pfn, prot) __pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) #define pfn_pmd(pfn, prot) __pmd(((pfn) << PAGE_SHIFT) | pgprot_val(prot)) Index: include/asm-sh/pgtable.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/pgtable.h,v retrieving revision 1.10 diff -u -3 -p -r1.10 pgtable.h --- include/asm-sh/pgtable.h 18 Jun 2002 03:36:24 -0000 1.10 +++ include/asm-sh/pgtable.h 26 Jun 2002 06:54:23 -0000 @@ -185,13 +185,7 @@ static inline pgprot_t pgprot_noncached( * * extern pte_t mk_pte(struct page *page, pgprot_t pgprot) */ -#define mk_pte(page,pgprot) \ -({ pte_t __pte; \ - \ - set_pte(&__pte, __pte(PHYSADDR(page_address(page)) \ - +pgprot_val(pgprot))); \ - __pte; \ -}) +#define mk_pte(page, pgprot) pfn_pte(page_to_pfn(page), (pgprot)) static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) { set_pte(&pte, __pte((pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot))); return pte; } @@ -222,6 +216,7 @@ static inline pte_t pte_modify(pte_t pte #define pte_unmap(pte) do { } while (0) #define pte_unmap_nested(pte) do { } while (0) +struct vm_area_struct; extern void update_mmu_cache(struct vm_area_struct * vma, unsigned long address, pte_t pte); Index: include/asm-sh/siginfo.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/siginfo.h,v retrieving revision 1.4 diff -u -3 -p -r1.4 siginfo.h --- include/asm-sh/siginfo.h 18 Jun 2002 02:54:38 -0000 1.4 +++ include/asm-sh/siginfo.h 26 Jun 2002 06:54:23 -0000 @@ -3,6 +3,4 @@ #include <asm-generic/siginfo.h> -#endif /* __KERNEL__ */ - #endif /* __ASM_SH_SIGINFO_H */ Index: include/asm-sh/signal.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/signal.h,v retrieving revision 1.1.1.1 diff -u -3 -p -r1.1.1.1 signal.h --- include/asm-sh/signal.h 15 Oct 2001 20:45:07 -0000 1.1.1.1 +++ include/asm-sh/signal.h 26 Jun 2002 06:54:23 -0000 @@ -4,6 +4,7 @@ #include <linux/types.h> /* Avoid too many header ordering problems. */ +struct pt_regs; struct siginfo; #define _NSIG 64 |