[rtems commit] libnetworking: Add <machine/_align.h>

Sebastian Huber sebh at rtems.org
Tue Jun 28 13:20:13 UTC 2016


Module:    rtems
Branch:    master
Commit:    f0fc2c0e0242260dc75c981500803e983adba91e
Changeset: http://git.rtems.org/rtems/commit/?id=f0fc2c0e0242260dc75c981500803e983adba91e

Author:    Christian Mauderer <Christian.Mauderer at embedded-brains.de>
Date:      Fri Jun 24 10:25:17 2016 +0200

libnetworking: Add <machine/_align.h>

This is necessary for new <sys/socket.h>.

---

 cpukit/libnetworking/Makefile.am      |  3 ++-
 cpukit/libnetworking/machine/_align.h | 23 +++++++++++++++++++++++
 cpukit/libnetworking/preinstall.am    |  4 ++++
 3 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/cpukit/libnetworking/Makefile.am b/cpukit/libnetworking/Makefile.am
index 424bd25..5def014 100644
--- a/cpukit/libnetworking/Makefile.am
+++ b/cpukit/libnetworking/Makefile.am
@@ -51,7 +51,8 @@ libnetworking_a_SOURCES += kern/kern_mib.c kern/kern_subr.c \
 
 include_machinedir = $(includedir)/machine
 
-include_machine_HEADERS = machine/cpu.h
+include_machine_HEADERS = machine/_align.h
+include_machine_HEADERS += machine/cpu.h
 include_machine_HEADERS += machine/cpufunc.h
 include_machine_HEADERS += machine/in_cksum.h
 include_machine_HEADERS += machine/vmparam.h
diff --git a/cpukit/libnetworking/machine/_align.h b/cpukit/libnetworking/machine/_align.h
new file mode 100644
index 0000000..fa26a54
--- /dev/null
+++ b/cpukit/libnetworking/machine/_align.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.org/license/LICENSE.
+ */
+
+#ifndef _MACHINE_INCLUDE__ALIGN_H_
+#define	_MACHINE_INCLUDE__ALIGN_H_
+
+#include <sys/_types.h>
+
+#define	_ALIGNBYTES	(sizeof(long long) - 1)
+#define	_ALIGN(_p)	(((__uintptr_t)(_p) + _ALIGNBYTES) & ~_ALIGNBYTES)
+
+#endif /* !_MACHINE_INCLUDE__ALIGN_H_ */
diff --git a/cpukit/libnetworking/preinstall.am b/cpukit/libnetworking/preinstall.am
index 468f379..53f7026 100644
--- a/cpukit/libnetworking/preinstall.am
+++ b/cpukit/libnetworking/preinstall.am
@@ -57,6 +57,10 @@ $(PROJECT_INCLUDE)/machine/$(dirstamp):
 	@: > $(PROJECT_INCLUDE)/machine/$(dirstamp)
 PREINSTALL_DIRS += $(PROJECT_INCLUDE)/machine/$(dirstamp)
 
+$(PROJECT_INCLUDE)/machine/_align.h: machine/_align.h $(PROJECT_INCLUDE)/machine/$(dirstamp)
+	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/machine/_align.h
+PREINSTALL_FILES += $(PROJECT_INCLUDE)/machine/_align.h
+
 $(PROJECT_INCLUDE)/machine/cpu.h: machine/cpu.h $(PROJECT_INCLUDE)/machine/$(dirstamp)
 	$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/machine/cpu.h
 PREINSTALL_FILES += $(PROJECT_INCLUDE)/machine/cpu.h



More information about the vc mailing list