From patchwork Fri Mar 26 19:04:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 48718 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id BCCACB7CC2 for ; Sat, 27 Mar 2010 07:15:07 +1100 (EST) Received: from localhost ([127.0.0.1]:49170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvFuZ-0005ZK-0C for incoming@patchwork.ozlabs.org; Fri, 26 Mar 2010 16:13:43 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvEpi-0002mI-HY for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:04:38 -0400 Received: from [140.186.70.92] (port=32961 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvEpg-0002k0-4O for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:04:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvEpb-0007bE-Ly for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:04:34 -0400 Received: from mail-pz0-f194.google.com ([209.85.222.194]:52504) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvEpa-0007as-N8 for qemu-devel@nongnu.org; Fri, 26 Mar 2010 15:04:31 -0400 Received: by pzk32 with SMTP id 32so2910330pzk.4 for ; Fri, 26 Mar 2010 12:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:received:message-id :subject:from:to:content-type; bh=fLQyaBCHOrkiK36/8fj40/jwW3jP26bdNyLFO8uj+ZQ=; b=Cd9FFny5hUXhoAFQGuFo9pw20ZChk8mSlxy2LDdfvpMyWoD8ll+iAfiSVOyzcdYtby qPQD3eFy5o+2TtYl6K1HWPnblo66Vk9hK2Qid0p+Rh21SmJU0tQGccJ5PfsbxKQzmEsS eckWsMU0cfgTtm0HxP9bbg8mMGkn94hO2l0Pg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=oSJyws/vRf3fYnrpikaXGmW7djgdwM968JeMFz+skdFACc1TpDMQboP0/YtihT9CvI 78OZl2VgjMYuZxCK9ikZSBFRYxuzd55CnqkyR6SLZpP6fIozEbSLByz0c/dRFKLPbOyM joDMz9IiL9YpuVcMSiQzYIrmiIanAtNhP9r2w= MIME-Version: 1.0 Received: by 10.141.51.13 with HTTP; Fri, 26 Mar 2010 12:04:29 -0700 (PDT) Date: Fri, 26 Mar 2010 21:04:29 +0200 Received: by 10.141.106.11 with SMTP id i11mr1388524rvm.213.1269630269774; Fri, 26 Mar 2010 12:04:29 -0700 (PDT) Message-ID: From: Blue Swirl To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 08/10] Compile virtio-serial-bus only once X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Replace access macros with direct accesses. Signed-off-by: Blue Swirl --- Makefile.objs | 2 +- Makefile.target | 2 +- hw/virtio-serial-bus.c | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) 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); diff --git a/Makefile.objs b/Makefile.objs index 6498ff7..7973ab2 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -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 diff --git a/Makefile.target b/Makefile.target index 45c9d40..285c805 100644 --- a/Makefile.target +++ b/Makefile.target @@ -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 diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 17c1ec1..a1c0964 100644 --- a/hw/virtio-serial-bus.c +++ b/hw/virtio-serial-bus.c @@ -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);