blob: 813987eb660648cf17d6d6e1b656648220e5922e [file] [log] [blame]
Dmitry Shmidtf9bdef92014-04-25 10:46:36 -07001#ifndef PLATFORM_H
2#define PLATFORM_H
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -07003
Dmitry Shmidtf9bdef92014-04-25 10:46:36 -07004#include "includes.h"
5#include "common.h"
6
7#define le16_to_cpu le_to_host16
8#define le32_to_cpu le_to_host32
9
Dmitry Shmidt7dba0e52014-04-14 10:49:15 -070010#define get_unaligned(p) \
11({ \
12 struct packed_dummy_struct { \
13 typeof(*(p)) __val; \
14 } __attribute__((packed)) *__ptr = (void *) (p); \
15 \
16 __ptr->__val; \
17})
Dmitry Shmidt4ae50e62016-06-27 13:48:39 -070018#define get_unaligned_le16(p) le16_to_cpu(get_unaligned((le16 *)(p)))
19#define get_unaligned_le32(p) le32_to_cpu(get_unaligned((le32 *)(p)))
Dmitry Shmidtf9bdef92014-04-25 10:46:36 -070020
21#endif /* PLATFORM_H */