_alternative_instructions(false);
}
-void __init alternative_branches(void)
+void __init boot_apply_alt_calls(void)
{
local_irq_disable();
_alternative_instructions(true);
/* Similar to alternative_instructions except it can be run with IRQs enabled. */
extern int apply_alternatives(struct alt_instr *start, struct alt_instr *end);
extern void alternative_instructions(void);
-extern void alternative_branches(void);
#define alt_orig_len "(.LXEN%=_orig_e - .LXEN%=_orig_s)"
#define alt_pad_len "(.LXEN%=_orig_p - .LXEN%=_orig_e)"
#include <xen/acpi.h>
+#include <xen/alternative-call.h>
#include <xen/bitops.h>
#include <xen/console.h>
#include <xen/cpu.h>
do_presmp_initcalls();
- alternative_branches();
+ boot_apply_alt_calls();
/*
* NB: when running as a PV shim VCPUOP_up/down is wired to the shim
* generation requirements are to emit a function pointer call at build
* time, and stash enough metadata to simplify the call at boot once the
* implementation has been resolved.
+ * - Implement boot_apply_alt_calls() to convert the function pointer calls
+ * into direct calls on boot.
* - Select ALTERNATIVE_CALL in Kconfig.
*
* To use:
# define __alt_call_maybe_initdata __initdata
#endif
-#else
+/*
+ * Devirtualise the alternative_{,v}call()'s on boot. Convert still-NULL
+ * function pointers into traps.
+ */
+void boot_apply_alt_calls(void);
+
+#else /* CONFIG_ALTERNATIVE_CALL */
#define alternative_call(func, args...) (func)(args)
#define alternative_vcall(func, args...) (func)(args)