From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oR7Q1-0000yp-11 for mharc-grub-devel@gnu.org; Thu, 25 Aug 2022 03:36:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR7Py-0000ye-Mu for grub-devel@gnu.org; Thu, 25 Aug 2022 03:36:46 -0400 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]:45902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oR7Pw-0008Am-5q for grub-devel@gnu.org; Thu, 25 Aug 2022 03:36:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Hq/xUK7Ci4cjv/cnw1EYq/UyW9g7A/uLgciKELszyN8=; b=G7inRRlVwOTIxAYm4zyr6uBH7p zLqe5IYdT9WPbv4jYDAYmdOA92NqwK7Al/dIWrm99meVYLRk+HxYWxuXg63LLcB6QnR3t8aJvGO6u FYgvawIv9lxo0OUi72DeiaUqwRdfnJnTmrVVuE6aEbmZWye3sSEIsyE5gVFgbOA0De8b+8EiJUAhL IriLnu70sAvLnhxmRoSo4P1ifZuxWglISP+iqPRXCdC4X0xqLuNQGgKKoyhyPTBS+TadyVlCzNddB 2TLCFEY07iWWbFkJQpFnDVJHDF0ApHLfxs5YOosJY5Xxbmxte9iPRyMXJa9mcyCKvhD0cPYOM1T91 JH+wlVEQ==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oR7Po-005x67-49; Thu, 25 Aug 2022 07:36:39 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 1398898012A; Thu, 25 Aug 2022 09:36:35 +0200 (CEST) Date: Thu, 25 Aug 2022 09:36:34 +0200 From: Peter Zijlstra To: Glenn Washburn Cc: The development of GNU GRUB , Daniel Kiper Subject: Re: [PATCH] term/serial: Add support for PCI serial devices Message-ID: References: <20220824151355.6312d89d@crass-HP-ZBook-15-G2> <20220824183627.62abec4e@crass-HP-ZBook-15-G2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220824183627.62abec4e@crass-HP-ZBook-15-G2> Received-SPF: none client-ip=2001:8b0:10b:1:d65d:64ff:fe57:4e05; envelope-from=peterz@infradead.org; helo=desiato.infradead.org X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Aug 2022 07:36:47 -0000 On Wed, Aug 24, 2022 at 06:36:27PM -0500, Glenn Washburn wrote: > Yeah, it can get tricky. Its kind of custom build system layered on top > of autotools. The file you're looking for is > grub-core/Makefile.core.def. > > Looking at this again, it looks like pci is only supported on x86 and > mips_loongson. So this is not as simple as it could be. I believe > you'll want to add the following lines to the serial module definition > (search for "name = serial;"): > > mips_loongson = term/pci/serial.c; > x86 = term/pci/serial.c; > > Also, the call to grub_pciserial_init() in grub-core/term/serial.c > should be ifdef'd to only be included for those platforms, otherwise > the other builds will break. Oh boy... you don't happen to have a convenient GRUB_HAZ_PCI define squirreld away somewhere eh? Does this look like something that could work? --- diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def index 5212dfab1369..ba52a675da84 100644 --- a/grub-core/Makefile.core.def +++ b/grub-core/Makefile.core.def @@ -224,12 +224,14 @@ kernel = { i386_efi = kern/i386/efi/init.c; i386_efi = bus/pci.c; + i386_efi_cppflags = '-DGRUB_HAS_PCI' x86_64 = kern/x86_64/dl.c; x86_64_xen = kern/x86_64/dl.c; x86_64_efi = kern/x86_64/efi/callwrap.S; x86_64_efi = kern/i386/efi/init.c; x86_64_efi = bus/pci.c; + x86_64_efi_cppflags = '-DGRUB_HAS_PCI' xen = kern/i386/tsc.c; xen = kern/i386/xen/tsc.c; @@ -271,6 +273,7 @@ kernel = { i386_pc = term/i386/pc/console.c; i386_qemu = bus/pci.c; + i386_qemu_cppflags = '-DGRUB_HAS_PCI' i386_qemu = kern/vga_init.c; i386_qemu = kern/i386/qemu/mmap.c; @@ -303,6 +306,7 @@ kernel = { mips_loongson = bus/bonito.c; mips_loongson = bus/cs5536.c; mips_loongson = bus/pci.c; + mips_loongson_cppflags = '-DGRUB_HAS_PCI' mips_loongson = kern/mips/loongson/init.c; mips_loongson = term/at_keyboard.c; mips_loongson = term/ps2.c; @@ -2047,6 +2051,8 @@ module = { ieee1275 = term/ieee1275/serial.c; mips_arc = term/arc/serial.c; efi = term/efi/serial.c; + x86 = term/pci/serial.c; + mips_loongson = term/pci/serial.c; enable = terminfomodule; enable = ieee1275;