aboutsummaryrefslogtreecommitdiff
path: root/arch/sandbox
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-07-08 14:39:07 -0400
committerTom Rini <trini@konsulko.com>2022-07-08 14:39:07 -0400
commit9ff4ce8abc627b8696c9bd6fd726dd1dbf4b9a5c (patch)
treed28c5d99d4996b080ec0c38f24a0232d611ea847 /arch/sandbox
parent7bc0be96f79344d7b103dd64c31be0574f7b39e9 (diff)
parente87da5704ffa6fc782d93d137fa30a37a5df3566 (diff)
Merge tag 'dm-pull-28jun22' of https://source.denx.de/u-boot/custodians/u-boot-dm into next
nman external-symbol improvements Driver model memory-usage reporting patman test-reporting improvements Add bloblist design goals
Diffstat (limited to 'arch/sandbox')
-rw-r--r--arch/sandbox/Kconfig4
-rw-r--r--arch/sandbox/cpu/cpu.c8
-rw-r--r--arch/sandbox/cpu/os.c13
3 files changed, 19 insertions, 6 deletions
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index 5f55c7f28e..852a7c8bf2 100644
--- a/arch/sandbox/Kconfig
+++ b/arch/sandbox/Kconfig
@@ -17,11 +17,11 @@ config SANDBOX64
config SANDBOX_RAM_SIZE_MB
int "RAM size in MiB"
- default 128
+ default 256
range 64 4095 if !SANDBOX64
range 64 268435456 if SANDBOX64
help
- Memory size of the sandbox in MiB. The default value is 128 MiB.
+ Memory size of the sandbox in MiB. The default value is 256 MiB.
The minimum value is 64 MiB. The maximum value is 4095 MiB for the
32bit sandbox.
diff --git a/arch/sandbox/cpu/cpu.c b/arch/sandbox/cpu/cpu.c
index 7a82798c36..d077948dd7 100644
--- a/arch/sandbox/cpu/cpu.c
+++ b/arch/sandbox/cpu/cpu.c
@@ -331,27 +331,27 @@ void *board_fdt_blob_setup(int *ret)
err = setup_auto_tree(blob);
if (!err)
goto done;
- printf("Unable to create empty FDT: %s\n", fdt_strerror(err));
+ os_printf("Unable to create empty FDT: %s\n", fdt_strerror(err));
*ret = -EINVAL;
goto fail;
}
err = os_get_filesize(fname, &size);
if (err < 0) {
- printf("Failed to find FDT file '%s'\n", fname);
+ os_printf("Failed to find FDT file '%s'\n", fname);
*ret = err;
goto fail;
}
fd = os_open(fname, OS_O_RDONLY);
if (fd < 0) {
- printf("Failed to open FDT file '%s'\n", fname);
+ os_printf("Failed to open FDT file '%s'\n", fname);
*ret = -EACCES;
goto fail;
}
if (os_read(fd, blob, size) != size) {
os_close(fd);
- printf("Failed to read FDT file '%s'\n", fname);
+ os_printf("Failed to read FDT file '%s'\n", fname);
*ret = -EIO;
goto fail;
}
diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index 3b230606a9..f937991139 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -12,6 +12,7 @@
#include <getopt.h>
#include <setjmp.h>
#include <signal.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -54,6 +55,18 @@ ssize_t os_write(int fd, const void *buf, size_t count)
return write(fd, buf, count);
}
+int os_printf(const char *fmt, ...)
+{
+ va_list args;
+ int i;
+
+ va_start(args, fmt);
+ i = vfprintf(stdout, fmt, args);
+ va_end(args);
+
+ return i;
+}
+
off_t os_lseek(int fd, off_t offset, int whence)
{
if (whence == OS_SEEK_SET)