diff options
| author | Michael Brown | 2023-02-05 23:02:05 +0100 |
|---|---|---|
| committer | Michael Brown | 2023-02-05 23:21:36 +0100 |
| commit | a2bed43939b40ec843fd99bc9fd0d0e58124e082 (patch) | |
| tree | 90fd251383b5265592cd2df3d25044150072c024 /src/include/xen | |
| parent | [efi] Enable NET_PROTO_LLDP by default (diff) | |
| download | ipxe-a2bed43939b40ec843fd99bc9fd0d0e58124e082.tar.gz ipxe-a2bed43939b40ec843fd99bc9fd0d0e58124e082.tar.xz ipxe-a2bed43939b40ec843fd99bc9fd0d0e58124e082.zip | |
[xen] Allow for platforms that have no Xen support
The Xen headers support only x86 and ARM. Allow for platforms such as
LoongArch64 to build despite the absence of Xen support by providing
an architecture-specific <bits/xen.h> that simply does:
#ifndef _BITS_XEN_H
#define _BITS_XEN_H
#include <ipxe/nonxen.h>
#endif /* _BITS_XEN_H */
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/xen')
| -rwxr-xr-x | src/include/xen/import.pl | 4 | ||||
| -rw-r--r-- | src/include/xen/xen.h | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/include/xen/import.pl b/src/include/xen/import.pl index 9f09a77a4..12c7b0013 100755 --- a/src/include/xen/import.pl +++ b/src/include/xen/import.pl @@ -59,6 +59,10 @@ sub try_import_file { if ( /^\#include\s+[<\"](\S+)[>\"]/ ) { push @dependencies, catfile ( $subdir, $1 ); } + # Patch "Unsupported architecture" line + if ( /^\#error\s+"Unsupported\sarchitecture"/ ) { + $_ = "#include <bits/xen.h>" + } # Write out line print $outfh "$_\n"; # Apply FILE_LICENCE() immediately after include guard diff --git a/src/include/xen/xen.h b/src/include/xen/xen.h index 8a4b30b39..c35008aa0 100644 --- a/src/include/xen/xen.h +++ b/src/include/xen/xen.h @@ -19,7 +19,7 @@ FILE_LICENCE ( MIT ); #elif defined(__arm__) || defined (__aarch64__) #include "arch-arm.h" #else -#error "Unsupported architecture" +#include <bits/xen.h> #endif #ifndef __ASSEMBLY__ |
