]> err.no Git - linux-2.6/blobdiff - arch/sparc/mm/sun4c.c
x86: printk kernel version in WARN_ON and other dump_stack users
[linux-2.6] / arch / sparc / mm / sun4c.c
index a57a366e339ac6cb3796357087ca20c088f90558..0729305f2f594a83ff6259ec1e5e223ba51ab30c 100644 (file)
@@ -1,7 +1,6 @@
-/* $Id: sun4c.c,v 1.212 2001/12/21 04:56:15 davem Exp $
- * sun4c.c: Doing in software what should be done in hardware.
+/* sun4c.c: Doing in software what should be done in hardware.
  *
- * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
+ * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
  * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be)
  * Copyright (C) 1996 Andrew Tridgell (Andrew.Tridgell@anu.edu.au)
  * Copyright (C) 1997-2000 Anton Blanchard (anton@samba.org)
@@ -17,8 +16,8 @@
 #include <linux/highmem.h>
 #include <linux/fs.h>
 #include <linux/seq_file.h>
+#include <linux/scatterlist.h>
 
-#include <asm/scatterlist.h>
 #include <asm/page.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
@@ -268,7 +267,6 @@ static inline void sun4c_init_clean_mmu(unsigned long kernel_end)
        unsigned char savectx, ctx;
 
        savectx = sun4c_get_context();
-       kernel_end = SUN4C_REAL_PGDIR_ALIGN(kernel_end);
        for (ctx = 0; ctx < num_contexts; ctx++) {
                sun4c_set_context(ctx);
                for (vaddr = 0; vaddr < 0x20000000; vaddr += SUN4C_REAL_PGDIR_SIZE)
@@ -720,7 +718,7 @@ static void add_ring(struct sun4c_mmu_ring *ring,
        ring->num_entries++;
 }
 
-static __inline__ void add_lru(struct sun4c_mmu_entry *entry)
+static inline void add_lru(struct sun4c_mmu_entry *entry)
 {
        struct sun4c_mmu_ring *ring = &sun4c_ulru_ring;
        struct sun4c_mmu_entry *head = &ring->ringhd;
@@ -747,7 +745,7 @@ static void add_ring_ordered(struct sun4c_mmu_ring *ring,
        add_lru(entry);
 }
 
-static __inline__ void remove_ring(struct sun4c_mmu_ring *ring,
+static inline void remove_ring(struct sun4c_mmu_ring *ring,
                                   struct sun4c_mmu_entry *entry)
 {
        struct sun4c_mmu_entry *next = entry->next;
@@ -1229,8 +1227,9 @@ static void sun4c_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus *
 {
        while (sz != 0) {
                --sz;
-               sg[sz].dvma_address = (__u32)sun4c_lockarea(page_address(sg[sz].page) + sg[sz].offset, sg[sz].length);
-               sg[sz].dvma_length = sg[sz].length;
+               sg->dvma_address = (__u32)sun4c_lockarea(sg_virt(sg), sg->length);
+               sg->dvma_length = sg->length;
+               sg = sg_next(sg);
        }
 }
 
@@ -1245,7 +1244,8 @@ static void sun4c_release_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_b
 {
        while (sz != 0) {
                --sz;
-               sun4c_unlockarea((char *)sg[sz].dvma_address, sg[sz].length);
+               sun4c_unlockarea((char *)sg->dvma_address, sg->length);
+               sg = sg_next(sg);
        }
 }
 
@@ -1835,7 +1835,7 @@ static unsigned long sun4c_pte_to_pgoff(pte_t pte)
 }
 
 
-static __inline__ unsigned long sun4c_pmd_page_v(pmd_t pmd)
+static inline unsigned long sun4c_pmd_page_v(pmd_t pmd)
 {
        return (pmd_val(pmd) & PAGE_MASK);
 }
@@ -1921,7 +1921,7 @@ static void sun4c_free_pgd_fast(pgd_t *pgd)
 }
 
 
-static __inline__ pte_t *
+static inline pte_t *
 sun4c_pte_alloc_one_fast(struct mm_struct *mm, unsigned long address)
 {
        unsigned long *ret;
@@ -1955,7 +1955,7 @@ static struct page *sun4c_pte_alloc_one(struct mm_struct *mm, unsigned long addr
        return virt_to_page(pte);
 }
 
-static __inline__ void sun4c_free_pte_fast(pte_t *pte)
+static inline void sun4c_free_pte_fast(pte_t *pte)
 {
        *(unsigned long *)pte = (unsigned long) pte_quicklist;
        pte_quicklist = (unsigned long *) pte;
@@ -1999,6 +1999,9 @@ void sun4c_update_mmu_cache(struct vm_area_struct *vma, unsigned long address, p
        unsigned long flags;
        int pseg;
 
+       if (vma->vm_mm->context == NO_CONTEXT)
+               return;
+
        local_irq_save(flags);
        address &= PAGE_MASK;
        if ((pseg = sun4c_get_segmap(address)) == invalid_segment) {
@@ -2061,7 +2064,6 @@ void __init sun4c_paging_init(void)
        unsigned long end_pfn, pages_avail;
 
        kernel_end = (unsigned long) &end;
-       kernel_end += (SUN4C_REAL_PGDIR_SIZE * 4);
        kernel_end = SUN4C_REAL_PGDIR_ALIGN(kernel_end);
 
        pages_avail = 0;