Displaying 18 results from an estimated 18 matches for "vmi_clobb".
Did you mean:
vmi_clobber
2007 Apr 18
0
[RFC, PATCH 13/24] i386 Vmi system header
...mbridge, MA 02139, USA.
+ *
+ * Send feedback to zach@vmware.com
+ *
+ */
+
+
+#ifndef _MACH_SYSTEM_H
+#define _MACH_SYSTEM_H
+
+#include <vmi.h>
+
+static inline void write_cr0(const u32 val)
+{
+ vmi_wrap_call(
+ SetCR0, "mov %0, %%cr0",
+ VMI_NO_OUTPUT,
+ 1, VMI_IREG1(val),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void write_cr2(const u32 val)
+{
+ vmi_wrap_call(
+ SetCR2, "mov %0, %%cr2",
+ VMI_NO_OUTPUT,
+ 1, VMI_IREG1(val),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void write_cr3(const u32...
2007 Apr 18
0
[RFC, PATCH 13/24] i386 Vmi system header
...mbridge, MA 02139, USA.
+ *
+ * Send feedback to zach@vmware.com
+ *
+ */
+
+
+#ifndef _MACH_SYSTEM_H
+#define _MACH_SYSTEM_H
+
+#include <vmi.h>
+
+static inline void write_cr0(const u32 val)
+{
+ vmi_wrap_call(
+ SetCR0, "mov %0, %%cr0",
+ VMI_NO_OUTPUT,
+ 1, VMI_IREG1(val),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void write_cr2(const u32 val)
+{
+ vmi_wrap_call(
+ SetCR2, "mov %0, %%cr2",
+ VMI_NO_OUTPUT,
+ 1, VMI_IREG1(val),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void write_cr3(const u32...
2007 Apr 18
1
[RFC, PATCH 12/24] i386 Vmi processor header
...ESSOR_H
+
+#include <vmi.h>
+
+static inline void vmi_cpuid(const int op, int *eax, int *ebx, int *ecx, int *edx)
+{
+ vmi_wrap_call(
+ CPUID, "cpuid",
+ XCONC("=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)),
+ 1, "a" (op),
+ VMI_CLOBBER(FOUR_RETURNS));
+}
+
+/*
+ * Generic CPUID function
+ */
+static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
+{
+ vmi_cpuid(op, eax, ebx, ecx, edx);
+}
+
+
+/* Some CPUID calls want 'count' to be placed in ecx */
+static inline void cpuid_count(int op, int count, int...
2007 Apr 18
1
[RFC, PATCH 12/24] i386 Vmi processor header
...ESSOR_H
+
+#include <vmi.h>
+
+static inline void vmi_cpuid(const int op, int *eax, int *ebx, int *ecx, int *edx)
+{
+ vmi_wrap_call(
+ CPUID, "cpuid",
+ XCONC("=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)),
+ 1, "a" (op),
+ VMI_CLOBBER(FOUR_RETURNS));
+}
+
+/*
+ * Generic CPUID function
+ */
+static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
+{
+ vmi_cpuid(op, eax, ebx, ecx, edx);
+}
+
+
+/* Some CPUID calls want 'count' to be placed in ecx */
+static inline void cpuid_count(int op, int count, int...
2007 Apr 18
2
[RFC, PATCH 17/24] i386 Vmi msr patch
...386/mach-vmi/mach_msr.h 2006-03-08 10:32:30.000000000 -0800
@@ -0,0 +1,79 @@
+#ifndef MACH_MSR_H
+#define MACH_MSR_H
+
+#include <vmi.h>
+
+static inline u64 vmi_rdmsr(const u32 msr)
+{
+ u64 ret;
+ vmi_wrap_call(
+ RDMSR, "rdmsr",
+ VMI_OREG64 (ret),
+ 1, "c" (msr),
+ VMI_CLOBBER(TWO_RETURNS));
+ return ret;
+}
+
+#define rdmsr(msr,val1,val2) \
+do { \
+ u64 _val = vmi_rdmsr(msr); \
+ val1 = (u32)_val; \
+ val2 = (u32)(_val >> 32); \
+} while (0)
+
+static inline void wrmsr(const u32 msr, const u32 valLo, const u32 valHi)
+{
+ vmi_wrap_call(
+ WRMSR, "wrmsr&qu...
2007 Apr 18
2
[RFC, PATCH 17/24] i386 Vmi msr patch
...386/mach-vmi/mach_msr.h 2006-03-08 10:32:30.000000000 -0800
@@ -0,0 +1,79 @@
+#ifndef MACH_MSR_H
+#define MACH_MSR_H
+
+#include <vmi.h>
+
+static inline u64 vmi_rdmsr(const u32 msr)
+{
+ u64 ret;
+ vmi_wrap_call(
+ RDMSR, "rdmsr",
+ VMI_OREG64 (ret),
+ 1, "c" (msr),
+ VMI_CLOBBER(TWO_RETURNS));
+ return ret;
+}
+
+#define rdmsr(msr,val1,val2) \
+do { \
+ u64 _val = vmi_rdmsr(msr); \
+ val1 = (u32)_val; \
+ val2 = (u32)(_val >> 32); \
+} while (0)
+
+static inline void wrmsr(const u32 msr, const u32 valLo, const u32 valHi)
+{
+ vmi_wrap_call(
+ WRMSR, "wrmsr&qu...
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
...iews of time are accessible through the VMI cycle
+ * counters.
+ */
+
+static inline VMI_CYCLES vmi_get_cycle_frequency(void)
+{
+ VMI_CYCLES ret;
+ vmi_wrap_call(
+ GetCycleFrequency, "xor %%eax, %%eax;"
+ "xor %%edx, %%edx;",
+ VMI_OREG64 (ret),
+ 0, VMI_NO_INPUT,
+ VMI_CLOBBER(TWO_RETURNS));
+ return ret;
+}
+
+static inline VMI_CYCLES vmi_get_real_cycles(void)
+{
+ VMI_CYCLES ret;
+ vmi_wrap_call(
+ GetCycleCounter, "rdtsc",
+ VMI_OREG64 (ret),
+ 1, VMI_IREG1(VMI_CYCLES_REAL),
+ VMI_CLOBBER(TWO_RETURNS));
+ return ret;
+}
+
+static inline VMI_CYCLES vmi_...
2007 Apr 18
0
[RFC, PATCH 23/24] i386 Vmi timer patch
...iews of time are accessible through the VMI cycle
+ * counters.
+ */
+
+static inline VMI_CYCLES vmi_get_cycle_frequency(void)
+{
+ VMI_CYCLES ret;
+ vmi_wrap_call(
+ GetCycleFrequency, "xor %%eax, %%eax;"
+ "xor %%edx, %%edx;",
+ VMI_OREG64 (ret),
+ 0, VMI_NO_INPUT,
+ VMI_CLOBBER(TWO_RETURNS));
+ return ret;
+}
+
+static inline VMI_CYCLES vmi_get_real_cycles(void)
+{
+ VMI_CYCLES ret;
+ vmi_wrap_call(
+ GetCycleCounter, "rdtsc",
+ VMI_OREG64 (ret),
+ 1, VMI_IREG1(VMI_CYCLES_REAL),
+ VMI_CLOBBER(TWO_RETURNS));
+ return ret;
+}
+
+static inline VMI_CYCLES vmi_...
2007 Apr 18
0
[RFC, PATCH 15/24] i386 Vmi apic header
...f CONFIG_X86_LOCAL_APIC
+#include <vmi.h>
+
+static inline void apic_write(unsigned long reg, unsigned long value)
+{
+ void *addr = (void *)(APIC_BASE + reg);
+ vmi_wrap_call(
+ APICWrite, "movl %1, (%0)",
+ VMI_NO_OUTPUT,
+ 2, XCONC(VMI_IREG1(addr), VMI_IREG2(value)),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+#define apic_write_atomic(r,v) apic_write(r,v)
+
+static inline unsigned long apic_read(unsigned long reg)
+{
+ unsigned long value;
+ void *addr = (void *)(APIC_BASE + reg);
+ vmi_wrap_call(
+ APICRead, "movl (%0), %%eax",
+ V...
2007 Apr 18
0
[RFC, PATCH 15/24] i386 Vmi apic header
...f CONFIG_X86_LOCAL_APIC
+#include <vmi.h>
+
+static inline void apic_write(unsigned long reg, unsigned long value)
+{
+ void *addr = (void *)(APIC_BASE + reg);
+ vmi_wrap_call(
+ APICWrite, "movl %1, (%0)",
+ VMI_NO_OUTPUT,
+ 2, XCONC(VMI_IREG1(addr), VMI_IREG2(value)),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+#define apic_write_atomic(r,v) apic_write(r,v)
+
+static inline unsigned long apic_read(unsigned long reg)
+{
+ unsigned long value;
+ void *addr = (void *)(APIC_BASE + reg);
+ vmi_wrap_call(
+ APICRead, "movl (%0), %%eax",
+ V...
2007 Apr 18
3
[RFC, PATCH 10/24] i386 Vmi descriptor changes
.../
+
+#ifndef __MACH_DESC_H
+#define __MACH_DESC_H
+
+#include <vmi.h>
+
+#if !defined(CONFIG_X86_VMI)
+# error invalid sub-arch include
+#endif
+
+static inline void load_gdt(VMI_DTR *const dtr)
+{
+ vmi_wrap_call(
+ SetGDT, "lgdt (%0)",
+ VMI_NO_OUTPUT,
+ 1, VMI_IREG1 (dtr),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void load_idt(VMI_DTR *const dtr)
+{
+ vmi_wrap_call(
+ SetIDT, "lidt (%0)",
+ VMI_NO_OUTPUT,
+ 1, VMI_IREG1 (dtr),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void load_ldt(const VMI...
2007 Apr 18
3
[RFC, PATCH 10/24] i386 Vmi descriptor changes
.../
+
+#ifndef __MACH_DESC_H
+#define __MACH_DESC_H
+
+#include <vmi.h>
+
+#if !defined(CONFIG_X86_VMI)
+# error invalid sub-arch include
+#endif
+
+static inline void load_gdt(VMI_DTR *const dtr)
+{
+ vmi_wrap_call(
+ SetGDT, "lgdt (%0)",
+ VMI_NO_OUTPUT,
+ 1, VMI_IREG1 (dtr),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void load_idt(VMI_DTR *const dtr)
+{
+ vmi_wrap_call(
+ SetIDT, "lidt (%0)",
+ VMI_NO_OUTPUT,
+ 1, VMI_IREG1 (dtr),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void load_ldt(const VMI...
2007 Apr 18
1
[RFC, PATCH 16/24] i386 Vmi io header
...struction. In addition, even input operations may clobber
+ * hardware mapped memory.
+ */
+
+static inline void vmi_outl(const VMI_UINT32 value, const VMI_UINT16 port)
+{
+ vmi_wrap_call(
+ OUT, "out %0, %w1",
+ VMI_NO_OUTPUT,
+ 2, XCONC("a"(value), "d"(port)),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void vmi_outb(const VMI_UINT8 value, const VMI_UINT16 port)
+{
+ vmi_wrap_call(
+ OUTB, "outb %b0, %w1",
+ VMI_NO_OUTPUT,
+ 2, XCONC("a"(value), "d"(port)),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, &quo...
2007 Apr 18
1
[RFC, PATCH 16/24] i386 Vmi io header
...struction. In addition, even input operations may clobber
+ * hardware mapped memory.
+ */
+
+static inline void vmi_outl(const VMI_UINT32 value, const VMI_UINT16 port)
+{
+ vmi_wrap_call(
+ OUT, "out %0, %w1",
+ VMI_NO_OUTPUT,
+ 2, XCONC("a"(value), "d"(port)),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, "memory"));
+}
+
+static inline void vmi_outb(const VMI_UINT8 value, const VMI_UINT16 port)
+{
+ vmi_wrap_call(
+ OUTB, "outb %b0, %w1",
+ VMI_NO_OUTPUT,
+ 2, XCONC("a"(value), "d"(port)),
+ VMI_CLOBBER_EXTENDED(ZERO_RETURNS, &quo...
2007 Apr 18
3
[RFC, PATCH 4/24] i386 Vmi inline implementation
...NT32;
+typedef uint16_t VMI_UINT16;
+typedef uint16_t VMI_SELECTOR;
+typedef uint8_t VMI_UINT8;
+typedef int8_t VMI_INT8;
+typedef uint8_t VMI_BOOL;
+typedef uint64_t VMI_CYCLES;
+
+#include <paravirtualInterface.h>
+#include <mach_asm.h>
+
+#if defined(CONFIG_VMI_C_CONVENTION)
+#define VMI_CLOBBER_ZERO_RETURNS "cc", "eax", "edx", "ecx"
+#define VMI_CLOBBER_ONE_RETURN "cc", "edx", "ecx"
+#define VMI_CLOBBER_TWO_RETURNS "cc", "ecx"
+#define VMI_CLOBBER_FOUR_RETURNS "cc"
+#elif defined(CONFIG...
2007 Apr 18
3
[RFC, PATCH 4/24] i386 Vmi inline implementation
...NT32;
+typedef uint16_t VMI_UINT16;
+typedef uint16_t VMI_SELECTOR;
+typedef uint8_t VMI_UINT8;
+typedef int8_t VMI_INT8;
+typedef uint8_t VMI_BOOL;
+typedef uint64_t VMI_CYCLES;
+
+#include <paravirtualInterface.h>
+#include <mach_asm.h>
+
+#if defined(CONFIG_VMI_C_CONVENTION)
+#define VMI_CLOBBER_ZERO_RETURNS "cc", "eax", "edx", "ecx"
+#define VMI_CLOBBER_ONE_RETURN "cc", "edx", "ecx"
+#define VMI_CLOBBER_TWO_RETURNS "cc", "ecx"
+#define VMI_CLOBBER_FOUR_RETURNS "cc"
+#elif defined(CONFIG...
2007 Apr 18
1
[RFC, PATCH 19/24] i386 Vmi mmu changes
...lease_page(pfn, VMI_PAGE_PDP)
+#endif
+
+static inline void vmi_set_linear_mapping(const int slot, const u32 va, const u32 pages, const u32 ppn)
+{
+ vmi_wrap_call(
+ SetLinearMapping, "",
+ VMI_NO_OUTPUT,
+ 4, XCONC(VMI_IREG1(slot), VMI_IREG2(va), VMI_IREG3(pages), VMI_IREG4(ppn)),
+ VMI_CLOBBER(ZERO_RETURNS));
+}
+
+#define mach_map_linear_pt(num, ptep, pfn) \
+ vmi_set_linear_mapping(num+1, (uint32_t)ptep, 1, pfn)
+#define mach_map_linear_range(start, pages, pfn) \
+ vmi_set_linear_mapping(0, start, pages, pfn)
+
+#endif /* _MACH_PGALLOC_H */
Index: linux-2.6.16-rc5/include/asm-i386/ma...
2007 Apr 18
1
[RFC, PATCH 19/24] i386 Vmi mmu changes
...lease_page(pfn, VMI_PAGE_PDP)
+#endif
+
+static inline void vmi_set_linear_mapping(const int slot, const u32 va, const u32 pages, const u32 ppn)
+{
+ vmi_wrap_call(
+ SetLinearMapping, "",
+ VMI_NO_OUTPUT,
+ 4, XCONC(VMI_IREG1(slot), VMI_IREG2(va), VMI_IREG3(pages), VMI_IREG4(ppn)),
+ VMI_CLOBBER(ZERO_RETURNS));
+}
+
+#define mach_map_linear_pt(num, ptep, pfn) \
+ vmi_set_linear_mapping(num+1, (uint32_t)ptep, 1, pfn)
+#define mach_map_linear_range(start, pages, pfn) \
+ vmi_set_linear_mapping(0, start, pages, pfn)
+
+#endif /* _MACH_PGALLOC_H */
Index: linux-2.6.16-rc5/include/asm-i386/ma...