@@ -17,19 +17,18 @@
#include <hardware.h>
static struct vm vm;
-extern const char SNIPPET_NAME_START(c, spec_ex)[];
-extern const char SNIPPET_NAME_END(c, spec_ex)[];
static bool strict;
static void setup_guest(void)
{
- char *guest;
- int binary_size = SNIPPET_LEN(c, spec_ex);
+ extern const char SNIPPET_NAME_START(c, spec_ex)[];
+ extern const char SNIPPET_NAME_END(c, spec_ex)[];
setup_vm();
- guest = alloc_pages(8);
- memcpy(guest, SNIPPET_NAME_START(c, spec_ex), binary_size);
- sie_guest_create(&vm, (uint64_t) guest, HPAGE_SIZE);
+
+ snippet_setup_guest(&vm, false);
+ snippet_init(&vm, SNIPPET_NAME_START(c, spec_ex),
+ SNIPPET_LEN(c, spec_ex), SNIPPET_UNPACK_OFF);
}
static void reset_guest(void)
spec_ex-sie uses a snippet, but allocated the memory on its own without obvious reason to do so. Refactor the test to use snippet_init(). Signed-off-by: Nico Boehr <nrb@linux.ibm.com> --- s390x/spec_ex-sie.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)