From: Jack Lange Date: Fri, 26 Sep 2008 21:04:10 +0000 (-0500) Subject: almost done with the namespace protection via -D__V3VEE__ header wrappers X-Git-Tag: 1.0~3^2~25 X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=f4b074d9bf5c28dfd6e5fd616805ade2e9473b01 almost done with the namespace protection via -D__V3VEE__ header wrappers --- diff --git a/palacios/include/palacios/svm.h b/palacios/include/palacios/svm.h index 22cb157..6a7f230 100644 --- a/palacios/include/palacios/svm.h +++ b/palacios/include/palacios/svm.h @@ -6,11 +6,13 @@ #define __SVM_H -#include #ifdef __V3VEE__ +#include + + #include #include @@ -62,12 +64,12 @@ #define SVM_HANDLER_ERROR 0x1 #define SVM_HANDLER_HALT 0x2 -#endif void Init_SVM(struct vmm_ctrl_ops * vmm_ops); int is_svm_capable(); +#endif diff --git a/palacios/include/palacios/vm_dev.h b/palacios/include/palacios/vm_dev.h index cae6f1f..795a3d1 100644 --- a/palacios/include/palacios/vm_dev.h +++ b/palacios/include/palacios/vm_dev.h @@ -4,6 +4,8 @@ #ifndef __VM_DEV_H #define __VM_DEV_H +#ifdef __V3VEE__ + #include #include #include @@ -83,4 +85,7 @@ int dev_hook_irq(struct vm_device * dev, int dev_unhook_irq(struct vm_device * dev, uint_t irq); + +#endif // ! __V3VEE__ + #endif diff --git a/palacios/include/palacios/vm_guest.h b/palacios/include/palacios/vm_guest.h index 5b37d8f..8bdf0c0 100644 --- a/palacios/include/palacios/vm_guest.h +++ b/palacios/include/palacios/vm_guest.h @@ -157,7 +157,7 @@ void PrintV3Segments(struct guest_info * info); void PrintV3CtrlRegs(struct guest_info * info); void PrintV3GPRs(struct guest_info * info); -#endif +#endif // ! __V3VEE__ diff --git a/palacios/include/palacios/vm_guest_mem.h b/palacios/include/palacios/vm_guest_mem.h index 4f17c5b..bc1a288 100644 --- a/palacios/include/palacios/vm_guest_mem.h +++ b/palacios/include/palacios/vm_guest_mem.h @@ -4,6 +4,9 @@ #ifndef __VM_GUEST_MEM_H #define __VM_GUEST_MEM_H + +#ifdef __V3VEE__ + #include #include @@ -92,7 +95,7 @@ int write_guest_pa_memory(struct guest_info * guest_info, addr_t guest_pa, int c // TODO int write_guest_va_memory(struct guest_info * guest_info, addr_t guest_va, int count, char * src); - +#endif // ! __V3VEE__ #endif diff --git a/palacios/include/palacios/vmcs.h b/palacios/include/palacios/vmcs.h index 01d6ba2..337099c 100644 --- a/palacios/include/palacios/vmcs.h +++ b/palacios/include/palacios/vmcs.h @@ -2,8 +2,10 @@ /* (c) 2008, Jack Lange */ /* (c) 2008, The V3VEE Project */ -#ifndef __VMCS_H -#define __VMCS_H +#ifndef __VMCS_H__ +#define __VMCS_H__ + +#ifdef __V3VEE__ #include @@ -582,4 +584,7 @@ extern uint_t VMCS_READ(); #include +#endif // ! __V3VEE__ + + #endif diff --git a/palacios/include/palacios/vmcs_gen.h b/palacios/include/palacios/vmcs_gen.h index 467ae78..42af92e 100644 --- a/palacios/include/palacios/vmcs_gen.h +++ b/palacios/include/palacios/vmcs_gen.h @@ -1,8 +1,11 @@ /* (c) 2008, The V3VEE Project */ -#ifndef vmcs_gen -#define vmcs_gen +#ifndef __VMCS_GEN__ +#define __VMCS_GEN__ + +#ifdef __V3VEE__ + #include #include @@ -780,4 +783,11 @@ uint_t Get_HOST_RIP(); void PrintTrace_HOST_RIP(); void PrintTrace_VMCS_ALL(); + + +#endif // !__V3VEE + #endif + + + diff --git a/palacios/include/palacios/vmm.h b/palacios/include/palacios/vmm.h index cf02258..737ec35 100644 --- a/palacios/include/palacios/vmm.h +++ b/palacios/include/palacios/vmm.h @@ -174,10 +174,10 @@ struct vmm_intr_state { // This is the value given when the interrupt is hooked. // This will never be NULL - void *opaque; + void * opaque; }; -void deliver_interrupt_to_vmm(struct vmm_intr_state *state); +void deliver_interrupt_to_vmm(struct vmm_intr_state * state); /* This will contain function pointers that provide OS services */ diff --git a/palacios/include/palacios/vmm_config.h b/palacios/include/palacios/vmm_config.h index 1b41387..5072ef9 100644 --- a/palacios/include/palacios/vmm_config.h +++ b/palacios/include/palacios/vmm_config.h @@ -7,6 +7,7 @@ #ifdef __V3VEE__ + #include diff --git a/palacios/include/palacios/vmm_ctrl_regs.h b/palacios/include/palacios/vmm_ctrl_regs.h index 96d5d16..a72d248 100644 --- a/palacios/include/palacios/vmm_ctrl_regs.h +++ b/palacios/include/palacios/vmm_ctrl_regs.h @@ -4,6 +4,8 @@ #ifndef __VMM_CTRL_REGS_H #define __VMM_CTRL_REGS_H +#ifdef __V3VEE__ + #include @@ -194,4 +196,7 @@ int handle_cr3_read(struct guest_info * info); #define CR3_32_COPY_BASE(source,dest) do { (dest)->pdt_base_addr = (source)->pdt_base_addr; } while (0) +#endif // ! __V3VEE__ + + #endif diff --git a/palacios/include/palacios/vmm_debug.h b/palacios/include/palacios/vmm_debug.h index 5424ab7..9718f74 100644 --- a/palacios/include/palacios/vmm_debug.h +++ b/palacios/include/palacios/vmm_debug.h @@ -6,6 +6,7 @@ #ifdef __V3VEE__ + #include struct dbg_bp32 { diff --git a/palacios/include/palacios/vmm_list.h b/palacios/include/palacios/vmm_list.h index 9bcf7f8..9fc2e5c 100644 --- a/palacios/include/palacios/vmm_list.h +++ b/palacios/include/palacios/vmm_list.h @@ -6,8 +6,8 @@ #ifndef _VMM_LIST_H #define _VMM_LIST_H -// JRL FIXME -// #ifdef __V3VEE__ + +#ifdef __V3VEE__ #include @@ -533,7 +533,7 @@ static inline void hlist_add_after(struct hlist_node *n, pos = n) -// JRL FIXME -//#endif // ! __V3VEE__ + +#endif // ! __V3VEE__ #endif diff --git a/palacios/include/palacios/vmm_paging.h b/palacios/include/palacios/vmm_paging.h index e11a452..7b6836b 100644 --- a/palacios/include/palacios/vmm_paging.h +++ b/palacios/include/palacios/vmm_paging.h @@ -5,6 +5,8 @@ #define __VMM_PAGING_H +#ifdef __V3VEE__ + #include #include @@ -71,7 +73,7 @@ the host state in the vmcs before entering the guest. */ -#ifdef __V3VEE__ + #define MAX_PTE32_ENTRIES 1024 #define MAX_PDE32_ENTRIES 1024 diff --git a/palacios/include/palacios/vmm_time.h b/palacios/include/palacios/vmm_time.h index ccc7775..3cbd2ed 100644 --- a/palacios/include/palacios/vmm_time.h +++ b/palacios/include/palacios/vmm_time.h @@ -4,6 +4,7 @@ #ifndef __VMM_TIME_H #define __VMM_TIME_H +#ifdef __V3VEE__ #include #include @@ -28,7 +29,7 @@ struct vm_time { }; -#ifdef __V3VEE__ + struct vm_timer_ops { void (*update_time)(ullong_t cpu_cycles, ullong_t cpu_freq, void * priv_data); diff --git a/palacios/include/palacios/vmm_types.h b/palacios/include/palacios/vmm_types.h index cd837f4..cb846f2 100644 --- a/palacios/include/palacios/vmm_types.h +++ b/palacios/include/palacios/vmm_types.h @@ -38,6 +38,6 @@ typedef int sint32_t; typedef ulong_t addr_t; -#endif +#endif // ! __V3VEE__ #endif diff --git a/palacios/include/palacios/vmx.h b/palacios/include/palacios/vmx.h index 3b40784..91f13a8 100644 --- a/palacios/include/palacios/vmx.h +++ b/palacios/include/palacios/vmx.h @@ -5,6 +5,8 @@ #ifndef __VMX_H #define __VMX_H +#ifdef __V3VEE__ + #include #include @@ -112,6 +114,6 @@ int VMLaunch(struct VMDescriptor *vm); int Do_VMM(struct VMXRegs regs); - +#endif // ! __V3VEE__ #endif