From nobody Sat Apr 20 02:20:31 2024 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; dkim=fail; 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 15160166426081020.4885125628412; Mon, 15 Jan 2018 03:44:02 -0800 (PST) Received: from [127.0.0.1] (helo=ra.coreboot.org) by mail.coreboot.org with esmtp (Exim 4.86_2) (envelope-from ) id 1eb1jL-0004Rf-I2; Mon, 15 Jan 2018 11:11:03 +0100 Received: from mail-lf0-f67.google.com ([209.85.215.67]) by mail.coreboot.org with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1eb1jA-0004Q0-7d for seabios@seabios.org; Mon, 15 Jan 2018 11:11:01 +0100 Received: by mail-lf0-f67.google.com with SMTP id q194so1171073lfe.13 for ; Mon, 15 Jan 2018 02:09:12 -0800 (PST) Received: from vaio.localdomain ([78.83.148.119]) by smtp.googlemail.com with ESMTPSA id 71sm5358942ljr.68.2018.01.15.02.09.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Jan 2018 02:09:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=rTTLeOz2fXfXIz3IwlX1jHgFXE3okWI0oFav6QmywE0=; b=rCsADUW8ODy4YZJy4iz1OE8QPDGoVh+RfYS3Y5tqwULsXTVm7NcTEhZ960sOwXKDJu PVVnC4P+tJKcYzXUhlyv94ncaHrEgM4t0g5AW1wwxkyvr6V/7uig1WYku+0ryKL0QdyT p6R6jDT9XN0PHw6/1A0f4CFMCOOmCZPXnNeicBQ/6MNtwzd0ILHHBGTQZb5XYUobFEtp iDzGRZd3hD78Eu+p1f/m5seH11kLgtDKkzNhzL8hNoPsDEX0vjhYb87MCEEjfREdWBwu rJ5XWWwkPc6u/ytYJcrE+0WHhSlGtlE2YWOm1dr4uP78IRjQ7tIa47DT4gGliEf6mz8g xRwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=rTTLeOz2fXfXIz3IwlX1jHgFXE3okWI0oFav6QmywE0=; b=JwWQpv7QvOOjk47ytWs7qoV9A7HkCt3uD7aWWTC0LFiCHBo2g3sJ8xHraV1LtYT+EQ ik4nHY62E1nogKufkVbkFNJM0smQxu7dErcSB525bZCdh5/8hAGGK60owW02VWKqvfqR AB8evABIn7uBNjjYpgP3VKu9e9PJfoouHS4LHPrBuXV+2dAUKOA043UuRNExf31uhRje FRc1n6vrpQBONi55Z2K6vYkgX6qZvT87xAqm8WsPayQBrjlE3JECZIbFPXb1N/Qp5l9E wMliOunAW7zpM2tgrI5sphPjMnn6DGTmQW24cpj7MQgN2ZXAVvkfSu14zPMpgvf7Y262 hyRQ== X-Gm-Message-State: AKGB3mIrMicdQSTWGJc2001TEHclBVi5g0MMnm3pZeuahJ+aRDV5A25+ pyi0QK8aSXgj8pm5rltMWxTHGfUR X-Google-Smtp-Source: ACJfBotwC4ZceuHU5IL/8e4Gv0nxg1iB+C0avHj4RJxC2fCdBdzk4dzDJQtba32zSkvxHGDceU9shw== X-Received: by 10.46.50.25 with SMTP id y25mr20215316ljy.24.1516010950842; Mon, 15 Jan 2018 02:09:10 -0800 (PST) To: seabios@seabios.org From: Nikolay Nikolov Message-ID: Date: Mon, 15 Jan 2018 12:09:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Content-Language: en-US X-Spam-Score: -3.9 (---) Subject: [SeaBIOS] [PATCH] Show the real IRQ number in the debug, produced by the unused, IRQ handler 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: , 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-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8"; format="flowed" Show the IRQ number from the actual interrupt vector in addition to the=20 value read from the ISR (the In-Service Register of the 8259A PIC) in the debug output, generated by the unused IRQ handlers. This helps e.g. distinguishing real IRQs from spurious interrupts, generated by buggy (or badly configured) hardware. Signed-off-by: Nikolay Nikolov --- =C2=A0src/hw/pic.c=C2=A0=C2=A0=C2=A0 | 108=20 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- =C2=A0src/post.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 20 ++++++++--- =C2=A0src/romlayout.S |=C2=A0 18 ++++++++-- =C2=A03 files changed, 135 insertions(+), 11 deletions(-) diff --git a/src/hw/pic.c b/src/hw/pic.c index a13564a..dc9fe21 100644 --- a/src/hw/pic.c +++ b/src/hw/pic.c @@ -99,17 +99,115 @@ pic_isr2_read(void) =C2=A0=C2=A0=C2=A0=C2=A0 return inb(PORT_PIC2_CMD); =C2=A0} -// Handler for otherwise unused hardware irqs. +// Handlers for otherwise unused hardware irqs. =C2=A0void VISIBLE16 -handle_hwpic1(void) +handle_hwpic1_irq0(void) =C2=A0{ -=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D%x\n", p= ic_isr1_read()); +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D0 isr=3D= %x\n",=20 pic_isr1_read()); =C2=A0=C2=A0=C2=A0=C2=A0 pic_eoi1(); =C2=A0} =C2=A0void VISIBLE16 -handle_hwpic2(void) +handle_hwpic1_irq1(void) =C2=A0{ -=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D%x\n", p= ic_isr2_read()); +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D1 isr=3D= %x\n",=20 pic_isr1_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi1(); +} + +void VISIBLE16 +handle_hwpic1_irq2(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D2 isr=3D= %x\n",=20 pic_isr1_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi1(); +} + +void VISIBLE16 +handle_hwpic1_irq3(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D3 isr=3D= %x\n",=20 pic_isr1_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi1(); +} + +void VISIBLE16 +handle_hwpic1_irq4(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D4 isr=3D= %x\n",=20 pic_isr1_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi1(); +} + +void VISIBLE16 +handle_hwpic1_irq5(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D5 isr=3D= %x\n",=20 pic_isr1_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi1(); +} + +void VISIBLE16 +handle_hwpic1_irq6(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D6 isr=3D= %x\n",=20 pic_isr1_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi1(); +} + +void VISIBLE16 +handle_hwpic1_irq7(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic1, "handle_hwpic1 irq=3D7 isr=3D= %x\n",=20 pic_isr1_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi1(); +} + +void VISIBLE16 +handle_hwpic2_irq8(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D8 isr=3D= %x\n",=20 pic_isr2_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi2(); +} + +void VISIBLE16 +handle_hwpic2_irq9(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D9 isr=3D= %x\n",=20 pic_isr2_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi2(); +} + +void VISIBLE16 +handle_hwpic2_irq10(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D10 isr= =3D%x\n",=20 pic_isr2_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi2(); +} + +void VISIBLE16 +handle_hwpic2_irq11(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D11 isr= =3D%x\n",=20 pic_isr2_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi2(); +} + +void VISIBLE16 +handle_hwpic2_irq12(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D12 isr= =3D%x\n",=20 pic_isr2_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi2(); +} + +void VISIBLE16 +handle_hwpic2_irq13(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D13 isr= =3D%x\n",=20 pic_isr2_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi2(); +} + +void VISIBLE16 +handle_hwpic2_irq14(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D14 isr= =3D%x\n",=20 pic_isr2_read()); +=C2=A0=C2=A0=C2=A0 pic_eoi2(); +} + +void VISIBLE16 +handle_hwpic2_irq15(void) +{ +=C2=A0=C2=A0=C2=A0 dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=3D15 isr= =3D%x\n",=20 pic_isr2_read()); =C2=A0=C2=A0=C2=A0=C2=A0 pic_eoi2(); =C2=A0} diff --git a/src/post.c b/src/post.c index f93106a..12aa4f8 100644 --- a/src/post.c +++ b/src/post.c @@ -40,10 +40,22 @@ ivt_init(void) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SET_IVT(i, FUNC16(entry_i= ret_official)); =C2=A0=C2=A0=C2=A0=C2=A0 // Initialize all hw vectors to a default hw hand= ler. -=C2=A0=C2=A0=C2=A0 for (i=3DBIOS_HWIRQ0_VECTOR; i