lkml.org 
[lkml]   [2001]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: pte_val(*pte) as lvalue
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/

\
 
 \ /
  Last update: 2005-03-22 12:56    [W:0.045 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site