From f9e23e6e41068d63d42f950941c3d2fc155ef21c Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 18 Jul 2024 17:39:15 +0300 Subject: add ipc_tail() + ipc_kick() does a forward and a tail at the same time The idea with ipc_tail() is to allow 'trusted' calls, so for example a process is not allowed to willy-nilly open a file, as it has to go via init(), making the eid 1. This way the receiver can know that the request has gone through init() and can open up a new connection (file, whatever) after which requests from that pid/tid are allowed without init() intervention --- src/bits.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/bits.c') diff --git a/src/bits.c b/src/bits.c index 6bc3032..d5968f1 100644 --- a/src/bits.c +++ b/src/bits.c @@ -17,7 +17,13 @@ __weak uint16_t __bswap16(const uint16_t u) return (u & 0xff00) >> 8 | (u & 0x00ff) << 8; } -uint16_t __bswaphi2(uint16_t u) +/** + * Wrapper for gcc builtins, if arch doesn't have it. + * + * @param u Value to byteswap. + * @return \p u byteswapped. + */ +__used uint16_t __bswaphi2(uint16_t u) { return __bswap16(u); } @@ -29,7 +35,13 @@ __weak uint32_t __bswap32(const uint32_t u) (u & 0x0000ff00) << 8 | (u & 0x000000ff) << 24; } -uint32_t __bswapsi2(uint32_t u) +/** + * Wrapper for gcc builtins, if arch doesn't have it. + * + * @param u Value to byteswap. + * @return \p u byteswapped. + */ +__used uint32_t __bswapsi2(uint32_t u) { return __bswap32(u); } @@ -47,7 +59,13 @@ __weak uint64_t __bswap64(const uint64_t u) (u & 0x00000000000000ffULL) << 56; } -uint64_t __bswapdi2(uint64_t u) +/** + * Wrapper for gcc builtins, if arch doesn't have it. + * + * @param u Value to byteswap. + * @return \p u byteswapped. + */ +__used uint64_t __bswapdi2(uint64_t u) { return __bswap64(u); } -- cgit v1.3