From b4cf974a3256275fe2c03d8eaaf07a5e5b337cfc Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Thu, 27 Sep 2018 09:22:19 +0100 Subject: libc: Adapt strlcpy to this codebase Change-Id: I2f5f64aaf90caae936510e1179392a8835f493e0 Signed-off-by: Antonio Nino Diaz --- include/lib/libc/string.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/lib/libc/string.h b/include/lib/libc/string.h index 3c8e3b65e..ee6eeacef 100644 --- a/include/lib/libc/string.h +++ b/include/lib/libc/string.h @@ -28,5 +28,6 @@ void *memset(void *dst, int val, size_t count); size_t strlen(const char *s); size_t strnlen(const char *s, size_t maxlen); char *strrchr(const char *p, int ch); +size_t strlcpy(char * dst, const char * src, size_t dsize); #endif /* STRING_H */ -- cgit v1.2.3 From 2747362062d4286e47cb13dbdfddfebc6d355dca Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Tue, 26 Jun 2018 10:34:07 +0100 Subject: Introduce new fdt helper to read string properties Introduced fdtw_read_string() to read string properties. Change-Id: I854eef0390632cf2eaddd2dce60cdb98c117de43 Signed-off-by: Antonio Nino Diaz --- include/common/fdt_wrappers.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/common/fdt_wrappers.h b/include/common/fdt_wrappers.h index 3eae944e5..a0fe6b753 100644 --- a/include/common/fdt_wrappers.h +++ b/include/common/fdt_wrappers.h @@ -14,6 +14,9 @@ int fdtw_read_cells(const void *dtb, int node, const char *prop, unsigned int cells, void *value); +int fdtw_read_string(const void *dtb, int node, const char *prop, + char *str, size_t size); int fdtw_write_inplace_cells(void *dtb, int node, const char *prop, unsigned int cells, void *value); + #endif /* __FDT_WRAPPERS__ */ -- cgit v1.2.3 From 73f1ac6c8ee4a688ed8e1fddc040b882171d3453 Mon Sep 17 00:00:00 2001 From: Antonio Nino Diaz Date: Tue, 26 Jun 2018 10:34:10 +0100 Subject: Introduce fdtw_read_array() helper fdtw_read_cells() can only read one or two cells, sometimes it may be needed to read more cells from one property. Change-Id: Ie70dc76d1540cd6a04787cde7cccb4d1bafc7282 Signed-off-by: Antonio Nino Diaz --- include/common/fdt_wrappers.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/common/fdt_wrappers.h b/include/common/fdt_wrappers.h index a0fe6b753..c8d753f9a 100644 --- a/include/common/fdt_wrappers.h +++ b/include/common/fdt_wrappers.h @@ -14,6 +14,8 @@ int fdtw_read_cells(const void *dtb, int node, const char *prop, unsigned int cells, void *value); +int fdtw_read_array(const void *dtb, int node, const char *prop, + unsigned int cells, void *value); int fdtw_read_string(const void *dtb, int node, const char *prop, char *str, size_t size); int fdtw_write_inplace_cells(void *dtb, int node, const char *prop, -- cgit v1.2.3