[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH v5 17/18] gdbstub: x86: Support for setting segm
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] Re: [PATCH v5 17/18] gdbstub: x86: Support for setting segment registers |
Date: |
Wed, 19 Nov 2008 00:15:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
Anthony Liguori wrote:
> Jan Kiszka wrote:
>> diff --git a/target-i386/cpu.h b/target-i386/cpu.h
>> index eed1f62..b7c8a2f 100644
>> --- a/target-i386/cpu.h
>> +++ b/target-i386/cpu.h
>> @@ -651,6 +651,20 @@ int cpu_get_pic_interrupt(CPUX86State *s);
>> /* MSDOS compatibility mode FPU exception support */
>> void cpu_set_ferr(CPUX86State *s);
>>
>> +static inline unsigned int get_seg_limit(uint32_t e1, uint32_t e2)
>> +{
>> + unsigned int limit;
>> + limit = (e1 & 0xffff) | (e2 & 0x000f0000);
>> + if (e2 & DESC_G_MASK)
>> + limit = (limit << 12) | 0xfff;
>> + return limit;
>> +}
>> +
>> +static inline uint32_t get_seg_base(uint32_t e1, uint32_t e2)
>> +{
>> + return ((e1 >> 16) | ((e2 & 0xff) << 16) | (e2 & 0xff000000));
>> +}
>> +
>>
>
> I like this patch but if you're going to export new x86 helper
> functions, please prefix them with cpu_x86. In this case, these helpers
> are awfully low level (they're taking a GDT entry split into two 32-bit
> words). I would rather see an interface that took a CPUState and a
> segment register index. In the very least, it won't be very obvious to
> anyone what this API expects to take so a comment would be required.
That was a result of the decision process "quick feature enhancement or
also some more refactoring?". :)
Will think out a new interface instead, leaving those two where they
came from.
Jan
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v5 05/18] Set mem_io_vaddr on io_read, (continued)
- [Qemu-devel] [PATCH v5 05/18] Set mem_io_vaddr on io_read, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 12/18] Introduce BP_CPU as a breakpoint type, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 03/18] gdbstub: Return appropriate watch message to gdb, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 13/18] x86: Debug register emulation, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 04/18] Refactor and enhance break/watchpoint API, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 15/18] gdbstub: Add vCont support, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 17/18] gdbstub: x86: Support for setting segment registers, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 01/18] Convert CPU_PC_FROM_TB to static inline, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 06/18] Respect length of watchpoints, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 14/18] x86: Dump debug registers, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 11/18] Add debug exception hook, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 10/18] Introduce BP_WATCHPOINT_HIT flag, Jan Kiszka, 2008/11/17
- [Qemu-devel] [PATCH v5 18/18] gdbstub: x86: Switch 64/32 bit registers dynamically, Jan Kiszka, 2008/11/17