From nobody Sat May 10 07:53:28 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) client-ip=80.81.252.135; envelope-from=seabios-bounces@seabios.org; helo=mail.coreboot.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 80.81.252.135 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from mail.coreboot.org (mail.coreboot.org [80.81.252.135]) by mx.zohomail.com with SMTPS id 15051287372841022.6562144870588; Mon, 11 Sep 2017 04:18:57 -0700 (PDT) Received: from [127.0.0.1] (helo=ra.coreboot.org) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1drMjh-0005Er-TZ; Mon, 11 Sep 2017 13:18:42 +0200 Received: from mx1.redhat.com ([209.132.183.28]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_2) (envelope-from ) id 1drMjX-0005EN-Hp for seabios@seabios.org; Mon, 11 Sep 2017 13:18:39 +0200 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5D2B16C380 for ; Mon, 11 Sep 2017 11:18:28 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-117-175.ams2.redhat.com [10.36.117.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id E37B25F906; Mon, 11 Sep 2017 11:18:24 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 003E9ECC; Mon, 11 Sep 2017 13:18:22 +0200 (CEST) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D5D2B16C380 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=kraxel@redhat.com From: Gerd Hoffmann To: seabios@seabios.org Date: Mon, 11 Sep 2017 13:18:15 +0200 Message-Id: <20170911111816.30819-1-kraxel@redhat.com> In-Reply-To: <20170908061828.13732-1-kraxel@redhat.com> References: <20170908061828.13732-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 11 Sep 2017 11:18:28 +0000 (UTC) X-Spam-Score: -8.0 (--------) Subject: [SeaBIOS] [PATCH 7/6] sercon: use a single entry point X-BeenThere: seabios@seabios.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SeaBIOS mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: seabios-bounces@seabios.org Sender: "SeaBIOS" X-Duff: Orig. Duff, Duff Lite, Duff Dry, Duff Dark, Raspberry Duff, Lady Duff, Red Duff, Tartar Control Duff X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- src/config.h | 1 - src/misc.c | 9 --------- src/sercon.c | 49 ++++++++++++++++++------------------------------- src/romlayout.S | 5 +++-- 4 files changed, 21 insertions(+), 43 deletions(-) diff --git a/src/config.h b/src/config.h index baca029f0e..93c8dbc2d5 100644 --- a/src/config.h +++ b/src/config.h @@ -76,7 +76,6 @@ #define DEBUG_ISR_08 20 #define DEBUG_ISR_09 9 #define DEBUG_ISR_0e 9 -#define DEBUG_HDL_10 20 #define DEBUG_HDL_11 2 #define DEBUG_HDL_12 2 #define DEBUG_HDL_13 10 diff --git a/src/misc.c b/src/misc.c index f4b656dd35..387a3482c9 100644 --- a/src/misc.c +++ b/src/misc.c @@ -52,15 +52,6 @@ handle_05(struct bregs *regs) debug_enter(regs, DEBUG_HDL_05); } =20 -// INT 10h Video Support Service Entry Point -void VISIBLE16 -handle_10(struct bregs *regs) -{ - debug_enter(regs, DEBUG_HDL_10); - // don't do anything, since the VGA BIOS handles int10h requests - sercon_10(regs); -} - // NMI handler void VISIBLE16 handle_02(void) diff --git a/src/sercon.c b/src/sercon.c index 5699905f32..9c49a2fc4c 100644 --- a/src/sercon.c +++ b/src/sercon.c @@ -325,10 +325,10 @@ static void sercon_1000(struct bregs *regs) SET_BDA(video_rows, rows-1); SET_BDA(cursor_type, 0x0007); } else { - SET_LOW(sercon_enable, (mode =3D=3D 0x03)); /* let vgabios handle mode init */ } =20 + SET_LOW(sercon_enable, (mode =3D=3D 0x03)); SET_LOW(sercon_col_last, 0); SET_LOW(sercon_row_last, 0); SET_LOW(sercon_attr_last, 0); @@ -470,40 +470,26 @@ sercon_10(struct bregs *regs) return; =20 switch (regs->ah) { - case 0x00: sercon_1000(regs); break; - case 0x01: sercon_1001(regs); break; - case 0x02: sercon_1002(regs); break; - case 0x03: sercon_1003(regs); break; - case 0x06: sercon_1006(regs); break; - case 0x08: sercon_1008(regs); break; - case 0x09: sercon_1009(regs); break; - case 0x0e: sercon_100e(regs); break; - case 0x0f: sercon_100f(regs); break; - case 0x4f: sercon_104f(regs); break; - default: sercon_10XX(regs); break; - } -} - -void VISIBLE16 -sercon_10_splitmode(struct bregs *regs) -{ - if (!CONFIG_SERCON) - return; - if (!GET_LOW(sercon_port)) - return; - - switch (regs->ah) { case 0x01: case 0x02: case 0x03: case 0x08: case 0x0f: - /* nothing, vgabios did all work */ - break; + if (sercon_splitmode()) + /* nothing, vgabios handles it */ + return; + } + + switch (regs->ah) { case 0x00: sercon_1000(regs); break; + case 0x01: sercon_1001(regs); break; + case 0x02: sercon_1002(regs); break; + case 0x03: sercon_1003(regs); break; case 0x06: sercon_1006(regs); break; + case 0x08: sercon_1008(regs); break; case 0x09: sercon_1009(regs); break; case 0x0e: sercon_100e(regs); break; + case 0x0f: sercon_100f(regs); break; case 0x4f: sercon_104f(regs); break; default: sercon_10XX(regs); break; } @@ -521,15 +507,16 @@ void sercon_setup(void) seabios =3D FUNC16(entry_10); if (vgabios.seg !=3D seabios.seg || vgabios.offset !=3D seabios.offset) { - dprintf(1, "%s:%d: using splitmode (vgabios %04x:%04x, hook %04x:%= 04x)\n", - __func__, __LINE__, - vgabios.seg, vgabios.offset, - seabios.seg, seabios.offset); + dprintf(1, "sercon: configuring in splitmode (vgabios %04x:%04x)\n= ", + vgabios.seg, vgabios.offset); sercon_real_vga_handler =3D vgabios; - SET_IVT(0x10, FUNC16(entry_sercon)); SET_LOW(sercon_split, 1); + } else { + dprintf(1, "sercon: configuring as primary display\n"); + sercon_real_vga_handler =3D seabios; } =20 + SET_IVT(0x10, FUNC16(entry_sercon)); SET_LOW(sercon_port, addr); outb(0x03, addr + SEROFF_LCR); // 8N1 outb(0x01, addr + 0x02); // enable fifo diff --git a/src/romlayout.S b/src/romlayout.S index 1c9d56df1b..911a416d7f 100644 --- a/src/romlayout.S +++ b/src/romlayout.S @@ -440,7 +440,7 @@ entry_sercon: =20 2: popl %eax popw %ds - pushl $sercon_10_splitmode + pushl $sercon_10 #if CONFIG_ENTRY_EXTRASTACK jmp irqentry_arg_extrastack #else @@ -643,7 +643,8 @@ entry_10_0x0f: iretw =20 ORG 0xf065 - IRQ_ENTRY_ARG 10 +entry_10: + iretw =20 // 0xf0a4 - VideoParams in misc.c =20 --=20 2.9.3 _______________________________________________ SeaBIOS mailing list SeaBIOS@seabios.org https://mail.coreboot.org/mailman/listinfo/seabios