Thread (28 messages) 28 messages, 5 authors, 2016-11-30

Re: [PATCH 2/6] arm/efi: Allow invocation of arbitrary runtime services [ver #2]

From: David Howells <dhowells@redhat.com>
Date: 2016-11-23 09:34:35
Also in: lkml

David Howells [off-list ref] wrote:
+#define efi_call_runtime(f, ...)	sys_table_arg->runtime->f(__VA_ARGS__)
Turns out it's not that simple - of course.  runtime->get_variable is just a
void pointer.  The old arm stub was casting it by virtue of assignment to a
function pointer variable.

The x86_64 appears to be doing bypassing all the compile-time type checking by
passing the arguments through an ellipsis and then fixing up the argument list
in the ->call() function.

What I've changed the ARM and ARM64 things to is:

	#define efi_call_runtime(f, ...)	((efi_##f##_t *)sys_table_arg->runtime->f)(__VA_ARGS__)

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help