From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IyyeQ-0008IB-US for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:55:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IyyeQ-0008HH-AX for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:55:06 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyyeQ-0008H6-5E for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:55:06 -0500 Received: from pop-gadwall.atl.sa.earthlink.net ([207.69.195.61]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IyyeP-0007dq-Ok for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:55:05 -0500 Received: from user-142h2k8.cable.mindspring.com ([72.40.138.136] helo=earthlink.net) by pop-gadwall.atl.sa.earthlink.net with esmtp (Exim 3.36 #1) id 1IyyeO-0005aX-00 for qemu-devel@nongnu.org; Sun, 02 Dec 2007 18:55:04 -0500 Message-ID: <475345D7.1030504@earthlink.net> Date: Sun, 02 Dec 2007 18:55:03 -0500 From: Robert Reif MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------010400030304090301010308" Subject: [Qemu-devel] [PATCH] sparc32 no keyboard mode Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------010400030304090301010308 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit If a sun system is booted without a keyboard, it uses serial port A for the console. This patch disables (unplugs) the keyboard when -nographic is set on the command line. Another option would be to add a -nokeyboard option to the command line. --------------010400030304090301010308 Content-Type: text/plain; name="nokbd.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="nokbd.diff.txt" Index: hw/slavio_serial.c =================================================================== RCS file: /sources/qemu/qemu/hw/slavio_serial.c,v retrieving revision 1.28 diff -p -u -r1.28 slavio_serial.c --- hw/slavio_serial.c 25 Nov 2007 08:48:16 -0000 1.28 +++ hw/slavio_serial.c 2 Dec 2007 23:47:08 -0000 @@ -100,6 +100,7 @@ typedef struct ChannelState { SERIOQueue queue; CharDriverState *chr; int e0_mode, led_mode, caps_lock_mode, num_lock_mode; + int disabled; } ChannelState; struct SerialState { @@ -193,7 +194,10 @@ static void slavio_serial_reset_chn(Chan s->wregs[11] = 8; s->wregs[14] = 0x30; s->wregs[15] = 0xf8; - s->rregs[0] = 0x44; + if (s->disabled) + s->rregs[0] = 0x7c; + else + s->rregs[0] = 0x44; s->rregs[1] = 6; s->rx = s->tx = 0; @@ -437,7 +441,7 @@ static void slavio_serial_mem_writeb(voi if (s->wregs[5] & 8) { // tx enabled if (s->chr) qemu_chr_write(s->chr, &s->tx, 1); - else if (s->type == kbd) { + else if (s->type == kbd && !s->disabled) { handle_kbd_command(s, val); } } @@ -765,7 +769,8 @@ static void sunmouse_event(void *opaque, put_queue(s, 0); } -void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq) +void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq, + int disabled) { int slavio_serial_io_memory, i; SerialState *s; @@ -782,6 +787,8 @@ void slavio_serial_ms_kbd_init(target_ph s->chn[1].otherchn = &s->chn[0]; s->chn[0].type = mouse; s->chn[1].type = kbd; + s->chn[0].disabled = disabled; + s->chn[1].disabled = disabled; slavio_serial_io_memory = cpu_register_io_memory(0, slavio_serial_mem_read, slavio_serial_mem_write, s); cpu_register_physical_memory(base, SERIAL_SIZE, slavio_serial_io_memory); Index: hw/sun4m.c =================================================================== RCS file: /sources/qemu/qemu/hw/sun4m.c,v retrieving revision 1.66 diff -p -u -r1.66 sun4m.c --- hw/sun4m.c 2 Dec 2007 04:51:10 -0000 1.66 +++ hw/sun4m.c 2 Dec 2007 23:47:09 -0000 @@ -436,7 +443,8 @@ static void sun4m_hw_init(const struct h slavio_timer_init_all(hwdef->counter_base, slavio_irq[hwdef->clock1_irq], slavio_cpu_irq); - slavio_serial_ms_kbd_init(hwdef->ms_kb_base, slavio_irq[hwdef->ms_kb_irq]); + slavio_serial_ms_kbd_init(hwdef->ms_kb_base, slavio_irq[hwdef->ms_kb_irq], + nographic); // Slavio TTYA (base+4, Linux ttyS0) is the first Qemu serial device // Slavio TTYB (base+0, Linux ttyS1) is the second Qemu serial device slavio_serial_init(hwdef->serial_base, slavio_irq[hwdef->ser_irq], Index: hw/sun4m.h =================================================================== RCS file: /sources/qemu/qemu/hw/sun4m.h,v retrieving revision 1.2 diff -p -u -r1.2 sun4m.h --- hw/sun4m.h 2 Dec 2007 04:51:10 -0000 1.2 +++ hw/sun4m.h 2 Dec 2007 23:47:09 -0000 @@ -41,7 +41,8 @@ void slavio_timer_init_all(target_phys_a /* slavio_serial.c */ SerialState *slavio_serial_init(target_phys_addr_t base, qemu_irq irq, CharDriverState *chr1, CharDriverState *chr2); -void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq); +void slavio_serial_ms_kbd_init(target_phys_addr_t base, qemu_irq irq, + int disabled); /* slavio_misc.c */ void *slavio_misc_init(target_phys_addr_t base, target_phys_addr_t power_base, --------------010400030304090301010308--