[PATCH 26/27] libnetworking: Add machine/_align.h.

Christian Mauderer christian.mauderer at embedded-brains.de
Fri Jun 24 09:38:45 UTC 2016


From: Christian Mauderer <Christian.Mauderer at embedded-brains.de>

This is necessary for new sys/socket.h.
---
 cpukit/libnetworking/Makefile.am      |  3 ++-
 cpukit/libnetworking/machine/_align.h | 21 +++++++++++++++++++++
 cpukit/libnetworking/preinstall.am    |  4 ++++
 3 files changed, 27 insertions(+), 1 deletion(-)
 create mode 100644 cpukit/libnetworking/machine/_align.h

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..9b88892
--- /dev/null
+++ b/cpukit/libnetworking/machine/_align.h
@@ -0,0 +1,21 @@
+/*
+ * 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_
+
+#define	_ALIGNBYTES	(sizeof(long long) - 1)
+#define	_ALIGN(_p)	(((uintptr_t)(_p) + _ALIGNBYTES) & ~_ALIGNBYTES)
+
+#endif /* !_X86_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
-- 
1.8.4.5




More information about the devel mailing list