mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
Let address_space_rw() calls pass a boolean 'is_write' argument
Since its introduction in commit ac1970fbe8
, address_space_rw()
takes a boolean 'is_write' argument. Fix the codebase by using
an explicit boolean type.
This commit was produced with the included Coccinelle script
scripts/coccinelle/exec_rw_const.
Inspired-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
ae5883abec
commit
1ccda935d4
7 changed files with 41 additions and 27 deletions
|
@ -149,7 +149,7 @@ static void i82596_transmit(I82596State *s, uint32_t addr)
|
|||
if (s->nic && len) {
|
||||
assert(len <= sizeof(s->tx_buffer));
|
||||
address_space_rw(&address_space_memory, tba,
|
||||
MEMTXATTRS_UNSPECIFIED, s->tx_buffer, len, 0);
|
||||
MEMTXATTRS_UNSPECIFIED, s->tx_buffer, len, false);
|
||||
DBG(PRINT_PKTHDR("Send", &s->tx_buffer));
|
||||
DBG(printf("Sending %d bytes\n", len));
|
||||
qemu_send_packet(qemu_get_queue(s->nic), s->tx_buffer, len);
|
||||
|
@ -173,7 +173,7 @@ static void set_individual_address(I82596State *s, uint32_t addr)
|
|||
nc = qemu_get_queue(s->nic);
|
||||
m = s->conf.macaddr.a;
|
||||
address_space_rw(&address_space_memory, addr + 8,
|
||||
MEMTXATTRS_UNSPECIFIED, m, ETH_ALEN, 0);
|
||||
MEMTXATTRS_UNSPECIFIED, m, ETH_ALEN, false);
|
||||
qemu_format_nic_info_str(nc, m);
|
||||
trace_i82596_new_mac(nc->info_str);
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ static void set_multicast_list(I82596State *s, uint32_t addr)
|
|||
uint8_t multicast_addr[ETH_ALEN];
|
||||
address_space_rw(&address_space_memory,
|
||||
addr + i * ETH_ALEN, MEMTXATTRS_UNSPECIFIED,
|
||||
multicast_addr, ETH_ALEN, 0);
|
||||
multicast_addr, ETH_ALEN, false);
|
||||
DBG(printf("Add multicast entry " MAC_FMT "\n",
|
||||
MAC_ARG(multicast_addr)));
|
||||
unsigned mcast_idx = (net_crc32(multicast_addr, ETH_ALEN) &
|
||||
|
@ -261,7 +261,8 @@ static void command_loop(I82596State *s)
|
|||
byte_cnt = MIN(byte_cnt, sizeof(s->config));
|
||||
/* copy byte_cnt max. */
|
||||
address_space_rw(&address_space_memory, s->cmd_p + 8,
|
||||
MEMTXATTRS_UNSPECIFIED, s->config, byte_cnt, 0);
|
||||
MEMTXATTRS_UNSPECIFIED, s->config, byte_cnt,
|
||||
false);
|
||||
/* config byte according to page 35ff */
|
||||
s->config[2] &= 0x82; /* mask valid bits */
|
||||
s->config[2] |= 0x40;
|
||||
|
@ -647,7 +648,7 @@ ssize_t i82596_receive(NetClientState *nc, const uint8_t *buf, size_t sz)
|
|||
len -= num;
|
||||
if (len == 0) { /* copy crc */
|
||||
address_space_rw(&address_space_memory, rba - 4,
|
||||
MEMTXATTRS_UNSPECIFIED, crc_ptr, 4, 1);
|
||||
MEMTXATTRS_UNSPECIFIED, crc_ptr, 4, true);
|
||||
}
|
||||
|
||||
num |= 0x4000; /* set F BIT */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue