diff options
Diffstat (limited to 'arch/sandbox/os/common.c')
-rw-r--r-- | arch/sandbox/os/common.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/arch/sandbox/os/common.c b/arch/sandbox/os/common.c index 0a4b96a63e..0dedfe19f4 100644 --- a/arch/sandbox/os/common.c +++ b/arch/sandbox/os/common.c @@ -49,6 +49,9 @@ #include <mach/linux.h> #include <mach/hostfile.h> +int sdl_xres; +int sdl_yres; + static struct termios term_orig, term_vi; static char erase_char; /* the users erase character */ @@ -275,10 +278,12 @@ static struct option long_options[] = { {"env", 1, 0, 'e'}, {"stdout", 1, 0, 'O'}, {"stdin", 1, 0, 'I'}, + {"xres", 1, 0, 'x'}, + {"yres", 1, 0, 'y'}, {0, 0, 0, 0}, }; -static const char optstring[] = "hm:i:e:O:I:"; +static const char optstring[] = "hm:i:e:O:I:x:y:"; int main(int argc, char *argv[]) { @@ -303,6 +308,8 @@ int main(int argc, char *argv[]) case 'm': malloc_size = strtoul(optarg, NULL, 0); break; + case 'i': + break; case 'e': sprintf(str, "env%d", envno); ret = add_image(optarg, str); @@ -328,6 +335,12 @@ int main(int argc, char *argv[]) barebox_register_console("cin", fd, -1); break; + case 'x': + sdl_xres = strtoul(optarg, NULL, 0); + break; + case 'y': + sdl_yres = strtoul(optarg, NULL, 0); + break; default: exit(1); } @@ -340,7 +353,11 @@ int main(int argc, char *argv[]) } mem_malloc_init(ram, ram + malloc_size - 1); - /* reset getopt */ + /* + * Reset getopt. + * We need to run a second getopt to count -i parameters. + * This is for /dev/fd# devices. + */ optind = 1; while (1) { @@ -396,7 +413,9 @@ static void print_usage(const char *prgname) " -O, --stdout=<file> Register a file as a console capable of doing stdout.\n" " <file> can be a regular file or a FIFO.\n" " -I, --stdin=<file> Register a file as a console capable of doing stdin.\n" -" <file> can be a regular file or a FIFO.\n", +" <file> can be a regular file or a FIFO.\n" +" -x, --xres=<res> SDL width.\n" +" -y, --yres=<res> SDL height.\n", prgname ); } @@ -436,6 +455,14 @@ static void print_usage(const char *prgname) * Register \<file\> as a console capable of doing stdin. \<file\> can be a regular * file or a fifo. * + * -x, --xres \<res\> + * + * Specify SDL width + * + * -y, --yres \<res\> + * + * Specify SDL height + * * @section simu_dbg How to debug barebox simulator * */ |