qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC][PATCH 06/14 v7] target-i386: Add API to write cpu


From: Wen Congyang
Subject: Re: [Qemu-devel] [RFC][PATCH 06/14 v7] target-i386: Add API to write cpu status to core file
Date: Thu, 01 Mar 2012 13:05:31 +0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4

At 03/01/2012 01:01 PM, HATAYAMA Daisuke Wrote:
> From: Wen Congyang <address@hidden>
> Subject: [RFC][PATCH 06/14 v7] target-i386: Add API to write cpu status to 
> core file
> Date: Thu, 01 Mar 2012 10:48:17 +0800
> 
>> +struct QEMUCPUState {
>> +    uint32_t version;
>> +    uint32_t size;
>> +    uint64_t rax, rbx, rcx, rdx, rsi, rdi, rsp, rbp;
>> +    uint64_t r8, r9, r10, r11, r12, r13, r14, r15;
>> +    uint64_t rip, rflags;
>> +    QEMUCPUSegment cs, ds, es, fs, gs, ss;
>> +    QEMUCPUSegment ldt, tr, gdt, idt;
>> +    uint64_t cr[5];
>> +};
>> +
>> +typedef struct QEMUCPUState QEMUCPUState;
> <cut>
>> +static void qemu_get_cpustate(QEMUCPUState *s, CPUState *env)
>> +{
>> +    memset(s, 0, sizeof(QEMUCPUState));
>> +
>> +    s->version = 1;
> 
> It seems to me better to prepare a macro:
> 
>   #define QEMUCPUSTATE_VERSION (1)
> 
> and use it as:
> 
>   s->version = QEMUCPUSTATE_VERSION;
> 
> and add comment above the macro definition indicating: please count up
> QEMUCPUSTATE_VERSION if you have changed definition of QEMUCPUState,
> and modify the tools using this information accordingly.

Yes, I will fix it.

PS: Do you have any comment about QEMUCPUState? I think the content is enough
to calculate phys_base now.

Thanks
Wen Congyang

> 
> Thanks.
> HATAYAMA, Daisuke
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]