summaryrefslogtreecommitdiff
path: root/libhw_cr
diff options
context:
space:
mode:
Diffstat (limited to 'libhw_cr')
-rw-r--r--libhw_cr/host_alarmclock.c2
-rw-r--r--libhw_cr/host_include/libhw/host_alarmclock.h6
-rw-r--r--libhw_cr/host_include/libhw/host_net.h18
-rw-r--r--libhw_cr/host_net.c24
-rw-r--r--libhw_cr/rp2040_hwspi.c4
-rw-r--r--libhw_cr/rp2040_include/libhw/rp2040_hwspi.h8
-rw-r--r--libhw_cr/rp2040_include/libhw/w5500.h30
-rw-r--r--libhw_cr/w5500.c26
8 files changed, 59 insertions, 59 deletions
diff --git a/libhw_cr/host_alarmclock.c b/libhw_cr/host_alarmclock.c
index 2f255e0..9eedec2 100644
--- a/libhw_cr/host_alarmclock.c
+++ b/libhw_cr/host_alarmclock.c
@@ -19,7 +19,7 @@
#include "host_util.h" /* for host_sigrt_alloc(), ns_to_host_ns_time() */
-LO_IMPLEMENTATION_C(alarmclock, struct hostclock, hostclock, static)
+LO_IMPLEMENTATION_C(alarmclock, struct hostclock, hostclock, static);
static uint64_t hostclock_get_time_ns(struct hostclock *alarmclock) {
assert(alarmclock);
diff --git a/libhw_cr/host_include/libhw/host_alarmclock.h b/libhw_cr/host_include/libhw/host_alarmclock.h
index 89df68a..0cb8d30 100644
--- a/libhw_cr/host_include/libhw/host_alarmclock.h
+++ b/libhw_cr/host_include/libhw/host_alarmclock.h
@@ -16,12 +16,12 @@
struct hostclock {
clockid_t clock_id;
- BEGIN_PRIVATE(LIBHW_HOST_ALARMCLOCK_H)
+ BEGIN_PRIVATE(LIBHW_HOST_ALARMCLOCK_H);
bool initialized;
timer_t timer_id;
struct alarmclock_trigger *queue;
- END_PRIVATE(LIBHW_HOST_ALARMCLOCK_H)
+ END_PRIVATE(LIBHW_HOST_ALARMCLOCK_H);
};
-LO_IMPLEMENTATION_H(alarmclock, struct hostclock, hostclock)
+LO_IMPLEMENTATION_H(alarmclock, struct hostclock, hostclock);
#endif /* _LIBHW_HOST_ALARMCLOCK_H_ */
diff --git a/libhw_cr/host_include/libhw/host_net.h b/libhw_cr/host_include/libhw/host_net.h
index fced229..a16ed01 100644
--- a/libhw_cr/host_include/libhw/host_net.h
+++ b/libhw_cr/host_include/libhw/host_net.h
@@ -14,30 +14,30 @@
#include <libhw/generic/net.h>
struct _hostnet_tcp_conn {
- BEGIN_PRIVATE(LIBHW_HOST_NET_H)
+ BEGIN_PRIVATE(LIBHW_HOST_NET_H);
int fd;
uint64_t read_deadline_ns;
- END_PRIVATE(LIBHW_HOST_NET_H)
+ END_PRIVATE(LIBHW_HOST_NET_H);
};
-LO_IMPLEMENTATION_H(net_stream_conn, struct _hostnet_tcp_conn, hostnet_tcp)
+LO_IMPLEMENTATION_H(net_stream_conn, struct _hostnet_tcp_conn, hostnet_tcp);
struct hostnet_tcp_listener {
- BEGIN_PRIVATE(LIBHW_HOST_NET_H)
+ BEGIN_PRIVATE(LIBHW_HOST_NET_H);
int fd;
struct _hostnet_tcp_conn active_conn;
- END_PRIVATE(LIBHW_HOST_NET_H)
+ END_PRIVATE(LIBHW_HOST_NET_H);
};
-LO_IMPLEMENTATION_H(net_stream_listener, struct hostnet_tcp_listener, hostnet_tcplist)
+LO_IMPLEMENTATION_H(net_stream_listener, struct hostnet_tcp_listener, hostnet_tcplist);
void hostnet_tcp_listener_init(struct hostnet_tcp_listener *self, uint16_t port);
struct hostnet_udp_conn {
- BEGIN_PRIVATE(LIBHW_HOST_NET_H)
+ BEGIN_PRIVATE(LIBHW_HOST_NET_H);
int fd;
uint64_t read_deadline_ns;
- END_PRIVATE(LIBHW_HOST_NET_H)
+ END_PRIVATE(LIBHW_HOST_NET_H);
};
-LO_IMPLEMENTATION_H(net_packet_conn, struct hostnet_udp_conn, hostnet_udp)
+LO_IMPLEMENTATION_H(net_packet_conn, struct hostnet_udp_conn, hostnet_udp);
void hostnet_udp_conn_init(struct hostnet_udp_conn *self, uint16_t port);
diff --git a/libhw_cr/host_net.c b/libhw_cr/host_net.c
index f1c988c..6ed6e46 100644
--- a/libhw_cr/host_net.c
+++ b/libhw_cr/host_net.c
@@ -30,18 +30,18 @@
#include "host_util.h" /* for host_sigrt_alloc(), ns_to_host_us_time() */
-LO_IMPLEMENTATION_C(io_closer, struct hostnet_tcp_listener, hostnet_tcplist, static)
-LO_IMPLEMENTATION_C(net_stream_listener, struct hostnet_tcp_listener, hostnet_tcplist, static)
-
-LO_IMPLEMENTATION_C(io_reader, struct _hostnet_tcp_conn, hostnet_tcp, static)
-LO_IMPLEMENTATION_C(io_writer, struct _hostnet_tcp_conn, hostnet_tcp, static)
-LO_IMPLEMENTATION_C(io_readwriter, struct _hostnet_tcp_conn, hostnet_tcp, static)
-LO_IMPLEMENTATION_C(io_closer, struct _hostnet_tcp_conn, hostnet_tcp, static)
-LO_IMPLEMENTATION_C(io_bidi_closer, struct _hostnet_tcp_conn, hostnet_tcp, static)
-LO_IMPLEMENTATION_C(net_stream_conn, struct _hostnet_tcp_conn, hostnet_tcp, static)
-
-LO_IMPLEMENTATION_C(io_closer, struct hostnet_udp_conn, hostnet_udp, static)
-LO_IMPLEMENTATION_C(net_packet_conn, struct hostnet_udp_conn, hostnet_udp, static)
+LO_IMPLEMENTATION_C(io_closer, struct hostnet_tcp_listener, hostnet_tcplist, static);
+LO_IMPLEMENTATION_C(net_stream_listener, struct hostnet_tcp_listener, hostnet_tcplist, static);
+
+LO_IMPLEMENTATION_C(io_reader, struct _hostnet_tcp_conn, hostnet_tcp, static);
+LO_IMPLEMENTATION_C(io_writer, struct _hostnet_tcp_conn, hostnet_tcp, static);
+LO_IMPLEMENTATION_C(io_readwriter, struct _hostnet_tcp_conn, hostnet_tcp, static);
+LO_IMPLEMENTATION_C(io_closer, struct _hostnet_tcp_conn, hostnet_tcp, static);
+LO_IMPLEMENTATION_C(io_bidi_closer, struct _hostnet_tcp_conn, hostnet_tcp, static);
+LO_IMPLEMENTATION_C(net_stream_conn, struct _hostnet_tcp_conn, hostnet_tcp, static);
+
+LO_IMPLEMENTATION_C(io_closer, struct hostnet_udp_conn, hostnet_udp, static);
+LO_IMPLEMENTATION_C(net_packet_conn, struct hostnet_udp_conn, hostnet_udp, static);
/* common *********************************************************************/
diff --git a/libhw_cr/rp2040_hwspi.c b/libhw_cr/rp2040_hwspi.c
index 58513f4..646d8ba 100644
--- a/libhw_cr/rp2040_hwspi.c
+++ b/libhw_cr/rp2040_hwspi.c
@@ -30,8 +30,8 @@
#error config.h must define CONFIG_RP2040_SPI_DEBUG (bool)
#endif
-LO_IMPLEMENTATION_C(io_duplex_readwriter, struct rp2040_hwspi, rp2040_hwspi, static)
-LO_IMPLEMENTATION_C(spi, struct rp2040_hwspi, rp2040_hwspi, static)
+LO_IMPLEMENTATION_C(io_duplex_readwriter, struct rp2040_hwspi, rp2040_hwspi, static);
+LO_IMPLEMENTATION_C(spi, struct rp2040_hwspi, rp2040_hwspi, static);
static void rp2040_hwspi_intrhandler(void *_self, enum dmairq LM_UNUSED(irq), uint LM_UNUSED(channel)) {
struct rp2040_hwspi *self = _self;
diff --git a/libhw_cr/rp2040_include/libhw/rp2040_hwspi.h b/libhw_cr/rp2040_include/libhw/rp2040_hwspi.h
index 9d99f7b..4951136 100644
--- a/libhw_cr/rp2040_include/libhw/rp2040_hwspi.h
+++ b/libhw_cr/rp2040_include/libhw/rp2040_hwspi.h
@@ -20,7 +20,7 @@ enum rp2040_hwspi_instance {
};
struct rp2040_hwspi {
- BEGIN_PRIVATE(LIBHW_RP2040_HWSPI_H)
+ BEGIN_PRIVATE(LIBHW_RP2040_HWSPI_H);
/* const */
LM_IF(IS_IMPLEMENTATION_FOR(LIBHW_RP2040_HWSPI_H))(spi_inst_t)(void) *inst;
uint64_t min_delay_ns;
@@ -34,10 +34,10 @@ struct rp2040_hwspi {
/* mutable */
uint64_t dead_until_ns;
cr_sema_t sema;
- END_PRIVATE(LIBHW_RP2040_HWSPI_H)
+ END_PRIVATE(LIBHW_RP2040_HWSPI_H);
};
-LO_IMPLEMENTATION_H(io_duplex_readwriter, struct rp2040_hwspi, rp2040_hwspi)
-LO_IMPLEMENTATION_H(spi, struct rp2040_hwspi, rp2040_hwspi)
+LO_IMPLEMENTATION_H(io_duplex_readwriter, struct rp2040_hwspi, rp2040_hwspi);
+LO_IMPLEMENTATION_H(spi, struct rp2040_hwspi, rp2040_hwspi);
/**
* Initialize an instance of `struct rp2040_hwspi`.
diff --git a/libhw_cr/rp2040_include/libhw/w5500.h b/libhw_cr/rp2040_include/libhw/w5500.h
index 51effba..8db6a58 100644
--- a/libhw_cr/rp2040_include/libhw/w5500.h
+++ b/libhw_cr/rp2040_include/libhw/w5500.h
@@ -20,7 +20,7 @@
CR_CHAN_DECLARE(_w5500_sockintr_ch, uint8_t)
struct _w5500_socket {
- BEGIN_PRIVATE(LIBHW_W5500_H)
+ BEGIN_PRIVATE(LIBHW_W5500_H);
/* const-after-init */
uint8_t socknum;
@@ -38,24 +38,24 @@ struct _w5500_socket {
_w5500_sockintr_ch_t write_ch; /* MODE_{TCP,UDP} */
bool list_open, read_open, write_open; /* MODE_TCP */
- END_PRIVATE(LIBHW_W5500_H)
+ END_PRIVATE(LIBHW_W5500_H);
};
-LO_IMPLEMENTATION_H(io_closer, struct _w5500_socket, w5500_tcplist)
-LO_IMPLEMENTATION_H(net_stream_listener, struct _w5500_socket, w5500_tcplist)
+LO_IMPLEMENTATION_H(io_closer, struct _w5500_socket, w5500_tcplist);
+LO_IMPLEMENTATION_H(net_stream_listener, struct _w5500_socket, w5500_tcplist);
-LO_IMPLEMENTATION_H(io_reader, struct _w5500_socket, w5500_tcp)
-LO_IMPLEMENTATION_H(io_writer, struct _w5500_socket, w5500_tcp)
-LO_IMPLEMENTATION_H(io_readwriter, struct _w5500_socket, w5500_tcp)
-LO_IMPLEMENTATION_H(io_closer, struct _w5500_socket, w5500_tcp)
-LO_IMPLEMENTATION_H(io_bidi_closer, struct _w5500_socket, w5500_tcp)
-LO_IMPLEMENTATION_H(net_stream_conn, struct _w5500_socket, w5500_tcp)
+LO_IMPLEMENTATION_H(io_reader, struct _w5500_socket, w5500_tcp);
+LO_IMPLEMENTATION_H(io_writer, struct _w5500_socket, w5500_tcp);
+LO_IMPLEMENTATION_H(io_readwriter, struct _w5500_socket, w5500_tcp);
+LO_IMPLEMENTATION_H(io_closer, struct _w5500_socket, w5500_tcp);
+LO_IMPLEMENTATION_H(io_bidi_closer, struct _w5500_socket, w5500_tcp);
+LO_IMPLEMENTATION_H(net_stream_conn, struct _w5500_socket, w5500_tcp);
-LO_IMPLEMENTATION_H(io_closer, struct _w5500_socket, w5500_udp)
-LO_IMPLEMENTATION_H(net_packet_conn, struct _w5500_socket, w5500_udp)
+LO_IMPLEMENTATION_H(io_closer, struct _w5500_socket, w5500_udp);
+LO_IMPLEMENTATION_H(net_packet_conn, struct _w5500_socket, w5500_udp);
struct w5500 {
- BEGIN_PRIVATE(LIBHW_W5500_H)
+ BEGIN_PRIVATE(LIBHW_W5500_H);
/* const-after-init */
lo_interface spi spidev;
uint pin_intr;
@@ -68,9 +68,9 @@ struct w5500 {
struct _w5500_socket *free;
cr_sema_t intr;
cr_mutex_t mu;
- END_PRIVATE(LIBHW_W5500_H)
+ END_PRIVATE(LIBHW_W5500_H);
};
-LO_IMPLEMENTATION_H(net_iface, struct w5500, w5500_if)
+LO_IMPLEMENTATION_H(net_iface, struct w5500, w5500_if);
/**
* Initialize a WIZnet W5500 Ethernet-and-TCP/IP-offload chip.
diff --git a/libhw_cr/w5500.c b/libhw_cr/w5500.c
index 295add2..fa427d9 100644
--- a/libhw_cr/w5500.c
+++ b/libhw_cr/w5500.c
@@ -126,20 +126,20 @@ static const char *w5500_state_str(uint8_t state) {
/* libobj *********************************************************************/
-LO_IMPLEMENTATION_C(io_closer, struct _w5500_socket, w5500_tcplist, static)
-LO_IMPLEMENTATION_C(net_stream_listener, struct _w5500_socket, w5500_tcplist, static)
+LO_IMPLEMENTATION_C(io_closer, struct _w5500_socket, w5500_tcplist, static);
+LO_IMPLEMENTATION_C(net_stream_listener, struct _w5500_socket, w5500_tcplist, static);
-LO_IMPLEMENTATION_C(io_reader, struct _w5500_socket, w5500_tcp, static)
-LO_IMPLEMENTATION_C(io_writer, struct _w5500_socket, w5500_tcp, static)
-LO_IMPLEMENTATION_C(io_readwriter, struct _w5500_socket, w5500_tcp, static)
-LO_IMPLEMENTATION_C(io_closer, struct _w5500_socket, w5500_tcp, static)
-LO_IMPLEMENTATION_C(io_bidi_closer, struct _w5500_socket, w5500_tcp, static)
-LO_IMPLEMENTATION_C(net_stream_conn, struct _w5500_socket, w5500_tcp, static)
+LO_IMPLEMENTATION_C(io_reader, struct _w5500_socket, w5500_tcp, static);
+LO_IMPLEMENTATION_C(io_writer, struct _w5500_socket, w5500_tcp, static);
+LO_IMPLEMENTATION_C(io_readwriter, struct _w5500_socket, w5500_tcp, static);
+LO_IMPLEMENTATION_C(io_closer, struct _w5500_socket, w5500_tcp, static);
+LO_IMPLEMENTATION_C(io_bidi_closer, struct _w5500_socket, w5500_tcp, static);
+LO_IMPLEMENTATION_C(net_stream_conn, struct _w5500_socket, w5500_tcp, static);
-LO_IMPLEMENTATION_C(io_closer, struct _w5500_socket, w5500_udp, static)
-LO_IMPLEMENTATION_C(net_packet_conn, struct _w5500_socket, w5500_udp, static)
+LO_IMPLEMENTATION_C(io_closer, struct _w5500_socket, w5500_udp, static);
+LO_IMPLEMENTATION_C(net_packet_conn, struct _w5500_socket, w5500_udp, static);
-LO_IMPLEMENTATION_C(net_iface, struct w5500, w5500_if, static)
+LO_IMPLEMENTATION_C(net_iface, struct w5500, w5500_if, static);
/* mid-level utilities ********************************************************/
@@ -706,7 +706,7 @@ static ssize_t w5500_tcp_readv(struct _w5500_socket *socket, const struct iovec
if (count == 0)
return 0;
- struct alarmclock_trigger trigger = {0};
+ struct alarmclock_trigger trigger = {};
if (socket->read_deadline_ns)
LO_CALL(bootclock, add_trigger, &trigger,
socket->read_deadline_ns,
@@ -885,7 +885,7 @@ static ssize_t w5500_udp_recvfrom(struct _w5500_socket *socket, void *buf, size_
assert(buf);
assert(count);
- struct alarmclock_trigger trigger = {0};
+ struct alarmclock_trigger trigger = {};
if (socket->read_deadline_ns)
LO_CALL(bootclock, add_trigger, &trigger,
socket->read_deadline_ns,