Compile virtio-serial-bus only once
PATCH 8/10 Compile virtio-serial-bus only once
Replace access macros with direct accesses.
Signed-off-by Blue Swirl <[email protected]>
--- Makefile.objs | 2 +- Makefile.target | 2 +- hw/virtio-serial-bus.c | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-)
Makefile.objs +1 -1
@@ -128,7 +128,7 @@ user-obj-y += cutils.o cache-utils.o hw-obj-y = hw-obj-y += loader.o -hw-obj-y += virtio.o virtio-console.o virtio-pci.o +hw-obj-y += virtio.o virtio-console.o virtio-pci.o virtio-serial-bus.o hw-obj-y += fw_cfg.o pci.o pci_host.o pcie_host.o hw-obj-y += watchdog.o hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
Makefile.target +1 -1
@@ -165,7 +165,7 @@ obj-y = vl.o monitor.o machine.o gdbstub.o obj-y += qemu-timer.o # virtio has to be here due to weird dependency between PCI and virtio-net. # need to fix this properly -obj-y += virtio-blk.o virtio-balloon.o virtio-net.o virtio-serial-bus.o +obj-y += virtio-blk.o virtio-balloon.o virtio-net.o obj-y += rwhandler.o obj-$(CONFIG_KVM) += kvm.o kvm-all.o LIBS+=-lz
hw/virtio-serial-bus.c +0 -0
@@ -122,7 +122,7 @@ static size_t send_control_msg(VirtIOSerialPort
*port, void *buf, size_t len)
}
cpkt = (struct virtio_console_control *)buf;
- stl_p(&cpkt->id, port->id);
+ cpkt->id = port->id;
memcpy(elem.in_sg[0].iov_base, buf, len);
virtqueue_push(vq, &elem, len);
@@ -135,8 +135,8 @@ static size_t send_control_event(VirtIOSerialPort
*port, uint16_t event,
{
struct virtio_console_control cpkt;- stw_p(&cpkt.event, event); - stw_p(&cpkt.value, value); + cpkt.event = event; + cpkt.value = value;
return send_control_msg(port, &cpkt, sizeof(cpkt));
}
@@ -208,12 +208,12 @@ static void handle_control_message(VirtIOSerial
*vser, void *buf)
size_t buffer_len;
gcpkt = buf;
- port = find_port_by_id(vser, ldl_p(&gcpkt->id));
+ port = find_port_by_id(vser, gcpkt->id);
if (!port)
return;- cpkt.event = lduw_p(&gcpkt->event); - cpkt.value = lduw_p(&gcpkt->value); + cpkt.event = gcpkt->event; + cpkt.value = gcpkt->value;
switch(cpkt.event) {
case VIRTIO_CONSOLE_PORT_READY:
@@ -229,8 +229,8 @@ static void handle_control_message(VirtIOSerial
*vser, void *buf)
}
if (port->name) {
- stw_p(&cpkt.event, VIRTIO_CONSOLE_PORT_NAME);
- stw_p(&cpkt.value, 1);
+ cpkt.event = VIRTIO_CONSOLE_PORT_NAME;
+ cpkt.value =1; buffer_len = sizeof(cpkt) + strlen(port->name) + 1;
buffer = qemu_malloc(buffer_len);Signature · 1 line
1.6.2.4