RE: kernel 2.5.20 on alpha (RE: [patch] Re: kernel 2.5.18 on alpha)

Oliver Pitzeier
2002-06-04T15:47:24Z

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

Jan Benedict Glaw wrote:
[ ... ]
> > PS: Anybody want's the patches???
>
> /me

OK, I attached the patches:
a small part is from: Anton Blanchard;
a big part from: Ivan Kokshaysky
a small part from: me...

And I took an idea from: "davidm@napali.hpl.hp.com" (See the
2.5.20 Changelog)

-Oliver

[-- Attachment #2: kernel-2.5.20.alpha.patch --]
[-- Type: application/octet-stream, Size: 9433 bytes --]

diff -r -C2 tarballs/linux-2.5.20/arch/alpha/kernel/osf_sys.c linux-2.5.20/arch/alpha/kernel/osf_sys.c
*** tarballs/linux-2.5.20/arch/alpha/kernel/osf_sys.c Mon Jun 3 03:44:37 2002
--- linux-2.5.20/arch/alpha/kernel/osf_sys.c Tue Jun 4 11:19:48 2002
***************
*** 34,37 ****
--- 34,38 ----
#include <linux/types.h>
#include <linux/ipc.h>
+ #include <linux/namei.h>

#include <asm/fpu.h>
diff -r -C2 tarballs/linux-2.5.20/arch/alpha/kernel/pci.c linux-2.5.20/arch/alpha/kernel/pci.c
*** tarballs/linux-2.5.20/arch/alpha/kernel/pci.c Mon Jun 3 03:44:41 2002
--- linux-2.5.20/arch/alpha/kernel/pci.c Tue Jun 4 11:19:48 2002
***************
*** 191,200 ****
#undef GB

! static void __init
pcibios_init(void)
{
! if (!alpha_mv.init_pci)
! return;
! alpha_mv.init_pci();
}

--- 191,200 ----
#undef GB

! static int __init
pcibios_init(void)
{
! if (alpha_mv.init_pci)
! alpha_mv.init_pci();
! return 0;
}

diff -r -C2 tarballs/linux-2.5.20/arch/alpha/kernel/signal.c linux-2.5.20/arch/alpha/kernel/signal.c
*** tarballs/linux-2.5.20/arch/alpha/kernel/signal.c Mon Jun 3 03:44:49 2002
--- linux-2.5.20/arch/alpha/kernel/signal.c Tue Jun 4 11:19:48 2002
***************
*** 19,22 ****
--- 19,23 ----
#include <linux/stddef.h>
#include <linux/tty.h>
+ #include <linux/binfmts.h>

#include <asm/bitops.h>
diff -r -C2 tarballs/linux-2.5.20/drivers/pci/pci-driver.c linux-2.5.20/drivers/pci/pci-driver.c
*** tarballs/linux-2.5.20/drivers/pci/pci-driver.c Mon Jun 3 03:44:51 2002
--- linux-2.5.20/drivers/pci/pci-driver.c Tue Jun 4 16:46:39 2002
***************
*** 193,197 ****
}

! subsys_initcall(pci_driver_init);

EXPORT_SYMBOL(pci_match_device);
--- 193,197 ----
}

! arch_initcall(pci_driver_init);

EXPORT_SYMBOL(pci_match_device);
diff -r -C2 tarballs/linux-2.5.20/fs/mpage.c linux-2.5.20/fs/mpage.c
*** tarballs/linux-2.5.20/fs/mpage.c Mon Jun 3 03:44:44 2002
--- linux-2.5.20/fs/mpage.c Tue Jun 4 14:30:34 2002
***************
*** 13,16 ****
--- 13,17 ----
#include <linux/kernel.h>
#include <linux/module.h>
+ #include <linux/kdev_t.h>
#include <linux/bio.h>
#include <linux/fs.h>
diff -r -C2 tarballs/linux-2.5.20/include/asm-alpha/bitops.h linux-2.5.20/include/asm-alpha/bitops.h
*** tarballs/linux-2.5.20/include/asm-alpha/bitops.h Mon Jun 3 03:44:49 2002
--- linux-2.5.20/include/asm-alpha/bitops.h Tue Jun 4 11:19:49 2002
***************
*** 316,319 ****
--- 316,333 ----
}

+ /*
+ * fls: find last bit set.
+ */
+ #if defined(__alpha_cix__) && defined(__alpha_fix__)
+ static inline int fls(int word)
+ {
+ long result;
+ __asm__("ctlz %1,%0" : "=r"(result) : "r"(word & 0xffffffff));
+ return 64 - result;
+ }
+ #else
+ #define fls generic_fls
+ #endif
+
/* Compute powers of two for the given integer. */
static inline int floor_log2(unsigned long word)
diff -r -C2 tarballs/linux-2.5.20/include/asm-alpha/mc146818rtc.h linux-2.5.20/include/asm-alpha/mc146818rtc.h
*** tarballs/linux-2.5.20/include/asm-alpha/mc146818rtc.h Mon Jun 3 03:44:39 2002
--- linux-2.5.20/include/asm-alpha/mc146818rtc.h Tue Jun 4 12:39:46 2002
***************
*** 25,27 ****
--- 25,29 ----
})

+ #define RTC_IRQ 8
+
#endif /* __ASM_ALPHA_MC146818RTC_H */
diff -r -C2 tarballs/linux-2.5.20/include/asm-alpha/page.h linux-2.5.20/include/asm-alpha/page.h
*** tarballs/linux-2.5.20/include/asm-alpha/page.h Mon Jun 3 03:44:52 2002
--- linux-2.5.20/include/asm-alpha/page.h Tue Jun 4 12:07:23 2002
***************
*** 16,23 ****

extern void clear_page(void *page);
! #define clear_user_page(page, vaddr) clear_page(page)

extern void copy_page(void * _to, void * _from);
! #define copy_user_page(to, from, vaddr) copy_page(to, from)

#ifdef STRICT_MM_TYPECHECKS
--- 16,23 ----

extern void clear_page(void *page);
! #define clear_user_page(page, vaddr, pg) clear_page(page)

extern void copy_page(void * _to, void * _from);
! #define copy_user_page(to, from, vaddr, pg) copy_page(to, from)

#ifdef STRICT_MM_TYPECHECKS
***************
*** 96,101 ****
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
#ifndef CONFIG_DISCONTIGMEM
! #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT))
! #define VALID_PAGE(page) (((page) - mem_map) < max_mapnr)
#endif /* CONFIG_DISCONTIGMEM */

--- 96,105 ----
#define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
#ifndef CONFIG_DISCONTIGMEM
! #define pfn_to_page(pfn) (mem_map + (pfn))
! #define page_to_pfn(page) ((unsigned long)((page) - mem_map))
! #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
!
! #define pfn_valid(pfn) ((pfn) < max_mapnr)
! #define virt_addr_valid(kaddr) pfn_valid(__pa(kaddr) >> PAGE_SHIFT)
#endif /* CONFIG_DISCONTIGMEM */

diff -r -C2 tarballs/linux-2.5.20/include/asm-alpha/pgtable.h linux-2.5.20/include/asm-alpha/pgtable.h
*** tarballs/linux-2.5.20/include/asm-alpha/pgtable.h Mon Jun 3 03:44:45 2002
--- linux-2.5.20/include/asm-alpha/pgtable.h Tue Jun 4 12:10:18 2002
***************
*** 180,188 ****
#if defined(CONFIG_ALPHA_GENERIC) || \
(defined(CONFIG_ALPHA_EV6) && !defined(USE_48_BIT_KSEG))
! #define PHYS_TWIDDLE(phys) \
! ((((phys) & 0xc0000000000UL) == 0x40000000000UL) \
! ? ((phys) ^= 0xc0000000000UL) : (phys))
#else
! #define PHYS_TWIDDLE(phys) (phys)
#endif

--- 180,189 ----
#if defined(CONFIG_ALPHA_GENERIC) || \
(defined(CONFIG_ALPHA_EV6) && !defined(USE_48_BIT_KSEG))
! #define KSEG_PFN (0xc0000000000UL >> PAGE_SHIFT)
! #define PHYS_TWIDDLE(pfn) \
! ((((pfn) & KSEG_PFN) == (0x40000000000UL >> PAGE_SHIFT)) \
! ? ((pfn) ^= KSEG_PFN) : (pfn))
#else
! #define PHYS_TWIDDLE(pfn) (pfn)
#endif

***************
*** 200,209 ****

#ifndef CONFIG_DISCONTIGMEM
#define mk_pte(page, pgprot) \
({ \
pte_t pte; \
\
! pte_val(pte) = ((unsigned long)(page - mem_map) << 32) | \
! pgprot_val(pgprot); \
pte; \
})
--- 201,211 ----

#ifndef CONFIG_DISCONTIGMEM
+ #define pte_pfn(pte) (pte_val(pte) >> 32)
+ #define pte_page(pte) pfn_to_page(pte_pfn(pte))
#define mk_pte(page, pgprot) \
({ \
pte_t pte; \
\
! pte_val(pte) = (page_to_pfn(page) << 32) | pgprot_val(pgprot); \
pte; \
})
***************
*** 220,227 ****
pte; \
})
#endif

! extern inline pte_t mk_pte_phys(unsigned long physpage, pgprot_t pgprot)
! { pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpage) << (32-PAGE_SHIFT)) | pgprot_val(pgprot); return pte; }

extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
--- 222,239 ----
pte; \
})
+ #define pte_page(x) \
+ ({ \
+ unsigned long kvirt; \
+ struct page * __xx; \
+ \
+ kvirt = (unsigned long)__va(pte_val(x) >> (32-PAGE_SHIFT)); \
+ __xx = virt_to_page(kvirt); \
+ \
+ __xx; \
+ })
#endif

! extern inline pte_t pfn_pte(unsigned long physpfn, pgprot_t pgprot)
! { pte_t pte; pte_val(pte) = (PHYS_TWIDDLE(physpfn) << 32) | pgprot_val(pgprot); return pte; }

extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
***************
*** 234,251 ****
{ pgd_val(*pgdp) = _PAGE_TABLE | ((((unsigned long) pmdp) - PAGE_OFFSET) << (32-PAGE_SHIFT)); }

- #ifndef CONFIG_DISCONTIGMEM
- #define pte_page(x) (mem_map+(unsigned long)((pte_val(x) >> 32)))
- #else
- #define pte_page(x) \
- ({ \
- unsigned long kvirt; \
- struct page * __xx; \
- \
- kvirt = (unsigned long)__va(pte_val(x) >> (32-PAGE_SHIFT)); \
- __xx = virt_to_page(kvirt); \
- \
- __xx; \
- })
- #endif

extern inline unsigned long
--- 246,249 ----
diff -r -C2 tarballs/linux-2.5.20/include/asm-alpha/tlb.h linux-2.5.20/include/asm-alpha/tlb.h
*** tarballs/linux-2.5.20/include/asm-alpha/tlb.h Mon Jun 3 03:44:48 2002
--- linux-2.5.20/include/asm-alpha/tlb.h Tue Jun 4 11:19:48 2002
***************
*** 1 ****
--- 1,15 ----
+ #ifndef _ALPHA_TLB_H
+ #define _ALPHA_TLB_H
+
+ #define tlb_start_vma(tlb, vma) do { } while (0)
+ #define tlb_end_vma(tlb, vma) do { } while (0)
+ #define tlb_remove_tlb_entry(tlb, pte, addr) do { } while (0)
+
+ #define tlb_flush(tlb) flush_tlb_mm((tlb)->mm)
+
#include <asm-generic/tlb.h>
+
+ #define pte_free_tlb(tlb,pte) pte_free(pte)
+ #define pmd_free_tlb(tlb,pmd) pmd_free(pmd)
+
+ #endif
diff -r -C2 tarballs/linux-2.5.20/include/linux/bio.h linux-2.5.20/include/linux/bio.h
*** tarballs/linux-2.5.20/include/linux/bio.h Mon Jun 3 03:44:52 2002
--- linux-2.5.20/include/linux/bio.h Tue Jun 4 12:56:40 2002
***************
*** 129,134 ****
* will die
*/
! #define bio_to_phys(bio) (page_to_phys(bio_page((bio))) + (unsigned long) bio_offset((bio)))
! #define bvec_to_phys(bv) (page_to_phys((bv)->bv_page) + (unsigned long) (bv)->bv_offset)

/*
--- 129,134 ----
* will die
*/
! #define bio_to_phys(bio) ((page_to_pfn(bio_page((bio))) << PAGE_SHIFT) + (unsigned long) bio_offset((bio)))
! #define bvec_to_phys(bv) ((page_to_pfn((bv)->bv_page) << PAGE_SHIFT) + (unsigned long) (bv)->bv_offset)

/*