lkml.org 
[lkml]   [2008]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs
Joe Damato wrote:
>> Small detail, the syntactic form you chose:
>>
>> + if (!cpu->arch.idt[num].p)
>>
>> is not very readable because it's not obvious at first sight that
>> ".p" intends to mean "present bit". If then idt[num].present would
>> have been the better choice - but it's even better to not do
>> bitfields at all but an idt_present(desc *) helper inline function.
>>
>>
>
> OK, I'll try to use more descriptive names. As hpa pointed out in his
> email, 'p' is the name of the field in the intel x86 documentation.
> That's why I chose that, but I agree it isn't particularly clear.

Using bitfields would be a lot more appealing if the x86 design weren't
so batshit insane. Given that the addresses and limits are split of
multiple bitfields, you need to have a set of accessors for those at
least. If you're going to do that, it might be worth having them for
all the fields, at least for consistency. Perhaps this would be too
ugly and clumsy, but there isn't much code which really does anything
with descriptors in detail.

J
>
> Thanks again for the feedback,
> Joe



\
 
 \ /
  Last update: 2008-10-28 00:05    [W:0.069 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site