Messages in this thread | | | Date | Sat, 19 Feb 2011 22:44:40 -0600 | From | Matt Domsch <> | Subject | Re: [PATCH v1 3/6] driver: Google EFI SMI |
| |
On Thu, Jan 27, 2011 at 03:41:06PM -0800, Mike Waychison wrote: > On Wed, Jan 26, 2011 at 5:22 PM, Mike Waychison <mikew@google.com> wrote: > > I've spent the last few hours looking at efivars.c and working out how > I can refactor it to reuse all the kobject bits it uses. Does anybody > use this thing though? > > I can't believe I was just lectured for crappy ABI when this thing > takes a binary packed struct on write() and process it: > - without regard to write length, and > - in a way that isn't compatible across compat (both DataSize and > Status are unsigned long!). > > struct efi_variable { > efi_char16_t VariableName[1024/sizeof(efi_char16_t)]; > efi_guid_t VendorGuid; > unsigned long DataSize; > __u8 Data[1024]; > efi_status_t Status; > __u32 Attributes; > } __attribute__((packed)); > > :(
I wrote that long before anyone believed there could be a 32-bit EFI or 32-bit kernel running on a 64-bit EFI. Remember, this originated on Itanium. I knew it was ugly, but the EFI spec itself defined the DataSize and Status as they did.
-- Matt Domsch Technology Strategist Dell | Office of the CTO
| |