Revision 99a0949b hw/rtl8139.c
b/hw/rtl8139.c | ||
---|---|---|
335 | 335 |
CH_8100, |
336 | 336 |
CH_8100B_8139D, |
337 | 337 |
CH_8101, |
338 |
} chip_t;
|
|
338 |
} e_chip;
|
|
339 | 339 |
|
340 | 340 |
enum chip_flags { |
341 | 341 |
HasHltClk = (1 << 0), |
... | ... | |
414 | 414 |
static void RTL8139TallyCounters_clear(RTL8139TallyCounters* counters); |
415 | 415 |
|
416 | 416 |
/* Writes tally counters to specified physical memory address */ |
417 |
static void RTL8139TallyCounters_physical_memory_write(target_phys_addr_t tc_addr, RTL8139TallyCounters* counters);
|
|
417 |
static void RTL8139TallyCounters_physical_memory_write(a_target_phys_addr tc_addr, RTL8139TallyCounters* counters);
|
|
418 | 418 |
|
419 | 419 |
/* Loads values of tally counters from VM state file */ |
420 | 420 |
static void RTL8139TallyCounters_load(QEMUFile* f, RTL8139TallyCounters *tally_counters); |
... | ... | |
781 | 781 |
} |
782 | 782 |
|
783 | 783 |
#define MIN_BUF_SIZE 60 |
784 |
static inline target_phys_addr_t rtl8139_addr64(uint32_t low, uint32_t high)
|
|
784 |
static inline a_target_phys_addr rtl8139_addr64(uint32_t low, uint32_t high)
|
|
785 | 785 |
{ |
786 | 786 |
#if TARGET_PHYS_ADDR_BITS > 32 |
787 |
return low | ((target_phys_addr_t)high << 32);
|
|
787 |
return low | ((a_target_phys_addr)high << 32);
|
|
788 | 788 |
#else |
789 | 789 |
return low; |
790 | 790 |
#endif |
... | ... | |
959 | 959 |
/* w3 high 32bit of Rx buffer ptr */ |
960 | 960 |
|
961 | 961 |
int descriptor = s->currCPlusRxDesc; |
962 |
target_phys_addr_t cplus_rx_ring_desc;
|
|
962 |
a_target_phys_addr cplus_rx_ring_desc;
|
|
963 | 963 |
|
964 | 964 |
cplus_rx_ring_desc = rtl8139_addr64(s->RxRingAddrLO, s->RxRingAddrHI); |
965 | 965 |
cplus_rx_ring_desc += 16 * descriptor; |
... | ... | |
1017 | 1017 |
return size_; |
1018 | 1018 |
} |
1019 | 1019 |
|
1020 |
target_phys_addr_t rx_addr = rtl8139_addr64(rxbufLO, rxbufHI);
|
|
1020 |
a_target_phys_addr rx_addr = rtl8139_addr64(rxbufLO, rxbufHI);
|
|
1021 | 1021 |
|
1022 | 1022 |
/* receive/copy to target memory */ |
1023 | 1023 |
cpu_physical_memory_write( rx_addr, buf, size ); |
... | ... | |
1280 | 1280 |
counters->TxUndrn = 0; |
1281 | 1281 |
} |
1282 | 1282 |
|
1283 |
static void RTL8139TallyCounters_physical_memory_write(target_phys_addr_t tc_addr, RTL8139TallyCounters* tally_counters)
|
|
1283 |
static void RTL8139TallyCounters_physical_memory_write(a_target_phys_addr tc_addr, RTL8139TallyCounters* tally_counters)
|
|
1284 | 1284 |
{ |
1285 | 1285 |
uint16_t val16; |
1286 | 1286 |
uint32_t val32; |
... | ... | |
1913 | 1913 |
|
1914 | 1914 |
int descriptor = s->currCPlusTxDesc; |
1915 | 1915 |
|
1916 |
target_phys_addr_t cplus_tx_ring_desc =
|
|
1916 |
a_target_phys_addr cplus_tx_ring_desc =
|
|
1917 | 1917 |
rtl8139_addr64(s->TxAddr[0], s->TxAddr[1]); |
1918 | 1918 |
|
1919 | 1919 |
/* Normal priority ring */ |
... | ... | |
1996 | 1996 |
} |
1997 | 1997 |
|
1998 | 1998 |
int txsize = txdw0 & CP_TX_BUFFER_SIZE_MASK; |
1999 |
target_phys_addr_t tx_addr = rtl8139_addr64(txbufLO, txbufHI);
|
|
1999 |
a_target_phys_addr tx_addr = rtl8139_addr64(txbufLO, txbufHI);
|
|
2000 | 2000 |
|
2001 | 2001 |
/* make sure we have enough space to assemble the packet */ |
2002 | 2002 |
if (!s->cplus_txbuffer) |
... | ... | |
2386 | 2386 |
|
2387 | 2387 |
if (descriptor == 0 && (val & 0x8)) |
2388 | 2388 |
{ |
2389 |
target_phys_addr_t tc_addr = rtl8139_addr64(s->TxStatus[0] & ~0x3f, s->TxStatus[1]);
|
|
2389 |
a_target_phys_addr tc_addr = rtl8139_addr64(s->TxStatus[0] & ~0x3f, s->TxStatus[1]);
|
|
2390 | 2390 |
|
2391 | 2391 |
/* dump tally counters to specified memory location */ |
2392 | 2392 |
RTL8139TallyCounters_physical_memory_write( tc_addr, &s->tally_counters); |
... | ... | |
3070 | 3070 |
|
3071 | 3071 |
/* */ |
3072 | 3072 |
|
3073 |
static void rtl8139_mmio_writeb(void *opaque, target_phys_addr_t addr, uint32_t val)
|
|
3073 |
static void rtl8139_mmio_writeb(void *opaque, a_target_phys_addr addr, uint32_t val)
|
|
3074 | 3074 |
{ |
3075 | 3075 |
rtl8139_io_writeb(opaque, addr & 0xFF, val); |
3076 | 3076 |
} |
3077 | 3077 |
|
3078 |
static void rtl8139_mmio_writew(void *opaque, target_phys_addr_t addr, uint32_t val)
|
|
3078 |
static void rtl8139_mmio_writew(void *opaque, a_target_phys_addr addr, uint32_t val)
|
|
3079 | 3079 |
{ |
3080 | 3080 |
#ifdef TARGET_WORDS_BIGENDIAN |
3081 | 3081 |
val = bswap16(val); |
... | ... | |
3083 | 3083 |
rtl8139_io_writew(opaque, addr & 0xFF, val); |
3084 | 3084 |
} |
3085 | 3085 |
|
3086 |
static void rtl8139_mmio_writel(void *opaque, target_phys_addr_t addr, uint32_t val)
|
|
3086 |
static void rtl8139_mmio_writel(void *opaque, a_target_phys_addr addr, uint32_t val)
|
|
3087 | 3087 |
{ |
3088 | 3088 |
#ifdef TARGET_WORDS_BIGENDIAN |
3089 | 3089 |
val = bswap32(val); |
... | ... | |
3091 | 3091 |
rtl8139_io_writel(opaque, addr & 0xFF, val); |
3092 | 3092 |
} |
3093 | 3093 |
|
3094 |
static uint32_t rtl8139_mmio_readb(void *opaque, target_phys_addr_t addr)
|
|
3094 |
static uint32_t rtl8139_mmio_readb(void *opaque, a_target_phys_addr addr)
|
|
3095 | 3095 |
{ |
3096 | 3096 |
return rtl8139_io_readb(opaque, addr & 0xFF); |
3097 | 3097 |
} |
3098 | 3098 |
|
3099 |
static uint32_t rtl8139_mmio_readw(void *opaque, target_phys_addr_t addr)
|
|
3099 |
static uint32_t rtl8139_mmio_readw(void *opaque, a_target_phys_addr addr)
|
|
3100 | 3100 |
{ |
3101 | 3101 |
uint32_t val = rtl8139_io_readw(opaque, addr & 0xFF); |
3102 | 3102 |
#ifdef TARGET_WORDS_BIGENDIAN |
... | ... | |
3105 | 3105 |
return val; |
3106 | 3106 |
} |
3107 | 3107 |
|
3108 |
static uint32_t rtl8139_mmio_readl(void *opaque, target_phys_addr_t addr)
|
|
3108 |
static uint32_t rtl8139_mmio_readl(void *opaque, a_target_phys_addr addr)
|
|
3109 | 3109 |
{ |
3110 | 3110 |
uint32_t val = rtl8139_io_readl(opaque, addr & 0xFF); |
3111 | 3111 |
#ifdef TARGET_WORDS_BIGENDIAN |
Also available in: Unified diff