summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2023-03-10 09:57:50 +0100
committerJan Janssen <medhefgo@web.de>2023-03-17 10:39:32 +0100
commit0b482b37f9289e25bc7375609b2fc46f88affad9 (patch)
treeec158787d1acdf6d193fa2fd308d2456006a5210 /src/boot
parentf64f82aa8d5181bb024767292aa8bcabdc7c019c (diff)
downloadsystemd-0b482b37f9289e25bc7375609b2fc46f88affad9.tar.gz
meson: Share more C flags
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/efi/efi-string.c12
-rw-r--r--src/boot/efi/log.c6
-rw-r--r--src/boot/efi/util.h1
-rw-r--r--src/boot/efi/vmm.c1
4 files changed, 14 insertions, 6 deletions
diff --git a/src/boot/efi/efi-string.c b/src/boot/efi/efi-string.c
index a94e2e4c17..d199410881 100644
--- a/src/boot/efi/efi-string.c
+++ b/src/boot/efi/efi-string.c
@@ -882,6 +882,10 @@ char16_t *xvasprintf_status(EFI_STATUS status, const char *format, va_list ap) {
# undef memcmp
# undef memcpy
# undef memset
+_used_ void *memchr(const void *p, int c, size_t n);
+_used_ int memcmp(const void *p1, const void *p2, size_t n);
+_used_ void *memcpy(void * restrict dest, const void * restrict src, size_t n);
+_used_ void *memset(void *p, int c, size_t n);
#else
/* And for userspace unit testing we need to give them an efi_ prefix. */
# define memchr efi_memchr
@@ -890,7 +894,7 @@ char16_t *xvasprintf_status(EFI_STATUS status, const char *format, va_list ap) {
# define memset efi_memset
#endif
-_used_ void *memchr(const void *p, int c, size_t n) {
+void *memchr(const void *p, int c, size_t n) {
if (!p || n == 0)
return NULL;
@@ -902,7 +906,7 @@ _used_ void *memchr(const void *p, int c, size_t n) {
return NULL;
}
-_used_ int memcmp(const void *p1, const void *p2, size_t n) {
+int memcmp(const void *p1, const void *p2, size_t n) {
const uint8_t *up1 = p1, *up2 = p2;
int r;
@@ -922,7 +926,7 @@ _used_ int memcmp(const void *p1, const void *p2, size_t n) {
return 0;
}
-_used_ void *memcpy(void * restrict dest, const void * restrict src, size_t n) {
+void *memcpy(void * restrict dest, const void * restrict src, size_t n) {
if (!dest || !src || n == 0)
return dest;
@@ -949,7 +953,7 @@ _used_ void *memcpy(void * restrict dest, const void * restrict src, size_t n) {
return dest;
}
-_used_ void *memset(void *p, int c, size_t n) {
+void *memset(void *p, int c, size_t n) {
if (!p || n == 0)
return p;
diff --git a/src/boot/efi/log.c b/src/boot/efi/log.c
index 879ed766e3..82307516dc 100644
--- a/src/boot/efi/log.c
+++ b/src/boot/efi/log.c
@@ -89,12 +89,14 @@ void abort(void) {
#if defined(__ARM_EABI__)
/* These override the (weak) div0 handlers from libgcc as they would otherwise call raise() instead. */
+_used_ _noreturn_ int __aeabi_idiv0(int return_value);
+_used_ _noreturn_ long long __aeabi_ldiv0(long long return_value);
-_used_ _noreturn_ int __aeabi_idiv0(int return_value) {
+int __aeabi_idiv0(int return_value) {
panic(u"systemd-boot: Division by zero, halting.");
}
-_used_ _noreturn_ long long __aeabi_ldiv0(long long return_value) {
+long long __aeabi_ldiv0(long long return_value) {
panic(u"systemd-boot: Division by zero, halting.");
}
#endif
diff --git a/src/boot/efi/util.h b/src/boot/efi/util.h
index 5b4f47a1ae..c321062996 100644
--- a/src/boot/efi/util.h
+++ b/src/boot/efi/util.h
@@ -172,6 +172,7 @@ void hexdump(const char16_t *prefix, const void *data, size_t size);
EFI_SYSTEM_TABLE *ST; \
EFI_BOOT_SERVICES *BS; \
EFI_RUNTIME_SERVICES *RT; \
+ EFIAPI EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table); \
EFIAPI EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *system_table) { \
ST = system_table; \
BS = system_table->BootServices; \
diff --git a/src/boot/efi/vmm.c b/src/boot/efi/vmm.c
index 60e8a97c43..951b4e3766 100644
--- a/src/boot/efi/vmm.c
+++ b/src/boot/efi/vmm.c
@@ -10,6 +10,7 @@
#include "proto/device-path.h"
#include "string-util-fundamental.h"
#include "util.h"
+#include "vmm.h"
#define QEMU_KERNEL_LOADER_FS_MEDIA_GUID \
{ 0x1428f772, 0xb64a, 0x441e, { 0xb8, 0xc3, 0x9e, 0xbd, 0xd7, 0xf8, 0x93, 0xc7 } }