1 /////////////////////////////////////////////////////////////////////////
3 // Copyright (C) 2001-2012 The Bochs Project
4 // Copyright (C) 2017 Google Inc.
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA
19 /////////////////////////////////////////////////////////////////////////
21 * x86 eflags functions
23 #ifndef __X86_FLAGS_H__
24 #define __X86_FLAGS_H__
27 void lflags_to_rflags(CPUX86State
*env
);
28 void rflags_to_lflags(CPUX86State
*env
);
30 bool get_PF(CPUX86State
*env
);
31 void set_PF(CPUX86State
*env
, bool val
);
32 bool get_CF(CPUX86State
*env
);
33 void set_CF(CPUX86State
*env
, bool val
);
34 bool get_AF(CPUX86State
*env
);
35 void set_AF(CPUX86State
*env
, bool val
);
36 bool get_ZF(CPUX86State
*env
);
37 void set_ZF(CPUX86State
*env
, bool val
);
38 bool get_SF(CPUX86State
*env
);
39 void set_SF(CPUX86State
*env
, bool val
);
40 bool get_OF(CPUX86State
*env
);
41 void set_OF(CPUX86State
*env
, bool val
);
43 void SET_FLAGS_OxxxxC(CPUX86State
*env
, uint32_t new_of
, uint32_t new_cf
);
45 void SET_FLAGS_OSZAPC_SUB32(CPUX86State
*env
, uint32_t v1
, uint32_t v2
,
47 void SET_FLAGS_OSZAPC_SUB16(CPUX86State
*env
, uint16_t v1
, uint16_t v2
,
49 void SET_FLAGS_OSZAPC_SUB8(CPUX86State
*env
, uint8_t v1
, uint8_t v2
,
52 void SET_FLAGS_OSZAPC_ADD32(CPUX86State
*env
, uint32_t v1
, uint32_t v2
,
54 void SET_FLAGS_OSZAPC_ADD16(CPUX86State
*env
, uint16_t v1
, uint16_t v2
,
56 void SET_FLAGS_OSZAPC_ADD8(CPUX86State
*env
, uint8_t v1
, uint8_t v2
,
59 void SET_FLAGS_OSZAP_SUB32(CPUX86State
*env
, uint32_t v1
, uint32_t v2
,
61 void SET_FLAGS_OSZAP_SUB16(CPUX86State
*env
, uint16_t v1
, uint16_t v2
,
63 void SET_FLAGS_OSZAP_SUB8(CPUX86State
*env
, uint8_t v1
, uint8_t v2
,
66 void SET_FLAGS_OSZAP_ADD32(CPUX86State
*env
, uint32_t v1
, uint32_t v2
,
68 void SET_FLAGS_OSZAP_ADD16(CPUX86State
*env
, uint16_t v1
, uint16_t v2
,
70 void SET_FLAGS_OSZAP_ADD8(CPUX86State
*env
, uint8_t v1
, uint8_t v2
,
73 void SET_FLAGS_OSZAPC_LOGIC32(CPUX86State
*env
, uint32_t v1
, uint32_t v2
,
75 void SET_FLAGS_OSZAPC_LOGIC16(CPUX86State
*env
, uint16_t v1
, uint16_t v2
,
77 void SET_FLAGS_OSZAPC_LOGIC8(CPUX86State
*env
, uint8_t v1
, uint8_t v2
,
80 #endif /* __X86_FLAGS_H__ */