169e0a03cSPaolo Bonzini ///////////////////////////////////////////////////////////////////////// 269e0a03cSPaolo Bonzini // 369e0a03cSPaolo Bonzini // Copyright (C) 2001-2012 The Bochs Project 469e0a03cSPaolo Bonzini // Copyright (C) 2017 Google Inc. 569e0a03cSPaolo Bonzini // 669e0a03cSPaolo Bonzini // This library is free software; you can redistribute it and/or 769e0a03cSPaolo Bonzini // modify it under the terms of the GNU Lesser General Public 869e0a03cSPaolo Bonzini // License as published by the Free Software Foundation; either 9*8af82b8eSChetan Pant // version 2.1 of the License, or (at your option) any later version. 1069e0a03cSPaolo Bonzini // 1169e0a03cSPaolo Bonzini // This library is distributed in the hope that it will be useful, 1269e0a03cSPaolo Bonzini // but WITHOUT ANY WARRANTY; without even the implied warranty of 1369e0a03cSPaolo Bonzini // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1469e0a03cSPaolo Bonzini // Lesser General Public License for more details. 1569e0a03cSPaolo Bonzini // 1669e0a03cSPaolo Bonzini // You should have received a copy of the GNU Lesser General Public 1769e0a03cSPaolo Bonzini // License along with this library; if not, write to the Free Software 1869e0a03cSPaolo Bonzini // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA 1969e0a03cSPaolo Bonzini ///////////////////////////////////////////////////////////////////////// 2069e0a03cSPaolo Bonzini /* 2169e0a03cSPaolo Bonzini * x86 eflags functions 2269e0a03cSPaolo Bonzini */ 23a8b991b5SMarkus Armbruster 24a8b991b5SMarkus Armbruster #ifndef X86_FLAGS_H 25a8b991b5SMarkus Armbruster #define X86_FLAGS_H 2669e0a03cSPaolo Bonzini 2769e0a03cSPaolo Bonzini #include "cpu.h" 2869e0a03cSPaolo Bonzini void lflags_to_rflags(CPUX86State *env); 2969e0a03cSPaolo Bonzini void rflags_to_lflags(CPUX86State *env); 3069e0a03cSPaolo Bonzini 3169e0a03cSPaolo Bonzini bool get_PF(CPUX86State *env); 3269e0a03cSPaolo Bonzini void set_PF(CPUX86State *env, bool val); 3369e0a03cSPaolo Bonzini bool get_CF(CPUX86State *env); 3469e0a03cSPaolo Bonzini void set_CF(CPUX86State *env, bool val); 3569e0a03cSPaolo Bonzini bool get_AF(CPUX86State *env); 3669e0a03cSPaolo Bonzini void set_AF(CPUX86State *env, bool val); 3769e0a03cSPaolo Bonzini bool get_ZF(CPUX86State *env); 3869e0a03cSPaolo Bonzini void set_ZF(CPUX86State *env, bool val); 3969e0a03cSPaolo Bonzini bool get_SF(CPUX86State *env); 4069e0a03cSPaolo Bonzini void set_SF(CPUX86State *env, bool val); 4169e0a03cSPaolo Bonzini bool get_OF(CPUX86State *env); 4269e0a03cSPaolo Bonzini void set_OF(CPUX86State *env, bool val); 4369e0a03cSPaolo Bonzini 4469e0a03cSPaolo Bonzini void SET_FLAGS_OxxxxC(CPUX86State *env, uint32_t new_of, uint32_t new_cf); 4569e0a03cSPaolo Bonzini 4669e0a03cSPaolo Bonzini void SET_FLAGS_OSZAPC_SUB32(CPUX86State *env, uint32_t v1, uint32_t v2, 4769e0a03cSPaolo Bonzini uint32_t diff); 4869e0a03cSPaolo Bonzini void SET_FLAGS_OSZAPC_SUB16(CPUX86State *env, uint16_t v1, uint16_t v2, 4969e0a03cSPaolo Bonzini uint16_t diff); 5069e0a03cSPaolo Bonzini void SET_FLAGS_OSZAPC_SUB8(CPUX86State *env, uint8_t v1, uint8_t v2, 5169e0a03cSPaolo Bonzini uint8_t diff); 5269e0a03cSPaolo Bonzini 5369e0a03cSPaolo Bonzini void SET_FLAGS_OSZAPC_ADD32(CPUX86State *env, uint32_t v1, uint32_t v2, 5469e0a03cSPaolo Bonzini uint32_t diff); 5569e0a03cSPaolo Bonzini void SET_FLAGS_OSZAPC_ADD16(CPUX86State *env, uint16_t v1, uint16_t v2, 5669e0a03cSPaolo Bonzini uint16_t diff); 5769e0a03cSPaolo Bonzini void SET_FLAGS_OSZAPC_ADD8(CPUX86State *env, uint8_t v1, uint8_t v2, 5869e0a03cSPaolo Bonzini uint8_t diff); 5969e0a03cSPaolo Bonzini 6069e0a03cSPaolo Bonzini void SET_FLAGS_OSZAP_SUB32(CPUX86State *env, uint32_t v1, uint32_t v2, 6169e0a03cSPaolo Bonzini uint32_t diff); 6269e0a03cSPaolo Bonzini void SET_FLAGS_OSZAP_SUB16(CPUX86State *env, uint16_t v1, uint16_t v2, 6369e0a03cSPaolo Bonzini uint16_t diff); 6469e0a03cSPaolo Bonzini void SET_FLAGS_OSZAP_SUB8(CPUX86State *env, uint8_t v1, uint8_t v2, 6569e0a03cSPaolo Bonzini uint8_t diff); 6669e0a03cSPaolo Bonzini 6769e0a03cSPaolo Bonzini void SET_FLAGS_OSZAP_ADD32(CPUX86State *env, uint32_t v1, uint32_t v2, 6869e0a03cSPaolo Bonzini uint32_t diff); 6969e0a03cSPaolo Bonzini void SET_FLAGS_OSZAP_ADD16(CPUX86State *env, uint16_t v1, uint16_t v2, 7069e0a03cSPaolo Bonzini uint16_t diff); 7169e0a03cSPaolo Bonzini void SET_FLAGS_OSZAP_ADD8(CPUX86State *env, uint8_t v1, uint8_t v2, 7269e0a03cSPaolo Bonzini uint8_t diff); 7369e0a03cSPaolo Bonzini 74e8a63257SPaolo Bonzini void SET_FLAGS_OSZAPC_LOGIC32(CPUX86State *env, uint32_t v1, uint32_t v2, 75e8a63257SPaolo Bonzini uint32_t diff); 76e8a63257SPaolo Bonzini void SET_FLAGS_OSZAPC_LOGIC16(CPUX86State *env, uint16_t v1, uint16_t v2, 77e8a63257SPaolo Bonzini uint16_t diff); 78e8a63257SPaolo Bonzini void SET_FLAGS_OSZAPC_LOGIC8(CPUX86State *env, uint8_t v1, uint8_t v2, 79e8a63257SPaolo Bonzini uint8_t diff); 8069e0a03cSPaolo Bonzini 81a8b991b5SMarkus Armbruster #endif /* X86_FLAGS_H */ 82