/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2008 Apple Inc. All rights reserved.
*
* @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
#include <i386/cpu_data.h>
#include <i386/machine_routines.h>
#include <i386/cpuid.h>
+#include <i386/vmx.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_kern.h>
#include <libkern/OSAtomic.h>
#include <sys/kdebug.h>
+
#if 0
#undef KERNEL_DEBUG
#define value_64bit(value) ((value) & 0xFFFFFFFF00000000LL)
#define low32(x) ((unsigned int)((x) & 0x00000000FFFFFFFFLL))
+
+
+
void
bzero_phys_nc(
addr64_t src64,
- vm_size_t bytes)
+ uint32_t bytes)
{
bzero_phys(src64,bytes);
}
void
bzero_phys(
addr64_t src64,
- vm_size_t bytes)
+ uint32_t bytes)
{
mapwindow_t *map;
/*
- * Read data from a physical address. Memory should not be cache inhibited.
+ * Read data from a physical address.
*/
return result;
}
-
-
unsigned int ml_phys_read( vm_offset_t paddr)
{
return ml_phys_read_data((pmap_paddr_t)paddr, 4);
/*
- * Write data to a physical address. Memory should not be cache inhibited.
+ * Write data to a physical address.
*/
static void
if ((PAGE_SIZE - (paddr & PAGE_MASK)) < 4)
return FALSE;
- *val = ml_phys_read((pmap_paddr_t)paddr);
+ *val = ml_phys_read(paddr);
return TRUE;
}
istate = ml_set_interrupts_enabled(FALSE);
- offset = pa & (linesize - 1);
+ offset = (uint32_t)(pa & (linesize - 1));
addr = pa - offset;
map = pmap_get_mapwindow((pt_entry_t)(i386_ptob(atop_64(addr)) | INTEL_PTE_VALID));
count += offset;
- offset = addr & ((addr64_t) (page_size - 1));
+ offset = (uint32_t)(addr & ((addr64_t) (page_size - 1)));
chunk = page_size - offset;
do
#define COPYOUTPHYS 4
-
void inval_copy_windows(thread_t thread)
{
int i;
thread->machine.nxt_window = 0;
thread->machine.copyio_state = WINDOWS_DIRTY;
- KERNEL_DEBUG(0xeff70058 | DBG_FUNC_NONE, (int)thread, (int)thread->map, 0, 0, 0);
+ KERNEL_DEBUG(0xeff70058 | DBG_FUNC_NONE, (uintptr_t)thread_tid(thread), (int)thread->map, 0, 0, 0);
}
return (error);
}
user_base = user_addr & ~((user_addr_t)(NBPDE - 1));
- user_offset = user_addr & (NBPDE - 1);
+ user_offset = (vm_offset_t)(user_addr & (NBPDE - 1));
KERNEL_DEBUG(debug_type | DBG_FUNC_NONE, (int)(user_base >> 32), (int)user_base,
(int)user_offset, 0, 0);
kpdp += window_index;
if ((*kpdp & PG_FRAME) != (*updp & PG_FRAME)) {
- panic("copyio: user pdp mismatch - kpdp = 0x%x, updp = 0x%x\n", kpdp, updp);
+ panic("copyio: user pdp mismatch - kpdp = 0x%qx, updp = 0x%qx\n", *kpdp, *updp);
}
(void) ml_set_interrupts_enabled(istate);
}
* flushing the tlb after it reloaded the page table from machine.physwindow_pte
*/
istate = ml_set_interrupts_enabled(FALSE);
+
pmap_store_pte((current_cpu_datap()->cpu_physwindow_ptep), pentry);
(void) ml_set_interrupts_enabled(istate);
int
copyoutmsg(const char *kernel_addr, user_addr_t user_addr, vm_size_t nbytes)
{
- return (copyio(COPYOUT, user_addr, kernel_addr, nbytes, NULL, 0));
+ return (copyio(COPYOUT, user_addr, (char *)(uintptr_t)kernel_addr, nbytes, NULL, 0));
}
int
copyout(const void *kernel_addr, user_addr_t user_addr, vm_size_t nbytes)
{
- return (copyio(COPYOUT, user_addr, kernel_addr, nbytes, NULL, 0));
+ return (copyio(COPYOUT, user_addr, (char *)(uintptr_t)kernel_addr, nbytes, NULL, 0));
}
{
}
#endif
+
+#if !CONFIG_VMX
+int host_vmxon(boolean_t exclusive __unused)
+{
+ return VMX_UNSUPPORTED;
+}
+
+void host_vmxoff(void)
+{
+ return;
+}
+#endif