@@ -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)