diff mbox series

[v2,1/3] xen/multiboot: add proper struct definitions to typedefs

Message ID 20221219144533.19836-2-sergey.dyasli@citrix.com (mailing list archive)
State New, archived
Headers show
Series x86: load microcode earlier on boot CPU | expand

Commit Message

Sergey Dyasli Dec. 19, 2022, 2:45 p.m. UTC
This allows to use them for forward declaration in other headers.

Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>

---
CC: George Dunlap <george.dunlap@citrix.com>
CC: Julien Grall <julien@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>

v1 --> v2:
- New patch
---
 xen/include/xen/multiboot.h | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)

Comments

Jan Beulich Dec. 20, 2022, 1:56 p.m. UTC | #1
On 19.12.2022 15:45, Sergey Dyasli wrote:
> This allows to use them for forward declaration in other headers.
> 
> Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
with ...

> --- a/xen/include/xen/multiboot.h
> +++ b/xen/include/xen/multiboot.h
> @@ -46,23 +46,25 @@
>  #ifndef __ASSEMBLY__
>  
>  /* The symbol table for a.out.  */
> -typedef struct {
> +struct aout_symbol_table {
>      u32 tabsize;
>      u32 strsize;
>      u32 addr;
>      u32 reserved;
> -} aout_symbol_table_t;
> +};
> +typedef struct aout_symbol_table aout_symbol_table_t;
>  
>  /* The section header table for ELF.  */
> -typedef struct {
> +struct elf_section_header_table{

... the missing blank added here.

I also have to admit that I would have preferred a variant with less
code churn: The typedef re-arrangement really isn't needed to fulfill
the goal pf the change.

Jan
diff mbox series

Patch

diff --git a/xen/include/xen/multiboot.h b/xen/include/xen/multiboot.h
index d1b43e1183..a541bdf8a8 100644
--- a/xen/include/xen/multiboot.h
+++ b/xen/include/xen/multiboot.h
@@ -46,23 +46,25 @@ 
 #ifndef __ASSEMBLY__
 
 /* The symbol table for a.out.  */
-typedef struct {
+struct aout_symbol_table {
     u32 tabsize;
     u32 strsize;
     u32 addr;
     u32 reserved;
-} aout_symbol_table_t;
+};
+typedef struct aout_symbol_table aout_symbol_table_t;
 
 /* The section header table for ELF.  */
-typedef struct {
+struct elf_section_header_table{
     u32 num;
     u32 size;
     u32 addr;
     u32 shndx;
-} elf_section_header_table_t;
+};
+typedef struct elf_section_header_table elf_section_header_table_t;
 
 /* The Multiboot information.  */
-typedef struct {
+struct multiboot_info {
     u32 flags;
 
     /* Valid if flags sets MBI_MEMLIMITS */
@@ -101,26 +103,29 @@  typedef struct {
 
     /* Valid if flags sets MBI_APM */
     u32 apm_table;
-} multiboot_info_t;
+};
+typedef struct multiboot_info multiboot_info_t;
 
 /* The module structure.  */
-typedef struct {
+struct module {
     u32 mod_start;
     u32 mod_end;
     u32 string;
     u32 reserved;
-} module_t;
+};
+typedef struct module module_t;
 
 /* The memory map. Be careful that the offset 0 is base_addr_low
    but no size.  */
-typedef struct {
+struct memory_map {
     u32 size;
     u32 base_addr_low;
     u32 base_addr_high;
     u32 length_low;
     u32 length_high;
     u32 type;
-} memory_map_t;
+};
+typedef struct memory_map memory_map_t;
 
 
 #endif /* __ASSEMBLY__ */