17316329aSStefan Weil /* 27316329aSStefan Weil * Tiny Code Generator for QEMU 37316329aSStefan Weil * 47316329aSStefan Weil * Copyright (c) 2009, 2011 Stefan Weil 57316329aSStefan Weil * 67316329aSStefan Weil * Permission is hereby granted, free of charge, to any person obtaining a copy 77316329aSStefan Weil * of this software and associated documentation files (the "Software"), to deal 87316329aSStefan Weil * in the Software without restriction, including without limitation the rights 97316329aSStefan Weil * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 107316329aSStefan Weil * copies of the Software, and to permit persons to whom the Software is 117316329aSStefan Weil * furnished to do so, subject to the following conditions: 127316329aSStefan Weil * 137316329aSStefan Weil * The above copyright notice and this permission notice shall be included in 147316329aSStefan Weil * all copies or substantial portions of the Software. 157316329aSStefan Weil * 167316329aSStefan Weil * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 177316329aSStefan Weil * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 187316329aSStefan Weil * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 197316329aSStefan Weil * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 207316329aSStefan Weil * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 217316329aSStefan Weil * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 227316329aSStefan Weil * THE SOFTWARE. 237316329aSStefan Weil */ 247316329aSStefan Weil 257316329aSStefan Weil /* 267316329aSStefan Weil * This code implements a TCG which does not generate machine code for some 277316329aSStefan Weil * real target machine but which generates virtual machine code for an 287316329aSStefan Weil * interpreter. Interpreted pseudo code is slow, but it works on any host. 297316329aSStefan Weil * 307316329aSStefan Weil * Some remarks might help in understanding the code: 317316329aSStefan Weil * 327316329aSStefan Weil * "target" or "TCG target" is the machine which runs the generated code. 337316329aSStefan Weil * This is different to the usual meaning in QEMU where "target" is the 347316329aSStefan Weil * emulated machine. So normally QEMU host is identical to TCG target. 357316329aSStefan Weil * Here the TCG target is a virtual machine, but this virtual machine must 367316329aSStefan Weil * use the same word size like the real machine. 377316329aSStefan Weil * Therefore, we need both 32 and 64 bit virtual machines (interpreter). 387316329aSStefan Weil */ 397316329aSStefan Weil 40175de524SMarkus Armbruster #ifndef TCG_TARGET_H 417316329aSStefan Weil #define TCG_TARGET_H 427316329aSStefan Weil 437316329aSStefan Weil #define TCG_TARGET_INTERPRETER 1 44*65089889SRichard Henderson #define TCG_TARGET_INSN_UNIT_SIZE 4 4526a75d12SRichard Henderson #define MAX_CODE_GEN_BUFFER_SIZE ((size_t)-1) 467316329aSStefan Weil 47187f44d9SRichard Henderson /* Number of registers available. */ 487316329aSStefan Weil #define TCG_TARGET_NB_REGS 16 497316329aSStefan Weil 507316329aSStefan Weil /* List of registers which are used by TCG. */ 517316329aSStefan Weil typedef enum { 527316329aSStefan Weil TCG_REG_R0 = 0, 537316329aSStefan Weil TCG_REG_R1, 547316329aSStefan Weil TCG_REG_R2, 557316329aSStefan Weil TCG_REG_R3, 567316329aSStefan Weil TCG_REG_R4, 577316329aSStefan Weil TCG_REG_R5, 587316329aSStefan Weil TCG_REG_R6, 597316329aSStefan Weil TCG_REG_R7, 607316329aSStefan Weil TCG_REG_R8, 617316329aSStefan Weil TCG_REG_R9, 627316329aSStefan Weil TCG_REG_R10, 637316329aSStefan Weil TCG_REG_R11, 647316329aSStefan Weil TCG_REG_R12, 657316329aSStefan Weil TCG_REG_R13, 667316329aSStefan Weil TCG_REG_R14, 677316329aSStefan Weil TCG_REG_R15, 68187f44d9SRichard Henderson 69baa94c0dSRichard Henderson TCG_REG_TMP = TCG_REG_R13, 70187f44d9SRichard Henderson TCG_AREG0 = TCG_REG_R14, 71187f44d9SRichard Henderson TCG_REG_CALL_STACK = TCG_REG_R15, 72771142c2SRichard Henderson } TCGReg; 737316329aSStefan Weil 745a58e884SPaolo Bonzini #define HAVE_TCG_QEMU_TB_EXEC 757316329aSStefan Weil 767316329aSStefan Weil #endif /* TCG_TARGET_H */ 77