diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2011-02-16 15:57:11 -0200 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2011-02-16 15:57:11 -0200 |
commit | 9fd7c767dbed9c4d1d5e312f32b2299f8d2257e7 (patch) | |
tree | 5ab9eb108356a99d371122918a0f0b1ee53a515e /exec.c | |
parent | 0d14905b5eb8aa1c2e195e13478bb7c74e1776db (diff) | |
parent | b4a3d965dee06d52281496bb5fd0a5cb5534b545 (diff) |
Merge commit 'b4a3d965dee06d52281496bb5fd0a5cb5534b545' into upstream-merge
* commit 'b4a3d965dee06d52281496bb5fd0a5cb5534b545': (34 commits)
Stop current VCPU on synchronous reset requests
Prevent abortion on multiple VCPU kicks
vmmouse: fix queue_size field initialization
hpet: make optional
sysbus: add creation function that may fail
x86: make vmmouse optional
isa: add creation function that may fail
vmmouse: convert to qdev
vmport: convert to qdev
x86,MIPS: make vmware_vga optional
pci: add creation functions that may fail
qdev: add creation function that may fail
vmware_vga: refactor device creation
mst_fpga: Drop one more pxa.h inclusion.
pxa2xx: convert i2c master to use qdev/vmsd
max7310: finish qdev'ication
tosa: we aren't connected to VBus, pass this info to Linux kernel
mainstone: pass one irq to the mst_fpga instead of the whole PIC
Drop unnecessary inclusions of pxa.h header
Add scoop post_load callback that sets IRQs to loaded levels
...
Conflicts:
vl.c
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 52 |
1 files changed, 26 insertions, 26 deletions
@@ -663,6 +663,32 @@ void cpu_exec_init(CPUState *env) #endif } +/* Allocate a new translation block. Flush the translation buffer if + too many translation blocks or too much generated code. */ +static TranslationBlock *tb_alloc(target_ulong pc) +{ + TranslationBlock *tb; + + if (nb_tbs >= code_gen_max_blocks || + (code_gen_ptr - code_gen_buffer) >= code_gen_buffer_max_size) + return NULL; + tb = &tbs[nb_tbs++]; + tb->pc = pc; + tb->cflags = 0; + return tb; +} + +void tb_free(TranslationBlock *tb) +{ + /* In practice this is mostly used for single use temporary TB + Ignore the hard cases and just back up if this TB happens to + be the last one generated. */ + if (nb_tbs > 0 && tb == &tbs[nb_tbs - 1]) { + code_gen_ptr = tb->tc_ptr; + nb_tbs--; + } +} + static inline void invalidate_page_bitmap(PageDesc *p) { if (p->code_bitmap) { @@ -1240,32 +1266,6 @@ static inline void tb_alloc_page(TranslationBlock *tb, #endif /* TARGET_HAS_SMC */ } -/* Allocate a new translation block. Flush the translation buffer if - too many translation blocks or too much generated code. */ -TranslationBlock *tb_alloc(target_ulong pc) -{ - TranslationBlock *tb; - - if (nb_tbs >= code_gen_max_blocks || - (code_gen_ptr - code_gen_buffer) >= code_gen_buffer_max_size) - return NULL; - tb = &tbs[nb_tbs++]; - tb->pc = pc; - tb->cflags = 0; - return tb; -} - -void tb_free(TranslationBlock *tb) -{ - /* In practice this is mostly used for single use temporary TB - Ignore the hard cases and just back up if this TB happens to - be the last one generated. */ - if (nb_tbs > 0 && tb == &tbs[nb_tbs - 1]) { - code_gen_ptr = tb->tc_ptr; - nb_tbs--; - } -} - /* add a new TB and link it to the physical page tables. phys_page2 is (-1) to indicate that only one page contains the TB. */ void tb_link_page(TranslationBlock *tb, |