diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/kmi/debug.h | 4 | ||||
| -rw-r--r-- | include/kmi/string.h | 15 |
2 files changed, 17 insertions, 2 deletions
diff --git a/include/kmi/debug.h b/include/kmi/debug.h index deca4ca..4079048 100644 --- a/include/kmi/debug.h +++ b/include/kmi/debug.h @@ -320,8 +320,8 @@ #if defined(DEBUG) /** Serial devices supported. */ enum serial_dev { - /** NS16550A and compatible. Currently the only supported serial device. */ - NS16550A, + /** 8250 and compatible. Currently the only supported serial device. */ + UART_8250, }; /** diff --git a/include/kmi/string.h b/include/kmi/string.h index 2b26a2d..f72299b 100644 --- a/include/kmi/string.h +++ b/include/kmi/string.h @@ -215,6 +215,21 @@ void *memmove(void *dst, const void *src, size_t num); */ int memcmp(const void *ptr1, const void *ptr2, size_t num); +/** + * Try to convert string \p s into a corresponding + * \c uintptr_t. Handles decimal, octal and hex, + * assuming hex starts with \c 0x or \c 0X and octal with + * \c 0, otherwise assumes decimal. Allows \c + and \c - in + * decimal. + * + * Note that u-boot likes to skip leading \c 0x when using hex, + * so if you're passing u-boot variables make sure to check prefixes. + * + * @param s String to convert to pointer. + * @return Corresponding pointer value. + */ +uintptr_t strtouintptr(const char *s); + /* Honorable mentions: * * char *strerror(int err); |
