mirror of
https://github.com/Cxbx-Reloaded/unicorn.git
synced 2024-11-23 11:29:44 +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()
|
||||
{
|
||||
puint val = 0;
|
||||
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
|
||||
|
||||
#if defined(__i386__)
|
||||
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
|
||||
|
||||
__asm__("pushf\n\t"
|
||||
"push %0\n\t"
|
||||
"popf\n\t"
|
||||
@ -38,6 +39,8 @@ uint32_t realEflags()
|
||||
: "r"(i)
|
||||
: "%0");
|
||||
#elif defined(__x86_64__)
|
||||
puint i = 0xFFFFFEFF; //attempt to set ALL bits except trap flag.
|
||||
|
||||
__asm__("pushfq\n\t"
|
||||
"pushq %0\n\t"
|
||||
"popfq\n\t"
|
||||
@ -56,7 +59,7 @@ uint32_t realEflags()
|
||||
|
||||
static void VM_exec()
|
||||
{
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__)
|
||||
uc_engine *uc;
|
||||
uc_err err;
|
||||
unsigned int r_eax, eflags, r_esp, realflags = 0;
|
||||
@ -115,6 +118,7 @@ static void VM_exec()
|
||||
realflags = realEflags();
|
||||
|
||||
assert(r_eax == realflags);
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
|
Loading…
Reference in New Issue
Block a user