From 219c9d4b5d12b3b965da838eb467b955ef928170 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 23 Nov 2018 18:48:20 +0100 Subject: tls: code shrink function old new delta xwrite_encrypted 599 585 -14 Signed-off-by: Denys Vlasenko --- include/platform.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/platform.h b/include/platform.h index c365d5c..50365a3 100644 --- a/include/platform.h +++ b/include/platform.h @@ -236,6 +236,7 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING; # define move_from_unaligned32(v, u32p) ((v) = *(bb__aliased_uint32_t*)(u32p)) # define move_to_unaligned16(u16p, v) (*(bb__aliased_uint16_t*)(u16p) = (v)) # define move_to_unaligned32(u32p, v) (*(bb__aliased_uint32_t*)(u32p) = (v)) +# define move_to_unaligned64(u64p, v) (*(bb__aliased_uint64_t*)(u64p) = (v)) /* #elif ... - add your favorite arch today! */ #else # define BB_UNALIGNED_MEMACCESS_OK 0 @@ -252,6 +253,10 @@ typedef uint64_t bb__aliased_uint64_t FIX_ALIASING; uint32_t __t = (v); \ memcpy((u32p), &__t, 4); \ } while (0) +# define move_to_unaligned64(u64p, v) do { \ + uint64_t __t = (v); \ + memcpy((u64p), &__t, 8); \ +} while (0) #endif /* Unaligned, fixed-endian accessors */ -- cgit v1.1