Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 462324
Collapse All | Expand All

(-)source900/vmmon-only/linux/hostif.c (-19 / +2 lines)
Lines 47-52 Link Here
47
47
48
#include <linux/smp.h>
48
#include <linux/smp.h>
49
49
50
#include <asm/asm.h>
50
#include <asm/io.h>
51
#include <asm/io.h>
51
#include <linux/mc146818rtc.h>
52
#include <linux/mc146818rtc.h>
52
#include <linux/capability.h>
53
#include <linux/capability.h>
Lines 4118-4124 Link Here
4118
                 uint64 *val)        // OUT: MSR value
4119
                 uint64 *val)        // OUT: MSR value
4119
{
4120
{
4120
   int ret;
4121
   int ret;
4121
#if defined(VM_X86_64)
4122
   unsigned low, high;
4122
   unsigned low, high;
4123
4123
4124
   asm volatile("2: rdmsr ; xor %0,%0\n"
4124
   asm volatile("2: rdmsr ; xor %0,%0\n"
Lines 4126-4152 Link Here
4126
                ".section .fixup,\"ax\"\n\t"
4126
                ".section .fixup,\"ax\"\n\t"
4127
                "3: mov %4,%0 ; jmp 1b\n\t"
4127
                "3: mov %4,%0 ; jmp 1b\n\t"
4128
                ".previous\n\t"
4128
                ".previous\n\t"
4129
                ".section __ex_table,\"a\"\n\t"
4129
                _ASM_EXTABLE(2b,3b)
4130
                ".balign 8\n"
4131
                ".quad 2b,3b\n"
4132
                ".previous\n"
4133
                : "=r"(ret), "=a"(low), "=d"(high)
4130
                : "=r"(ret), "=a"(low), "=d"(high)
4134
                : "c"(msr), "i"(-EFAULT), "1"(0), "2"(0)); // init eax/edx to 0
4131
                : "c"(msr), "i"(-EFAULT), "1"(0), "2"(0)); // init eax/edx to 0
4135
   *val = (low | ((u64)(high) << 32));
4132
   *val = (low | ((u64)(high) << 32));
4136
#else
4137
   asm volatile("2: rdmsr ; xor %0,%0\n"
4138
                "1:\n\t"
4139
                ".section .fixup,\"ax\"\n\t"
4140
                "3: mov %3,%0 ; jmp 1b\n\t"
4141
                ".previous\n\t"
4142
                ".section __ex_table,\"a\"\n"
4143
                ".balign 4\n"
4144
                ".long 2b,3b\n"
4145
                ".previous\n"
4146
                : "=r"(ret), "=A"(*val)
4147
                : "c"(msr), "i"(-EFAULT), "1"(0)); // init rax to 0
4148
4149
#endif // VM_X86_64
4150
4133
4151
   return ret;
4134
   return ret;
4152
}
4135
}

Return to bug 462324