Commit 88b4e9dbe242ff2b83f9539a13efc1d4f935da7d
1 parent
daa41b00
Make some tables const
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5395 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
6 deletions
hw/e1000.c
... | ... | @@ -131,7 +131,7 @@ enum { |
131 | 131 | }; |
132 | 132 | |
133 | 133 | enum { PHY_R = 1, PHY_W = 2, PHY_RW = PHY_R | PHY_W }; |
134 | -static char phy_regcap[0x20] = { | |
134 | +static const char phy_regcap[0x20] = { | |
135 | 135 | [PHY_STATUS] = PHY_R, [M88E1000_EXT_PHY_SPEC_CTRL] = PHY_RW, |
136 | 136 | [PHY_ID1] = PHY_R, [M88E1000_PHY_SPEC_CTRL] = PHY_RW, |
137 | 137 | [PHY_CTRL] = PHY_RW, [PHY_1000T_CTRL] = PHY_RW, |
... | ... | @@ -783,7 +783,7 @@ e1000_mmio_readw(void *opaque, target_phys_addr_t addr) |
783 | 783 | (8 * (addr & 3))) & 0xffff; |
784 | 784 | } |
785 | 785 | |
786 | -static int mac_regtosave[] = { | |
786 | +static const int mac_regtosave[] = { | |
787 | 787 | CTRL, EECD, EERD, GPRC, GPTC, ICR, ICS, IMC, IMS, |
788 | 788 | LEDCTL, MANC, MDIC, MPC, PBA, RCTL, RDBAH, RDBAL, RDH, |
789 | 789 | RDLEN, RDT, STATUS, SWSM, TCTL, TDBAH, TDBAL, TDH, TDLEN, |
... | ... | @@ -791,7 +791,7 @@ static int mac_regtosave[] = { |
791 | 791 | }; |
792 | 792 | enum { MAC_NSAVE = sizeof mac_regtosave/sizeof *mac_regtosave }; |
793 | 793 | |
794 | -static struct { | |
794 | +static const struct { | |
795 | 795 | int size; |
796 | 796 | int array0; |
797 | 797 | } mac_regarraystosave[] = { {32, RA}, {128, MTA} }; |
... | ... | @@ -887,7 +887,7 @@ nic_load(QEMUFile *f, void *opaque, int version_id) |
887 | 887 | return 0; |
888 | 888 | } |
889 | 889 | |
890 | -static uint16_t e1000_eeprom_template[64] = { | |
890 | +static const uint16_t e1000_eeprom_template[64] = { | |
891 | 891 | 0x0000, 0x0000, 0x0000, 0x0000, 0xffff, 0x0000, 0x0000, 0x0000, |
892 | 892 | 0x3000, 0x1000, 0x6403, E1000_DEVID, 0x8086, E1000_DEVID, 0x8086, 0x3040, |
893 | 893 | 0x0008, 0x2000, 0x7e14, 0x0048, 0x1000, 0x00d8, 0x0000, 0x2700, |
... | ... | @@ -898,7 +898,7 @@ static uint16_t e1000_eeprom_template[64] = { |
898 | 898 | 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, |
899 | 899 | }; |
900 | 900 | |
901 | -static uint16_t phy_reg_init[] = { | |
901 | +static const uint16_t phy_reg_init[] = { | |
902 | 902 | [PHY_CTRL] = 0x1140, [PHY_STATUS] = 0x796d, // link initially up |
903 | 903 | [PHY_ID1] = 0x141, [PHY_ID2] = PHY_ID2_INIT, |
904 | 904 | [PHY_1000T_CTRL] = 0x0e00, [M88E1000_PHY_SPEC_CTRL] = 0x360, |
... | ... | @@ -907,7 +907,7 @@ static uint16_t phy_reg_init[] = { |
907 | 907 | [M88E1000_PHY_SPEC_STATUS] = 0xac00, |
908 | 908 | }; |
909 | 909 | |
910 | -static uint32_t mac_reg_init[] = { | |
910 | +static const uint32_t mac_reg_init[] = { | |
911 | 911 | [PBA] = 0x00100030, |
912 | 912 | [LEDCTL] = 0x602, |
913 | 913 | [CTRL] = E1000_CTRL_SWDPIN2 | E1000_CTRL_SWDPIN0 | | ... | ... |