| 1 | From koen.kooi at linaro.org Sat Apr 11 01:23:22 2015
|
| 2 | From: koen.kooi at linaro.org (Koen Kooi)
|
| 3 | Date: Sat, 11 Apr 2015 10:23:22 +0200
|
| 4 | Subject: [systemd-devel] [gummiboot][PATCH 1/5] Makefile: support non-x86
|
| 5 | builds
|
| 6 | Message-ID: <[email protected]>
|
| 7 |
|
| 8 | Move the no-mmx/no-sse CFLAGS to X86-64 and IA32 defines in preparation
|
| 9 | for ARM32 and Aarch64 support.
|
| 10 |
|
| 11 | Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
|
| 12 | ---
|
| 13 | Makefile.am | 12 +++++++++---
|
| 14 | 1 file changed, 9 insertions(+), 3 deletions(-)
|
| 15 |
|
| 16 | diff --git a/Makefile.am b/Makefile.am
|
| 17 | index 6568a35..2cca313 100644
|
| 18 | |
| 19 | |
| 20 | @@ -94,17 +94,23 @@ efi_cflags = \
|
| 21 | -ffreestanding \
|
| 22 | -fno-strict-aliasing \
|
| 23 | -fno-stack-protector \
|
| 24 | - -Wsign-compare \
|
| 25 | - -mno-sse \
|
| 26 | - -mno-mmx
|
| 27 | + -Wsign-compare
|
| 28 |
|
| 29 | if ARCH_X86_64
|
| 30 | efi_cflags += \
|
| 31 | -mno-red-zone \
|
| 32 | + -mno-sse \
|
| 33 | + -mno-mmx
|
| 34 | -DEFI_FUNCTION_WRAPPER \
|
| 35 | -DGNU_EFI_USE_MS_ABI
|
| 36 | endif
|
| 37 |
|
| 38 | +if ARCH_IA32
|
| 39 | +efi_cflags += \
|
| 40 | + -mno-sse \
|
| 41 | + -mno-mmx
|
| 42 | +endif
|
| 43 | +
|
| 44 | efi_ldflags = \
|
| 45 | $(EFI_LDFLAGS) \
|
| 46 | -T $(EFI_LDS_DIR)/elf_$(ARCH)_efi.lds \
|
| 47 | --
|
| 48 | 2.0.1
|
| 49 |
|
| 50 |
|
| 51 | From koen.kooi at linaro.org Sat Apr 11 01:23:23 2015
|
| 52 | From: koen.kooi at linaro.org (Koen Kooi)
|
| 53 | Date: Sat, 11 Apr 2015 10:23:23 +0200
|
| 54 | Subject: [systemd-devel] [gummiboot][PATCH 2/5] util: use x86 ASM only on
|
| 55 | x86(-64) platforms.
|
| 56 | In-Reply-To: <[email protected]>
|
| 57 | References: <[email protected]>
|
| 58 | Message-ID: <[email protected]>
|
| 59 |
|
| 60 | Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
|
| 61 | ---
|
| 62 | src/efi/util.c | 4 +++-
|
| 63 | 1 file changed, 3 insertions(+), 1 deletion(-)
|
| 64 |
|
| 65 | diff --git a/src/efi/util.c b/src/efi/util.c
|
| 66 | index ba5ed7d..689bc7c 100644
|
| 67 | |
| 68 | |
| 69 | @@ -33,7 +33,9 @@ UINT64 ticks_read(VOID) {
|
| 70 | __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
|
| 71 | return (d << 32) | a;
|
| 72 | }
|
| 73 | -#else
|
| 74 | +#endif
|
| 75 | +
|
| 76 | +#ifdef __i386__
|
| 77 | UINT64 ticks_read(VOID) {
|
| 78 | UINT64 val;
|
| 79 | __asm__ volatile ("rdtsc" : "=A" (val));
|
| 80 | --
|
| 81 | 2.0.1
|
| 82 |
|
| 83 |
|
| 84 | From koen.kooi at linaro.org Sat Apr 11 01:23:24 2015
|
| 85 | From: koen.kooi at linaro.org (Koen Kooi)
|
| 86 | Date: Sat, 11 Apr 2015 10:23:24 +0200
|
| 87 | Subject: [systemd-devel] [gummiboot][PATCH 3/5] configure: add AARCH64
|
| 88 | support
|
| 89 | In-Reply-To: <[email protected]>
|
| 90 | References: <[email protected]>
|
| 91 | Message-ID: <[email protected]>
|
| 92 |
|
| 93 | This is just plumbing to add ARCH_AARCH64 for makefile tests and
|
| 94 | defining the machine name.
|
| 95 |
|
| 96 | Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
|
| 97 | ---
|
| 98 | configure.ac | 4 ++++
|
| 99 | 1 file changed, 4 insertions(+)
|
| 100 |
|
| 101 | diff --git a/configure.ac b/configure.ac
|
| 102 | index 27bbe1d..c2077b1 100644
|
| 103 | |
| 104 | |
| 105 | @@ -51,6 +51,7 @@ dnl Define ARCH_<NAME> conditionals
|
| 106 | SET_ARCH(IA32, i*86*)
|
| 107 | SET_ARCH(X86_64, x86_64*)
|
| 108 | SET_ARCH(IA64, ia64*)
|
| 109 | +SET_ARCH(AARCH64, aarch64*)
|
| 110 |
|
| 111 | ARCH=`echo $host | sed "s/\(-\).*$//"`
|
| 112 |
|
| 113 | @@ -61,6 +62,9 @@ AM_COND_IF(ARCH_IA32, [
|
| 114 | AM_COND_IF(ARCH_X86_64, [
|
| 115 | MACHINE_TYPE_NAME=x64])
|
| 116 |
|
| 117 | +AM_COND_IF(ARCH_AARCH64, [
|
| 118 | + MACHINE_TYPE_NAME=aa64])
|
| 119 | +
|
| 120 | AC_SUBST([ARCH])
|
| 121 | AC_SUBST([MACHINE_TYPE_NAME])
|
| 122 |
|
| 123 | --
|
| 124 | 2.0.1
|
| 125 |
|
| 126 |
|
| 127 | From koen.kooi at linaro.org Sat Apr 11 01:23:25 2015
|
| 128 | From: koen.kooi at linaro.org (Koen Kooi)
|
| 129 | Date: Sat, 11 Apr 2015 10:23:25 +0200
|
| 130 | Subject: [systemd-devel] [gummiboot][PATCH 4/5] util: confine x86 asm to x86
|
| 131 | architectures
|
| 132 | In-Reply-To: <[email protected]>
|
| 133 | References: <[email protected]>
|
| 134 | Message-ID: <[email protected]>
|
| 135 |
|
| 136 | Also add a stub function that just returns '1' to avoid missing symbols.
|
| 137 |
|
| 138 | Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
|
| 139 | ---
|
| 140 | src/efi/util.c | 9 ++++++---
|
| 141 | 1 file changed, 6 insertions(+), 3 deletions(-)
|
| 142 |
|
| 143 | diff --git a/src/efi/util.c b/src/efi/util.c
|
| 144 | index 689bc7c..6ce1f18 100644
|
| 145 | |
| 146 | |
| 147 | @@ -33,14 +33,17 @@ UINT64 ticks_read(VOID) {
|
| 148 | __asm__ volatile ("rdtsc" : "=a" (a), "=d" (d));
|
| 149 | return (d << 32) | a;
|
| 150 | }
|
| 151 | -#endif
|
| 152 | -
|
| 153 | -#ifdef __i386__
|
| 154 | +#elif __i386__
|
| 155 | UINT64 ticks_read(VOID) {
|
| 156 | UINT64 val;
|
| 157 | __asm__ volatile ("rdtsc" : "=A" (val));
|
| 158 | return val;
|
| 159 | }
|
| 160 | +#else
|
| 161 | +UINT64 ticks_read(VOID) {
|
| 162 | + UINT64 val = 1;
|
| 163 | + return val;
|
| 164 | +}
|
| 165 | #endif
|
| 166 |
|
| 167 | /* count TSC ticks during a millisecond delay */
|
| 168 | --
|
| 169 | 2.0.1
|
| 170 |
|
| 171 |
|
| 172 | From koen.kooi at linaro.org Sat Apr 11 01:23:26 2015
|
| 173 | From: koen.kooi at linaro.org (Koen Kooi)
|
| 174 | Date: Sat, 11 Apr 2015 10:23:26 +0200
|
| 175 | Subject: [systemd-devel] [gummiboot][PATCH 5/5] Makefile.am: Add support for
|
| 176 | AARCH64
|
| 177 | In-Reply-To: <[email protected]>
|
| 178 | References: <[email protected]>
|
| 179 | Message-ID: <[email protected]>
|
| 180 |
|
| 181 | Aarch64 and ARM32 lack an EFI capable objcopy, so use the ldflags + -O
|
| 182 | binary trick gnu-efi and the Red Hat shimloader are using.
|
| 183 |
|
| 184 | Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
|
| 185 | ---
|
| 186 | Makefile.am | 15 +++++++++++++--
|
| 187 | 1 file changed, 13 insertions(+), 2 deletions(-)
|
| 188 |
|
| 189 | diff --git a/Makefile.am b/Makefile.am
|
| 190 | index 2cca313..eba5ec4 100644
|
| 191 | |
| 192 | |
| 193 | @@ -121,6 +121,17 @@ efi_ldflags = \
|
| 194 | -L $(EFI_LIB_DIR) \
|
| 195 | $(EFI_LDS_DIR)/crt0-efi-$(ARCH).o
|
| 196 |
|
| 197 | +# Aarch64 and ARM32 don't have an EFI capable objcopy
|
| 198 | +if ARCH_AARCH64
|
| 199 | +efi_ldflags += \
|
| 200 | + --defsym=EFI_SUBSYSTEM=0xa
|
| 201 | +
|
| 202 | +FORMAT = -O binary
|
| 203 | +else
|
| 204 | +FORMAT = --target=efi-app-$(ARCH)
|
| 205 | +endif
|
| 206 | +
|
| 207 | +
|
| 208 | # ------------------------------------------------------------------------------
|
| 209 | gummiboot_headers = \
|
| 210 | src/efi/util.h \
|
| 211 | @@ -156,7 +167,7 @@ $(gummiboot_solib): $(gummiboot_objects)
|
| 212 | $(gummiboot): $(gummiboot_solib)
|
| 213 | $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
|
| 214 | -j .dynsym -j .rel -j .rela -j .reloc \
|
| 215 | - --target=efi-app-$(ARCH) $< $@
|
| 216 | + $(FORMAT) $< $@
|
| 217 |
|
| 218 | # ------------------------------------------------------------------------------
|
| 219 | stub_headers = \
|
| 220 | @@ -191,7 +202,7 @@ $(stub_solib): $(stub_objects)
|
| 221 | $(stub): $(stub_solib)
|
| 222 | $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
|
| 223 | -j .dynsym -j .rel -j .rela -j .reloc \
|
| 224 | - --target=efi-app-$(ARCH) $< $@
|
| 225 | + $(FORMAT) $< $@
|
| 226 |
|
| 227 | # ------------------------------------------------------------------------------
|
| 228 | CLEANFILES += test-disk.img
|
| 229 | --
|
| 230 | 2.0.1
|
| 231 |
|