From 7c31469f67a36ca1d9d036e4dcd3c739513a8436 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Sat, 4 Aug 2007 19:36:14 +0000 Subject: [PATCH] Replace "__asm __volatile()" by equivalent support functions from ia64_cpu.h. This improves readability and consistency and aids in auditing the code. Add data-serialization after writing to the region registers and add instruction-serialization after writing to cr.pta. Approved by: re (blanket) --- sys/ia64/ia64/pmap.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index 6dc87a1fb206..7a50848177ae 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -450,8 +450,9 @@ pmap_bootstrap() } map_vhpt(pmap_vhpt_base[0]); - __asm __volatile("mov cr.pta=%0;; srlz.i;;" :: - "r" (pmap_vhpt_base[0] + (1<<8) + (pmap_vhpt_log2size<<2) + 1)); + ia64_set_pta(pmap_vhpt_base[0] + (1 << 8) + + (pmap_vhpt_log2size << 2) + 1); + ia64_srlz_i(); virtual_avail = VM_MIN_KERNEL_ADDRESS; virtual_end = VM_MAX_KERNEL_ADDRESS; @@ -480,6 +481,7 @@ pmap_bootstrap() */ ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (IA64_ID_PAGE_SHIFT << 2)); ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (IA64_ID_PAGE_SHIFT << 2)); + ia64_srlz_d(); /* * Clear out any random TLB entries left over from booting. @@ -2254,7 +2256,7 @@ pmap_switch(pmap_t pm) atomic_set_32(&pm->pm_active, PCPU_GET(cpumask)); } PCPU_SET(current_pmap, pm); - __asm __volatile("srlz.d"); + ia64_srlz_d(); out: critical_exit();