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: 1933131 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=vBg/ihLU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VZMzn3QcLz23tx for ; Thu, 9 May 2024 03:47:32 +1000 (AEST) 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-Google-Smtp-Source: AGHT+IGgoFPgSuLdJzWWmK9z4ETnXQ6RpLzaJ6VUGGmiPZJTYJtmUOqfqGpI+sM4ujIoLfARASYHjA== 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.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) {