diff options
| author | Nathan Lee <me@nwlee.tech> | 2026-06-19 19:05:01 -0500 |
|---|---|---|
| committer | Nathan Lee <me@nwlee.tech> | 2026-06-19 19:05:01 -0500 |
| commit | 5c15e93fa87800b1f8fae7ef688a9d41221526f1 (patch) | |
| tree | 2b8ed7b696edc9889b588dd79db14c564ea9a77e /include/common.h | |
| parent | b106df2447d23d6b3fcffa7cc87edde218d054f3 (diff) | |
create dtb allocator
the parent commit (b106df2447d23d6b3fcffa7cc87edde218d054f3) discussed
the possibility of creating dtb device discovery. for that, we have
replaced wdt device discovery with dtb device discovery. in the future,
we will use the pci kernel module to use device discovery via a PCI
controller
Diffstat (limited to 'include/common.h')
| -rw-r--r-- | include/common.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/common.h b/include/common.h new file mode 100644 index 0000000..86f1f9c --- /dev/null +++ b/include/common.h @@ -0,0 +1,19 @@ +#pragma once +#include <types.h> + +static inline size_t strlen(const char *s) { + size_t len = 0; + while (*s++) { + ++len; + } + return len; +} +static inline int strcmp(const char *str1, const char* str2) { + while (*str1 && (*str1 == *str2)) { + ++str1; + ++str2; + } + return *(const unsigned char *)str1 - *(const unsigned char *)str2; +} + + |
