Re: [PATCH v1 3/6] driver: Google EFI SMI
From: Matt Domsch
Date: Sat Feb 19 2011 - 23:44:59 EST
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@xxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/