copyin/copyout should return 0 if they are truly emulating copyin/copyout behavior.

remove stray %s in printf

rewrite printf to display 64bit type without warning.
This commit is contained in:
sbruno 2014-07-22 04:47:19 +00:00
parent e417398410
commit 24f74ef803

View File

@ -36,6 +36,7 @@
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <inttypes.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@ -292,6 +293,7 @@ test_copyin(void *arg, const void *from, uint64_t to, size_t size)
if (to + size > image_size)
size = image_size - to;
memcpy(&image[to], from, size);
return(0);
}
int
@ -304,6 +306,7 @@ test_copyout(void *arg, uint64_t from, void *to, size_t size)
if (from + size > image_size)
size = image_size - from;
memcpy(to, &image[from], size);
return(0);
}
void
@ -333,7 +336,7 @@ test_setgdt(void *arg, uint64_t v, size_t sz)
void
test_exec(void *arg, uint64_t pc)
{
printf("Execute at 0x%llx\n", pc);
printf("Execute at 0x%"PRIu64"\n", pc);
test_exit(arg, 0);
}
@ -411,7 +414,7 @@ void
usage()
{
printf("usage: %s [-d <disk image path>] [-h <host filesystem path>\n");
printf("usage: [-d <disk image path>] [-h <host filesystem path>\n");
exit(1);
}