X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=include%2Fos.h;h=c8e0f52d306345ac91d2a57d3dffe913e98e3764;hb=896019b18b0a6f9392fa234c082ef492e1630cc3;hp=2bf4bdb1b8369a48b3c3f6ec89d8889b97bd685c;hpb=19d1f1a2f3ccfbf85125150f7876ce22714b38bd;p=u-boot diff --git a/include/os.h b/include/os.h index 2bf4bdb1b8..c8e0f52d30 100644 --- a/include/os.h +++ b/include/os.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ /* * Operating System Interface * @@ -5,7 +6,6 @@ * They are kept in a separate file so we can include system headers. * * Copyright (c) 2011 The Chromium OS Authors. - * SPDX-License-Identifier: GPL-2.0+ */ #ifndef __OS_H__ @@ -240,6 +240,26 @@ const char *os_dirent_get_typename(enum os_dirent_t type); */ int os_get_filesize(const char *fname, loff_t *size); +/** + * Write a character to the controlling OS terminal + * + * This bypasses the U-Boot console support and writes directly to the OS + * stdout file descriptor. + * + * @param ch Character to write + */ +void os_putc(int ch); + +/** + * Write a string to the controlling OS terminal + * + * This bypasses the U-Boot console support and writes directly to the OS + * stdout file descriptor. + * + * @param str String to write (note that \n is not appended) + */ +void os_puts(const char *str); + /** * Write the sandbox RAM buffer to a existing file * @@ -310,4 +330,25 @@ int os_spl_to_uboot(const char *fname); */ void os_localtime(struct rtc_time *rt); +/** + * os_setjmp() - Call setjmp() + * + * Call the host system's setjmp() function. + * + * @jmp: Buffer to store current execution state + * @size: Size of buffer + * @return normal setjmp() value if OK, -ENOSPC if @size is too small + */ +int os_setjmp(ulong *jmp, int size); + +/** + * os_longjmp() - Call longjmp() + * + * Call the host system's longjmp() function. + * + * @jmp: Buffer where previous execution state was stored + * @ret: Value to pass to longjmp() + */ +void os_longjmp(ulong *jmp, int ret); + #endif