aboutsummaryrefslogtreecommitdiff
path: root/sys/boot/ia64
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2004-09-23 18:37:36 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2004-09-23 18:37:36 +0000
commitf3a21ad7c63e6c2fb9e63ca7aea2ae7a11019d0f (patch)
tree3a8da576e47f9a945a455cf8d54e51170240ea68 /sys/boot/ia64
parenta9da2faf343af4604cefb2a3d436de112c61fa33 (diff)
downloadsrc-f3a21ad7c63e6c2fb9e63ca7aea2ae7a11019d0f.tar.gz
src-f3a21ad7c63e6c2fb9e63ca7aea2ae7a11019d0f.zip
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.
Notes
Notes: svn path=/head/; revision=135630
Diffstat (limited to 'sys/boot/ia64')
-rw-r--r--sys/boot/ia64/common/exec.c18
-rw-r--r--sys/boot/ia64/efi/main.c36
2 files changed, 21 insertions, 33 deletions
diff --git a/sys/boot/ia64/common/exec.c b/sys/boot/ia64/common/exec.c
index 5f534b25b763..93cfdbde2e3b 100644
--- a/sys/boot/ia64/common/exec.c
+++ b/sys/boot/ia64/common/exec.c
@@ -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);
diff --git a/sys/boot/ia64/efi/main.c b/sys/boot/ia64/efi/main.c
index 30b4f257e04c..64916836dcff 100644
--- a/sys/boot/ia64/efi/main.c
+++ b/sys/boot/ia64/efi/main.c
@@ -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();