Le samedi 03 février 2007 à 10:33 +0100, Andi Kleen a écrit : > > /* > > + * Wrap all the virtual calls in a way that forces the parameters on the > > stack. > > + */ > > + > > +#define efi_call_virt(f, args...) \ > > + ((efi_##f##_t > > __attribute__((regparm(0)))*)efi.systab->runtime->f)(args) > > + > > +static efi_status_t virt_efi_get_time(efi_time_t *tm, efi_time_cap_t *tc) > > +{ > > + return efi_call_virt(get_time, tm, tc); > > Wouldn't it be better to just declare the pointers in efi.systab with > the correct attribute? Then you wouldn't need all that ugly casting.
Was what I did in the initial patch: http://lkml.org/lkml/2007/1/30/258 The issue is that the structure definition is used on multiple architectures (for now ia64 and i386) which might used different calling conventions. As Bjorn Helgaas pointed out, ia64 already has such wrapper functions. I agree that the casting isn't the nicest thing, but I prefer that to writing asm stubs. Fred - 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/