[parisc-linux] The 720/50 saga continues...

Jochen Friedrich jochen@scram.de
Wed, 26 Sep 2001 22:34:31 +0200 (CEST)


Hi Jurij,

> down_read(&mm->mmap_sem);
> vma = find_vma_prev(mm, address, &prev_vma);
>

I was roughly thinking about something like this (completely untested!!!):

case 18:
if (in_interrupt() || !mm)
        goto pagefault; /* shouldn't happen */

/* FIXME: do propper locking here */

pgd = pgd_offset(mm, address);        /* page directory */
if (pgd_none(pgd) || pgd_bad(pgd))
        goto pagefault; /* expandable stack etc */

pmd = pmd_offset(pgd, address);       /* middle page directory */
if (pmd_none(pmd) || pmd_bad((pmd))
        goto pagefault; /* expandable stack etc */

pte = pte_offset(pmd, address);       /* page table entry */
if (pte_none(pte))
        goto pagefault; /* expandable stack etc */

if (!pte_present(pte))  /* is this test sufficient? */
        goto pagefault; /* page not loaded */

acc_type = parisc_acctyp(code,regs->iir);

if ((acc_type & VM_WRITE) && (!(pte_write(pte))))
	goto pagefault; /* Write protected access */

if ((acc_type & VM_READ) && (!(pte_read(pte))))
	goto pagefault; /* Read protected access */

if ((acc_type & VM_EXEC) && (!(pte_exec(pte))))
	goto pagefault; /* Exec protected access */

/* fall through to case 28 */

Does this make sense?

Cheers,
Jochen