From patchwork Wed May 8 17:44:53 2024 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: 795493 Delivered-To: patch@linaro.org Received: by 2002:a5d:525c:0:b0:34e:ceec:bfcd with SMTP id k28csp903400wrc; Wed, 8 May 2024 10:47:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW1rf6+NHMtu2fI8c+jhsZu4XpsHnfUsr2yStK84lfSGYLtduSS7XMOPQGBjiBuR3EPlYy3FRCzB6GR8UNZLu/H X-Google-Smtp-Source: AGHT+IEJ3eq7W1pyZGAm/Z06r7CmzciKfjWNM4j4z9/WcljYIJQoSfH0x/gvtsRNYFUlWY2wS5BR X-Received: by 2002:a05:620a:2608:b0:792:b6f0:65d1 with SMTP id af79cd13be357-792b6f06754mr264214685a.64.1715190451516; Wed, 08 May 2024 10:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715190451; cv=none; d=google.com; s=arc-20160816; b=HhFjELgbivPVohv5vB2Udfd3HkL6uNcD5pi+qd75DueFowXMz7ucpbkqNc4oMaqSKh yct//Y5S9VkKcm+Fumks3vb2BFLaGrQaR1TZi/TAf4/qqkdseOmeSBtBJ5ODEWdCcUGA zHZQy6nyQXI+sVglj3CzWbNHS8uaMrWUegB3RIfljVJo14eJ+L6eUx88VZQkepfzSZov ZDl1zYg8G4eMWvoR8ixaZhHplRBHBXghpvHf5315fMkGHkyDnjPSYkPHqJpNwmoMl8ID GVV1lfbMdauhQauI/ivcMoRThaSQ4h0/0caJNRaMjPCbzDcByInFrWkrHVlkWkJuIiey s1Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/3iYL7NrK3YLqicig51htgd0NBJzLG9cU40QkiClpvo=; fh=qi6M7+758Hm8qfC4GxHVnK55oMKkCiFOk69X0Z7vtIs=; b=i5FFI79mU61ZQ3GQkAfoE0UH3SJ25IMzU3/ctlsLC/8EopSxEKpIak6eRDwjGt88ph jVflzF5b8FXCC3b36NQIBQCUG/UeyfX0aw9FV/owbgQymRxPXAjf7nwesq3hf86c98Td XSM81P1Y8q0jvh8/ZwLWlM088YeEvnzBDNIV0pjH0a5SnqM/d6+c0JokSZNn+YQWbueC eUaQ5VZ4abSWCTeTch8JKVBgwLFbOQxTm1sqhnD1T4NrMNsQnTbI2UD10KhH50iTcFL+ Olnb/AMOCrNWSBUwX6X6oUI8zMzLPtDGTwHhZutmBB31cKZuE7D6G5nYC2/sOpqM6XMP ujjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vBg/ihLU"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u17-20020a05620a455100b0078eeba4fd95si15485418qkp.220.2024.05.08.10.47.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2024 10:47:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="vBg/ihLU"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4lNG-00014V-BM; Wed, 08 May 2024 13:46:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4lMk-0000TL-Ec for qemu-devel@nongnu.org; Wed, 08 May 2024 13:46:14 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4lMi-0007Oz-SV for qemu-devel@nongnu.org; Wed, 08 May 2024 13:46:06 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-52006fbae67so6405735e87.0 for ; Wed, 08 May 2024 10:46:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715190363; x=1715795163; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/3iYL7NrK3YLqicig51htgd0NBJzLG9cU40QkiClpvo=; b=vBg/ihLUYONPmDIgZzQMVzAQWatOVPUNTqpDCGqFBwZ2RZ+F61dfyGFZV9KGrzoBja OdoHUc1+wXuW3nEEfMSzW3smCme2pvx3cM3H8AlhDQ2Az1w5gVDSyW8LPym9dBgD/iLT mUr+/627HjxB9g59xgx7evuN/iuI6ngoNOc8r1XbIwA2040kOXwWPRaPOCjteR9r+sgE ArGkNqZod35zY7QoJmaGjdqGw9SYKfGUGgE6e3vDQW6wPpyGquPN5dQzUIreLikDJA2f zEPMnujSzb9ADtWMcaN/1ZiTVC3oTCVxGKZnISTpKZ9sPHBapqDUEbpRwcACjmxwnz1n Z9EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715190363; x=1715795163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/3iYL7NrK3YLqicig51htgd0NBJzLG9cU40QkiClpvo=; b=cwcFgi9bl/HU++Btnhs43vKsTbwD1FdfYVLzaRJS6WW3gRYijeVT3vgX5e7oyrJNtC MEFXWMibsNxQ9X50qZX/gV4b/tr5lyDzWCpv1g2TjfYnA0VgQEM82pHgNtahdUP+cwxR Swi+R6GXgJb10UGTPS+cVHjL63hIIdvbBDD/NAIM44QJGRHYSAxcTMUFvCo5dE8SuOMp o54xSHAZ4DhuQdbAxNDxU8WXzNKDYId7Wmkg6krejqZ5gYM8AoDmzRya7lNC8ZgcXy9B sH2fsQyC60uwL9p6uf977eBt+OsyiN8fB/qgdx5qQVKexAf/nS7v+jN/E9ji5EmD9ShI 9CAg== X-Gm-Message-State: AOJu0YxKhpcIlciPuhBIwLg/71AA1nw/YfLbqbhmfGY27pnkk72PgC54 d1Vs7MmxP+/fnEhTUQya5onKU7gJR9z093LO/ynA3gWLTTkZXv472tbTYY4svlLEiU7H6hpMwDh C X-Received: by 2002:a05:6512:3f1a:b0:518:ae8f:b573 with SMTP id 2adb3069b0e04-5217cf3cb59mr2189882e87.61.1715190362829; Wed, 08 May 2024 10:46:02 -0700 (PDT) Received: from m1x-phil.lan (sar95-h02-176-184-10-250.dsl.sta.abo.bbox.fr. [176.184.10.250]) by smtp.gmail.com with ESMTPSA id oy6-20020a170907104600b00a59a86b85ecsm5747185ejb.78.2024.05.08.10.46.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 08 May 2024 10:46:02 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 09/26] hw/i386/pc: Allow to compile without CONFIG_FDC_ISA Date: Wed, 8 May 2024 19:44:53 +0200 Message-ID: <20240508174510.60470-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240508174510.60470-1-philmd@linaro.org> References: <20240508174510.60470-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Thomas Huth The q35 machine can work without FDC. But to be able to also link a QEMU binary that does not include the FDC code, we have to make it possible to disable the spots that call into the FDC code. Signed-off-by: Thomas Huth Acked-by: Philippe Mathieu-Daudé Message-ID: <20240425184315.553329-2-thuth@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/pc.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 46235466d7..505ea750f4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -440,16 +440,19 @@ static void pc_boot_set(void *opaque, const char *boot_device, Error **errp) static void pc_cmos_init_floppy(MC146818RtcState *rtc_state, ISADevice *floppy) { - int val, nb, i; + int val, nb; FloppyDriveType fd_type[2] = { FLOPPY_DRIVE_TYPE_NONE, FLOPPY_DRIVE_TYPE_NONE }; +#ifdef CONFIG_FDC_ISA /* floppy type */ if (floppy) { - for (i = 0; i < 2; i++) { + for (int i = 0; i < 2; i++) { fd_type[i] = isa_fdc_get_drive_type(floppy, i); } } +#endif + val = (cmos_get_fd_drive_type(fd_type[0]) << 4) | cmos_get_fd_drive_type(fd_type[1]); mc146818rtc_set_cmos_data(rtc_state, 0x10, val); @@ -1133,7 +1136,7 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, int i; DriveInfo *fd[MAX_FD]; qemu_irq *a20_line; - ISADevice *fdc, *i8042, *port92, *vmmouse; + ISADevice *i8042, *port92, *vmmouse; serial_hds_isa_init(isa_bus, 0, MAX_ISA_SERIAL_PORTS); parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS); @@ -1143,11 +1146,13 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl, create_fdctrl |= !!fd[i]; } if (create_fdctrl) { - fdc = isa_new(TYPE_ISA_FDC); +#ifdef CONFIG_FDC_ISA + ISADevice *fdc = isa_new(TYPE_ISA_FDC); if (fdc) { isa_realize_and_unref(fdc, isa_bus, &error_fatal); isa_fdc_init_drives(fdc, fd); } +#endif } if (!create_i8042) {