|[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]|
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.
Thanks again for the feedback, Joe
-- To unsubscribe from this list: send the line "unsubscribe linux-x86_64" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html