Skip to contentSkip to conversation

hw/loader: Restrict PC_ROM_* definitions to hw/i386/pc

PATCH Applied Philippe Mathieu-Daudé 2 participants 3 messages Sep 17, 2021 – Sep 23, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw/loader: Restrict PC_ROM_* definitions to hw/i386/pc

The PC_ROM_* definitions are only used by the PC machine, and are irrelevant to the other architectures / machines. Reduce their scope by moving them to hw/i386/pc.c.

---
 include/hw/loader.h | 6 ------
 hw/i386/pc.c        | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)
include/hw/loader.h +0 -6
index cbfc1848737..81104cb02fe 100644
@@ -336,12 +336,6 @@ void hmp_info_roms(Monitor *mon, const QDict *qdict);
 #define rom_add_blob_fixed_as(_f, _b, _l, _a, _as)      \
     rom_add_blob(_f, _b, _l, _l, _a, NULL, NULL, NULL, _as, true)
 
-#define PC_ROM_MIN_VGA     0xc0000
-#define PC_ROM_MIN_OPTION  0xc8000
-#define PC_ROM_MAX         0xe0000
-#define PC_ROM_ALIGN       0x800
-#define PC_ROM_SIZE        (PC_ROM_MAX - PC_ROM_MIN_VGA)
-
 int rom_add_vga(const char *file);
 int rom_add_option(const char *file, int32_t bootindex);
 
hw/i386/pc.c +6 -0
index 7e523b913ca..557d49c9f8f 100644
@@ -843,6 +843,12 @@ void xen_load_linux(PCMachineState *pcms)
     x86ms->fw_cfg = fw_cfg;
 }
 
+#define PC_ROM_MIN_VGA     0xc0000
+#define PC_ROM_MIN_OPTION  0xc8000
+#define PC_ROM_MAX         0xe0000
+#define PC_ROM_ALIGN       0x800
+#define PC_ROM_SIZE        (PC_ROM_MAX - PC_ROM_MIN_VGA)
+
 void pc_memory_init(PCMachineState *pcms,
                     MemoryRegion *system_memory,
                     MemoryRegion *rom_memory,
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw

Le 17/09/2021 à 20:59, Philippe Mathieu-Daudé a écrit :

Quoted 35 lines

The PC_ROM_* definitions are only used by the PC machine, and are irrelevant to the other architectures / machines. Reduce their scope by moving them to hw/i386/pc.c.

---
 include/hw/loader.h | 6 ------
 hw/i386/pc.c        | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)
include/hw/loader.h +0 -6
index cbfc1848737..81104cb02fe 100644
@@ -336,12 +336,6 @@ void hmp_info_roms(Monitor *mon, const QDict *qdict);
 #define rom_add_blob_fixed_as(_f, _b, _l, _a, _as)      \
     rom_add_blob(_f, _b, _l, _l, _a, NULL, NULL, NULL, _as, true)
 
-#define PC_ROM_MIN_VGA     0xc0000
-#define PC_ROM_MIN_OPTION  0xc8000
-#define PC_ROM_MAX         0xe0000
-#define PC_ROM_ALIGN       0x800
-#define PC_ROM_SIZE        (PC_ROM_MAX - PC_ROM_MIN_VGA)
-
 int rom_add_vga(const char *file);
 int rom_add_option(const char *file, int32_t bootindex);
 
hw/i386/pc.c +0 -0
index 7e523b913ca..557d49c9f8f 100644
@@ -843,6 +843,12 @@ void xen_load_linux(PCMachineState *pcms)
     x86ms->fw_cfg = fw_cfg;
 }

hw/i386/pc.c void xen_load_linux(PCMachineState *pcms) · line 854

Quoted 10 lines
hw/i386/pc.c +6 -0
 
+#define PC_ROM_MIN_VGA     0xc0000
+#define PC_ROM_MIN_OPTION  0xc8000
+#define PC_ROM_MAX         0xe0000
+#define PC_ROM_ALIGN       0x800
+#define PC_ROM_SIZE        (PC_ROM_MAX - PC_ROM_MIN_VGA)
+
 void pc_memory_init(PCMachineState *pcms,
                     MemoryRegion *system_memory,
                     MemoryRegion *rom_memory,
#2 lore raw
In reply to Philippe Mathieu-Daudé

Le 17/09/2021 à 20:59, Philippe Mathieu-Daudé a écrit :

Quoted 35 lines

The PC_ROM_* definitions are only used by the PC machine, and are irrelevant to the other architectures / machines. Reduce their scope by moving them to hw/i386/pc.c.

---
 include/hw/loader.h | 6 ------
 hw/i386/pc.c        | 6 ++++++
 2 files changed, 6 insertions(+), 6 deletions(-)
include/hw/loader.h +0 -6
index cbfc1848737..81104cb02fe 100644
@@ -336,12 +336,6 @@ void hmp_info_roms(Monitor *mon, const QDict *qdict);
 #define rom_add_blob_fixed_as(_f, _b, _l, _a, _as)      \
     rom_add_blob(_f, _b, _l, _l, _a, NULL, NULL, NULL, _as, true)
 
-#define PC_ROM_MIN_VGA     0xc0000
-#define PC_ROM_MIN_OPTION  0xc8000
-#define PC_ROM_MAX         0xe0000
-#define PC_ROM_ALIGN       0x800
-#define PC_ROM_SIZE        (PC_ROM_MAX - PC_ROM_MIN_VGA)
-
 int rom_add_vga(const char *file);
 int rom_add_option(const char *file, int32_t bootindex);
 
hw/i386/pc.c +0 -0
index 7e523b913ca..557d49c9f8f 100644
@@ -843,6 +843,12 @@ void xen_load_linux(PCMachineState *pcms)
     x86ms->fw_cfg = fw_cfg;
 }

hw/i386/pc.c void xen_load_linux(PCMachineState *pcms) · line 854

Quoted 10 lines
hw/i386/pc.c +6 -0
 
+#define PC_ROM_MIN_VGA     0xc0000
+#define PC_ROM_MIN_OPTION  0xc8000
+#define PC_ROM_MAX         0xe0000
+#define PC_ROM_ALIGN       0x800
+#define PC_ROM_SIZE        (PC_ROM_MAX - PC_ROM_MIN_VGA)
+
 void pc_memory_init(PCMachineState *pcms,
                     MemoryRegion *system_memory,
                     MemoryRegion *rom_memory,

Applied to my trivial-patches branch.

Thanks,
Laurent