From: Andrew Cooper Date: Fri, 7 Mar 2025 14:40:27 +0000 (+0000) Subject: xen/elfstructs: Include xen/types.h X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b21d4e4561ccb28fcc2f6fb9814580fd412b45d9;p=people%2Fandrewcoop%2Fxen.git xen/elfstructs: Include xen/types.h elfstructs.h needs the stdint.h types. Two headers arrange this manually, but elf.h and livepatch.h do not, which breaks source files whose headers are properly sorted. elfstructs.h is used by tools too, so limit this to Xen only. Signed-off-by: Andrew Cooper --- CC: Anthony PERARD CC: Michal Orzel CC: Jan Beulich CC: Julien Grall CC: Roger Pau Monné CC: Stefano Stabellini CC: Volodymyr Babchuk CC: Bertrand Marquis CC: Oleksii Kurochko CC: Shawn Anastasio --- diff --git a/xen/include/xen/elfstructs.h b/xen/include/xen/elfstructs.h index eb6b87a823..f64ecec019 100644 --- a/xen/include/xen/elfstructs.h +++ b/xen/include/xen/elfstructs.h @@ -26,6 +26,11 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* Outside of Xen, the includer must provide stdint.h or equivalent. */ +#ifdef __XEN__ +#include +#endif + typedef uint32_t Elf32_Addr; /* Unsigned program address */ typedef uint32_t Elf32_Off; /* Unsigned file offset */ typedef uint16_t Elf32_Half; /* Unsigned medium integer */ @@ -45,7 +50,7 @@ typedef uint64_t Elf64_Xword; /* * e_ident[] identification indexes - * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html + * See http://www.caldera.com/developers/gabi/2000-07-17/ch4.eheader.html */ #define EI_MAG0 0 /* file ID */ #define EI_MAG1 1 /* file ID */ diff --git a/xen/include/xen/livepatch_elf.h b/xen/include/xen/livepatch_elf.h index 842111e145..a8aafecd34 100644 --- a/xen/include/xen/livepatch_elf.h +++ b/xen/include/xen/livepatch_elf.h @@ -5,7 +5,6 @@ #ifndef __XEN_LIVEPATCH_ELF_H__ #define __XEN_LIVEPATCH_ELF_H__ -#include #include /* The following describes an Elf file as consumed by Xen Live Patch. */ diff --git a/xen/include/xen/version.h b/xen/include/xen/version.h index 4856ad1b44..bc69ec9fb0 100644 --- a/xen/include/xen/version.h +++ b/xen/include/xen/version.h @@ -1,7 +1,6 @@ #ifndef __XEN_VERSION_H__ #define __XEN_VERSION_H__ -#include #include const char *xen_compile_date(void);