lkml.org 
[lkml]   [2009]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/21] x86: add methods for writing of an MSR on several CPUs
Borislav Petkov wrote:
>>
>> Please, for the love of God, no!
>>
>> Make it an array of u64s or (equivalently!) an array of (l,h)
>> structures, not separate arrays for the halves of the register.
>
> how about something like the following then? If there's agreement I could
> convert all users to struct msr later.
>

I personally would prefer if you just used an array of u64s. The whole
l/h split for MSRs was a mistake in the first place. However, if not,
at least make it a union; using something like:

union msr {
u32 l[2];
u64 q;
};

Or fancier, using gcc's anonymous structs/unions:

struct msr {
union {
struct {
u32 l, h;
};
u64 q;
};
};

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.



\
 
 \ /
  Last update: 2009-05-04 19:29    [W:0.091 / U:0.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site