btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / system / kernel / arch / x86 / 64 / cpuid.cpp
blob7d14b71bbd5ebfc94eb8a3e1359e0eda3fbf1199
1 /*
2 * Copyright 2014, Paweł Dziepak, pdziepak@quarnos.org.
3 * Copyright 2012, Alex Smith, alex@alex-smith.me.uk.
4 * Distributed under the terms of the MIT License.
5 */
8 #include <arch_system_info.h>
11 status_t
12 get_current_cpuid(cpuid_info* info, uint32 eax, uint32 ecx)
14 __asm__("cpuid"
15 : "=a" (info->regs.eax), "=b" (info->regs.ebx), "=c" (info->regs.ecx),
16 "=d" (info->regs.edx)
17 : "a" (eax), "c" (ecx));
18 return B_OK;
22 uint32
23 get_eflags()
25 uint64_t flags;
26 __asm__("pushf; popq %0;" : "=r" (flags));
27 return flags;
31 void
32 set_eflags(uint32 value)
34 uint64_t flags = value;
35 __asm__("pushq %0; popf;" : : "r" (flags) : "cc");