Implement mmu functions and cpu_mondo_send

fix some more kernel compile fallout
This commit is contained in:
kmacy 2006-11-24 18:50:56 +00:00
parent c41b4d1505
commit 491108697b
6 changed files with 75 additions and 8 deletions

View File

@ -59,6 +59,10 @@ extern uint64_t hv_mach_watchdog(uint64_t timeout, uint64_t *time_remaining);
* Section 11 CPU Services
*/
extern uint64_t hv_cpu_yield(void);
extern uint64_t hv_cpu_state(uint64_t cpuid, uint64_t *state);
extern uint64_t hv_cpu_mondo_send(int ncpu, vm_paddr_t cpulist_ra);
/*
* Section 12 MMU Services
*/
@ -78,11 +82,14 @@ typedef struct hv_tsb_info {
extern uint64_t hv_mmu_tsb_ctx0(uint64_t, uint64_t);
extern uint64_t hv_mmu_tsb_ctxnon0(uint64_t, uint64_t);
extern uint64_t hv_mmu_map_perm_addr(vm_offset_t va, uint64_t, tte_t tte, uint64_t flags);
/*
* Section 13 Cache and Memory Services
*/
extern uint64_t hv_mem_scrub(vm_paddr_t ra, uint64_t length, uint64_t *scrubbed);
/*
* Section 14 Device Interrupt Services
*/

View File

@ -42,8 +42,7 @@
#define CORE_TRAP 0xff
/*
* Error returns in %o0.
* (Additional result is returned in %o1.)
* Status returns in %o0.
*/
#define H_EOK 0 /* Successful return */
#define H_ENOCPU 1 /* Invalid CPU id */
@ -74,7 +73,7 @@
#define HV_SEND_MONDO_ENTRYDONE 0xffff
/*
* Function numbers for API_TRAP.
* Function numbers for CORE_TRAP.
*/
#define API_SET_VERSION 0x00
#define API_PUTCHAR 0x01

View File

@ -53,11 +53,10 @@
*
*/
ENTRY(api_set_version)
mov %o3, %o4
mov API_SET_VERSION, %o5
ta CORE_TRAP
retl
stx %o1, [%o4]
stx %o1, [%o3]
END(api_set_version)
/*
@ -313,6 +312,11 @@ END(hv_cpu_qinfo)
*
*/
ENTRY(hv_cpu_mondo_send)
ldx [PCPU(MONDO_DATA_RA)], %o2
mov HV_INTR_SEND, %o5
ta FAST_TRAP
retl
membar #Sync
END(hv_cpu_mondo_send)
/*
@ -399,6 +403,10 @@ END(hv_mmu_tsb_ctxnon0)
*
*/
ENTRY(hv_mmu_demap_page)
mov MMU_DEMAP_PAGE, %o5
ta FAST_TRAP
retl
nop
END(hv_mmu_demap_page)
/*
@ -413,6 +421,10 @@ END(hv_mmu_demap_page)
*
*/
ENTRY(hv_mmu_demap_ctx)
mov MMU_DEMAP_CTX, %o5
ta FAST_TRAP
retl
nop
END(hv_mmu_demap_ctx)
/*
@ -427,6 +439,10 @@ END(hv_mmu_demap_ctx)
*
*/
ENTRY(hv_mmu_demap_all)
mov MMU_DEMAP_ALL, %o5
ta FAST_TRAP
retl
nop
END(hv_mmu_demap_all)
/*
@ -441,6 +457,10 @@ END(hv_mmu_demap_all)
*
*/
ENTRY(hv_mmu_map_addr)
mov MMU_MAP_ADDR, %o5
ta FAST_TRAP
retl
nop
END(hv_mmu_map_addr)
/*
@ -455,6 +475,10 @@ END(hv_mmu_map_addr)
*
*/
ENTRY(hv_mmu_map_perm_addr)
mov MMU_MAP_PERM_ADDR, %o5
ta FAST_TRAP
retl
nop
END(hv_mmu_map_perm_addr)
/*
@ -468,6 +492,10 @@ END(hv_mmu_map_perm_addr)
*
*/
ENTRY(hv_mmu_unmap_addr)
mov MMU_UNMAP_ADDR, %o5
ta FAST_TRAP
retl
nop
END(hv_mmu_unmap_addr)
/*
@ -481,6 +509,10 @@ END(hv_mmu_unmap_addr)
*
*/
ENTRY(hv_mmu_unmap_perm_addr)
mov MMU_UNMAP_PERM_ADDR, %o5
ta FAST_TRAP
retl
nop
END(hv_mmu_unmap_perm_addr)
/*
@ -489,10 +521,15 @@ END(hv_mmu_unmap_perm_addr)
* arg0 raddr (%o0)
*
* ret0 status (%o0)
* ret1 prev_raddr (%o0)
* ret1 prev_raddr (%o1)
*
*/
ENTRY(hv_mmu_fault_area_conf)
mov %o1, %o2
mov MMU_FAULT_AREA_CONF, %o5
ta FAST_TRAP
retl
stx %o1, [%o2]
END(hv_mmu_fault_area_conf)
/*
@ -505,6 +542,10 @@ END(hv_mmu_fault_area_conf)
*
*/
ENTRY(hv_mmu_enable)
mov MMU_ENABLE, %o5
ta FAST_TRAP
retl
nop
END(hv_mmu_enable)
/*
@ -518,6 +559,11 @@ END(hv_mmu_enable)
*
*/
ENTRY(hv_mmu_tsb_ctx0_info)
mov %o1, %o2
mov MMU_TSB_CTX0_INFO, %o5
ta FAST_TRAP
retl
stx %o1, [%o2]
END(hv_mmu_tsb_ctx0_info)
/*
@ -531,6 +577,11 @@ END(hv_mmu_tsb_ctx0_info)
*
*/
ENTRY(hv_mmu_tsb_ctxnon0_info)
mov %o1, %o2
mov MMU_TSB_CTXNON0_INFO, %o5
ta FAST_TRAP
retl
stx %o1, [%o2]
END(hv_mmu_tsb_ctxnon0_info)
/*
@ -541,6 +592,12 @@ END(hv_mmu_tsb_ctxnon0_info)
*
*/
ENTRY(hv_mmu_fault_area_info)
mov %o0, %o2
mov MMU_FAULT_AREA_INFO, %o5
ta FAST_TRAP
retl
stx %o1, [%o2]
END(hv_mmu_fault_area_info)
/*

View File

@ -120,6 +120,10 @@
#include <machine/pmap.h>
#include <machine/resource.h>
#include <machine/hypervisorvar.h>
#include <machine/hv_api.h>
#include <sys/rman.h>
/*

View File

@ -472,7 +472,7 @@ pmap_bootstrap(vm_offset_t ekva)
translations[i].om_start <= KERNBASE + 3*PAGE_SIZE_4M)) {
KDPRINTF("mapping permanent translation\n");
pa = TTE_GET_PA(translations[i].om_tte);
error = hv_mmu_map_perm_addr((char *)translations[i].om_start,
error = hv_mmu_map_perm_addr(translations[i].om_start,
KCONTEXT, pa | TTE_KERNEL | VTD_4M, MAP_ITLB | MAP_DTLB);
if (error != H_EOK)
panic("map_perm_addr returned error=%ld", error);

View File

@ -90,7 +90,7 @@
#include <machine/wstate.h>
#include <machine/md_var.h>
#include <machine/hv_api.h>
#include <machine/hypervisorvar.h>
#include <security/audit/audit.h>