Redefine a PTE as a 64-bit integral type instead of a struct of

bit-fields. Unify the PTE defines accordingly and update all
uses.
This commit is contained in:
Marcel Moolenaar 2004-09-23 18:37:36 +00:00
parent a9da2faf34
commit f3a21ad7c6
4 changed files with 42 additions and 66 deletions

View File

@ -137,7 +137,7 @@ elf64_exec(struct preloaded_file *fp)
{
struct file_metadata *md;
Elf_Ehdr *hdr;
struct ia64_pte pte;
pt_entry_t pte;
struct bootinfo *bi;
u_int64_t psr;
UINTN mapkey, pages, size;
@ -193,25 +193,17 @@ elf64_exec(struct preloaded_file *fp)
ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (28 << 2));
ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (28 << 2));
bzero(&pte, sizeof(pte));
pte.pte_p = 1;
pte.pte_ma = PTE_MA_WB;
pte.pte_a = 1;
pte.pte_d = 1;
pte.pte_pl = PTE_PL_KERN;
pte.pte_ar = PTE_AR_RWX;
pte.pte_ppn = 0;
pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
PTE_PL_KERN | PTE_AR_RWX;
__asm __volatile("mov cr.ifa=%0" :: "r"(IA64_RR_BASE(7)));
__asm __volatile("mov cr.itir=%0" :: "r"(28 << 2));
__asm __volatile("ptr.i %0,%1" :: "r"(IA64_RR_BASE(7)), "r"(28<<2));
__asm __volatile("ptr.d %0,%1" :: "r"(IA64_RR_BASE(7)), "r"(28<<2));
__asm __volatile("srlz.i;;");
__asm __volatile("itr.i itr[%0]=%1;;"
:: "r"(0), "r"(*(u_int64_t*)&pte));
__asm __volatile("itr.i itr[%0]=%1;;" :: "r"(0), "r"(pte));
__asm __volatile("srlz.i;;");
__asm __volatile("itr.d dtr[%0]=%1;;"
:: "r"(0), "r"(*(u_int64_t*)&pte));
__asm __volatile("itr.d dtr[%0]=%1;;" :: "r"(0), "r"(pte));
__asm __volatile("srlz.i;;");
enter_kernel(hdr->e_entry, bi);

View File

@ -387,7 +387,7 @@ print_trs(int type)
struct ia64_pal_result res;
int i, maxtr;
struct {
struct ia64_pte pte;
pt_entry_t pte;
struct ia64_itir itir;
uint64_t ifa;
struct ia64_rr rr;
@ -436,28 +436,24 @@ print_trs(int type)
continue;
if (!(res.pal_result[0] & 1))
buf.pte.pte_ar = 0;
buf.pte &= ~PTE_AR_MASK;
if (!(res.pal_result[0] & 2))
buf.pte.pte_pl = 0;
buf.pte &= ~PTE_PL_MASK;
if (!(res.pal_result[0] & 4))
buf.pte.pte_d = 0;
buf.pte &= ~PTE_DIRTY;
if (!(res.pal_result[0] & 8))
buf.pte.pte_ma = 0;
sprintf(lbuf,
"%03d %06x %013lx %013lx %4s %d %d %d %d %d %-3s %d %06x\n",
i,
buf.rr.rr_rid,
buf.ifa >> 12,
buf.pte.pte_ppn,
psnames[buf.itir.itir_ps],
buf.pte.pte_ed,
buf.pte.pte_ar,
buf.pte.pte_pl,
buf.pte.pte_d,
buf.pte.pte_a,
manames[buf.pte.pte_ma],
buf.pte.pte_p,
buf.itir.itir_key);
buf.pte &= ~PTE_MA_MASK;
sprintf(lbuf, "%03d %06x %013lx %013lx %4s %d %d %d %d %d "
"%-3s %d %06x\n", i, buf.rr.rr_rid, buf.ifa >> 12,
(buf.pte & PTE_PPN_MASK) >> 12, psnames[buf.itir.ps],
(buf.pte & PTE_ED) ? 1 : 0,
(int)(buf.pte & PTE_AR_MASK) >> 9,
(int)(buf.pte & PTE_PL_MASK) >> 7,
(buf.pte & PTE_DIRTY) ? 1 : 0,
(buf.pte & PTE_ACCESSED) ? 1 : 0,
manames[(buf.pte & PTE_MA_MASK) >> 2],
(buf.pte & PTE_PRESENT) ? 1 : 0,
buf.itir.key);
pager_output(lbuf);
}
pager_close();

View File

@ -137,7 +137,7 @@ elf64_exec(struct preloaded_file *fp)
{
struct file_metadata *md;
Elf_Ehdr *hdr;
struct ia64_pte pte;
pt_entry_t pte;
struct bootinfo *bi;
u_int64_t psr;
UINTN mapkey, pages, size;
@ -193,25 +193,17 @@ elf64_exec(struct preloaded_file *fp)
ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (28 << 2));
ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (28 << 2));
bzero(&pte, sizeof(pte));
pte.pte_p = 1;
pte.pte_ma = PTE_MA_WB;
pte.pte_a = 1;
pte.pte_d = 1;
pte.pte_pl = PTE_PL_KERN;
pte.pte_ar = PTE_AR_RWX;
pte.pte_ppn = 0;
pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY |
PTE_PL_KERN | PTE_AR_RWX;
__asm __volatile("mov cr.ifa=%0" :: "r"(IA64_RR_BASE(7)));
__asm __volatile("mov cr.itir=%0" :: "r"(28 << 2));
__asm __volatile("ptr.i %0,%1" :: "r"(IA64_RR_BASE(7)), "r"(28<<2));
__asm __volatile("ptr.d %0,%1" :: "r"(IA64_RR_BASE(7)), "r"(28<<2));
__asm __volatile("srlz.i;;");
__asm __volatile("itr.i itr[%0]=%1;;"
:: "r"(0), "r"(*(u_int64_t*)&pte));
__asm __volatile("itr.i itr[%0]=%1;;" :: "r"(0), "r"(pte));
__asm __volatile("srlz.i;;");
__asm __volatile("itr.d dtr[%0]=%1;;"
:: "r"(0), "r"(*(u_int64_t*)&pte));
__asm __volatile("itr.d dtr[%0]=%1;;" :: "r"(0), "r"(pte));
__asm __volatile("srlz.i;;");
enter_kernel(hdr->e_entry, bi);

View File

@ -387,7 +387,7 @@ print_trs(int type)
struct ia64_pal_result res;
int i, maxtr;
struct {
struct ia64_pte pte;
pt_entry_t pte;
struct ia64_itir itir;
uint64_t ifa;
struct ia64_rr rr;
@ -436,28 +436,24 @@ print_trs(int type)
continue;
if (!(res.pal_result[0] & 1))
buf.pte.pte_ar = 0;
buf.pte &= ~PTE_AR_MASK;
if (!(res.pal_result[0] & 2))
buf.pte.pte_pl = 0;
buf.pte &= ~PTE_PL_MASK;
if (!(res.pal_result[0] & 4))
buf.pte.pte_d = 0;
buf.pte &= ~PTE_DIRTY;
if (!(res.pal_result[0] & 8))
buf.pte.pte_ma = 0;
sprintf(lbuf,
"%03d %06x %013lx %013lx %4s %d %d %d %d %d %-3s %d %06x\n",
i,
buf.rr.rr_rid,
buf.ifa >> 12,
buf.pte.pte_ppn,
psnames[buf.itir.itir_ps],
buf.pte.pte_ed,
buf.pte.pte_ar,
buf.pte.pte_pl,
buf.pte.pte_d,
buf.pte.pte_a,
manames[buf.pte.pte_ma],
buf.pte.pte_p,
buf.itir.itir_key);
buf.pte &= ~PTE_MA_MASK;
sprintf(lbuf, "%03d %06x %013lx %013lx %4s %d %d %d %d %d "
"%-3s %d %06x\n", i, buf.rr.rr_rid, buf.ifa >> 12,
(buf.pte & PTE_PPN_MASK) >> 12, psnames[buf.itir.ps],
(buf.pte & PTE_ED) ? 1 : 0,
(int)(buf.pte & PTE_AR_MASK) >> 9,
(int)(buf.pte & PTE_PL_MASK) >> 7,
(buf.pte & PTE_DIRTY) ? 1 : 0,
(buf.pte & PTE_ACCESSED) ? 1 : 0,
manames[(buf.pte & PTE_MA_MASK) >> 2],
(buf.pte & PTE_PRESENT) ? 1 : 0,
buf.itir.key);
pager_output(lbuf);
}
pager_close();