From nobody Thu Nov 13 21:53:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583360372; cv=none; d=zohomail.com; s=zohoarc; b=a8PhIDU0yhEmoJsSqBD70n7xiLZMgrjo796UuOnZOQ7e2EdLaidEMCb5tG/MosQQM7M9vVwOkDJhFDNuS2DRSEK0OQZaL2X3fj55hydFGK3uOpDdJcCQWiU3JzeaFx/aqQuFweMRARooUFvdY0B75VTY6+E5FWkjB5YLnSUfoC4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583360372; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rtGLaqsaZvVKv8neLsnCoHMeb27hmi8Np6ey/SFBDes=; b=WF3vrzEYtQW0/rGTQWuqmDBWCKddWhZJTY10K9A/ZVUHE/CnTY20QjU9s8lfRvJQQSYPJrC1pelMIyGMRi4DAk9eKx53ajY0RMTYe9KXzc3CVYN5LvyzBjrnu1sqkWySw/exBgGQgwmn1QSamZq5Z50h1S/ANGi+Vbzdq5ukqg8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583360372038587.0005225166163; Wed, 4 Mar 2020 14:19:32 -0800 (PST) Received: from localhost ([::1]:40482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cMU-0001dR-AZ for importer@patchew.org; Wed, 04 Mar 2020 17:19:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32968) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cLN-0008ON-AI for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9cLM-0006Xy-FD for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:21 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:27054 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9cLM-0006Wr-Bw for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:20 -0500 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-458-2XMKtcL5MC63Oders68UQQ-1; Wed, 04 Mar 2020 17:18:16 -0500 Received: by mail-wr1-f69.google.com with SMTP id n12so1429477wrp.19 for ; Wed, 04 Mar 2020 14:18:15 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id j5sm6058032wmi.33.2020.03.04.14.18.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 14:18:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583360299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rtGLaqsaZvVKv8neLsnCoHMeb27hmi8Np6ey/SFBDes=; b=M7/QAqPFeUknx4e+nyVyLcGitNkPQOQFZmPU0ScQvWdrulklSlfLsq0tziTFLaZ6NhC9uw 1oPiYqw4FTY7Vhk1PiwiPB2MLnSWSf3OFlHzZ/bIrDMs96gvABwvoVcLDuIloKJW+l/TIR ML+PF/oQL+4YZYZ9xYuXPVHFP862+tY= X-MC-Unique: 2XMKtcL5MC63Oders68UQQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Wqft5lo3Zm47BUbzrIIQxJ61cvphsmqIQUJGbmyNiH4=; b=PHD7WYiFR4NR3ey4xYEH/Zeh1K4nxpHu+a4YiiiVRBNfL1Tqe4zYYJkDc2dgJGLMJy z9+WlHiBdSf6ACMtTemSEsA9bZiAYLtXRg9DjotKPs3TAuDhmVATvoFDukMtlfVjymZ+ igg5EPBSeEoPbGd1oyo+EfcEUKwXCR+aQsDw/SjQvGT6eeKOBcBQLcdOEtu2SpgtmUcR Q548GWC/Qfz5/cOqxqhF6ulF5yCv60JOW1YO9GziCDh+qN4QqLKPLww6fbPQACWlQZhV cNBEPTCK0jXbz8/OgOIOtUJmwb/PyEZCFE0xn0TQ7AZ9EtO8y6E+vdweLWJVpiAp0Kxv Whcg== X-Gm-Message-State: ANhLgQ3uD4mmkhoT79db4WH8Y6keQb2J+fzVAvfqVel6CcrK8/veJCrY E6JTK0bKnN8WgUQ75CHQoA9s+UkQACmcKQMp79msbPxHOYb2SMmVwnZnR/TFAjyuPGXSlaN/Vaj 8XmiR8qcMRh4ISA0= X-Received: by 2002:a05:6000:1246:: with SMTP id j6mr4283579wrx.253.1583360294786; Wed, 04 Mar 2020 14:18:14 -0800 (PST) X-Google-Smtp-Source: ADFU+vsRtmVe+UpthqG+srK5guxiwnqy+NJfe/5y7pjqxGmb4mD83SZz0mvaBII5LFhzV7eC0Fhkxw== X-Received: by 2002:a05:6000:1246:: with SMTP id j6mr4283558wrx.253.1583360294504; Wed, 04 Mar 2020 14:18:14 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/6] hw/audio/fmopl: Fix a typo twice Date: Wed, 4 Mar 2020 23:18:02 +0100 Message-Id: <20200304221807.25212-2-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200304221807.25212-1-philmd@redhat.com> References: <20200304221807.25212-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laurent Vivier --- hw/audio/fmopl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index 9f50a89b4a..173a7521f2 100644 --- a/hw/audio/fmopl.c +++ b/hw/audio/fmopl.c @@ -1066,7 +1066,7 @@ static void OPLResetChip(FM_OPL *OPL) } } =20 -/* ---------- Create one of vietual YM3812 ---------- */ +/* ---------- Create one of virtual YM3812 ---------- */ /* 'rate' is sampling rate and 'bufsiz' is the size of the */ FM_OPL *OPLCreate(int clock, int rate) { @@ -1115,7 +1115,7 @@ FM_OPL *OPLCreate(int clock, int rate) return OPL; } =20 -/* ---------- Destroy one of vietual YM3812 ---------- */ +/* ---------- Destroy one of virtual YM3812 ---------- */ void OPLDestroy(FM_OPL *OPL) { #ifdef OPL_OUTPUT_LOG --=20 2.21.1 From nobody Thu Nov 13 21:53:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583360384; cv=none; d=zohomail.com; s=zohoarc; b=m4tkwL3fKtWh/YgQ1nsN2lZfhNqLdZyLFlhPJ/gWIoZUlqHRNe/7H3mVfkITQWUufWfNobQwrgDBPtNQ4BfSIBbnQQ7MhEdZmg6HR37Yxr2/Fv4/aw86yIYMNVljD44dnNmv18eqG6CkvCCfH5RpAiBq1+mClmVQHPdXcDpuPUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583360384; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=HfnT8d1lOc8oOW388s3B4mt/9tuFbIC8PeXMCcmaMOk=; b=Xs1rxd+FY/M7DU7QF0olz5VBwsfPS3m3QqxIh1RrLIF5QHQvxSCYqaEdv2psvUV5k3duBP+kaOjSScbhyHaAeQBZpKdfRTqqYgJYC20ldTadA8nPNZaFQ56BuDPWlqylSlBsHPCSDDrrwYkd3+js6epOEdkYlCZkSTN1Cupttts= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583360384395826.9209806817895; Wed, 4 Mar 2020 14:19:44 -0800 (PST) Received: from localhost ([::1]:40486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cMh-00029s-BO for importer@patchew.org; Wed, 04 Mar 2020 17:19:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32987) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cLR-0008TB-5k for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9cLP-0006e3-7g for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:25 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:24703 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9cLP-0006dH-41 for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:23 -0500 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-dWEvxEqFOrGvEW--I5etOQ-1; Wed, 04 Mar 2020 17:18:21 -0500 Received: by mail-wr1-f70.google.com with SMTP id b12so1463859wro.4 for ; Wed, 04 Mar 2020 14:18:20 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id g129sm7333661wmg.12.2020.03.04.14.18.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 14:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583360302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HfnT8d1lOc8oOW388s3B4mt/9tuFbIC8PeXMCcmaMOk=; b=EC66bnapAmehsR4VB3RZNyVUCRPC3PYiujP9vxs3ZXguQGxTIe+V0sNXKUEezAS1krpxAD VP2aEpAN+0B8wrzuxWpVNZdytKIFEU4o3tG/wFiJFHpwK9w99eJMxv4TBba8obmyoyPEhQ FkACEBbOcql09rJ7zQEE/W/AV6zjBeo= X-MC-Unique: dWEvxEqFOrGvEW--I5etOQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7WthtJEuF/N+eAMadHF0Sd51QGcmnmZoupRAgou8XDo=; b=Wvp9MGwesigHjt8922uAlQbgACSjvfkVvXk62xCRGNcm2eUKQdbE7l2TmbK8nKym3R CGldigWebki7r8ewBN6MsCii300wzxaH6o1pwdMBY7o2n/KvlZRZVfB1e84/gYsfrcat Nl4Y0UAn7PseW8uFTQL+PQWHW2PeLCCSUKcSLuZOMBWU7dnQ52kd6J3s4JwrnV2F1kmB cUNAUC9Hs0WnTbqADfWyGKF401MwNCIdoUN7n4a9YQpre+2mCziyGXwWhyQUI91Nfqsm E8db8BZ0Ui58ioxUIPKOx5e38As/SXUsQBJJexhrwBUaXUtoFzzSZn2v0PskwVDtn3rq uC3A== X-Gm-Message-State: ANhLgQ0lweqIkjoEatisnw704zkEHEBMQzRRFU93YJRcDJ3XjoTWIggI BpJku6aq86O2Lj04jV2iKp03ay7mbkiwAGZKKHfTzvZJ3tiHAlfDGk/WRmOHUWXjGMXWvzoY1HY wSqkY+ttOA/RFKcM= X-Received: by 2002:a1c:7c05:: with SMTP id x5mr5409982wmc.67.1583360299678; Wed, 04 Mar 2020 14:18:19 -0800 (PST) X-Google-Smtp-Source: ADFU+vslSkLYmU0p/p71iLp1NDP15gsZCNYU3xL69nA9zpOzAMa1N/ZkbHvZSvLrf1G1vtro/6DR/w== X-Received: by 2002:a1c:7c05:: with SMTP id x5mr5409970wmc.67.1583360299484; Wed, 04 Mar 2020 14:18:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/6] hw/audio/fmopl: Move ENV_CURVE to .heap to save 32KiB of .bss Date: Wed, 4 Mar 2020 23:18:03 +0100 Message-Id: <20200304221807.25212-3-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200304221807.25212-1-philmd@redhat.com> References: <20200304221807.25212-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" This buffer is only used by the adlib audio device. Move it to the .heap to release 32KiB of .bss (size reported on x86_64 host). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/fmopl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/audio/fmopl.c b/hw/audio/fmopl.c index 173a7521f2..356d4dfbca 100644 --- a/hw/audio/fmopl.c +++ b/hw/audio/fmopl.c @@ -186,7 +186,7 @@ static int32_t *VIB_TABLE; =20 /* envelope output curve table */ /* attack + decay + OFF */ -static int32_t ENV_CURVE[2*EG_ENT+1]; +static int32_t *ENV_CURVE; =20 /* multiple table */ #define ML 2 @@ -1090,6 +1090,7 @@ FM_OPL *OPLCreate(int clock, int rate) OPL->clock =3D clock; OPL->rate =3D rate; OPL->max_ch =3D max_ch; + ENV_CURVE =3D g_new(int32_t, 2 * EG_ENT + 1); /* init grobal tables */ OPL_initialize(OPL); /* reset chip */ @@ -1127,6 +1128,7 @@ void OPLDestroy(FM_OPL *OPL) #endif OPL_UnLockTable(); free(OPL); + g_free(ENV_CURVE); } =20 /* ---------- Option handlers ---------- */ --=20 2.21.1 From nobody Thu Nov 13 21:53:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583360383; cv=none; d=zohomail.com; s=zohoarc; b=FO0dGEVD5WqOwpnaeCgpFhMgNyW12m2i1+hOhkYcJeHs88nbiinsyEhYuR2Q6PrKvjhFPMWsv0W0aC8l8ieH7tcyuz2UNsFBiEmY4p+OnbEtWaz3nopUH8jypLGuJ2J95WdAr2gW9kF6U4ih0zAbaPHvqXj+GKsfI/GwJ+Wq9Ig= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583360383; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=l/IY56asJn4k/fIDmK4Z2UzFuTytUtXxN/1Jeo1uL4U=; b=msMuQ+iUtj/oG0VWZYyf57U+cOkn+MJjhD2MtvUecf6H4kbf6zMOREVfIPM8dNZm9jY8qAY4i7MQKDTrB+ldMnIjaVAhQ/w1ZCilNtlXcIr+Xi2y5rSJ3P3OXiWuxtjiZbPY+2NYx+JVMrJ7GsyFRSkTYkm2/j/pE6CkXczW2MM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583360383820526.3111552710362; Wed, 4 Mar 2020 14:19:43 -0800 (PST) Received: from localhost ([::1]:40484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cMg-00028b-Pj for importer@patchew.org; Wed, 04 Mar 2020 17:19:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33019) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cLU-00007x-Rm for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9cLT-0006lJ-TS for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:28 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:59429 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9cLT-0006kD-QX for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:27 -0500 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486-Q-BjeehaN-Ki9ytM9ZZRLg-1; Wed, 04 Mar 2020 17:18:26 -0500 Received: by mail-wm1-f71.google.com with SMTP id 7so1340172wmo.7 for ; Wed, 04 Mar 2020 14:18:25 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id r3sm3815573wmg.19.2020.03.04.14.18.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 14:18:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583360307; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l/IY56asJn4k/fIDmK4Z2UzFuTytUtXxN/1Jeo1uL4U=; b=fiu04KBwOcfg+FhGAjIBdELZCtfZ8TgU0QSBxSNe96pOlJ6+VTFEYASELj0xKo26Q6KROu VihXb8EyRRKMfJh9XUGG3+vYFm0f3oThhaNLoscGtFt0o9jNICylzqBEhkYjpijDmzkHC0 u8UpMKRkmxcXMc0e88KdhTZScVSj9k4= X-MC-Unique: Q-BjeehaN-Ki9ytM9ZZRLg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XSVnfTQjqSoslQR7PQ9GzBNYFbBYE7GKO7GWOT3EV9E=; b=jDVJO2bAdKu0jmw+sVgk9hO4xJjFn5cLywi1+C+MF2YsRMBfbL8UHUc25q9i2NXTL8 gphfslI16Lb4CLXL6g8XJbSY4GZFPcf1soWfwwqxp0NR4Sg10lnuHNil2q1QmVZj90vE Ql4XBWbnCw+BntLyeUh9LGC51knh9xUrNHR6fWA7EIUijUVQVxBYb4CJE3jue9/F1GY7 nJMsxwN2A1lG3v44LrwbnxUJS3C0WOhEh6u0Yck3XlQNsreCz38kVr9ayzhy5rPtY6h2 mUEUL7hjHkuWmoHOO7qUv/CSY/UBKWqFmfPQ4N866Jx0pv5KDCMzJ/TV14srfTAAtICQ 6P6g== X-Gm-Message-State: ANhLgQ0VkwHBTlE7ojBB8SKamhzn9OwpnkWuujDQEr2AGLZECwbRFNCZ 5/QCr3Hufb8+TW6sa6HFjQd6BjfqARIOuFKh8Sgam0j7hy7YlJ6s0KtCPxIaML6EIiM9tAlUb4Q Ed7b8qKf4UGNx5Dg= X-Received: by 2002:a05:6000:149:: with SMTP id r9mr5699809wrx.147.1583360304704; Wed, 04 Mar 2020 14:18:24 -0800 (PST) X-Google-Smtp-Source: ADFU+vuNJdcnEDAJHYcPDME2sY95E31wEuSjXw582qCwO+eePpHJ5JRuqU0V6TK2m3gpex69x2yTUw== X-Received: by 2002:a05:6000:149:: with SMTP id r9mr5699792wrx.147.1583360304484; Wed, 04 Mar 2020 14:18:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 3/6] hw/usb/quirks: Use smaller types to reduce .rodata by 10KiB Date: Wed, 4 Mar 2020 23:18:04 +0100 Message-Id: <20200304221807.25212-4-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200304221807.25212-1-philmd@redhat.com> References: <20200304221807.25212-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" The USB descriptor sizes are specified as 16-bit for idVendor / idProduct, and 8-bit for bInterfaceClass / bInterfaceSubClass / bInterfaceProtocol. Doing so we reduce the usbredir_raw_serial_ids[] and usbredir_ftdi_serial_ids[] arrays from 16KiB to 6KiB (size reported on x86_64 host, building with --extra-cflags=3D-Os). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/usb/quirks.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/usb/quirks.h b/hw/usb/quirks.h index 89480befd7..794d89a356 100644 --- a/hw/usb/quirks.h +++ b/hw/usb/quirks.h @@ -21,11 +21,11 @@ #include "quirks-pl2303-ids.h" =20 struct usb_device_id { - int vendor_id; - int product_id; - int interface_class; - int interface_subclass; - int interface_protocol; + int16_t vendor_id; + int16_t product_id; + int8_t interface_class; + int8_t interface_subclass; + int8_t interface_protocol; }; =20 #define USB_DEVICE(vendor, product) \ --=20 2.21.1 From nobody Thu Nov 13 21:53:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583360398; cv=none; d=zohomail.com; s=zohoarc; b=IgwhRpFco2GzLinF3Eo5paklplRJ0o11MoMOvt20Ul7ABBDUTc3r3jPhp1U8Se/BwwaC3b+FAd7zPPJyeEAt7MCXxsVfU865LTIyI6nU7+nSmKDjxNRB2b6IAgSewESBMx6anjFFLzn1UAbj3U7apZv6mskZ8PKJgi7HrDgy7/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583360398; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8g6dQ3CpRHKhm3JtMqVTXiTXrin8V/riv5Rhf5txJno=; b=IDhi0MS832LN27rKhT3Oksm6sIGtbqrCLNBpWma+coeeiJ3QWVcvInXxN28X1uWvTLRAsorcskdCXLVjxrVWwkZ6+E9rjW8a4eo5e4JYUj7fEE0mhs/6dp03JwwBpqe2bTPsXbNkodeBTUinccW7Kg3lOxuvJk2/rNh9GiatA5o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583360398610438.56707556675747; Wed, 4 Mar 2020 14:19:58 -0800 (PST) Received: from localhost ([::1]:40488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cMv-0002NJ-Dk for importer@patchew.org; Wed, 04 Mar 2020 17:19:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33058) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cLa-0000Io-8E for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9cLZ-0006qJ-5M for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:34 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:33645 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9cLZ-0006py-1N for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:33 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-_bGDrGbbMjO37IDn_5BCwA-1; Wed, 04 Mar 2020 17:18:31 -0500 Received: by mail-wr1-f72.google.com with SMTP id n12so1429757wrp.19 for ; Wed, 04 Mar 2020 14:18:30 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id q125sm6721082wme.19.2020.03.04.14.18.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 14:18:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583360312; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8g6dQ3CpRHKhm3JtMqVTXiTXrin8V/riv5Rhf5txJno=; b=fw08/QfeeWa0QGNYY/7RVPhCLO+3xHITguMS7pewmASzK4eiX1RnEa7PwBIezq81PmfwCA wZwrgmbMNPRLiR3TaPvVlEKm0XAqq7h+4UyehYgczb0FTFqYL5PrnIAjr9tYOiBj2Pm/ir OCn5cpfiL+rBgamybTOTtAyulZQfv0A= X-MC-Unique: _bGDrGbbMjO37IDn_5BCwA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8ag/+xxkZSZEkgkSM8quJuguUY+bU0lgLQ4HQ0DMXWs=; b=eVi3NXqYYwIagkkSrlsomJX03bmdC9ErWqXzSY7TSmU88U0jTIMgcXRa1dics3z8/C Rf6XagxTD1PeyFSWnIYWXLifECT+v241yCAiRyGGgXWrCdhlU8ImnNS1RVmsWtZZQonQ GntkOHL/lT0LoJFE7/BMVdzdrJiPoVqZlsG3IDP+p80vkAb0rRobPLyZBvS5Xd7c0QSV HJsJ4G8pCb4QQQyrR7wUTezZh+OHdL/1o04qykC2N4l2NP5KcQVdxvpGuYOOFo6l8qLL YDo0+f7y8M0YjtcY7ORLhIBENsWINrRpxleP2qpkJrXM+I4j9UX2lUVxa6FIGWdyV2LR TEeg== X-Gm-Message-State: ANhLgQ0fpspeZGOgc43W7q9+8woIVvQq+Cl2XTT4hjWw+xV9A3bknbJA tP0nsoI/lCfIE7L1IRop2g4v+rllgdu4hMtwd80kbt7PGrhprmM+JXH4UKhIAbp/Pzd8En/Nwzy fp2Yuig4Aj05MK3U= X-Received: by 2002:a1c:9e85:: with SMTP id h127mr5311631wme.145.1583360309774; Wed, 04 Mar 2020 14:18:29 -0800 (PST) X-Google-Smtp-Source: ADFU+vtKcWBVy9Ebsa5ZD89bCp6BN1joSIMvdFbksX94m3Mg3Rrj4N072ncdORfw0lP3e8sa5zBJbg== X-Received: by 2002:a1c:9e85:: with SMTP id h127mr5311613wme.145.1583360309508; Wed, 04 Mar 2020 14:18:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 4/6] hw/audio/intel-hda: Use memory region alias to reduce .rodata by 4.34MB Date: Wed, 4 Mar 2020 23:18:05 +0100 Message-Id: <20200304221807.25212-5-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200304221807.25212-1-philmd@redhat.com> References: <20200304221807.25212-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" The intel-hda model uses an array of register indexed by the register address. This array also contains a pair of aliased registers at offset 0x2000. This creates a huge hole in the array, which ends up eating 4.6MiB of .rodata (size reported on x86_64 host, building with --extra-cflags=3D-Os). By using a memory region alias, we reduce this array to 132kB. Before: (qemu) info mtree 00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda After: (qemu) info mtree 00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda 00000000febd4000-00000000febd7fff (prio 1, i/o): intel-hda-container 00000000febd4000-00000000febd5fff (prio 0, i/o): intel-hda 00000000febd6000-00000000febd7fff (prio 0, i/o): alias intel-hda-alia= s @intel-hda 0000000000000000-0000000000001fff Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/audio/intel-hda.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index 1bcc3e5cf8..e8d18b7c58 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -181,7 +181,9 @@ struct IntelHDAState { IntelHDAStream st[8]; =20 /* state */ + MemoryRegion container; MemoryRegion mmio; + MemoryRegion alias; uint32_t rirb_count; int64_t wall_base_ns; =20 @@ -670,12 +672,6 @@ static const struct IntelHDAReg regtab[] =3D { .offset =3D offsetof(IntelHDAState, wall_clk), .rhandler =3D intel_hda_get_wall_clk, }, - [ ICH6_REG_WALLCLK + 0x2000 ] =3D { - .name =3D "WALLCLK(alias)", - .size =3D 4, - .offset =3D offsetof(IntelHDAState, wall_clk), - .rhandler =3D intel_hda_get_wall_clk, - }, =20 /* dma engine */ [ ICH6_REG_CORBLBASE ] =3D { @@ -837,12 +833,6 @@ static const struct IntelHDAReg regtab[] =3D { .size =3D 4, \ .offset =3D offsetof(IntelHDAState, st[_i].lpib), \ }, \ - [ ST_REG(_i, ICH6_REG_SD_LPIB) + 0x2000 ] =3D { \ - .stream =3D _i, \ - .name =3D _t stringify(_i) " LPIB(alias)", \ - .size =3D 4, \ - .offset =3D offsetof(IntelHDAState, st[_i].lpib), \ - }, \ [ ST_REG(_i, ICH6_REG_SD_CBL) ] =3D { \ .stream =3D _i, \ .name =3D _t stringify(_i) " CBL", \ @@ -1125,9 +1115,15 @@ static void intel_hda_realize(PCIDevice *pci, Error = **errp) error_free(err); } =20 + memory_region_init(&d->container, OBJECT(d), + "intel-hda-container", 0x4000); memory_region_init_io(&d->mmio, OBJECT(d), &intel_hda_mmio_ops, d, - "intel-hda", 0x4000); - pci_register_bar(&d->pci, 0, 0, &d->mmio); + "intel-hda", 0x2000); + memory_region_add_subregion(&d->container, 0x0000, &d->mmio); + memory_region_init_alias(&d->alias, OBJECT(d), "intel-hda-alias", + &d->mmio, 0, 0x2000); + memory_region_add_subregion(&d->container, 0x2000, &d->alias); + pci_register_bar(&d->pci, 0, 0, &d->container); =20 hda_codec_bus_init(DEVICE(pci), &d->codecs, sizeof(d->codecs), intel_hda_response, intel_hda_xfer); --=20 2.21.1 From nobody Thu Nov 13 21:53:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583360489; cv=none; d=zohomail.com; s=zohoarc; b=gIyqqIQlL0i2gzaAd/TBSvERbIgkVNxCaWVdByFv+w7ZrrE+m0l5NZ+JP4CnI0voePmy8DM+v2LYnLvCcnAKZk8JjjPD+IGvTl8t46yfoaMrgCn+GiZTQ6SxXx0Pkraa4ojoaeN/qI1beGEhoX1Y6B089E3HhCervzct2br8Dag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583360489; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CFcihQRQW984a0z/mekZG0vNwXsxhiN/8+AlkGU0X9k=; b=PFV1I7hFF/L/0nrGZyxNshS32XuiDs+mzDdx+/ktRYOdZ9npT4R3NVdUwvEIv4uM6N6N/BhvkMs2dBCZEC5mDoMBado62SYwNOJm9ng4Dk9YcGJR1hHVYiznWsqEGjH76mDxiVvvK76WjIKeoZe/XNxYMxdMVoCvBHSJOI9uxeY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583360489858400.4902340442957; Wed, 4 Mar 2020 14:21:29 -0800 (PST) Received: from localhost ([::1]:40530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cOO-0005Uq-MP for importer@patchew.org; Wed, 04 Mar 2020 17:21:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33131) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cLf-0000Wd-Qa for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9cLe-0006vp-QE for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:39 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:36563 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9cLe-0006va-N4 for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:38 -0500 Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-200-40ZlwSWsOfmwVbFthSEnmg-1; Wed, 04 Mar 2020 17:18:36 -0500 Received: by mail-ed1-f70.google.com with SMTP id a11so1291904eds.15 for ; Wed, 04 Mar 2020 14:18:36 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id a10sm1714629edt.50.2020.03.04.14.18.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 14:18:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583360318; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CFcihQRQW984a0z/mekZG0vNwXsxhiN/8+AlkGU0X9k=; b=XKTuAcrSm3awrrlcZIVhOvaP5diNQ0SHz+OJ6M/A4HwGQ/HBsSEHY20cmMymyDSUmRvNoA 1oN77DXlJdoYexzMHblMCgHPms3ZpU4R8ZxQE6L0RSCuUsym7qouEGP4JzOOXTYPx3+snd 3bfUeNZKYSAM8Yb05YNSzlqzhyPZr2o= X-MC-Unique: 40ZlwSWsOfmwVbFthSEnmg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NxwSRvf3xC8N2g5o+oXCsfEFodIN9fcThiRrbeywMlg=; b=a9hufVGYEH0L+XjUlRtC0MBzx+bcNPXrwEH2ZDnzPleOXbaMCDNKUvhc3IrzcKp24N oa+cPpd1Ygq0Vlyodvx9NyLbK/LhULGXW/lus4mByWJ9NT4fPCVk/D3hHP1f0jickyXE LdudB1teLB3AZ2tTCmBx+9M38NvUo9cdSIRLxEhBfbIhmqkZHsGW+KhbQZCSYX1zn1ul I9UnjZCgc2XahSmPraEsTpDpnRzJ5T08R+lHq/2lgVgjB65Y66/ayBACXsqTgR/SXlGy gEzGn/KhxwPLlbRYBbXIuiK7Rv/SlAyyfFSQlSUCDLwEiV/3qMcpiwiy561epWAew3g8 EBRg== X-Gm-Message-State: ANhLgQ1rrAopIdpMrhl2+zBy6fDC1mTif6Siw36yguaQnOJdDpbXYdB0 9xR/Za3zZJ9nlcN0t5XxnoxZ1PUjokNaMoMpnCzBe6JHLD2yjU+wgPeDMfGCQUbpGBOH8hT/YU9 Z/lcaEWOABx4fvpY= X-Received: by 2002:aa7:c247:: with SMTP id y7mr4714026edo.376.1583360315010; Wed, 04 Mar 2020 14:18:35 -0800 (PST) X-Google-Smtp-Source: ADFU+vsCGvKZw64GnBwnakygOFTqcpNPa/Q3gqpp7wrdeUodsHHy6zRbfAFju5NyQpibcxt/UU0/iw== X-Received: by 2002:aa7:c247:: with SMTP id y7mr4713988edo.376.1583360314628; Wed, 04 Mar 2020 14:18:34 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 5/6] ui/curses: Make control_characters[] array const Date: Wed, 4 Mar 2020 23:18:06 +0100 Message-Id: <20200304221807.25212-6-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200304221807.25212-1-philmd@redhat.com> References: <20200304221807.25212-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" As we only use this array as input, make it const. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- ui/curses.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/curses.c b/ui/curses.c index 3a1b71451c..3bafc10c1c 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -529,7 +529,7 @@ static void font_setup(void) * Control characters are normally non-printable, but VGA does have * well-known glyphs for them. */ - static uint16_t control_characters[0x20] =3D { + static const uint16_t control_characters[0x20] =3D { 0x0020, 0x263a, 0x263b, --=20 2.21.1 From nobody Thu Nov 13 21:53:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1583360493; cv=none; d=zohomail.com; s=zohoarc; b=AHE1WBPzb40dpVU4R/W/skiHNEod/DOg0JFzRFKwGzbaS6EDDenTaUWCqzeg6tEdWxMryHncyHteNmFJzZGrvVsxKVc8GS4Ul9FhL0Ui5K6Zpltzf0IAHeRBBzGt7fghAk+5J5Zi7sn+asUVqyDS6pCvU4Eo+W6yS2M7Zd8Es3w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583360493; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bHjWSXQJGHXqNSVRp2m+ndgaVWWtzd8pKBpNi2noriY=; b=RKU/SUeaC7bdCRbgl0NvwIDliXmb6oXSwz6WRmR64UnPiAlT6o3htkknjcVHGhGgnhxFmLB7IF6RU/1eo53AkuwakOLBRwueatOgbdf+8iJAHTBevlDuhsBtISYG3DAJNweweSKMxeLT8h3CuwSz3EqrHUcwPu0cVSI3KC/kV9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1583360493897820.9141893188065; Wed, 4 Mar 2020 14:21:33 -0800 (PST) Received: from localhost ([::1]:40532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cOS-0005dh-U4 for importer@patchew.org; Wed, 04 Mar 2020 17:21:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33179) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cLk-0000iH-L5 for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j9cLj-0006zS-H5 for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:44 -0500 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:53859 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j9cLj-0006yv-D4 for qemu-devel@nongnu.org; Wed, 04 Mar 2020 17:18:43 -0500 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-2sL06UP2NouvJgmLzdmlWA-1; Wed, 04 Mar 2020 17:18:41 -0500 Received: by mail-wr1-f72.google.com with SMTP id p11so1441706wrn.10 for ; Wed, 04 Mar 2020 14:18:41 -0800 (PST) Received: from localhost.localdomain (47.red-88-21-205.staticip.rima-tde.net. [88.21.205.47]) by smtp.gmail.com with ESMTPSA id b82sm6438319wmb.16.2020.03.04.14.18.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 14:18:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583360323; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bHjWSXQJGHXqNSVRp2m+ndgaVWWtzd8pKBpNi2noriY=; b=fEJ92Dlitq1sDGCjas+WKsHVvXHp2f2xzLAbhmdncoX1GIrjR8ciazgR8L9yZXfZzHwuWR CxkIa0Wq/HbScf83UuwBWJUCRo8ZLQB/rerv8omF6GuZyTxdP6CfZcBO7RH4cIBlZd5TKr GBszbfbMfyRm0hAJOEBwj3gPFTtHqVw= X-MC-Unique: 2sL06UP2NouvJgmLzdmlWA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=37TekRuQ1Sj7bzipU9xMQGxHx7Oe/Uk9FNfgupkTT1U=; b=HpKUMSuiFMeFygA2+EN9hSFXq18QroshhN4W68zS84Oc9RR/EUVBcnGtllBLQ3/USp 9CjfS+QRB8UuMK8V/WU/YykVufFC315Eld4EhsoeGiCpWTQgW+BTWvFvOvDezLzh6Ud9 AZQG96s/+0EteUgDD+M/com413flukfd9wDwFFM+T2ba1W/H2Prg51fyto90QbSBUvju Pzy+iYLV+g9xW9diKElLvIj4tWmlfKV13WhOQqzWpzAV0j4KnBcJTKClK4PfD9oPYlbo BCZvauXANo5+tKm9WzFjR8/ZuafkWOogxYL9kjjIi/RLaAE+Ztb3wlbcp2K3hoAmCTQ2 5xpA== X-Gm-Message-State: ANhLgQ1Mr1jlwwCpTlwN9MJB6PsPYNLpgrcS7fdCuDfTxUQ6TD44vezG gJ/XGG046gztwnI/2CWJICCejUv05KucCVwYyhqkECmsgRZEaphgx4+c76Zv78ko2lBA63qRR3Y 2l/8SSHB8qwsDkE4= X-Received: by 2002:a1c:49d5:: with SMTP id w204mr5809805wma.55.1583360320033; Wed, 04 Mar 2020 14:18:40 -0800 (PST) X-Google-Smtp-Source: ADFU+vtOyc7p4gYjJFDvQtmH81U0uCFCbPF2K0vdpDiKNOiykLu2BoveuujIYG0oQbz2cnxOnxpr4Q== X-Received: by 2002:a1c:49d5:: with SMTP id w204mr5809777wma.55.1583360319639; Wed, 04 Mar 2020 14:18:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 6/6] ui/curses: Move arrays to .heap to save 74KiB of .bss Date: Wed, 4 Mar 2020 23:18:07 +0100 Message-Id: <20200304221807.25212-7-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200304221807.25212-1-philmd@redhat.com> References: <20200304221807.25212-1-philmd@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8"; text/plain; charset="utf-8" We only need these arrays when using the curses display. Move them from the .bss to the .heap (sizes reported on x86_64 host: screen[] is 64KiB, vga_to_curses 7KiB). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- ui/curses.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index 3bafc10c1c..a59b23a9cf 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -54,13 +54,13 @@ enum maybe_keycode { }; =20 static DisplayChangeListener *dcl; -static console_ch_t screen[160 * 100]; +static console_ch_t *screen; static WINDOW *screenpad =3D NULL; static int width, height, gwidth, gheight, invalidate; static int px, py, sminx, sminy, smaxx, smaxy; =20 static const char *font_charset =3D "CP437"; -static cchar_t vga_to_curses[256]; +static cchar_t *vga_to_curses; =20 static void curses_update(DisplayChangeListener *dcl, int x, int y, int w, int h) @@ -405,6 +405,8 @@ static void curses_refresh(DisplayChangeListener *dcl) static void curses_atexit(void) { endwin(); + g_free(vga_to_curses); + g_free(screen); } =20 /* @@ -783,6 +785,8 @@ static void curses_display_init(DisplayState *ds, Displ= ayOptions *opts) if (opts->u.curses.charset) { font_charset =3D opts->u.curses.charset; } + screen =3D g_new0(console_ch_t, 160 * 100); + vga_to_curses =3D g_new0(cchar_t, 256); curses_setup(); curses_keyboard_setup(); atexit(curses_atexit); --=20 2.21.1