summaryrefslogtreecommitdiff
path: root/usr/src/uts/i86pc/io/vmm/vmm.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/i86pc/io/vmm/vmm.c')
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/usr/src/uts/i86pc/io/vmm/vmm.c b/usr/src/uts/i86pc/io/vmm/vmm.c
index 47a5f26cb7..2238536121 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm.c
@@ -1008,7 +1008,7 @@ vmm_sysmem_maxaddr(struct vm *vm)
}
static void
-vm_iommu_modify(struct vm *vm, boolean_t map)
+vm_iommu_modify(struct vm *vm, bool map)
{
int i, sz;
vm_paddr_t gpa, hpa;
@@ -1083,8 +1083,8 @@ vm_iommu_modify(struct vm *vm, boolean_t map)
#endif
}
-#define vm_iommu_unmap(vm) vm_iommu_modify((vm), FALSE)
-#define vm_iommu_map(vm) vm_iommu_modify((vm), TRUE)
+#define vm_iommu_unmap(vm) vm_iommu_modify((vm), false)
+#define vm_iommu_map(vm) vm_iommu_modify((vm), true)
#ifdef __FreeBSD__
int
@@ -1193,9 +1193,7 @@ vm_gpa_release(void *cookie)
{
vm_page_t m = cookie;
- vm_page_lock(m);
- vm_page_unhold(m);
- vm_page_unlock(m);
+ vm_page_unwire(m, PQ_ACTIVE);
}
int
@@ -1234,20 +1232,20 @@ vm_set_register(struct vm *vm, int vcpuid, int reg, uint64_t val)
return (0);
}
-static boolean_t
+static bool
is_descriptor_table(int reg)
{
switch (reg) {
case VM_REG_GUEST_IDTR:
case VM_REG_GUEST_GDTR:
- return (TRUE);
+ return (true);
default:
- return (FALSE);
+ return (false);
}
}
-static boolean_t
+static bool
is_segment_register(int reg)
{
@@ -1260,9 +1258,9 @@ is_segment_register(int reg)
case VM_REG_GUEST_GS:
case VM_REG_GUEST_TR:
case VM_REG_GUEST_LDTR:
- return (TRUE);
+ return (true);
default:
- return (FALSE);
+ return (false);
}
}
@@ -2622,12 +2620,12 @@ vm_hpet(struct vm *vm)
}
#ifdef __FreeBSD__
-boolean_t
+bool
vmm_is_pptdev(int bus, int slot, int func)
{
- int found, i, n;
- int b, s, f;
+ int b, f, i, n, s;
char *val, *cp, *cp2;
+ bool found;
/*
* XXX
@@ -2641,7 +2639,7 @@ vmm_is_pptdev(int bus, int slot, int func)
const char *names[] = { "pptdevs", "pptdevs2", "pptdevs3", NULL };
/* set pptdevs="1/2/3 4/5/6 7/8/9 10/11/12" */
- found = 0;
+ found = false;
for (i = 0; names[i] != NULL && !found; i++) {
cp = val = kern_getenv(names[i]);
while (cp != NULL && *cp != '\0') {
@@ -2650,7 +2648,7 @@ vmm_is_pptdev(int bus, int slot, int func)
n = sscanf(cp, "%d/%d/%d", &b, &s, &f);
if (n == 3 && bus == b && slot == s && func == f) {
- found = 1;
+ found = true;
break;
}