# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID 062ab30ba4340c5f26b811be08f516b36bb5f43c
# Parent 2a2aaef05d70a033057deb47aa2cf3f709d754b8
[IA64] cleanup itir_ps(), itir_mask()
code clean up.
itir_ps(), itir_mask()
Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
diff -r 2a2aaef05d70 -r 062ab30ba434 xen/arch/ia64/xen/process.c
--- a/xen/arch/ia64/xen/process.c Fri Feb 24 15:24:58 2006
+++ b/xen/arch/ia64/xen/process.c Fri Feb 24 15:28:36 2006
@@ -94,7 +94,7 @@
extern unsigned long dom0_start, dom0_size;
// FIXME address had better be pre-validated on insert
- mask = (1L << ((itir >> 2) & 0x3f)) - 1;
+ mask = itir_mask(itir);
mpaddr = ((pteval & _PAGE_PPN_MASK) & ~mask) | (address & mask);
if (d == dom0) {
if (mpaddr < dom0_start || mpaddr >= dom0_start + dom0_size) {
diff -r 2a2aaef05d70 -r 062ab30ba434 xen/arch/ia64/xen/vcpu.c
--- a/xen/arch/ia64/xen/vcpu.c Fri Feb 24 15:24:58 2006
+++ b/xen/arch/ia64/xen/vcpu.c Fri Feb 24 15:28:36 2006
@@ -1293,9 +1293,6 @@
return (IA64_ILLOP_FAULT);
}
-#define itir_ps(itir) ((itir >> 2) & 0x3f)
-#define itir_mask(itir) (~((1UL << itir_ps(itir)) - 1))
-
unsigned long vhpt_translate_count = 0;
unsigned long fast_vhpt_translate_count = 0;
unsigned long recover_to_page_fault_count = 0;
@@ -1798,7 +1795,7 @@
IA64FAULT vcpu_itc_d(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
{
- unsigned long pteval, logps = (itir >> 2) & 0x3f;
+ unsigned long pteval, logps = itir_ps(itir);
unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
BOOLEAN swap_rr0 = (!(ifa>>61) && PSCB(vcpu,metaphysical_mode));
@@ -1818,7 +1815,7 @@
IA64FAULT vcpu_itc_i(VCPU *vcpu, UINT64 pte, UINT64 itir, UINT64 ifa)
{
- unsigned long pteval, logps = (itir >> 2) & 0x3f;
+ unsigned long pteval, logps = itir_ps(itir);
unsigned long translate_domain_pte(UINT64,UINT64,UINT64);
BOOLEAN swap_rr0 = (!(ifa>>61) && PSCB(vcpu,metaphysical_mode));
diff -r 2a2aaef05d70 -r 062ab30ba434 xen/include/asm-ia64/vcpu.h
--- a/xen/include/asm-ia64/vcpu.h Fri Feb 24 15:24:58 2006
+++ b/xen/include/asm-ia64/vcpu.h Fri Feb 24 15:28:36 2006
@@ -149,4 +149,16 @@
extern UINT64 vcpu_get_tmp(VCPU *, UINT64);
extern void vcpu_set_tmp(VCPU *, UINT64, UINT64);
+static inline UINT64
+itir_ps(UINT64 itir)
+{
+ return ((itir >> 2) & 0x3f);
+}
+
+static inline UINT64
+itir_mask(UINT64 itir)
+{
+ return (~((1UL << itir_ps(itir)) - 1));
+}
+
#endif
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|