mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-09 12:35:39 +00:00
regress: fix warning on compilation on eflags_noset.c. see #764
This commit is contained in:
parent
b12ce92468
commit
a40e5aae09
|
@ -25,9 +25,10 @@ typedef uint64_t puint;
|
||||||
uint32_t realEflags()
|
uint32_t realEflags()
|
||||||
{
|
{
|
||||||
puint val = 0;
|
puint val = 0;
|
||||||
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
|
|
||||||
|
|
||||||
#if defined(__i386__)
|
#if defined(__i386__)
|
||||||
|
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
|
||||||
|
|
||||||
__asm__("pushf\n\t"
|
__asm__("pushf\n\t"
|
||||||
"push %0\n\t"
|
"push %0\n\t"
|
||||||
"popf\n\t"
|
"popf\n\t"
|
||||||
|
@ -38,6 +39,8 @@ uint32_t realEflags()
|
||||||
: "r"(i)
|
: "r"(i)
|
||||||
: "%0");
|
: "%0");
|
||||||
#elif defined(__x86_64__)
|
#elif defined(__x86_64__)
|
||||||
|
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
|
||||||
|
|
||||||
__asm__("pushfq\n\t"
|
__asm__("pushfq\n\t"
|
||||||
"pushq %0\n\t"
|
"pushq %0\n\t"
|
||||||
"popfq\n\t"
|
"popfq\n\t"
|
||||||
|
@ -56,7 +59,7 @@ uint32_t realEflags()
|
||||||
|
|
||||||
static void VM_exec()
|
static void VM_exec()
|
||||||
{
|
{
|
||||||
|
#if defined(__i386__) || defined(__x86_64__)
|
||||||
uc_engine *uc;
|
uc_engine *uc;
|
||||||
uc_err err;
|
uc_err err;
|
||||||
unsigned int r_eax, eflags, r_esp, realflags = 0;
|
unsigned int r_eax, eflags, r_esp, realflags = 0;
|
||||||
|
@ -115,6 +118,7 @@ static void VM_exec()
|
||||||
realflags = realEflags();
|
realflags = realEflags();
|
||||||
|
|
||||||
assert(r_eax == realflags);
|
assert(r_eax == realflags);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
|
Loading…
Reference in a new issue