From: Jack Lange Date: Thu, 16 Oct 2008 23:49:42 +0000 (-0500) Subject: more namespace changes X-Git-Tag: 1.0^2~44 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=7cdedeb7a01b51c5242cce94924f2ea246008e7d more namespace changes adding "v3_" prefixes moving function prototypes into the __V3VEE__ macros --- diff --git a/palacios/include/palacios/vmm_ctrl_regs.h b/palacios/include/palacios/vmm_ctrl_regs.h index c6eb1fe..1633217 100644 --- a/palacios/include/palacios/vmm_ctrl_regs.h +++ b/palacios/include/palacios/vmm_ctrl_regs.h @@ -200,11 +200,11 @@ static const uchar_t mov_from_cr_byte = 0x20; */ -int handle_cr0_write(struct guest_info * info); -int handle_cr0_read(struct guest_info * info); +int v3_handle_cr0_write(struct guest_info * info); +int v3_handle_cr0_read(struct guest_info * info); -int handle_cr3_write(struct guest_info * info); -int handle_cr3_read(struct guest_info * info); +int v3_handle_cr3_write(struct guest_info * info); +int v3_handle_cr3_read(struct guest_info * info); #endif // ! __V3VEE__ diff --git a/palacios/include/palacios/vmm_decoder.h b/palacios/include/palacios/vmm_decoder.h index ec52d09..6b8715e 100644 --- a/palacios/include/palacios/vmm_decoder.h +++ b/palacios/include/palacios/vmm_decoder.h @@ -27,12 +27,12 @@ #include -typedef enum {INVALID_OPERAND, REG_OPERAND, MEM_OPERAND, IMM_OPERAND} operand_type_t; +typedef enum {INVALID_OPERAND, REG_OPERAND, MEM_OPERAND, IMM_OPERAND} v3_operand_type_t; struct x86_operand { addr_t operand; uint_t size; - operand_type_t type; + v3_operand_type_t type; }; struct x86_prefixes { @@ -87,7 +87,7 @@ struct basic_instr_info { /* * Initializes a decoder */ -int init_decoder(); +int v3_init_decoder(); /* * Decodes an instruction @@ -118,7 +118,7 @@ int v3_basic_mem_decode(struct guest_info * info, addr_t instr_ptr, struct basic /* Removes a rep prefix in place */ -void strip_rep_prefix(uchar_t * instr, int length); +void v3_strip_rep_prefix(uchar_t * instr, int length); @@ -208,7 +208,7 @@ MAKE_INSTR(SMSW, 3, 0x0f, 0x01, 0x00); #define PREFIX_OP_SIZE 0x66 #define PREFIX_ADDR_SIZE 0x67 -int opcode_cmp(const uchar_t * op1, const uchar_t * op2); +int v3_opcode_cmp(const uchar_t * op1, const uchar_t * op2); static inline int is_prefix_byte(uchar_t byte) { @@ -331,7 +331,7 @@ static inline addr_t decode_register(struct v3_gprs * gprs, char reg_code, reg_s -static inline operand_type_t decode_operands16(struct v3_gprs * gprs, // input/output +static inline v3_operand_type_t decode_operands16(struct v3_gprs * gprs, // input/output char * modrm_instr, // input int * offset, // output addr_t * first_operand, // output @@ -341,7 +341,7 @@ static inline operand_type_t decode_operands16(struct v3_gprs * gprs, // input/o struct modrm_byte * modrm = (struct modrm_byte *)modrm_instr; addr_t base_addr = 0; modrm_mode_t mod_mode = 0; - operand_type_t addr_type = INVALID_OPERAND; + v3_operand_type_t addr_type = INVALID_OPERAND; char * instr_cursor = modrm_instr; // PrintDebug("ModRM mod=%d\n", modrm->mod); @@ -420,7 +420,7 @@ static inline operand_type_t decode_operands16(struct v3_gprs * gprs, // input/o -static inline operand_type_t decode_operands32(struct v3_gprs * gprs, // input/output +static inline v3_operand_type_t decode_operands32(struct v3_gprs * gprs, // input/output uchar_t * modrm_instr, // input int * offset, // output addr_t * first_operand, // output @@ -432,7 +432,7 @@ static inline operand_type_t decode_operands32(struct v3_gprs * gprs, // input/o addr_t base_addr = 0; modrm_mode_t mod_mode = 0; uint_t has_sib_byte = 0; - operand_type_t addr_type = INVALID_OPERAND; + v3_operand_type_t addr_type = INVALID_OPERAND; diff --git a/palacios/include/palacios/vmm_emulator.h b/palacios/include/palacios/vmm_emulator.h index e396474..45cfa44 100644 --- a/palacios/include/palacios/vmm_emulator.h +++ b/palacios/include/palacios/vmm_emulator.h @@ -73,7 +73,7 @@ struct emulation_state { }; -int init_emulator(struct guest_info * info); +int v3_init_emulator(struct guest_info * info); int v3_emulation_exit_handler(struct guest_info * info); diff --git a/palacios/include/palacios/vmm_intr.h b/palacios/include/palacios/vmm_intr.h index d4543fd..fd83edb 100644 --- a/palacios/include/palacios/vmm_intr.h +++ b/palacios/include/palacios/vmm_intr.h @@ -84,16 +84,13 @@ struct v3_intr_state { -void init_interrupt_state(struct guest_info * info); +void v3_init_interrupt_state(struct guest_info * info); int v3_raise_irq(struct guest_info * info, int irq); - -/*Zheng 07/30/2008*/ int v3_lower_irq(struct guest_info * info, int irq); -/*Zheng 07/30/2008*/ struct intr_ctrl_ops { int (*intr_pending)(void * private_data); @@ -106,16 +103,16 @@ struct intr_ctrl_ops { -void set_intr_controller(struct guest_info * info, struct intr_ctrl_ops * ops, void * state); +void v3_set_intr_controller(struct guest_info * info, struct intr_ctrl_ops * ops, void * state); int v3_raise_exception(struct guest_info * info, uint_t excp); int v3_raise_exception_with_error(struct guest_info * info, uint_t excp, uint_t error_code); -int intr_pending(struct guest_info * info); -uint_t get_intr_number(struct guest_info * info); -intr_type_t get_intr_type(struct guest_info * info); +int v3_intr_pending(struct guest_info * info); +uint_t v3_get_intr_number(struct guest_info * info); +intr_type_t v3_get_intr_type(struct guest_info * info); -int injecting_intr(struct guest_info * info, uint_t intr_num, intr_type_t type); +int v3_injecting_intr(struct guest_info * info, uint_t intr_num, intr_type_t type); /* int start_irq(struct vm_intr * intr); diff --git a/palacios/include/palacios/vmm_io.h b/palacios/include/palacios/vmm_io.h index 242554b..9bfc197 100644 --- a/palacios/include/palacios/vmm_io.h +++ b/palacios/include/palacios/vmm_io.h @@ -52,7 +52,7 @@ struct vmm_io_map { }; -void init_vmm_io_map(struct guest_info * info); +void v3_init_vmm_io_map(struct guest_info * info); // FOREACH_IO_HOOK(vmm_io_map_t * io_map, vmm_io_hook_t * io_hook) #define FOREACH_IO_HOOK(io_map, io_hook) for (io_hook = (io_map).head; io_hook != NULL; io_hook = (io_hook)->next) @@ -78,7 +78,7 @@ struct vmm_io_hook { struct vmm_io_hook * v3_get_io_hook(struct vmm_io_map * io_map, uint_t port); -void PrintDebugIOMap(struct vmm_io_map * io_map); +void v3_print_io_map(struct vmm_io_map * io_map); diff --git a/palacios/include/palacios/vmm_shadow_paging.h b/palacios/include/palacios/vmm_shadow_paging.h index f7424e8..07c15f5 100644 --- a/palacios/include/palacios/vmm_shadow_paging.h +++ b/palacios/include/palacios/vmm_shadow_paging.h @@ -57,14 +57,14 @@ struct guest_info; -int cache_page_tables32(struct guest_info * info, addr_t pde); +int v3_cache_page_tables32(struct guest_info * info, addr_t pde); -int init_shadow_page_state(struct guest_info * info); +int v3_init_shadow_page_state(struct guest_info * info); -addr_t create_new_shadow_pt32(); +addr_t v3_create_new_shadow_pt32(); -int handle_shadow_pagefault(struct guest_info * info, addr_t fault_addr, pf_error_t error_code); -int handle_shadow_invlpg(struct guest_info * info); +int v3_handle_shadow_pagefault(struct guest_info * info, addr_t fault_addr, pf_error_t error_code); +int v3_handle_shadow_invlpg(struct guest_info * info); diff --git a/palacios/include/palacios/vmm_time.h b/palacios/include/palacios/vmm_time.h index 11e4eb9..5e9a1f3 100644 --- a/palacios/include/palacios/vmm_time.h +++ b/palacios/include/palacios/vmm_time.h @@ -68,11 +68,9 @@ int v3_remove_timer(struct guest_info * info, struct vm_timer * timer); void v3_update_time(struct guest_info * info, ullong_t cycles); -#endif // !__V3VEE__ - void v3_init_time(struct guest_info * info); - +#endif // !__V3VEE__ #endif diff --git a/palacios/src/devices/8259a.c b/palacios/src/devices/8259a.c index c976d21..f13dc1d 100644 --- a/palacios/src/devices/8259a.c +++ b/palacios/src/devices/8259a.c @@ -632,7 +632,7 @@ static int write_slave_port2(ushort_t port, void * src, uint_t length, struct vm static int pic_init(struct vm_device * dev) { struct pic_internal * state = (struct pic_internal*)dev->private_data; - set_intr_controller(dev->vm, &intr_ops, state); + v3_set_intr_controller(dev->vm, &intr_ops, state); state->master_irr = 0; state->master_isr = 0; diff --git a/palacios/src/devices/simple_pic.c b/palacios/src/devices/simple_pic.c index b8d3fb2..7003111 100644 --- a/palacios/src/devices/simple_pic.c +++ b/palacios/src/devices/simple_pic.c @@ -62,7 +62,7 @@ static struct intr_ctrl_ops intr_ops = { static int pic_init_device(struct vm_device * dev) { struct pic_internal * data = (struct pic_internal *)dev->private_data; - set_intr_controller(dev->vm, &intr_ops, data); + v3_set_intr_controller(dev->vm, &intr_ops, data); data->pending_irq = 0; return 0; diff --git a/palacios/src/palacios/svm_handler.c b/palacios/src/palacios/svm_handler.c index 89f0ceb..cc9a8ab 100644 --- a/palacios/src/palacios/svm_handler.c +++ b/palacios/src/palacios/svm_handler.c @@ -150,7 +150,7 @@ int v3_handle_svm_exit(struct guest_info * info) { #ifdef DEBUG_CTRL_REGS PrintDebug("CR0 Write\n"); #endif - if (handle_cr0_write(info) == -1) { + if (v3_handle_cr0_write(info) == -1) { return -1; } } @@ -160,7 +160,7 @@ int v3_handle_svm_exit(struct guest_info * info) { #ifdef DEBUG_CTRL_REGS PrintDebug("CR0 Read\n"); #endif - if (handle_cr0_read(info) == -1) { + if (v3_handle_cr0_read(info) == -1) { return -1; } } @@ -170,7 +170,7 @@ int v3_handle_svm_exit(struct guest_info * info) { #ifdef DEBUG_CTRL_REGS PrintDebug("CR3 Write\n"); #endif - if (handle_cr3_write(info) == -1) { + if (v3_handle_cr3_write(info) == -1) { return -1; } } @@ -180,7 +180,7 @@ int v3_handle_svm_exit(struct guest_info * info) { #ifdef DEBUG_CTRL_REGS PrintDebug("CR3 Read\n"); #endif - if (handle_cr3_read(info) == -1) { + if (v3_handle_cr3_read(info) == -1) { return -1; } } @@ -193,7 +193,7 @@ int v3_handle_svm_exit(struct guest_info * info) { PrintDebug("PageFault at %x (error=%d)\n", fault_addr, *error_code); #endif if (info->shdw_pg_mode == SHADOW_PAGING) { - if (handle_shadow_pagefault(info, fault_addr, *error_code) == -1) { + if (v3_handle_shadow_pagefault(info, fault_addr, *error_code) == -1) { return -1; } } else { @@ -215,7 +215,7 @@ int v3_handle_svm_exit(struct guest_info * info) { #ifdef DEBUG_SHADOW_PAGING PrintDebug("Invlpg\n"); #endif - if (handle_shadow_invlpg(info) == -1) { + if (v3_handle_shadow_invlpg(info) == -1) { return -1; } } @@ -394,12 +394,12 @@ int v3_handle_svm_exit(struct guest_info * info) { // Update the low level state - if (intr_pending(info)) { + if (v3_intr_pending(info)) { - switch (get_intr_type(info)) { + switch (v3_get_intr_type(info)) { case EXTERNAL_IRQ: { - uint_t irq = get_intr_number(info); + uint_t irq = v3_get_intr_number(info); // check to see if ==-1 (non exists) @@ -416,7 +416,7 @@ int v3_handle_svm_exit(struct guest_info * info) { #ifdef DEBUG_INTERRUPTS PrintDebug("Injecting Interrupt %d (EIP=%x)\n", guest_ctrl->guest_ctrl.V_INTR_VECTOR, info->rip); #endif - injecting_intr(info, irq, EXTERNAL_IRQ); + v3_injecting_intr(info, irq, EXTERNAL_IRQ); break; } @@ -425,7 +425,7 @@ int v3_handle_svm_exit(struct guest_info * info) { break; case EXCEPTION: { - uint_t excp = get_intr_number(info); + uint_t excp = v3_get_intr_number(info); guest_ctrl->EVENTINJ.type = SVM_INJECTION_EXCEPTION; @@ -443,7 +443,7 @@ int v3_handle_svm_exit(struct guest_info * info) { #ifdef DEBUG_INTERRUPTS PrintDebug("Injecting Interrupt %d (EIP=%x)\n", guest_ctrl->EVENTINJ.vector, info->rip); #endif - injecting_intr(info, excp, EXCEPTION); + v3_injecting_intr(info, excp, EXCEPTION); break; } case SOFTWARE_INTR: diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index d6dfb91..4502a80 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -43,7 +43,7 @@ void Init_V3(struct v3_os_hooks * hooks, struct v3_ctrl_ops * vmm_ops) { v3_cpu_type = V3_INVALID_CPU; - init_decoder(); + v3_init_decoder(); if (v3_is_svm_capable()) { diff --git a/palacios/src/palacios/vmm_config.c b/palacios/src/palacios/vmm_config.c index 6264a2e..b80c0eb 100644 --- a/palacios/src/palacios/vmm_config.c +++ b/palacios/src/palacios/vmm_config.c @@ -94,7 +94,7 @@ int v3_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) if (v3_cpu_type == V3_SVM_REV3_CPU) { info->shdw_pg_mode = NESTED_PAGING; } else { - init_shadow_page_state(info); + v3_init_shadow_page_state(info); info->shdw_pg_mode = SHADOW_PAGING; } @@ -102,12 +102,12 @@ int v3_config_guest(struct guest_info * info, struct v3_vm_config * config_ptr) info->mem_mode = PHYSICAL_MEM; - init_vmm_io_map(info); - init_interrupt_state(info); + v3_init_vmm_io_map(info); + v3_init_interrupt_state(info); v3_init_dev_mgr(info); - init_emulator(info); + v3_init_emulator(info); v3_init_host_events(info); diff --git a/palacios/src/palacios/vmm_ctrl_regs.c b/palacios/src/palacios/vmm_ctrl_regs.c index 15ca631..01c66a7 100644 --- a/palacios/src/palacios/vmm_ctrl_regs.c +++ b/palacios/src/palacios/vmm_ctrl_regs.c @@ -41,7 +41,7 @@ // First Attempt = 494 lines // current = 106 lines -int handle_cr0_write(struct guest_info * info) { +int v3_handle_cr0_write(struct guest_info * info) { uchar_t instr[15]; int ret; struct x86_instr dec_instr; @@ -66,7 +66,7 @@ int handle_cr0_write(struct guest_info * info) { } - if (opcode_cmp(V3_OPCODE_LMSW, (const uchar_t *)(dec_instr.opcode)) == 0) { + if (v3_opcode_cmp(V3_OPCODE_LMSW, (const uchar_t *)(dec_instr.opcode)) == 0) { struct cr0_real *real_cr0 = (struct cr0_real*)&(info->ctrl_regs.cr0); struct cr0_real *new_cr0 = (struct cr0_real *)(dec_instr.src_operand.operand); uchar_t new_cr0_val; @@ -91,7 +91,7 @@ int handle_cr0_write(struct guest_info * info) { *(uchar_t*)shadow_cr0 |= new_cr0_val; PrintDebug("New Shadow CR0=%x\n", *shadow_cr0); } - } else if (opcode_cmp(V3_OPCODE_MOV2CR, (const uchar_t *)(dec_instr.opcode)) == 0) { + } else if (v3_opcode_cmp(V3_OPCODE_MOV2CR, (const uchar_t *)(dec_instr.opcode)) == 0) { PrintDebug("MOV2CR0\n"); if (info->cpu_mode == LONG) { @@ -132,7 +132,7 @@ int handle_cr0_write(struct guest_info * info) { PrintDebug("New CR0=%x\n", *real_cr0); } - } else if (opcode_cmp(V3_OPCODE_CLTS, (const uchar_t *)(dec_instr.opcode)) == 0) { + } else if (v3_opcode_cmp(V3_OPCODE_CLTS, (const uchar_t *)(dec_instr.opcode)) == 0) { // CLTS struct cr0_32 *real_cr0 = (struct cr0_32*)&(info->ctrl_regs.cr0); @@ -155,7 +155,7 @@ int handle_cr0_write(struct guest_info * info) { // First attempt = 253 lines // current = 51 lines -int handle_cr0_read(struct guest_info * info) { +int v3_handle_cr0_read(struct guest_info * info) { uchar_t instr[15]; int ret; struct x86_instr dec_instr; @@ -179,7 +179,7 @@ int handle_cr0_read(struct guest_info * info) { return -1; } - if (opcode_cmp(V3_OPCODE_MOVCR2, (const uchar_t *)(dec_instr.opcode)) == 0) { + if (v3_opcode_cmp(V3_OPCODE_MOVCR2, (const uchar_t *)(dec_instr.opcode)) == 0) { struct cr0_32 * virt_cr0 = (struct cr0_32 *)(dec_instr.dst_operand.operand); struct cr0_32 * real_cr0 = (struct cr0_32 *)&(info->ctrl_regs.cr0); @@ -194,7 +194,7 @@ int handle_cr0_read(struct guest_info * info) { PrintDebug("real CR0: %x\n", *(uint_t*)real_cr0); PrintDebug("returned CR0: %x\n", *(uint_t*)virt_cr0); - } else if (opcode_cmp(V3_OPCODE_SMSW, (const uchar_t *)(dec_instr.opcode)) == 0) { + } else if (v3_opcode_cmp(V3_OPCODE_SMSW, (const uchar_t *)(dec_instr.opcode)) == 0) { struct cr0_real *real_cr0= (struct cr0_real*)&(info->ctrl_regs.cr0); struct cr0_real *virt_cr0 = (struct cr0_real *)(dec_instr.dst_operand.operand); char cr0_val = *(char*)real_cr0 & 0x0f; @@ -220,7 +220,7 @@ int handle_cr0_read(struct guest_info * info) { // First Attempt = 256 lines // current = 65 lines -int handle_cr3_write(struct guest_info * info) { +int v3_handle_cr3_write(struct guest_info * info) { int ret; uchar_t instr[15]; struct x86_instr dec_instr; @@ -244,7 +244,7 @@ int handle_cr3_write(struct guest_info * info) { return -1; } - if (opcode_cmp(V3_OPCODE_MOV2CR, (const uchar_t *)(dec_instr.opcode)) == 0) { + if (v3_opcode_cmp(V3_OPCODE_MOV2CR, (const uchar_t *)(dec_instr.opcode)) == 0) { PrintDebug("MOV2CR3\n"); @@ -261,7 +261,7 @@ int handle_cr3_write(struct guest_info * info) { *(uint_t*)shadow_cr3, *(uint_t*)guest_cr3); - cached = cache_page_tables32(info, CR3_TO_PDE32(*(addr_t *)new_cr3)); + cached = v3_cache_page_tables32(info, CR3_TO_PDE32(*(addr_t *)new_cr3)); if (cached == -1) { PrintError("CR3 Cache failed\n"); @@ -273,7 +273,7 @@ int handle_cr3_write(struct guest_info * info) { delete_page_tables_pde32((pde32_t *)CR3_TO_PDE32(*(uint_t*)shadow_cr3)); - shadow_pt = create_new_shadow_pt32(); + shadow_pt = v3_create_new_shadow_pt32(); shadow_cr3->pdt_base_addr = PD32_BASE_ADDR(shadow_pt); } else { @@ -308,7 +308,7 @@ int handle_cr3_write(struct guest_info * info) { // first attempt = 156 lines // current = 36 lines -int handle_cr3_read(struct guest_info * info) { +int v3_handle_cr3_read(struct guest_info * info) { uchar_t instr[15]; int ret; struct x86_instr dec_instr; @@ -332,7 +332,7 @@ int handle_cr3_read(struct guest_info * info) { return -1; } - if (opcode_cmp(V3_OPCODE_MOVCR2, (const uchar_t *)(dec_instr.opcode)) == 0) { + if (v3_opcode_cmp(V3_OPCODE_MOVCR2, (const uchar_t *)(dec_instr.opcode)) == 0) { PrintDebug("MOVCR32\n"); struct cr3_32 * virt_cr3 = (struct cr3_32 *)(dec_instr.dst_operand.operand); diff --git a/palacios/src/palacios/vmm_decoder.c b/palacios/src/palacios/vmm_decoder.c index 8aca0e6..593b038 100644 --- a/palacios/src/palacios/vmm_decoder.c +++ b/palacios/src/palacios/vmm_decoder.c @@ -21,7 +21,7 @@ #include -int opcode_cmp(const uchar_t * op1, const uchar_t * op2) { +int v3_opcode_cmp(const uchar_t * op1, const uchar_t * op2) { if (op1[0] != op2[0]) { return op1[0] - op2[0];; } else { @@ -30,7 +30,7 @@ int opcode_cmp(const uchar_t * op1, const uchar_t * op2) { } -void strip_rep_prefix(uchar_t * instr, int length) { +void v3_strip_rep_prefix(uchar_t * instr, int length) { int read_ctr = 0; int write_ctr = 0; int found = 0; diff --git a/palacios/src/palacios/vmm_emulator.c b/palacios/src/palacios/vmm_emulator.c index 37fa3f9..b539490 100644 --- a/palacios/src/palacios/vmm_emulator.c +++ b/palacios/src/palacios/vmm_emulator.c @@ -33,7 +33,7 @@ static const char VMMCALL[3] = {0x0f, 0x01, 0xd9}; #endif -int init_emulator(struct guest_info * info) { +int v3_init_emulator(struct guest_info * info) { struct emulation_state * emulator = &(info->emulator); emulator->num_emulated_pages = 0; diff --git a/palacios/src/palacios/vmm_intr.c b/palacios/src/palacios/vmm_intr.c index 84a645b..a7f7924 100644 --- a/palacios/src/palacios/vmm_intr.c +++ b/palacios/src/palacios/vmm_intr.c @@ -31,7 +31,7 @@ -void init_interrupt_state(struct guest_info * info) { +void v3_init_interrupt_state(struct guest_info * info) { info->intr_state.excp_pending = 0; info->intr_state.excp_num = 0; info->intr_state.excp_error_code = 0; @@ -42,7 +42,7 @@ void init_interrupt_state(struct guest_info * info) { info->vm_ops.lower_irq = &v3_lower_irq; } -void set_intr_controller(struct guest_info * info, struct intr_ctrl_ops * ops, void * state) { +void v3_set_intr_controller(struct guest_info * info, struct intr_ctrl_ops * ops, void * state) { info->intr_state.controller = ops; info->intr_state.controller_state = state; } @@ -211,7 +211,7 @@ int v3_raise_irq(struct guest_info * info, int irq) { -int intr_pending(struct guest_info * info) { +int v3_intr_pending(struct guest_info * info) { struct v3_intr_state * intr_state = &(info->intr_state); // PrintDebug("[intr_pending]\n"); @@ -227,7 +227,7 @@ int intr_pending(struct guest_info * info) { } -uint_t get_intr_number(struct guest_info * info) { +uint_t v3_get_intr_number(struct guest_info * info) { struct v3_intr_state * intr_state = &(info->intr_state); if (intr_state->excp_pending == 1) { @@ -243,7 +243,7 @@ uint_t get_intr_number(struct guest_info * info) { } -intr_type_t get_intr_type(struct guest_info * info) { +intr_type_t v3_get_intr_type(struct guest_info * info) { struct v3_intr_state * intr_state = &(info->intr_state); if (intr_state->excp_pending) { @@ -262,7 +262,7 @@ intr_type_t get_intr_type(struct guest_info * info) { -int injecting_intr(struct guest_info * info, uint_t intr_num, intr_type_t type) { +int v3_injecting_intr(struct guest_info * info, uint_t intr_num, intr_type_t type) { struct v3_intr_state * intr_state = &(info->intr_state); if (type == EXCEPTION) { diff --git a/palacios/src/palacios/vmm_io.c b/palacios/src/palacios/vmm_io.c index b056441..d334c73 100644 --- a/palacios/src/palacios/vmm_io.c +++ b/palacios/src/palacios/vmm_io.c @@ -34,7 +34,7 @@ static int default_write(ushort_t port, void *src, uint_t length, void * priv_da static int default_read(ushort_t port, void * dst, uint_t length, void * priv_data); -void init_vmm_io_map(struct guest_info * info) { +void v3_init_vmm_io_map(struct guest_info * info) { struct vmm_io_map * io_map = &(info->io_map); io_map->num_ports = 0; io_map->head = NULL; @@ -170,7 +170,7 @@ struct vmm_io_hook * v3_get_io_hook(struct vmm_io_map * io_map, uint_t port) { -void PrintDebugIOMap(struct vmm_io_map * io_map) { +void v3_print_io_map(struct vmm_io_map * io_map) { struct vmm_io_hook * iter = io_map->head; PrintDebug("VMM IO Map (Entries=%d)\n", io_map->num_ports); diff --git a/palacios/src/palacios/vmm_shadow_paging.c b/palacios/src/palacios/vmm_shadow_paging.c index 54347e3..cca1e0f 100644 --- a/palacios/src/palacios/vmm_shadow_paging.c +++ b/palacios/src/palacios/vmm_shadow_paging.c @@ -76,7 +76,7 @@ static int handle_shadow_pte32_fault(struct guest_info* info, static int handle_shadow_pagefault32(struct guest_info * info, addr_t fault_addr, pf_error_t error_code); -int init_shadow_page_state(struct guest_info * info) { +int v3_init_shadow_page_state(struct guest_info * info) { struct shadow_page_state * state = &(info->shdw_pg_state); state->guest_mode = PDE32; state->shadow_mode = PDE32; @@ -146,7 +146,7 @@ int cache_page_tables32(struct guest_info * info, addr_t pde) { } */ -int cache_page_tables32(struct guest_info * info, addr_t pde) { +int v3_cache_page_tables32(struct guest_info * info, addr_t pde) { struct shadow_page_state * state = &(info->shdw_pg_state); addr_t pde_host_addr; pde32_t * tmp_pde; @@ -223,7 +223,7 @@ int v3_replace_shdw_page32(struct guest_info * info, addr_t location, pte32_t * -int handle_shadow_pagefault(struct guest_info * info, addr_t fault_addr, pf_error_t error_code) { +int v3_handle_shadow_pagefault(struct guest_info * info, addr_t fault_addr, pf_error_t error_code) { if (info->mem_mode == PHYSICAL_MEM) { // If paging is not turned on we need to handle the special cases @@ -246,7 +246,7 @@ int handle_shadow_pagefault(struct guest_info * info, addr_t fault_addr, pf_erro } } -addr_t create_new_shadow_pt32() { +addr_t v3_create_new_shadow_pt32() { void * host_pde = 0; host_pde = V3_AllocPages(1); @@ -420,7 +420,7 @@ static int handle_shadow_pagefault32(struct guest_info * info, addr_t fault_addr if (shadow_pde_access == PT_ENTRY_NOT_PRESENT) { - pte32_t * shadow_pt = (pte32_t *)create_new_shadow_pt32(); + pte32_t * shadow_pt = (pte32_t *)v3_create_new_shadow_pt32(); shadow_pde->present = 1; shadow_pde->user_page = guest_pde->user_page; @@ -664,7 +664,7 @@ static int handle_shadow_pte32_fault(struct guest_info * info, /* Currently Does not work with Segmentation!!! */ -int handle_shadow_invlpg(struct guest_info * info) { +int v3_handle_shadow_invlpg(struct guest_info * info) { if (info->mem_mode != VIRTUAL_MEM) { // Paging must be turned on... // should handle with some sort of fault I think @@ -696,7 +696,7 @@ int handle_shadow_invlpg(struct guest_info * info) { addr_t first_operand; addr_t second_operand; - operand_type_t addr_type; + v3_operand_type_t addr_type; addr_t guest_cr3 = CR3_TO_PDE32(info->shdw_pg_state.guest_cr3); pde32_t * guest_pd = NULL; diff --git a/palacios/src/palacios/vmm_xed.c b/palacios/src/palacios/vmm_xed.c index bea0aaf..cc25dc5 100644 --- a/palacios/src/palacios/vmm_xed.c +++ b/palacios/src/palacios/vmm_xed.c @@ -124,7 +124,7 @@ static int set_decoder_mode(struct guest_info * info, xed_state_t * state) { return 0; } -int is_flags_reg(xed_reg_enum_t xed_reg) { +static int is_flags_reg(xed_reg_enum_t xed_reg) { switch (xed_reg) { case XED_REG_FLAGS: case XED_REG_EFLAGS: @@ -137,7 +137,7 @@ int is_flags_reg(xed_reg_enum_t xed_reg) { -int init_decoder() { +int v3_init_decoder() { xed_tables_init(); xed_state_zero(&decoder_state); return 0;