[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/33] hw/net/e1000: Move macreg[] arrays to .rodata to save 1MiB
From: |
Laurent Vivier |
Subject: |
[PULL 06/33] hw/net/e1000: Move macreg[] arrays to .rodata to save 1MiB of .data |
Date: |
Mon, 9 Mar 2020 16:08:10 +0100 |
From: Philippe Mathieu-Daudé <address@hidden>
Each array consumes 256KiB of .data. As we do not reassign entries,
we can move it to the .rodata section, and save a total of 1MiB of
.data (size reported on x86_64 host).
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Reviewed-by: Dmitry Fleytman <address@hidden>
Reviewed-by: Stefano Garzarella <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Laurent Vivier <address@hidden>
---
hw/net/e1000.c | 4 ++--
hw/net/e1000e_core.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 972d9b508399..9233248c9af0 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -1151,7 +1151,7 @@ set_ims(E1000State *s, int index, uint32_t val)
#define getreg(x) [x] = mac_readreg
typedef uint32_t (*readops)(E1000State *, int);
-static readops macreg_readops[] = {
+static const readops macreg_readops[] = {
getreg(PBA), getreg(RCTL), getreg(TDH), getreg(TXDCTL),
getreg(WUFC), getreg(TDT), getreg(CTRL), getreg(LEDCTL),
getreg(MANC), getreg(MDIC), getreg(SWSM), getreg(STATUS),
@@ -1207,7 +1207,7 @@ enum { NREADOPS = ARRAY_SIZE(macreg_readops) };
#define putreg(x) [x] = mac_writereg
typedef void (*writeops)(E1000State *, int, uint32_t);
-static writeops macreg_writeops[] = {
+static const writeops macreg_writeops[] = {
putreg(PBA), putreg(EERD), putreg(SWSM), putreg(WUFC),
putreg(TDBAL), putreg(TDBAH), putreg(TXDCTL), putreg(RDBAH),
putreg(RDBAL), putreg(LEDCTL), putreg(VET), putreg(FCRUC),
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index 38bdb90114c6..df957e0c1a09 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -2856,7 +2856,7 @@ e1000e_set_gcr(E1000ECore *core, int index, uint32_t val)
#define e1000e_getreg(x) [x] = e1000e_mac_readreg
typedef uint32_t (*readops)(E1000ECore *, int);
-static readops e1000e_macreg_readops[] = {
+static const readops e1000e_macreg_readops[] = {
e1000e_getreg(PBA),
e1000e_getreg(WUFC),
e1000e_getreg(MANC),
@@ -3063,7 +3063,7 @@ enum { E1000E_NREADOPS =
ARRAY_SIZE(e1000e_macreg_readops) };
#define e1000e_putreg(x) [x] = e1000e_mac_writereg
typedef void (*writeops)(E1000ECore *, int, uint32_t);
-static writeops e1000e_macreg_writeops[] = {
+static const writeops e1000e_macreg_writeops[] = {
e1000e_putreg(PBA),
e1000e_putreg(SWSM),
e1000e_putreg(WUFC),
--
2.24.1
- [PULL 00/33] Trivial branch patches, Laurent Vivier, 2020/03/09
- [PULL 05/33] hw/net/e1000: Add readops/writeops typedefs, Laurent Vivier, 2020/03/09
- [PULL 06/33] hw/net/e1000: Move macreg[] arrays to .rodata to save 1MiB of .data,
Laurent Vivier <=
- [PULL 03/33] build-sys: Move the print-variable rule to rules.mak, Laurent Vivier, 2020/03/09
- [PULL 08/33] vl: Add missing "hw/boards.h" include, Laurent Vivier, 2020/03/09
- [PULL 04/33] hw/audio/fmopl: Fix a typo twice, Laurent Vivier, 2020/03/09
- [PULL 02/33] maint: Include top-level *.rst files early in git diff, Laurent Vivier, 2020/03/09
- [PULL 11/33] hw/timer: Remove unused "ui/console.h" header, Laurent Vivier, 2020/03/09
- [PULL 01/33] dp8393x: Mask EOL bit from descriptor addresses, take 2, Laurent Vivier, 2020/03/09
- [PULL 09/33] hw/southbridge/ich9: Removed unused headers, Laurent Vivier, 2020/03/09
- [PULL 12/33] hw/usb/dev-storage: Remove unused "ui/console.h" header, Laurent Vivier, 2020/03/09
- [PULL 19/33] hw/pci-host/q35: Include "qemu/range.h", Laurent Vivier, 2020/03/09
- [PULL 15/33] hw/alpha/dp264: Include "net/net.h", Laurent Vivier, 2020/03/09