From patchwork Thu Mar 8 22:39:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 883375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TJIpe6OJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zy5Cm5XLPz9scR for ; Fri, 9 Mar 2018 09:44:04 +1100 (AEDT) Received: from localhost ([::1]:42233 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4GY-0000vM-IQ for incoming@patchwork.ozlabs.org; Thu, 08 Mar 2018 17:44:02 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eu4Cl-0006nK-SV for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eu4Cl-0003uE-0o for qemu-devel@nongnu.org; Thu, 08 Mar 2018 17:40:07 -0500 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:40655) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eu4Ck-0003tx-Qm; Thu, 08 Mar 2018 17:40:06 -0500 Received: by mail-wr0-x241.google.com with SMTP id o76so7247840wrb.7; Thu, 08 Mar 2018 14:40:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DpHz+yOPRcolXxaCJjY99eF/NmlCOKIkmxQN+o7Gzr0=; b=TJIpe6OJcqKafxQWBJzC3VUY+01VE+lbGCUUj9HlcjsLztUmxk22lryWSVEJr/7pb6 Jpygi11knBHQmkVn1aSSOXAObV3KTsQPGJp12KlM2Hj6pikWqnn883xoIft/+pJFNRkF AmjGk5yUsuR4JQ+CLO+l/SXP4FHoKWsoaw9TppbnPETUbYnVf/kbGt8v6ShquiyN2yyy 3TKOnHyip7VARqA0qwwYFsYipQK1Fg96IwjGoUGZ1mlDSjZXp6UIeUKkKmmzQRXlAye0 wtuAe8JEUFTffbjmpqKuRdUcxhBDe6VHgvEvCiihsCHS6Ujp5iMtZSdCZ+CsV7pk+HhD QH1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DpHz+yOPRcolXxaCJjY99eF/NmlCOKIkmxQN+o7Gzr0=; b=aDggPxaZWEUyFaUnmHwWXD5TzgQUUmIzm5fMV7c9FYVqQSM/NlKMljB6mo9CdcjM+G JLMWf1nKj/82yYLEw0nyV9tnKb99jS8rZdwXxif4awKssvzWEmwe9vksUd0jTwJ8M3je GLao9iWLTqD4MUqZoMfXrsKuInYcnd0P0EpGwP8/I7RMBX6qvNAvqtkophs+nnQz5N+6 trxteIxVLJob2CJNPe8V18uWqzhpwAQa+tsnTx5KqdUj//kMtI+jrNB3gSvnG79/NcWt pgRBO3azCUlyQV5JCVZ0ARDtHtevqo4qvEZU7xBSiPWhDJ5M7qNSlq7pWovsRGdwKnUY UlvA== X-Gm-Message-State: APf1xPBnV2lywxC2B5HqZ6+M+mLVdC8o5LBY+VCoWrGxvA8EmNv0t/Rl omGCbvYj58qeKmv+yDPF+ww= X-Google-Smtp-Source: AG47ELuDj5nMzuMBg1IOB+8tI3Jv7/xMZ4CcTJZCk3wi7MJceKnlB54x1fyo3Nkksq1Rl7JkpiwyYw== X-Received: by 10.223.151.106 with SMTP id r97mr25341851wrb.203.1520548805832; Thu, 08 Mar 2018 14:40:05 -0800 (PST) Received: from x1.local (ABayonne-654-1-76-150.w86-222.abo.wanadoo.fr. [86.222.219.150]) by smtp.gmail.com with ESMTPSA id x190sm19315070wme.27.2018.03.08.14.40.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Mar 2018 14:40:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: "Michael S . Tsirkin" , Paolo Bonzini , =?utf-8?q?Herv=C3=A9_Poussineau?= , Marcel Apfelbaum , Aurelien Jarno , Alexey Kardashevskiy , Thomas Huth Date: Thu, 8 Mar 2018 23:39:27 +0100 Message-Id: <20180308223946.26784-7-f4bug@amsat.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180308223946.26784-1-f4bug@amsat.org> References: <20180308223946.26784-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH 06/25] hw/isa/pc87312: Use uint16_t for the ISA I/O base address X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Mark Cave-Ayland , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , qemu-devel@nongnu.org, "open list:PReP" , Guan Xuetao , Yongbok Kim , Artyom Tarasenko , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This matches the isa_register_ioport() prototype. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/isa/pc87312.h | 2 +- hw/isa/pc87312.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/hw/isa/pc87312.h b/include/hw/isa/pc87312.h index 710eb1c807..b65b219a8a 100644 --- a/include/hw/isa/pc87312.h +++ b/include/hw/isa/pc87312.h @@ -34,7 +34,7 @@ typedef struct PC87312State { ISADevice dev; - uint32_t iobase; + uint16_t iobase; uint8_t config; /* initial configuration */ struct { diff --git a/hw/isa/pc87312.c b/hw/isa/pc87312.c index e9edbc6c50..105c23e680 100644 --- a/hw/isa/pc87312.c +++ b/hw/isa/pc87312.c @@ -69,9 +69,9 @@ static inline bool is_parallel_enabled(PC87312State *s) return s->regs[REG_FER] & FER_PARALLEL_EN; } -static const uint32_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 }; +static const uint16_t parallel_base[] = { 0x378, 0x3bc, 0x278, 0x00 }; -static inline uint32_t get_parallel_iobase(PC87312State *s) +static inline uint16_t get_parallel_iobase(PC87312State *s) { return parallel_base[s->regs[REG_FAR] & FAR_PARALLEL_ADDR]; } @@ -92,12 +92,12 @@ static inline uint32_t get_parallel_irq(PC87312State *s) /* UARTs */ -static const uint32_t uart_base[2][4] = { +static const uint16_t uart_base[2][4] = { { 0x3e8, 0x338, 0x2e8, 0x220 }, { 0x2e8, 0x238, 0x2e0, 0x228 } }; -static inline uint32_t get_uart_iobase(PC87312State *s, int i) +static inline uint16_t get_uart_iobase(PC87312State *s, int i) { int idx; idx = (s->regs[REG_FAR] >> (2 * i + 2)) & 0x3; @@ -130,7 +130,7 @@ static inline bool is_fdc_enabled(PC87312State *s) return s->regs[REG_FER] & FER_FDC_EN; } -static inline uint32_t get_fdc_iobase(PC87312State *s) +static inline uint16_t get_fdc_iobase(PC87312State *s) { return (s->regs[REG_FER] & FER_FDC_ADDR) ? 0x370 : 0x3f0; } @@ -143,7 +143,7 @@ static inline bool is_ide_enabled(PC87312State *s) return s->regs[REG_FER] & FER_IDE_EN; } -static inline uint32_t get_ide_iobase(PC87312State *s) +static inline uint16_t get_ide_iobase(PC87312State *s) { return (s->regs[REG_FER] & FER_IDE_ADDR) ? 0x170 : 0x1f0; } @@ -373,7 +373,7 @@ static const VMStateDescription vmstate_pc87312 = { }; static Property pc87312_properties[] = { - DEFINE_PROP_UINT32("iobase", PC87312State, iobase, 0x398), + DEFINE_PROP_UINT16("iobase", PC87312State, iobase, 0x398), DEFINE_PROP_UINT8("config", PC87312State, config, 1), DEFINE_PROP_END_OF_LIST() };