From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kwvhh-0005TU-NR for qemu-devel@nongnu.org; Mon, 03 Nov 2008 04:26:33 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kwvhg-0005SY-Br for qemu-devel@nongnu.org; Mon, 03 Nov 2008 04:26:32 -0500 Received: from [199.232.76.173] (port=57838 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kwvhf-0005S7-Lp for qemu-devel@nongnu.org; Mon, 03 Nov 2008 04:26:31 -0500 Received: from mx2.redhat.com ([66.187.237.31]:33599) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kwvhf-0008TO-K4 for qemu-devel@nongnu.org; Mon, 03 Nov 2008 04:26:31 -0500 From: Gleb Natapov Date: Mon, 03 Nov 2008 11:26:25 +0200 Message-ID: <20081103092625.8058.52045.stgit@dhcp-1-237.local> In-Reply-To: <20081103092620.8058.91416.stgit@dhcp-1-237.local> References: <20081103092620.8058.91416.stgit@dhcp-1-237.local> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2 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