From patchwork Wed Mar 4 22:18:02 2020 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: 11420889 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EEB7292A for ; Wed, 4 Mar 2020 22:19:14 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82D3020848 for ; Wed, 4 Mar 2020 22:19:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="M7/QAqPF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82D3020848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cMD-0001dR-6L for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Mar 2020 17:19:13 -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 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= 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 X-MC-Unique: 2XMKtcL5MC63Oders68UQQ-1 Received: by mail-wr1-f69.google.com with SMTP id n12so1429477wrp.19 for ; Wed, 04 Mar 2020 14:18:15 -0800 (PST) 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) 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) From: =?utf-8?q?Philippe_Mathieu-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 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_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Philippe Mathieu-Daudé 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) } } -/* ---------- 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; } -/* ---------- Destroy one of vietual YM3812 ---------- */ +/* ---------- Destroy one of virtual YM3812 ---------- */ void OPLDestroy(FM_OPL *OPL) { #ifdef OPL_OUTPUT_LOG From patchwork Wed Mar 4 22:18:03 2020 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: 11420893 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 726AF1580 for ; Wed, 4 Mar 2020 22:19:28 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 49BE820848 for ; Wed, 4 Mar 2020 22:19:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="EC66bnap" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 49BE820848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cMR-00029s-Dk for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Mar 2020 17:19:27 -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 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= 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 X-MC-Unique: dWEvxEqFOrGvEW--I5etOQ-1 Received: by mail-wr1-f70.google.com with SMTP id b12so1463859wro.4 for ; Wed, 04 Mar 2020 14:18:20 -0800 (PST) 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) 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) From: =?utf-8?q?Philippe_Mathieu-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 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_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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é --- 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; /* envelope output curve table */ /* attack + decay + OFF */ -static int32_t ENV_CURVE[2*EG_ENT+1]; +static int32_t *ENV_CURVE; /* multiple table */ #define ML 2 @@ -1090,6 +1090,7 @@ FM_OPL *OPLCreate(int clock, int rate) OPL->clock = clock; OPL->rate = rate; OPL->max_ch = max_ch; + ENV_CURVE = 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); } /* ---------- Option handlers ---------- */ From patchwork Wed Mar 4 22:18:04 2020 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: 11420891 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CF9DC92A for ; Wed, 4 Mar 2020 22:19:27 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A506D2084E for ; Wed, 4 Mar 2020 22:19:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fiu04KBw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A506D2084E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cMQ-00028b-Qs for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Mar 2020 17:19:26 -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 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= 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 X-MC-Unique: Q-BjeehaN-Ki9ytM9ZZRLg-1 Received: by mail-wm1-f71.google.com with SMTP id 7so1340172wmo.7 for ; Wed, 04 Mar 2020 14:18:25 -0800 (PST) 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) 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) From: =?utf-8?q?Philippe_Mathieu-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 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_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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=-Os). Signed-off-by: Philippe Mathieu-Daudé --- 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" 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; }; #define USB_DEVICE(vendor, product) \ From patchwork Wed Mar 4 22:18:05 2020 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: 11420895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 543C292A for ; Wed, 4 Mar 2020 22:19:33 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2AF2C20848 for ; Wed, 4 Mar 2020 22:19:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fw08/Qfe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2AF2C20848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cMW-0002NJ-8J for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Mar 2020 17:19:32 -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 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= 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 X-MC-Unique: _bGDrGbbMjO37IDn_5BCwA-1 Received: by mail-wr1-f72.google.com with SMTP id n12so1429757wrp.19 for ; Wed, 04 Mar 2020 14:18:30 -0800 (PST) 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) 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) From: =?utf-8?q?Philippe_Mathieu-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 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_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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=-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-alias @intel-hda 0000000000000000-0000000000001fff Signed-off-by: Philippe Mathieu-Daudé --- 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]; /* state */ + MemoryRegion container; MemoryRegion mmio; + MemoryRegion alias; uint32_t rirb_count; int64_t wall_base_ns; @@ -670,12 +672,6 @@ static const struct IntelHDAReg regtab[] = { .offset = offsetof(IntelHDAState, wall_clk), .rhandler = intel_hda_get_wall_clk, }, - [ ICH6_REG_WALLCLK + 0x2000 ] = { - .name = "WALLCLK(alias)", - .size = 4, - .offset = offsetof(IntelHDAState, wall_clk), - .rhandler = intel_hda_get_wall_clk, - }, /* dma engine */ [ ICH6_REG_CORBLBASE ] = { @@ -837,12 +833,6 @@ static const struct IntelHDAReg regtab[] = { .size = 4, \ .offset = offsetof(IntelHDAState, st[_i].lpib), \ }, \ - [ ST_REG(_i, ICH6_REG_SD_LPIB) + 0x2000 ] = { \ - .stream = _i, \ - .name = _t stringify(_i) " LPIB(alias)", \ - .size = 4, \ - .offset = offsetof(IntelHDAState, st[_i].lpib), \ - }, \ [ ST_REG(_i, ICH6_REG_SD_CBL) ] = { \ .stream = _i, \ .name = _t stringify(_i) " CBL", \ @@ -1125,9 +1115,15 @@ static void intel_hda_realize(PCIDevice *pci, Error **errp) error_free(err); } + 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); hda_codec_bus_init(DEVICE(pci), &d->codecs, sizeof(d->codecs), intel_hda_response, intel_hda_xfer); From patchwork Wed Mar 4 22:18:06 2020 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: 11420901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 958D814B7 for ; Wed, 4 Mar 2020 22:21:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6C09620848 for ; Wed, 4 Mar 2020 22:21:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="XKTuAcrS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6C09620848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cOA-0005Uq-Jl for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Mar 2020 17:21:14 -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 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= 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 X-MC-Unique: 40ZlwSWsOfmwVbFthSEnmg-1 Received: by mail-ed1-f70.google.com with SMTP id a11so1291904eds.15 for ; Wed, 04 Mar 2020 14:18:36 -0800 (PST) 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) 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) From: =?utf-8?q?Philippe_Mathieu-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 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_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" As we only use this array as input, make it const. Signed-off-by: Philippe Mathieu-Daudé --- 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] = { + static const uint16_t control_characters[0x20] = { 0x0020, 0x263a, 0x263b, From patchwork Wed Mar 4 22:18:07 2020 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: 11420903 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 77A3892A for ; Wed, 4 Mar 2020 22:21:20 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4E90520848 for ; Wed, 4 Mar 2020 22:21:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fEJ92Dli" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E90520848 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:40532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j9cOF-0005dh-2I for patchwork-qemu-devel@patchwork.kernel.org; Wed, 04 Mar 2020 17:21:19 -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 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= 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 X-MC-Unique: 2sL06UP2NouvJgmLzdmlWA-1 Received: by mail-wr1-f72.google.com with SMTP id p11so1441706wrn.10 for ; Wed, 04 Mar 2020 14:18:41 -0800 (PST) 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) 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) From: =?utf-8?q?Philippe_Mathieu-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 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_Mathieu-Daud=C3=A9?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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é --- 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 { }; static DisplayChangeListener *dcl; -static console_ch_t screen[160 * 100]; +static console_ch_t *screen; static WINDOW *screenpad = NULL; static int width, height, gwidth, gheight, invalidate; static int px, py, sminx, sminy, smaxx, smaxy; static const char *font_charset = "CP437"; -static cchar_t vga_to_curses[256]; +static cchar_t *vga_to_curses; 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); } /* @@ -783,6 +785,8 @@ static void curses_display_init(DisplayState *ds, DisplayOptions *opts) if (opts->u.curses.charset) { font_charset = opts->u.curses.charset; } + screen = g_new0(console_ch_t, 160 * 100); + vga_to_curses = g_new0(cchar_t, 256); curses_setup(); curses_keyboard_setup(); atexit(curses_atexit);