Re: pte_val(*pte) as lvalue

From: Timur Tabi (ttabi@interactivesi.com)
Date: Tue Jul 03 2001 - 13:50:05 EST


Russell King wrote:

>Can I ask what the nature of the PTE modification is, and where you
>are making this modification?
>
I've written a hack which enables PAT (Page Address Translation) for a
particular page:

void set_pte_pat(pte_t *pte, unsigned long pat_index)
{
    unsigned long p = pte_val(*pte);

    p &= ~(_PAGE_PROTNONE | _PAGE_PCD | _PAGE_PWT); // zero-out the
relevant bits

    if (pat_index & 4)
    p |= _PAGE_PROTNONE;

    if (pat_index & 2)
    p |= _PAGE_PCD;

    if (pat_index & 1)
    p |= _PAGE_PWT;

#if CONFIG_X86_PAE
    pte->pte_high = 0;
    pte->pte_low = p;
#else
    pte_val(*pte) = p;
#endif

-- 
Timur Tabi
Interactive Silicon

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 07 2001 - 21:00:12 EST