From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KzSoJ-0003Jh-Sd for qemu-devel@nongnu.org; Mon, 10 Nov 2008 04:11:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KzSoG-0003J6-TK for qemu-devel@nongnu.org; Mon, 10 Nov 2008 04:11:50 -0500 Received: from [199.232.76.173] (port=55374 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KzSoF-0003It-Pa for qemu-devel@nongnu.org; Mon, 10 Nov 2008 04:11:48 -0500 Received: from mx20.gnu.org ([199.232.41.8]:51222) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KzSoF-0001sR-Dj for qemu-devel@nongnu.org; Mon, 10 Nov 2008 04:11:47 -0500 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KzSoE-0002ul-JU for qemu-devel@nongnu.org; Mon, 10 Nov 2008 04:11:46 -0500 From: Gleb Natapov Date: Mon, 10 Nov 2008 11:11:39 +0200 Message-ID: <20081110091139.11822.11686.stgit@dhcp-1-237.local> In-Reply-To: <20081110091134.11822.34230.stgit@dhcp-1-237.local> References: <20081110091134.11822.34230.stgit@dhcp-1-237.local> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v3 1/6] Move PIC initialization out of line to save space in post code area. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: bochs-developers@lists.sourceforge.net Cc: qemu-devel@nongnu.org There are only a couple of bytes left in post area. Signed-off-by: Gleb Natapov --- bios/rombios.c | 48 ++++++++++++++++++++++++++---------------------- 1 files changed, 26 insertions(+), 22 deletions(-) diff --git a/bios/rombios.c b/bios/rombios.c index 3366ad9..88eac04 100644 --- a/bios/rombios.c +++ b/bios/rombios.c @@ -10256,6 +10256,31 @@ rom_scan_increment: mov ds, ax ret +post_init_pic: + mov al, #0x11 ; send initialisation commands + out 0x20, al + out 0xa0, al + mov al, #0x08 + out 0x21, al + mov al, #0x70 + out 0xa1, al + mov al, #0x04 + out 0x21, al + mov al, #0x02 + out 0xa1, al + mov al, #0x01 + out 0x21, al + out 0xa1, al + mov al, #0xb8 + out 0x21, AL ;master pic: unmask IRQ 0, 1, 2, 6 +#if BX_USE_PS2_MOUSE + mov al, #0x8f +#else + mov al, #0x9f +#endif + out 0xa1, AL ;slave pic: unmask IRQ 12, 13, 14 + ret + ;; the following area can be used to write dynamically generated tables .align 16 bios_table_area_start: @@ -10516,28 +10541,7 @@ post_default_ints: SET_INT_VECTOR(0x10, #0xF000, #int10_handler) ;; PIC - mov al, #0x11 ; send initialisation commands - out 0x20, al - out 0xa0, al - mov al, #0x08 - out 0x21, al - mov al, #0x70 - out 0xa1, al - mov al, #0x04 - out 0x21, al - mov al, #0x02 - out 0xa1, al - mov al, #0x01 - out 0x21, al - out 0xa1, al - mov al, #0xb8 - out 0x21, AL ;master pic: unmask IRQ 0, 1, 2, 6 -#if BX_USE_PS2_MOUSE - mov al, #0x8f -#else - mov al, #0x9f -#endif - out 0xa1, AL ;slave pic: unmask IRQ 12, 13, 14 + call post_init_pic mov cx, #0xc000 ;; init vga bios mov ax, #0xc780