summaryrefslogtreecommitdiff
path: root/libhw_cr/w5500_ll.h
diff options
context:
space:
mode:
Diffstat (limited to 'libhw_cr/w5500_ll.h')
-rw-r--r--libhw_cr/w5500_ll.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libhw_cr/w5500_ll.h b/libhw_cr/w5500_ll.h
index 2506cd2..8b98f9d 100644
--- a/libhw_cr/w5500_ll.h
+++ b/libhw_cr/w5500_ll.h
@@ -10,10 +10,10 @@
#ifndef _LIBHW_CR_W5500_LL_H_
#define _LIBHW_CR_W5500_LL_H_
-#include <alloca.h> /* for alloca() */
#include <stdint.h> /* for uint{n}_t */
#include <string.h> /* for memcmp() */
+#include <libmisc/alloc.h> /* for stack_alloc() */
#include <libmisc/assert.h> /* for assert(), static_assert() */
#include <libmisc/endian.h> /* for uint16be_t */
@@ -94,7 +94,7 @@ w5500ll_writev(
(block & CTL_MASK_BLOCK) | CTL_W | CTL_OM_VDM,
};
int inner_cnt = 1+io_slice_cnt(iov, iovcnt, skip, max);
- struct duplex_iovec *inner = alloca(sizeof(struct duplex_iovec)*inner_cnt);
+ struct duplex_iovec *inner = stack_alloc(inner_cnt, struct duplex_iovec);
inner[0] = (struct duplex_iovec){
.iov_read_to = IOVEC_DISCARD,
.iov_write_from = header,
@@ -131,7 +131,7 @@ w5500ll_readv(
(block & CTL_MASK_BLOCK) | CTL_R | CTL_OM_VDM,
};
int inner_cnt = 1+io_slice_cnt(iov, iovcnt, 0, max);
- struct duplex_iovec *inner = alloca(sizeof(struct duplex_iovec)*inner_cnt);
+ struct duplex_iovec *inner = stack_alloc(inner_cnt, struct duplex_iovec);
inner[0] = (struct duplex_iovec){
.iov_read_to = IOVEC_DISCARD,
.iov_write_from = header,