__noinline \
__noreturn \
__used \
+ __weak \
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
: "=q" (xtf_has_fep));
}
+/*
+ * Default weak settings.
+ *
+ * test_wants_* indicates default settings for the framework, which may be
+ * overridden by individual tests by providing non-weak variables.
+ */
+bool __weak test_wants_user_mappings = false;
+
/*
* Local variables:
* mode: C
#define __always_inline __attribute__((__always_inline__))
#endif
+#define __weak __attribute__((weak))
+
#define __noreturn __attribute__((__noreturn__))
#define unreachable() __builtin_unreachable()
*/
extern bool xtf_has_fep;
+/**
+ * Boolean indicating whether the test wants user mappings or not.
+ *
+ * Some tests want an easy transition between supervisor and user modes. For
+ * such tests, this requires running on _PAGE_USER mappings, and they must
+ * opt-in.
+ *
+ * @see @ref errata
+ *
+ * The framework variable is a weak reference, and may be overridden by a test
+ * wishing to change the default.
+ */
+extern bool test_wants_user_mappings;
+
#endif /* XTF_TEST_H */
/*
#include <arch/x86/processor.h>
+bool test_wants_user_mappings = true;
+
/**
* Execute @p fn at user privilege on the current stack, folding @p iopl into
* the iret frame.
#include <arch/x86/processor.h>
#include <arch/x86/segment.h>
+bool test_wants_user_mappings = true;
+
static void test_int3_breakpoint(void)
{
printk("Test: int3 breakpoint\n");
#include "lowlevel.h"
+bool test_wants_user_mappings = true;
+
/** Single stub's worth of information. */
struct single
{