@@ -185,6 +185,28 @@ static inline off_t pte_get_off(pte_t *ptep, size_t pgsize)
|
||||
return (off_t)(*ptep & PAGE_MASK);
|
||||
}
|
||||
|
||||
static inline void pte_make_fileoff(off_t off,
|
||||
enum ihk_mc_pt_attribute ptattr, size_t pgsize, pte_t *ptep)
|
||||
{
|
||||
uint64_t attr;
|
||||
|
||||
attr = ptattr & ~PAGE_MASK;
|
||||
|
||||
switch (pgsize) {
|
||||
case PTL1_SIZE: attr |= PFL1_FILEOFF; break;
|
||||
case PTL2_SIZE: attr |= PFL2_FILEOFF | PFL2_SIZE; break;
|
||||
case PTL3_SIZE: attr |= PFL3_FILEOFF | PFL3_SIZE; break;
|
||||
default:
|
||||
#if 0 /* XXX: workaround. cannot use panic() here */
|
||||
panic("pte_make_fileoff");
|
||||
#else
|
||||
attr |= PTATTR_FILEOFF;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
*ptep = (off & PAGE_MASK) | attr;
|
||||
}
|
||||
|
||||
#if 0 /* XXX: workaround. cannot use panic() here */
|
||||
static inline void pte_xchg(pte_t *ptep, pte_t *valp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user