Add put_unaligned_leXX() for userspace

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2023-04-03 13:48:39 -07:00
committed by Auke Kok
parent 9491c784e7
commit 2c2c127c5e

View File

@@ -101,6 +101,16 @@ emit_get_unaligned_le(16)
emit_get_unaligned_le(32)
emit_get_unaligned_le(64)
#define emit_put_unaligned_le(nr) \
static inline void put_unaligned_le##nr(u##nr val, void *buf) \
{ \
__le##nr x = cpu_to_le##nr(val); \
memcpy(buf, &x, sizeof(x)); \
}
emit_put_unaligned_le(16)
emit_put_unaligned_le(32)
emit_put_unaligned_le(64)
/*
* return -1,0,+1 based on the memcmp comparison of the minimum of their
* two lengths. If their min shared bytes are equal but the lengths