From 7ba7c1dd86cf212c7d489dbf0a07301d1a3b4d2c Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 10 Jan 2025 17:00:03 -0700 Subject: abuf: Provide a constant buffer Add a new initialiser which can accept a constant pointer. Signed-off-by: Simon Glass --- lib/abuf.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/abuf.c') diff --git a/lib/abuf.c b/lib/abuf.c index 8156177c773..61adf7fc6b1 100644 --- a/lib/abuf.c +++ b/lib/abuf.c @@ -119,6 +119,12 @@ void abuf_init_set(struct abuf *abuf, void *data, size_t size) abuf_set(abuf, data, size); } +void abuf_init_const(struct abuf *abuf, const void *data, size_t size) +{ + /* for now there is no flag indicating that the abuf data is constant */ + abuf_init_set(abuf, (void *)data, size); +} + void abuf_init_move(struct abuf *abuf, void *data, size_t size) { abuf_init_set(abuf, data, size); -- cgit v1.2.3