aboutsummaryrefslogtreecommitdiff
path: root/hw/e1000.c
diff options
context:
space:
mode:
authorJuan Quintela <quintela@redhat.com>2009-10-19 19:16:16 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-27 12:28:54 -0500
commit2e885049381f925fc2b430289c4aeeccd0ef4ed3 (patch)
treee0ea0efbbe3366f75aebf460909d2a7d89bf716b /hw/e1000.c
parent7c131dd59d9c2f0d267841c296b02372c31fadcd (diff)
e1000: unfold mac_reg_tosave array
Signed-off-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/e1000.c')
-rw-r--r--hw/e1000.c87
1 files changed, 74 insertions, 13 deletions
diff --git a/hw/e1000.c b/hw/e1000.c
index 2db50671aa..da37f82951 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -881,15 +881,6 @@ e1000_mmio_readw(void *opaque, target_phys_addr_t addr)
(8 * (addr & 3))) & 0xffff;
}
-static const int mac_regtosave[] = {
- CTRL, EECD, EERD, GPRC, GPTC, ICR, ICS, IMC, IMS,
- LEDCTL, MANC, MDIC, MPC, PBA, RCTL, RDBAH, RDBAL, RDH,
- RDLEN, RDT, STATUS, SWSM, TCTL, TDBAH, TDBAL, TDH, TDLEN,
- TDT, TORH, TORL, TOTH, TOTL, TPR, TPT, TXDCTL, WUFC,
- VET,
-};
-enum { MAC_NSAVE = ARRAY_SIZE(mac_regtosave) };
-
static const struct {
int size;
int array0;
@@ -931,8 +922,43 @@ nic_save(QEMUFile *f, void *opaque)
qemu_put_be16s(f, s->eeprom_data + i);
for (i = 0; i < 0x20; i++)
qemu_put_be16s(f, s->phy_reg + i);
- for (i = 0; i < MAC_NSAVE; i++)
- qemu_put_be32s(f, s->mac_reg + mac_regtosave[i]);
+ qemu_put_be32s(f, &s->mac_reg[CTRL]);
+ qemu_put_be32s(f, &s->mac_reg[EECD]);
+ qemu_put_be32s(f, &s->mac_reg[EERD]);
+ qemu_put_be32s(f, &s->mac_reg[GPRC]);
+ qemu_put_be32s(f, &s->mac_reg[GPTC]);
+ qemu_put_be32s(f, &s->mac_reg[ICR]);
+ qemu_put_be32s(f, &s->mac_reg[ICS]);
+ qemu_put_be32s(f, &s->mac_reg[IMC]);
+ qemu_put_be32s(f, &s->mac_reg[IMS]);
+ qemu_put_be32s(f, &s->mac_reg[LEDCTL]);
+ qemu_put_be32s(f, &s->mac_reg[MANC]);
+ qemu_put_be32s(f, &s->mac_reg[MDIC]);
+ qemu_put_be32s(f, &s->mac_reg[MPC]);
+ qemu_put_be32s(f, &s->mac_reg[PBA]);
+ qemu_put_be32s(f, &s->mac_reg[RCTL]);
+ qemu_put_be32s(f, &s->mac_reg[RDBAH]);
+ qemu_put_be32s(f, &s->mac_reg[RDBAL]);
+ qemu_put_be32s(f, &s->mac_reg[RDH]);
+ qemu_put_be32s(f, &s->mac_reg[RDLEN]);
+ qemu_put_be32s(f, &s->mac_reg[RDT]);
+ qemu_put_be32s(f, &s->mac_reg[STATUS]);
+ qemu_put_be32s(f, &s->mac_reg[SWSM]);
+ qemu_put_be32s(f, &s->mac_reg[TCTL]);
+ qemu_put_be32s(f, &s->mac_reg[TDBAH]);
+ qemu_put_be32s(f, &s->mac_reg[TDBAL]);
+ qemu_put_be32s(f, &s->mac_reg[TDH]);
+ qemu_put_be32s(f, &s->mac_reg[TDLEN]);
+ qemu_put_be32s(f, &s->mac_reg[TDT]);
+ qemu_put_be32s(f, &s->mac_reg[TORH]);
+ qemu_put_be32s(f, &s->mac_reg[TORL]);
+ qemu_put_be32s(f, &s->mac_reg[TOTH]);
+ qemu_put_be32s(f, &s->mac_reg[TOTL]);
+ qemu_put_be32s(f, &s->mac_reg[TPR]);
+ qemu_put_be32s(f, &s->mac_reg[TPT]);
+ qemu_put_be32s(f, &s->mac_reg[TXDCTL]);
+ qemu_put_be32s(f, &s->mac_reg[WUFC]);
+ qemu_put_be32s(f, &s->mac_reg[VET]);
for (i = 0; i < MAC_NARRAYS; i++)
for (j = 0; j < mac_regarraystosave[i].size; j++)
qemu_put_be32s(f,
@@ -977,8 +1003,43 @@ nic_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_be16s(f, s->eeprom_data + i);
for (i = 0; i < 0x20; i++)
qemu_get_be16s(f, s->phy_reg + i);
- for (i = 0; i < MAC_NSAVE; i++)
- qemu_get_be32s(f, s->mac_reg + mac_regtosave[i]);
+ qemu_get_be32s(f, &s->mac_reg[CTRL]);
+ qemu_get_be32s(f, &s->mac_reg[EECD]);
+ qemu_get_be32s(f, &s->mac_reg[EERD]);
+ qemu_get_be32s(f, &s->mac_reg[GPRC]);
+ qemu_get_be32s(f, &s->mac_reg[GPTC]);
+ qemu_get_be32s(f, &s->mac_reg[ICR]);
+ qemu_get_be32s(f, &s->mac_reg[ICS]);
+ qemu_get_be32s(f, &s->mac_reg[IMC]);
+ qemu_get_be32s(f, &s->mac_reg[IMS]);
+ qemu_get_be32s(f, &s->mac_reg[LEDCTL]);
+ qemu_get_be32s(f, &s->mac_reg[MANC]);
+ qemu_get_be32s(f, &s->mac_reg[MDIC]);
+ qemu_get_be32s(f, &s->mac_reg[MPC]);
+ qemu_get_be32s(f, &s->mac_reg[PBA]);
+ qemu_get_be32s(f, &s->mac_reg[RCTL]);
+ qemu_get_be32s(f, &s->mac_reg[RDBAH]);
+ qemu_get_be32s(f, &s->mac_reg[RDBAL]);
+ qemu_get_be32s(f, &s->mac_reg[RDH]);
+ qemu_get_be32s(f, &s->mac_reg[RDLEN]);
+ qemu_get_be32s(f, &s->mac_reg[RDT]);
+ qemu_get_be32s(f, &s->mac_reg[STATUS]);
+ qemu_get_be32s(f, &s->mac_reg[SWSM]);
+ qemu_get_be32s(f, &s->mac_reg[TCTL]);
+ qemu_get_be32s(f, &s->mac_reg[TDBAH]);
+ qemu_get_be32s(f, &s->mac_reg[TDBAL]);
+ qemu_get_be32s(f, &s->mac_reg[TDH]);
+ qemu_get_be32s(f, &s->mac_reg[TDLEN]);
+ qemu_get_be32s(f, &s->mac_reg[TDT]);
+ qemu_get_be32s(f, &s->mac_reg[TORH]);
+ qemu_get_be32s(f, &s->mac_reg[TORL]);
+ qemu_get_be32s(f, &s->mac_reg[TOTH]);
+ qemu_get_be32s(f, &s->mac_reg[TOTL]);
+ qemu_get_be32s(f, &s->mac_reg[TPR]);
+ qemu_get_be32s(f, &s->mac_reg[TPT]);
+ qemu_get_be32s(f, &s->mac_reg[TXDCTL]);
+ qemu_get_be32s(f, &s->mac_reg[WUFC]);
+ qemu_get_be32s(f, &s->mac_reg[VET]);
for (i = 0; i < MAC_NARRAYS; i++)
for (j = 0; j < mac_regarraystosave[i].size; j++)
qemu_get_be32s(f,