Re: [Qemu-devel] classic emulator Vs QEMU-TCG

2010-12-17 Thread Andreas Färber
Hi, Am 17.12.2010 um 10:47 schrieb Stefano Bonifazi: I've got an explanation from a C guru :) ((long REGPARM (*)(void *))code_gen_prologue)(tb_ptr) - (long REGPARM (*)(void *)) is a type: a pointer pointing to a function, which takes one (void*) parameter. code_gen_prologue is an>

Re: [Qemu-devel] classic emulator Vs QEMU-TCG

2010-12-17 Thread Stefano Bonifazi
On 12/16/2010 04:41 PM, Peter Maydell wrote: Some hints: * go and look up the C syntax for function pointers and casting things to function pointers Yup! See the reply to Mr. Santosa, thank you! * code_gen_prologue[] contains code which has been generated once on startup -- go and find the

Re: [Qemu-devel] classic emulator Vs QEMU-TCG

2010-12-17 Thread Mulyadi Santosa
On Fri, Dec 17, 2010 at 16:47, Stefano Bonifazi wrote: > On 12/16/2010 04:57 PM, Mulyadi Santosa wrote: >> >> With my limited C knowledge, I saw that as a instruction jump (to >> tb_ptr). The "code_gen_prologue" seems to me like a cast. casting >> each opcode in tb_ptr as uint8_t with maxi

Re: [Qemu-devel] classic emulator Vs QEMU-TCG

2010-12-17 Thread Stefano Bonifazi
On 12/16/2010 04:57 PM, Mulyadi Santosa wrote: With my limited C knowledge, I saw that as a instruction jump (to tb_ptr). The "code_gen_prologue" seems to me like a cast. casting each opcode in tb_ptr as uint8_t with maximum length=1024 Hi! Thank you for your reply! I've got an explanat

Re: [Qemu-devel] classic emulator Vs QEMU-TCG

2010-12-16 Thread Mulyadi Santosa
Hi Stefano I'll try to share what I know about TCG.. On Thu, Dec 16, 2010 at 22:20, Stefano Bonifazi wrote: > Actually as a student, I've never developed even a simple classic emulator > myself, you're not alone...trust me.. :) >but in my idea it should follow this flow: > 1) Fetch

Re: [Qemu-devel] classic emulator Vs QEMU-TCG

2010-12-16 Thread Peter Maydell
On 16 December 2010 15:20, Stefano Bonifazi wrote: > so I thought tcg_qemu_tb_exec "function" should do the work of executing the > translated binary in the host. > But then I found out it is just a define in tcg.h: > >> #define tcg_qemu_tb_exec(tb_ptr) ((long REGPARM (*)(void >> *))code_gen_prolo

[Qemu-devel] classic emulator Vs QEMU-TCG

2010-12-16 Thread Stefano Bonifazi
Hi all! I am a student, trying to understand QEMU, specifically TCG translation/execution. After spending much time on the code I still have big doubts. I think my doubts are due to the classic idea I have of an emulator. Actually as a student, I've never developed even a simple classic emu