1c97d6d2cSSergio Andres Gomez Del Real ///////////////////////////////////////////////////////////////////////// 2c97d6d2cSSergio Andres Gomez Del Real // 3c97d6d2cSSergio Andres Gomez Del Real // Copyright (C) 2001-2012 The Bochs Project 4c97d6d2cSSergio Andres Gomez Del Real // Copyright (C) 2017 Google Inc. 5c97d6d2cSSergio Andres Gomez Del Real // 6c97d6d2cSSergio Andres Gomez Del Real // This library is free software; you can redistribute it and/or 7c97d6d2cSSergio Andres Gomez Del Real // modify it under the terms of the GNU Lesser General Public 8c97d6d2cSSergio Andres Gomez Del Real // License as published by the Free Software Foundation; either 98af82b8eSChetan Pant // version 2.1 of the License, or (at your option) any later version. 10c97d6d2cSSergio Andres Gomez Del Real // 11c97d6d2cSSergio Andres Gomez Del Real // This library is distributed in the hope that it will be useful, 12c97d6d2cSSergio Andres Gomez Del Real // but WITHOUT ANY WARRANTY; without even the implied warranty of 13c97d6d2cSSergio Andres Gomez Del Real // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14c97d6d2cSSergio Andres Gomez Del Real // Lesser General Public License for more details. 15c97d6d2cSSergio Andres Gomez Del Real // 16c97d6d2cSSergio Andres Gomez Del Real // You should have received a copy of the GNU Lesser General Public 17c97d6d2cSSergio Andres Gomez Del Real // License along with this library; if not, write to the Free Software 18c97d6d2cSSergio Andres Gomez Del Real // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA 19c97d6d2cSSergio Andres Gomez Del Real ///////////////////////////////////////////////////////////////////////// 20c97d6d2cSSergio Andres Gomez Del Real /* 21c97d6d2cSSergio Andres Gomez Del Real * x86 eflags functions 22c97d6d2cSSergio Andres Gomez Del Real */ 23a8b991b5SMarkus Armbruster 24fb8ebeddSWei Liu #ifndef X86_EMU_FLAGS_H 25fb8ebeddSWei Liu #define X86_EMU_FLAGS_H 26c97d6d2cSSergio Andres Gomez Del Real 27c97d6d2cSSergio Andres Gomez Del Real #include "cpu.h" 28c97d6d2cSSergio Andres Gomez Del Real void lflags_to_rflags(CPUX86State *env); 29c97d6d2cSSergio Andres Gomez Del Real void rflags_to_lflags(CPUX86State *env); 30c97d6d2cSSergio Andres Gomez Del Real 31c97d6d2cSSergio Andres Gomez Del Real bool get_CF(CPUX86State *env); 32c97d6d2cSSergio Andres Gomez Del Real void set_CF(CPUX86State *env, bool val); 33c97d6d2cSSergio Andres Gomez Del Real 34*5b80dcf9SPaolo Bonzini void SET_FLAGS_OxxxxC(CPUX86State *env, bool new_of, bool new_cf); 35c97d6d2cSSergio Andres Gomez Del Real 36c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAPC_SUB32(CPUX86State *env, uint32_t v1, uint32_t v2, 37c97d6d2cSSergio Andres Gomez Del Real uint32_t diff); 38c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAPC_SUB16(CPUX86State *env, uint16_t v1, uint16_t v2, 39c97d6d2cSSergio Andres Gomez Del Real uint16_t diff); 40c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAPC_SUB8(CPUX86State *env, uint8_t v1, uint8_t v2, 41c97d6d2cSSergio Andres Gomez Del Real uint8_t diff); 42c97d6d2cSSergio Andres Gomez Del Real 43c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAPC_ADD32(CPUX86State *env, uint32_t v1, uint32_t v2, 44c97d6d2cSSergio Andres Gomez Del Real uint32_t diff); 45c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAPC_ADD16(CPUX86State *env, uint16_t v1, uint16_t v2, 46c97d6d2cSSergio Andres Gomez Del Real uint16_t diff); 47c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAPC_ADD8(CPUX86State *env, uint8_t v1, uint8_t v2, 48c97d6d2cSSergio Andres Gomez Del Real uint8_t diff); 49c97d6d2cSSergio Andres Gomez Del Real 50c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAP_SUB32(CPUX86State *env, uint32_t v1, uint32_t v2, 51c97d6d2cSSergio Andres Gomez Del Real uint32_t diff); 52c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAP_SUB16(CPUX86State *env, uint16_t v1, uint16_t v2, 53c97d6d2cSSergio Andres Gomez Del Real uint16_t diff); 54c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAP_SUB8(CPUX86State *env, uint8_t v1, uint8_t v2, 55c97d6d2cSSergio Andres Gomez Del Real uint8_t diff); 56c97d6d2cSSergio Andres Gomez Del Real 57c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAP_ADD32(CPUX86State *env, uint32_t v1, uint32_t v2, 58c97d6d2cSSergio Andres Gomez Del Real uint32_t diff); 59c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAP_ADD16(CPUX86State *env, uint16_t v1, uint16_t v2, 60c97d6d2cSSergio Andres Gomez Del Real uint16_t diff); 61c97d6d2cSSergio Andres Gomez Del Real void SET_FLAGS_OSZAP_ADD8(CPUX86State *env, uint8_t v1, uint8_t v2, 62c97d6d2cSSergio Andres Gomez Del Real uint8_t diff); 63c97d6d2cSSergio Andres Gomez Del Real 64e8a63257SPaolo Bonzini void SET_FLAGS_OSZAPC_LOGIC32(CPUX86State *env, uint32_t v1, uint32_t v2, 65e8a63257SPaolo Bonzini uint32_t diff); 66e8a63257SPaolo Bonzini void SET_FLAGS_OSZAPC_LOGIC16(CPUX86State *env, uint16_t v1, uint16_t v2, 67e8a63257SPaolo Bonzini uint16_t diff); 68e8a63257SPaolo Bonzini void SET_FLAGS_OSZAPC_LOGIC8(CPUX86State *env, uint8_t v1, uint8_t v2, 69e8a63257SPaolo Bonzini uint8_t diff); 70c97d6d2cSSergio Andres Gomez Del Real 71fb8ebeddSWei Liu #endif /* X86_EMU_FLAGS_H */ 72