summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-01-23 14:35:11 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-01-23 14:35:11 +0000
commit43e67213704bfbc638eec70a87001f7c69c33447 (patch)
tree70f132383b14d2a234c6b34626309acac9c6fd70
parentaae7cfb9807fd7452e6662fc9f6c3ebe0e64dbf5 (diff)
Remove sdp_{get|put}_unaligned definition
-rw-r--r--include/sdp_internal.h97
1 files changed, 0 insertions, 97 deletions
diff --git a/include/sdp_internal.h b/include/sdp_internal.h
index 5d6ed7f9..2e0e343b 100644
--- a/include/sdp_internal.h
+++ b/include/sdp_internal.h
@@ -55,103 +55,6 @@ extern "C" {
#define SDP_UUID_SEQ_SIZE 256
#define SDP_MAX_ATTR_LEN 65535
-/*
- * SDP unaligned access.
- * based on linux/asm-<arch>/unaligned.h
- */
-#if defined(__i386__)
-
-#define sdp_get_unaligned(ptr) (*(ptr))
-#define sdp_put_unaligned(val, ptr) ((void)( *(ptr) = (val) ))
-
-#else
-
-struct __una_u64 { uint64_t x; } __attribute__((packed));
-struct __una_u32 { uint32_t x; } __attribute__((packed));
-struct __una_u16 { uint16_t x; } __attribute__((packed));
-
-static inline unsigned long long __uldq(const unsigned long *r11)
-{
- const struct __una_u64 *ptr = (const struct __una_u64 *) r11;
- return ptr->x;
-}
-
-static inline unsigned long __uldl(const unsigned int * r11)
-{
- const struct __una_u32 *ptr = (const struct __una_u32 *) r11;
- return ptr->x;
-}
-
-static inline unsigned long __uldw(const unsigned short * r11)
-{
- const struct __una_u16 *ptr = (const struct __una_u16 *) r11;
- return ptr->x;
-}
-
-static inline void __ustq(unsigned long r5, unsigned long * r11)
-{
- struct __una_u64 *ptr = (struct __una_u64 *) r11;
- ptr->x = r5;
-}
-
-static inline void __ustl(unsigned long r5, unsigned int * r11)
-{
- struct __una_u32 *ptr = (struct __una_u32 *) r11;
- ptr->x = r5;
-}
-
-static inline void __ustw(unsigned long r5, unsigned short * r11)
-{
- struct __una_u16 *ptr = (struct __una_u16 *) r11;
- ptr->x = r5;
-}
-
-static inline unsigned long long __sdp_get_unaligned(const void *ptr, size_t size)
-{
- unsigned long long val = 0;
- switch (size) {
- case 1:
- val = *(const unsigned char *)ptr;
- break;
- case 2:
- val = __uldw((const unsigned short *)ptr);
- break;
- case 4:
- val = __uldl((const unsigned int *)ptr);
- break;
- case 8:
- val = __uldq((const unsigned long *)ptr);
- break;
- }
- return val;
-}
-
-static inline void __sdp_put_unaligned(unsigned long val, void *ptr, size_t size)
-{
- switch (size) {
- case 1:
- *(unsigned char *)ptr = (val);
- break;
- case 2:
- __ustw(val, (unsigned short *)ptr);
- break;
- case 4:
- __ustl(val, (unsigned int *)ptr);
- break;
- case 8:
- __ustq(val, (unsigned long *)ptr);
- break;
- }
-}
-
-#define sdp_get_unaligned(ptr) \
- ((__typeof__(*(ptr)))__sdp_get_unaligned((ptr), sizeof(*(ptr))))
-
-#define sdp_put_unaligned(x,ptr) \
- __sdp_put_unaligned((unsigned long)(x), (ptr), sizeof(*(ptr)))
-
-#endif
-
#if __BYTE_ORDER == __BIG_ENDIAN
#define ntoh64(x) x
static inline void ntoh128(uint128_t *src, uint128_t *dst)