X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=include%2Fos.h;h=699682a4089beed0869c88fbf5974243aa647221;hb=7bf038ec21968eb3081529f257b7cd30474e6d62;hp=6b7ee474f04ddee319694d03e1c73eca47460f6c;hpb=d9165153caea9f342410ed3ac87cb68768ebec78;p=u-boot diff --git a/include/os.h b/include/os.h index 6b7ee474f0..699682a408 100644 --- a/include/os.h +++ b/include/os.h @@ -27,6 +27,8 @@ #ifndef __OS_H__ #define __OS_H__ +struct sandbox_state; + /** * Access to the OS read() system call * @@ -93,7 +95,7 @@ int os_close(int fd); * * @param exit_code exit code for U-Boot */ -void os_exit(int exit_code); +void os_exit(int exit_code) __attribute__((noreturn)); /** * Put tty into raw mode to mimic serial console better @@ -122,4 +124,16 @@ void os_usleep(unsigned long usec); */ u64 os_get_nsec(void); +/** + * Parse arguments and update sandbox state. + * + * @param state Sandbox state to update + * @param argc Argument count + * @param argv Argument vector + * @return 0 if ok, and program should continue; + * 1 if ok, but program should stop; + * -1 on error: program should terminate. + */ +int os_parse_args(struct sandbox_state *state, int argc, char *argv[]); + #endif