summaryrefslogtreecommitdiffstats
path: root/cpukit/score/cpu/powerpc
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2017-12-23 18:18:56 +1100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2018-01-25 08:45:26 +0100
commit2afb22b7e1ebcbe40373ff7e0efae7d207c655a9 (patch)
tree44759efe9374f13200a97e96d91bd9a2b7e5ce2a /cpukit/score/cpu/powerpc
parentMAINTAINERS: Add myself to Write After Approval. (diff)
downloadrtems-2afb22b7e1ebcbe40373ff7e0efae7d207c655a9.tar.bz2
Remove make preinstall
A speciality of the RTEMS build system was the make preinstall step. It copied header files from arbitrary locations into the build tree. The header files were included via the -Bsome/build/tree/path GCC command line option. This has at least seven problems: * The make preinstall step itself needs time and disk space. * Errors in header files show up in the build tree copy. This makes it hard for editors to open the right file to fix the error. * There is no clear relationship between source and build tree header files. This makes an audit of the build process difficult. * The visibility of all header files in the build tree makes it difficult to enforce API barriers. For example it is discouraged to use BSP-specifics in the cpukit. * An introduction of a new build system is difficult. * Include paths specified by the -B option are system headers. This may suppress warnings. * The parallel build had sporadic failures on some hosts. This patch removes the make preinstall step. All installed header files are moved to dedicated include directories in the source tree. Let @RTEMS_CPU@ be the target architecture, e.g. arm, powerpc, sparc, etc. Let @RTEMS_BSP_FAMILIY@ be a BSP family base directory, e.g. erc32, imx, qoriq, etc. The new cpukit include directories are: * cpukit/include * cpukit/score/cpu/@RTEMS_CPU@/include * cpukit/libnetworking The new BSP include directories are: * bsps/include * bsps/@RTEMS_CPU@/include * bsps/@RTEMS_CPU@/@RTEMS_BSP_FAMILIY@/include There are build tree include directories for generated files. The include directory order favours the most general header file, e.g. it is not possible to override general header files via the include path order. The "bootstrap -p" option was removed. The new "bootstrap -H" option should be used to regenerate the "headers.am" files. Update #3254.
Diffstat (limited to 'cpukit/score/cpu/powerpc')
-rw-r--r--cpukit/score/cpu/powerpc/Makefile.am15
-rw-r--r--cpukit/score/cpu/powerpc/headers.am21
-rw-r--r--cpukit/score/cpu/powerpc/include/machine/elf_machdep.h105
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/asm.h (renamed from cpukit/score/cpu/powerpc/rtems/asm.h)0
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/powerpc/registers.h (renamed from cpukit/score/cpu/powerpc/rtems/powerpc/registers.h)0
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/cpu.h (renamed from cpukit/score/cpu/powerpc/rtems/score/cpu.h)0
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/cpuatomic.h (renamed from cpukit/score/cpu/powerpc/rtems/score/cpuatomic.h)0
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h (renamed from cpukit/score/cpu/powerpc/rtems/score/cpuimpl.h)0
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/powerpc.h (renamed from cpukit/score/cpu/powerpc/rtems/score/powerpc.h)0
-rw-r--r--cpukit/score/cpu/powerpc/include/rtems/score/types.h (renamed from cpukit/score/cpu/powerpc/rtems/score/types.h)0
-rw-r--r--cpukit/score/cpu/powerpc/preinstall.am58
11 files changed, 127 insertions, 72 deletions
diff --git a/cpukit/score/cpu/powerpc/Makefile.am b/cpukit/score/cpu/powerpc/Makefile.am
index 7ed1f7996f..05ab2f480d 100644
--- a/cpukit/score/cpu/powerpc/Makefile.am
+++ b/cpukit/score/cpu/powerpc/Makefile.am
@@ -1,18 +1,5 @@
include $(top_srcdir)/automake/compile.am
-include_rtemsdir = $(includedir)/rtems
-include_rtems_HEADERS = rtems/asm.h
-
-include_rtems_scoredir = $(includedir)/rtems/score
-include_rtems_score_HEADERS = rtems/score/powerpc.h
-include_rtems_score_HEADERS += rtems/score/cpu.h
-include_rtems_score_HEADERS += rtems/score/cpuimpl.h
-include_rtems_score_HEADERS += rtems/score/types.h
-include_rtems_score_HEADERS += rtems/score/cpuatomic.h
-
-include_rtems_powerpcdir = $(includedir)/rtems/powerpc
-include_rtems_powerpc_HEADERS = rtems/powerpc/registers.h
-
noinst_LIBRARIES = libscorecpu.a
libscorecpu_a_SOURCES = cpu.c
libscorecpu_a_SOURCES += ppc-context-volatile-clobber.S
@@ -21,5 +8,5 @@ libscorecpu_a_SOURCES += ppc-isr-disable-mask.S
libscorecpu_a_SOURCES += ppc-isr-vector-install.c
libscorecpu_a_CPPFLAGS = $(AM_CPPFLAGS)
-include $(srcdir)/preinstall.am
include $(top_srcdir)/automake/local.am
+include $(srcdir)/headers.am
diff --git a/cpukit/score/cpu/powerpc/headers.am b/cpukit/score/cpu/powerpc/headers.am
new file mode 100644
index 0000000000..d8253e84f9
--- /dev/null
+++ b/cpukit/score/cpu/powerpc/headers.am
@@ -0,0 +1,21 @@
+## This file was generated by "./boostrap -H".
+
+include_machinedir = $(includedir)/machine
+include_machine_HEADERS =
+include_machine_HEADERS += include/machine/elf_machdep.h
+
+include_rtemsdir = $(includedir)/rtems
+include_rtems_HEADERS =
+include_rtems_HEADERS += include/rtems/asm.h
+
+include_rtems_powerpcdir = $(includedir)/rtems/powerpc
+include_rtems_powerpc_HEADERS =
+include_rtems_powerpc_HEADERS += include/rtems/powerpc/registers.h
+
+include_rtems_scoredir = $(includedir)/rtems/score
+include_rtems_score_HEADERS =
+include_rtems_score_HEADERS += include/rtems/score/cpu.h
+include_rtems_score_HEADERS += include/rtems/score/cpuatomic.h
+include_rtems_score_HEADERS += include/rtems/score/cpuimpl.h
+include_rtems_score_HEADERS += include/rtems/score/powerpc.h
+include_rtems_score_HEADERS += include/rtems/score/types.h
diff --git a/cpukit/score/cpu/powerpc/include/machine/elf_machdep.h b/cpukit/score/cpu/powerpc/include/machine/elf_machdep.h
new file mode 100644
index 0000000000..f0fdb3f33b
--- /dev/null
+++ b/cpukit/score/cpu/powerpc/include/machine/elf_machdep.h
@@ -0,0 +1,105 @@
+/* $NetBSD: elf_machdep.h,v 1.9 2011/01/15 10:00:07 matt Exp $ */
+
+#define ELF32_MACHDEP_ENDIANNESS ELFDATA2MSB
+#define ELF32_MACHDEP_ID_CASES \
+ case EM_PPC: \
+ break;
+
+#define ELF64_MACHDEP_ENDIANNESS ELFDATA2MSB
+#define ELF64_MACHDEP_ID_CASES \
+ case EM_PPC64: \
+ break;
+
+#define ELF32_MACHDEP_ID EM_PPC
+#define ELF64_MACHDEP_ID EM_PPC64
+
+#ifdef _LP64
+#define ARCH_ELFSIZE 64 /* MD native binary size */
+#else
+#define ARCH_ELFSIZE 32 /* MD native binary size */
+#endif
+
+/* Specify the value of _GLOBAL_OFFSET_TABLE_ */
+#define DT_PPC_GOT DT_LOPROC
+
+#define R_PPC_NONE 0
+#define R_PPC_32 1
+#define R_PPC_24 2
+#define R_PPC_16 3
+#define R_PPC_16_LO 4
+#define R_PPC_16_HI 5 /* R_PPC_ADDIS */
+#define R_PPC_16_HA 6
+#define R_PPC_14 7
+#define R_PPC_14_TAKEN 8
+#define R_PPC_14_NTAKEN 9
+#define R_PPC_REL24 10 /* R_PPC_BRANCH */
+#define R_PPC_REL14 11
+#define R_PPC_REL14_TAKEN 12
+#define R_PPC_REL14_NTAKEN 13
+#define R_PPC_GOT16 14
+#define R_PPC_GOT16_LO 15
+#define R_PPC_GOT16_HI 16
+#define R_PPC_GOT16_HA 17
+#define R_PPC_PLT24 18
+#define R_PPC_COPY 19
+#define R_PPC_GLOB_DAT 20
+#define R_PPC_JMP_SLOT 21
+#define R_PPC_RELATIVE 22
+#define R_PPC_LOCAL24PC 23
+#define R_PPC_U32 24
+#define R_PPC_U16 25
+#define R_PPC_REL32 26
+#define R_PPC_PLT32 27
+#define R_PPC_PLTREL32 28
+#define R_PPC_PLT16_LO 29
+#define R_PPC_PLT16_HI 30
+#define R_PPC_PLT16_HA 31
+#define R_PPC_SDAREL16 32
+#define R_PPC_SECTOFF 33
+#define R_PPC_SECTOFF_LO 34
+#define R_PPC_SECTOFF_HI 35
+#define R_PPC_SECTOFF_HA 36
+#define R_PPC_ADDR30 37
+
+/* TLS relocations */
+#define R_PPC_TLS 67
+
+#define R_PPC_DTPMOD32 68
+#define R_PPC_TPREL16 69
+#define R_PPC_TPREL16_LO 70
+#define R_PPC_TPREL16_HI 71
+#define R_PPC_TPREL16_HA 72
+#define R_PPC_TPREL32 73
+#define R_PPC_DTPREL16 74
+#define R_PPC_DTPREL16_LO 75
+#define R_PPC_DTPREL16_HI 76
+#define R_PPC_DTPREL16_HA 77
+#define R_PPC_DTPREL32 78
+
+#define R_PPC_GOT_TLSGD16 79
+#define R_PPC_GOT_TLSGD16_LO 80
+#define R_PPC_GOT_TLSGD16_HI 81
+#define R_PPC_GOT_TLSGD16_HA 82
+#define R_PPC_GOT_TLSLD16 83
+#define R_PPC_GOT_TLSLD16_LO 84
+#define R_PPC_GOT_TLSLD16_HI 85
+#define R_PPC_GOT_TLSLD16_HA 86
+
+#define R_PPC_GOT_TPREL16 87
+#define R_PPC_GOT_TPREL16_LO 88
+#define R_PPC_GOT_TPREL16_HI 89
+#define R_PPC_GOT_TPREL16_HA 90
+#define R_PPC_GOT_DTPREL16 91
+#define R_PPC_GOT_DTPREL16_LO 92
+#define R_PPC_GOT_DTPREL16_HI 93
+#define R_PPC_GOT_DTPREL16_HA 94
+#define R_PPC_TLSGD 95
+#define R_PPC_TLSLD 96
+
+/* Used for the secure-plt PIC code sequences */
+#define R_PPC_REL16 249
+#define R_PPC_REL16_LO 250
+#define R_PPC_REL16_HI 251
+#define R_PPC_REL16_HA 252
+
+#define R_TYPE(name) __CONCAT(R_PPC_,name)
diff --git a/cpukit/score/cpu/powerpc/rtems/asm.h b/cpukit/score/cpu/powerpc/include/rtems/asm.h
index 2fddf56e6d..2fddf56e6d 100644
--- a/cpukit/score/cpu/powerpc/rtems/asm.h
+++ b/cpukit/score/cpu/powerpc/include/rtems/asm.h
diff --git a/cpukit/score/cpu/powerpc/rtems/powerpc/registers.h b/cpukit/score/cpu/powerpc/include/rtems/powerpc/registers.h
index 4d9350324e..4d9350324e 100644
--- a/cpukit/score/cpu/powerpc/rtems/powerpc/registers.h
+++ b/cpukit/score/cpu/powerpc/include/rtems/powerpc/registers.h
diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpu.h b/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h
index 8c0f200641..8c0f200641 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/cpu.h
+++ b/cpukit/score/cpu/powerpc/include/rtems/score/cpu.h
diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpuatomic.h b/cpukit/score/cpu/powerpc/include/rtems/score/cpuatomic.h
index 598ee76b20..598ee76b20 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/cpuatomic.h
+++ b/cpukit/score/cpu/powerpc/include/rtems/score/cpuatomic.h
diff --git a/cpukit/score/cpu/powerpc/rtems/score/cpuimpl.h b/cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h
index 792a8111ad..792a8111ad 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/cpuimpl.h
+++ b/cpukit/score/cpu/powerpc/include/rtems/score/cpuimpl.h
diff --git a/cpukit/score/cpu/powerpc/rtems/score/powerpc.h b/cpukit/score/cpu/powerpc/include/rtems/score/powerpc.h
index 88ee0020e6..88ee0020e6 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/powerpc.h
+++ b/cpukit/score/cpu/powerpc/include/rtems/score/powerpc.h
diff --git a/cpukit/score/cpu/powerpc/rtems/score/types.h b/cpukit/score/cpu/powerpc/include/rtems/score/types.h
index cdab30234d..cdab30234d 100644
--- a/cpukit/score/cpu/powerpc/rtems/score/types.h
+++ b/cpukit/score/cpu/powerpc/include/rtems/score/types.h
diff --git a/cpukit/score/cpu/powerpc/preinstall.am b/cpukit/score/cpu/powerpc/preinstall.am
deleted file mode 100644
index b0f59c24f9..0000000000
--- a/cpukit/score/cpu/powerpc/preinstall.am
+++ /dev/null
@@ -1,58 +0,0 @@
-## Automatically generated by ampolish3 - Do not edit
-
-if AMPOLISH3
-$(srcdir)/preinstall.am: Makefile.am
- $(AMPOLISH3) $(srcdir)/Makefile.am > $(srcdir)/preinstall.am
-endif
-
-PREINSTALL_DIRS =
-DISTCLEANFILES = $(PREINSTALL_DIRS)
-
-all-am: $(PREINSTALL_FILES)
-
-PREINSTALL_FILES =
-CLEANFILES = $(PREINSTALL_FILES)
-
-$(PROJECT_INCLUDE)/rtems/$(dirstamp):
- @$(MKDIR_P) $(PROJECT_INCLUDE)/rtems
- @: > $(PROJECT_INCLUDE)/rtems/$(dirstamp)
-PREINSTALL_DIRS += $(PROJECT_INCLUDE)/rtems/$(dirstamp)
-
-$(PROJECT_INCLUDE)/rtems/asm.h: rtems/asm.h $(PROJECT_INCLUDE)/rtems/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/asm.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/asm.h
-
-$(PROJECT_INCLUDE)/rtems/score/$(dirstamp):
- @$(MKDIR_P) $(PROJECT_INCLUDE)/rtems/score
- @: > $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
-PREINSTALL_DIRS += $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
-
-$(PROJECT_INCLUDE)/rtems/score/powerpc.h: rtems/score/powerpc.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/powerpc.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/powerpc.h
-
-$(PROJECT_INCLUDE)/rtems/score/cpu.h: rtems/score/cpu.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpu.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpu.h
-
-$(PROJECT_INCLUDE)/rtems/score/cpuimpl.h: rtems/score/cpuimpl.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpuimpl.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpuimpl.h
-
-$(PROJECT_INCLUDE)/rtems/score/types.h: rtems/score/types.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/types.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/types.h
-
-$(PROJECT_INCLUDE)/rtems/score/cpuatomic.h: rtems/score/cpuatomic.h $(PROJECT_INCLUDE)/rtems/score/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/score/cpuatomic.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/score/cpuatomic.h
-
-$(PROJECT_INCLUDE)/rtems/powerpc/$(dirstamp):
- @$(MKDIR_P) $(PROJECT_INCLUDE)/rtems/powerpc
- @: > $(PROJECT_INCLUDE)/rtems/powerpc/$(dirstamp)
-PREINSTALL_DIRS += $(PROJECT_INCLUDE)/rtems/powerpc/$(dirstamp)
-
-$(PROJECT_INCLUDE)/rtems/powerpc/registers.h: rtems/powerpc/registers.h $(PROJECT_INCLUDE)/rtems/powerpc/$(dirstamp)
- $(INSTALL_DATA) $< $(PROJECT_INCLUDE)/rtems/powerpc/registers.h
-PREINSTALL_FILES += $(PROJECT_INCLUDE)/rtems/powerpc/registers.h
-