aboutsummaryrefslogtreecommitdiff
path: root/pk
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2019-05-09 11:58:15 -0700
committerAndrew Waterman <andrew@sifive.com>2019-05-09 11:58:48 -0700
commitcb253a3f970b373df4390a0e7a17610556f920f3 (patch)
treecdeec747db424e00a8cdd9801eabb156a6fd7c71 /pk
parent9239d63942b92c3568ebda26258e49d2acacd229 (diff)
downloadriscv-pk-cb253a3f970b373df4390a0e7a17610556f920f3.zip
riscv-pk-cb253a3f970b373df4390a0e7a17610556f920f3.tar.gz
riscv-pk-cb253a3f970b373df4390a0e7a17610556f920f3.tar.bz2
Allow up to 2 KiB of arguments
Closes #161
Diffstat (limited to 'pk')
-rw-r--r--pk/pk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pk/pk.c b/pk/pk.c
index a149a42..b8b0b1c 100644
--- a/pk/pk.c
+++ b/pk/pk.c
@@ -29,7 +29,7 @@ static void handle_option(const char* s)
}
}
-#define MAX_ARGS 64
+#define MAX_ARGS 256
typedef union {
uint64_t buf[MAX_ARGS];
char* argv[MAX_ARGS];
@@ -38,6 +38,9 @@ typedef union {
static size_t parse_args(arg_buf* args)
{
long r = frontend_syscall(SYS_getmainvars, va2pa(args), sizeof(*args), 0, 0, 0, 0, 0);
+ if (r != 0)
+ panic("args must not exceed %d bytes", (int)sizeof(arg_buf));
+
kassert(r == 0);
uint64_t* pk_argv = &args->buf[1];
// pk_argv[0] is the proxy kernel itself. skip it and any flags.