/trunk/kernel/arch/xen32/include/boot/boot.h |
---|
44,19 → 44,19 |
#include <arch/types.h> |
typedef struct { |
char magic[32]; /**< "xen-<version>-<platform>" */ |
unsigned long nr_pages; /**< Total pages allocated to this domain */ |
void *shared_info; /**< Machine address of shared info struct */ |
int8_t magic[32]; /**< "xen-<version>-<platform>" */ |
uint32_t frames; /**< Available frames */ |
void *shared_info; /**< Shared info structure (machine address) */ |
uint32_t flags; /**< SIF_xxx flags */ |
void *store_mfn; /**< Machine page number of shared page */ |
pfn_t store_mfn; /**< Shared page (machine page) */ |
uint32_t store_evtchn; /**< Event channel for store communication */ |
void *console_mfn; /**< Machine address of console page */ |
void *console_mfn; /**< Console page (machine address) */ |
uint32_t console_evtchn; /**< Event channel for console messages */ |
unsigned long *pt_base; /**< Virtual address of page directory */ |
unsigned long nr_pt_frames; /**< Number of bootstrap p.t. frames */ |
unsigned long *mfn_list; /**< Virtual address of page-frame list */ |
void *mod_start; /**< Virtual address of pre-loaded module */ |
unsigned long mod_len; /**< Size (bytes) of pre-loaded module */ |
pte_t *ptl0; /**< Boot PTL0 (kernel address) */ |
uint32_t pt_frames; /**< Number of bootstrap page table frames */ |
pfn_t *pm_map; /**< Physical->machine frame map (kernel address) */ |
void *mod_start; /**< Modules start (kernel address) */ |
uint32_t mod_len; /**< Modules size (bytes) */ |
int8_t cmd_line[GUEST_CMDLINE]; |
} start_info_t; |
/trunk/kernel/arch/xen32/include/asm.h |
---|
42,8 → 42,6 |
extern uint32_t interrupt_handler_size; |
extern void paging_on(void); |
extern void interrupt_handlers(void); |
extern void enable_l_apic_in_msr(void); |
74,8 → 72,6 |
GEN_READ_REG(cr0); |
GEN_READ_REG(cr2); |
GEN_READ_REG(cr3); |
GEN_WRITE_REG(cr3); |
GEN_READ_REG(dr0); |
GEN_READ_REG(dr1); |
/trunk/kernel/arch/xen32/include/mm/frame.h |
---|
43,7 → 43,10 |
#ifndef __ASM__ |
#include <arch/types.h> |
#include <arch/boot/boot.h> |
#define PA2MA(x) ((start_info.pm_map[((uintptr_t) (x)) >> 12] << 12) + (((uintptr_t) (x)) & 0xfff)) |
extern uintptr_t last_frame; |
extern void frame_arch_init(void); |
/trunk/kernel/arch/xen32/include/mm/page.h |
---|
43,6 → 43,7 |
#ifdef KERNEL |
#ifndef __ASM__ |
# include <arch/hypercall.h> |
# define KA2PA(x) (((uintptr_t) (x)) - 0x80000000) |
# define PA2KA(x) (((uintptr_t) (x)) + 0x80000000) |
#else |
69,11 → 70,26 |
#define GET_PTL3_ADDRESS_ARCH(ptl2, i) (ptl2) |
#define GET_FRAME_ADDRESS_ARCH(ptl3, i) ((uintptr_t)((((pte_t *)(ptl3))[(i)].frame_address)<<12)) |
#define SET_PTL0_ADDRESS_ARCH(ptl0) (write_cr3((uintptr_t) (ptl0))) |
#define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) (((pte_t *)(ptl0))[(i)].frame_address = (a)>>12) |
#define SET_PTL0_ADDRESS_ARCH(ptl0) { \ |
mmuext_op_t mmu_ext; \ |
mmu_ext.cmd = MMUEXT_NEW_BASEPTR; \ |
mmu_ext.arg1.mfn = ADDR2PFN(PA2MA(ptl0)); \ |
xen_mmuext_op(&mmu_ext, 1, NULL, DOMID_SELF); \ |
} |
#define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) { \ |
mmu_update_t update; \ |
update.ptr = PA2MA(KA2PA(&((pte_t *) (ptl0))[(i)])); \ |
update.val = PA2MA(a); \ |
xen_mmu_update(&update, 1, NULL, DOMID_SELF); \ |
} |
#define SET_PTL2_ADDRESS_ARCH(ptl1, i, a) |
#define SET_PTL3_ADDRESS_ARCH(ptl2, i, a) |
#define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) (((pte_t *)(ptl3))[(i)].frame_address = (a)>>12) |
#define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) { \ |
mmu_update_t update; \ |
update.ptr = PA2MA(KA2PA(&((pte_t *) (ptl3))[(i)])); \ |
update.val = PA2MA(a); \ |
xen_mmu_update(&update, 1, NULL, DOMID_SELF); \ |
} |
#define GET_PTL1_FLAGS_ARCH(ptl0, i) get_pt_flags((pte_t *)(ptl0), (index_t)(i)) |
#define GET_PTL2_FLAGS_ARCH(ptl1, i) PAGE_PRESENT |