summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2017-08-18 12:36:36 +0300
committerDan McDonald <danmcd@joyent.com>2017-09-21 12:36:51 -0400
commit5f82aa32fbc5dc2c59bca6ff315f44a4c4c9ea86 (patch)
tree543087f5d3c82178e644d9e544ef9c1498618fb6
parentd042c5a26452797afc4fe8c2ceddebff94d88745 (diff)
downloadillumos-joyent-5f82aa32fbc5dc2c59bca6ff315f44a4c4c9ea86.tar.gz
8595 sys/ccompile.h: add __aligned and __packed
Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Approved by: Dan McDonald <danmcd@joyent.com> 8596 iwn: remove local __packed Reviewed by: Vitaliy Gusev <gusev.vitaliy@icloud.com> Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Reviewed by: C Fraire <cfraire@me.com> Approved by: Dan McDonald <danmcd@joyent.com> 8597 grub: use __aligned from ccompile.h Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Hans Rosenfeld <rosenfeld@grumpf.hope-2000.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/grub/grub-0.97/netboot/nic.c2
-rw-r--r--usr/src/grub/grub-0.97/netboot/osdep.h1
-rw-r--r--usr/src/uts/common/io/iwn/if_iwncompat.h1
-rw-r--r--usr/src/uts/common/sys/ccompile.h13
4 files changed, 6 insertions, 11 deletions
diff --git a/usr/src/grub/grub-0.97/netboot/nic.c b/usr/src/grub/grub-0.97/netboot/nic.c
index 23b8d59fc8..c2b025b51a 100644
--- a/usr/src/grub/grub-0.97/netboot/nic.c
+++ b/usr/src/grub/grub-0.97/netboot/nic.c
@@ -117,7 +117,7 @@ static int dummy(void *unused __unused)
* leaving the ethernet data 16 byte aligned. Beyond this
* we use memmove but this makes the common cast simple and fast.
*/
-static char packet[ETH_FRAME_LEN + ETH_DATA_ALIGN] __aligned;
+static char packet[ETH_FRAME_LEN + ETH_DATA_ALIGN] __aligned(16);
struct nic nic =
{
diff --git a/usr/src/grub/grub-0.97/netboot/osdep.h b/usr/src/grub/grub-0.97/netboot/osdep.h
index 03b8981d82..58925fedc7 100644
--- a/usr/src/grub/grub-0.97/netboot/osdep.h
+++ b/usr/src/grub/grub-0.97/netboot/osdep.h
@@ -2,7 +2,6 @@
#define _OSDEP_H
#define __unused __attribute__((unused))
-#define __aligned __attribute__((aligned(16)))
#include "io.h"
#include "byteswap.h"
diff --git a/usr/src/uts/common/io/iwn/if_iwncompat.h b/usr/src/uts/common/io/iwn/if_iwncompat.h
index 4e326bd2f7..8c0b61f69e 100644
--- a/usr/src/uts/common/io/iwn/if_iwncompat.h
+++ b/usr/src/uts/common/io/iwn/if_iwncompat.h
@@ -145,7 +145,6 @@
#define PCI_PRODUCT_INTEL_WIFI_LINK_6000_3X3_2 0x4238
#define __inline inline
-#define __packed __attribute__((packed))
#define __arraycount(x) ARRAY_SIZE(x)
#define abs(x) ABS(x)
diff --git a/usr/src/uts/common/sys/ccompile.h b/usr/src/uts/common/sys/ccompile.h
index 91f99b2962..3bfbc2fb5e 100644
--- a/usr/src/uts/common/sys/ccompile.h
+++ b/usr/src/uts/common/sys/ccompile.h
@@ -115,19 +115,13 @@ extern "C" {
*/
#define __sun_attr___const__ __attribute__((__const__))
-/*
- * structure packing like #pragma pack(1)
- */
-#define __sun_attr___packed__ __attribute__((__packed__))
-
+#if __GNUC_VERSION >= 20700
+#define __aligned(x) __attribute__((__aligned__(x)))
/*
* This attribute, attached to a variable, means that the variable is meant to
* be possibly unused. GCC will not produce a warning for this variable.
*/
-#if __GNUC_VERSION >= 20700
#define __sun_attr___unused__ __attribute__((__unused__))
-#else
-#define __sun_attr___unused__
#endif
#define ___sun_attr_inner(__a) __sun_attr_##__a
@@ -135,7 +129,9 @@ extern "C" {
#else /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
+#define __aligned(x)
#define __sun_attr__(__a)
+#define __sun_attr___unused__
#endif /* __ATTRIBUTE_IMPLEMENTED || __GNUC__ */
@@ -152,6 +148,7 @@ extern "C" {
#define __RETURNS_TWICE __sun_attr__((__returns_twice__))
#define __CONST __sun_attr__((__const__))
#define __PURE __sun_attr__((__pure__))
+#define __packed __attribute__((__packed__))
#define __unused __sun_attr__((__unused__))
#ifdef __cplusplus