On Mon, Mar 9, 2015 at 2:43 PM, Andy Lutomirski <[email protected]> wrote:
>>         /* Offset from the sysenter stack to tss.sp0 */
>>         DEFINE(TSS_sysenter_sp0, offsetof(struct tss_struct, x86_tss.sp0) -
>> -                sizeof(struct tss_struct));
>> +               (offsetof(struct tss_struct, SYSENTER_stack_last_word) + 4));
>
> Is there no way to do this using sizeof to avoid having a "last_word" member.

sizeof of a structure member? IIRC in C sizeof can't be used for that.
You need to concoct a fictitious object, dereference its member
and take sizeof of _that_.

It would look horrible. Something like:

offsetof(struct tss_struct, SYSENTER_stack) +
                sizeof(((struct tss_struct*)NULL)->SYSENTER_stack)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to