Add get_unaligned_le16, put_unaligned_le16.

This commit is contained in:
riastradh 2015-02-25 15:01:03 +00:00
parent 4dce353130
commit 13a0a37bad

View File

@ -1,4 +1,4 @@
/* $NetBSD: unaligned.h,v 1.2 2015/02/25 14:36:58 riastradh Exp $ */
/* $NetBSD: unaligned.h,v 1.3 2015/02/25 15:01:03 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@ -34,6 +34,20 @@
#include <sys/endian.h>
static inline uint16_t
get_unaligned_le16(const void *p)
{
return le16dec(p);
}
static inline void
put_unaligned_le16(uint16_t v, void *p)
{
return le16enc(p, v);
}
static inline uint32_t
get_unaligned_le32(const void *p)
{