qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/6] Move PIC initialization out of line to save spa


From: Gleb Natapov
Subject: [Qemu-devel] [PATCH 1/6] Move PIC initialization out of line to save space in post code area.
Date: Sun, 26 Oct 2008 16:44:30 +0200
User-agent: StGIT/0.14.2

There are only a couple of bytes left.

Signed-off-by: Gleb Natapov <address@hidden>
---

 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]