r3928 - in trunk/src/host/qemu-neo1973: . audio hw
andrew at sita.openmoko.org
andrew at sita.openmoko.org
Tue Jan 22 22:03:39 CET 2008
Author: andrew
Date: 2008-01-22 22:03:36 +0100 (Tue, 22 Jan 2008)
New Revision: 3928
Modified:
trunk/src/host/qemu-neo1973/audio/dsound_template.h
trunk/src/host/qemu-neo1973/hw/eccmemctl.c
trunk/src/host/qemu-neo1973/hw/slavio_serial.c
trunk/src/host/qemu-neo1973/hw/sun4m.c
trunk/src/host/qemu-neo1973/hw/sun4m.h
trunk/src/host/qemu-neo1973/hw/usb-serial.c
trunk/src/host/qemu-neo1973/qemu-doc.texi
trunk/src/host/qemu-neo1973/s390-dis.c
trunk/src/host/qemu-neo1973/softmmu_header.h
trunk/src/host/qemu-neo1973/vl.c
Log:
Sync from CVS.
Modified: trunk/src/host/qemu-neo1973/audio/dsound_template.h
===================================================================
--- trunk/src/host/qemu-neo1973/audio/dsound_template.h 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/audio/dsound_template.h 2008-01-22 21:03:36 UTC (rev 3928)
@@ -197,7 +197,7 @@
#endif
if (!s->FIELD2) {
- dolog ("Attempt to initialize voice without " NAME2 " object");
+ dolog ("Attempt to initialize voice without " NAME2 " object\n");
return -1;
}
Modified: trunk/src/host/qemu-neo1973/hw/eccmemctl.c
===================================================================
--- trunk/src/host/qemu-neo1973/hw/eccmemctl.c 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/hw/eccmemctl.c 2008-01-22 21:03:36 UTC (rev 3928)
@@ -68,7 +68,7 @@
#define ECC_FAR0_TYPE 0x000000f0 /* Transaction type */
#define ECC_FAR0_SIZE 0x00000700 /* Transaction size */
#define ECC_FAR0_CACHE 0x00000800 /* Mapped cacheable */
-#define ECC_FAR0_LOCK 0x00001000 /* Error occurred in attomic cycle */
+#define ECC_FAR0_LOCK 0x00001000 /* Error occurred in atomic cycle */
#define ECC_FAR0_BMODE 0x00002000 /* Boot mode */
#define ECC_FAR0_VADDR 0x003fc000 /* VA[12-19] (superset bits) */
#define ECC_FAR0_S 0x08000000 /* Supervisor mode */
@@ -90,6 +90,7 @@
#define ECC_ADDR_MASK (ECC_SIZE - 1)
typedef struct ECCState {
+ qemu_irq irq;
uint32_t regs[ECC_NREGS];
} ECCState;
@@ -222,7 +223,7 @@
s->regs[i] = 0;
}
-void * ecc_init(target_phys_addr_t base, uint32_t version)
+void * ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version)
{
int ecc_io_memory;
ECCState *s;
@@ -232,6 +233,7 @@
return NULL;
s->regs[0] = version;
+ s->irq = irq;
ecc_io_memory = cpu_register_io_memory(0, ecc_mem_read, ecc_mem_write, s);
cpu_register_physical_memory(base, ECC_SIZE, ecc_io_memory);
Modified: trunk/src/host/qemu-neo1973/hw/slavio_serial.c
===================================================================
--- trunk/src/host/qemu-neo1973/hw/slavio_serial.c 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/hw/slavio_serial.c 2008-01-22 21:03:36 UTC (rev 3928)
@@ -215,7 +215,6 @@
static void handle_kbd_command(ChannelState *s, int val);
static int serial_can_receive(void *opaque);
static void serial_receive_byte(ChannelState *s, int ch);
-static inline void set_txint(ChannelState *s);
static void clear_queue(void *opaque)
{
@@ -321,28 +320,6 @@
slavio_serial_reset_chn(&s->chn[1]);
}
-static inline void clr_rxint(ChannelState *s)
-{
- s->rxint = 0;
- s->rxint_under_svc = 0;
- if (s->chn == chn_a) {
- if (s->wregs[W_MINTR] & MINTR_STATUSHI)
- s->otherchn->rregs[R_IVEC] = IVEC_HINOINT;
- else
- s->otherchn->rregs[R_IVEC] = IVEC_LONOINT;
- s->rregs[R_INTR] &= ~INTR_RXINTA;
- } else {
- if (s->wregs[W_MINTR] & MINTR_STATUSHI)
- s->rregs[R_IVEC] = IVEC_HINOINT;
- else
- s->rregs[R_IVEC] = IVEC_LONOINT;
- s->otherchn->rregs[R_INTR] &= ~INTR_RXINTB;
- }
- if (s->txint)
- set_txint(s);
- slavio_serial_update_irq(s);
-}
-
static inline void set_rxint(ChannelState *s)
{
s->rxint = 1;
@@ -367,6 +344,49 @@
slavio_serial_update_irq(s);
}
+static inline void set_txint(ChannelState *s)
+{
+ s->txint = 1;
+ if (!s->rxint_under_svc) {
+ s->txint_under_svc = 1;
+ if (s->chn == chn_a) {
+ if (s->wregs[W_MINTR] & MINTR_STATUSHI)
+ s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA;
+ else
+ s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA;
+ } else {
+ s->rregs[R_IVEC] = IVEC_TXINTB;
+ }
+ }
+ if (s->chn == chn_a)
+ s->rregs[R_INTR] |= INTR_TXINTA;
+ else
+ s->otherchn->rregs[R_INTR] |= INTR_TXINTB;
+ slavio_serial_update_irq(s);
+}
+
+static inline void clr_rxint(ChannelState *s)
+{
+ s->rxint = 0;
+ s->rxint_under_svc = 0;
+ if (s->chn == chn_a) {
+ if (s->wregs[W_MINTR] & MINTR_STATUSHI)
+ s->otherchn->rregs[R_IVEC] = IVEC_HINOINT;
+ else
+ s->otherchn->rregs[R_IVEC] = IVEC_LONOINT;
+ s->rregs[R_INTR] &= ~INTR_RXINTA;
+ } else {
+ if (s->wregs[W_MINTR] & MINTR_STATUSHI)
+ s->rregs[R_IVEC] = IVEC_HINOINT;
+ else
+ s->rregs[R_IVEC] = IVEC_LONOINT;
+ s->otherchn->rregs[R_INTR] &= ~INTR_RXINTB;
+ }
+ if (s->txint)
+ set_txint(s);
+ slavio_serial_update_irq(s);
+}
+
static inline void clr_txint(ChannelState *s)
{
s->txint = 0;
@@ -389,27 +409,6 @@
slavio_serial_update_irq(s);
}
-static inline void set_txint(ChannelState *s)
-{
- s->txint = 1;
- if (!s->rxint_under_svc) {
- s->txint_under_svc = 1;
- if (s->chn == chn_a) {
- if (s->wregs[W_MINTR] & MINTR_STATUSHI)
- s->otherchn->rregs[R_IVEC] = IVEC_HITXINTA;
- else
- s->otherchn->rregs[R_IVEC] = IVEC_LOTXINTA;
- } else {
- s->rregs[R_IVEC] = IVEC_TXINTB;
- }
- }
- if (s->chn == chn_a)
- s->rregs[R_INTR] |= INTR_TXINTA;
- else
- s->otherchn->rregs[R_INTR] |= INTR_TXINTB;
- slavio_serial_update_irq(s);
-}
-
static void slavio_serial_update_parameters(ChannelState *s)
{
int speed, parity, data_bits, stop_bits;
Modified: trunk/src/host/qemu-neo1973/hw/sun4m.c
===================================================================
--- trunk/src/host/qemu-neo1973/hw/sun4m.c 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/hw/sun4m.c 2008-01-22 21:03:36 UTC (rev 3928)
@@ -91,7 +91,7 @@
// IRQ numbers are not PIL ones, but master interrupt controller
// register bit numbers
int intctl_g_intr, esp_irq, le_irq, clock_irq, clock1_irq;
- int ser_irq, ms_kb_irq, fd_irq, me_irq, cs_irq;
+ int ser_irq, ms_kb_irq, fd_irq, me_irq, cs_irq, ecc_irq;
int machine_id; // For NVRAM
uint32_t iommu_version;
uint32_t intbit_to_level[32];
@@ -528,7 +528,8 @@
graphic_height, graphic_depth, hwdef->machine_id, "Sun4m");
if (hwdef->ecc_base != (target_phys_addr_t)-1)
- ecc_init(hwdef->ecc_base, hwdef->ecc_version);
+ ecc_init(hwdef->ecc_base, slavio_irq[hwdef->ecc_irq],
+ hwdef->ecc_version);
}
static void sun4c_hw_init(const struct hwdef *hwdef, int RAM_size,
@@ -742,6 +743,7 @@
.fd_irq = 22,
.me_irq = 30,
.cs_irq = -1,
+ .ecc_irq = 28,
.machine_id = 0x72,
.iommu_version = 0x03000000,
.intbit_to_level = {
@@ -783,6 +785,7 @@
.fd_irq = 22,
.me_irq = 30,
.cs_irq = -1,
+ .ecc_irq = 28,
.machine_id = 0x71,
.iommu_version = 0x01000000,
.intbit_to_level = {
@@ -824,6 +827,7 @@
.fd_irq = 22,
.me_irq = 30,
.cs_irq = -1,
+ .ecc_irq = 28,
.machine_id = 0x72,
.iommu_version = 0x13000000,
.intbit_to_level = {
Modified: trunk/src/host/qemu-neo1973/hw/sun4m.h
===================================================================
--- trunk/src/host/qemu-neo1973/hw/sun4m.h 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/hw/sun4m.h 2008-01-22 21:03:36 UTC (rev 3928)
@@ -81,6 +81,6 @@
qemu_irq irq, qemu_irq *reset);
/* eccmemctl.c */
-void *ecc_init(target_phys_addr_t base, uint32_t version);
+void *ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version);
#endif
Modified: trunk/src/host/qemu-neo1973/hw/usb-serial.c
===================================================================
--- trunk/src/host/qemu-neo1973/hw/usb-serial.c 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/hw/usb-serial.c 2008-01-22 21:03:36 UTC (rev 3928)
@@ -486,7 +486,7 @@
{
USBSerialState *s;
CharDriverState *cdrv;
- unsigned short vendorid = 0x0403, productid = 0xFF00;
+ unsigned short vendorid = 0x0403, productid = 0x6001;
while (*filename && *filename != ':') {
const char *p;
Modified: trunk/src/host/qemu-neo1973/qemu-doc.texi
===================================================================
--- trunk/src/host/qemu-neo1973/qemu-doc.texi 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/qemu-doc.texi 2008-01-22 21:03:36 UTC (rev 3928)
@@ -170,6 +170,8 @@
@item
Adlib(OPL2) - Yamaha YM3812 compatible chip
@item
+Gravis Ultrasound GF1 sound card
+ at item
PCI UHCI USB controller and a virtual USB hub.
@end itemize
@@ -183,7 +185,8 @@
QEMU uses YM3812 emulation by Tatsuyuki Satoh.
-QEMU uses GUS emulation(GUSEMU32) by Tibor "TS" Schütz.
+QEMU uses GUS emulation(GUSEMU32 @url{http://www.deinmeister.de/gusemu/})
+by Tibor "TS" Schütz.
@c man end
@@ -525,6 +528,10 @@
@item host:vendor_id:product_id
Pass through the host device identified by vendor_id:product_id (Linux only).
+ at item serial:[vendorid=@var{vendor_id}][,productid=@var{product_id}]:@var{dev}
+Serial converter to host character device @var{dev}, see @code{-serial} for the
+available devices.
+
@end table
@end table
@@ -1562,27 +1569,37 @@
USB devices can be connected with the @option{-usbdevice} commandline option
or the @code{usb_add} monitor command. Available devices are:
- at table @var
- at item @code{mouse}
+ at table @code
+ at item mouse
Virtual Mouse. This will override the PS/2 mouse emulation when activated.
- at item @code{tablet}
+ at item tablet
Pointer device that uses absolute coordinates (like a touchscreen).
This means qemu is able to report the mouse position without having
to grab the mouse. Also overrides the PS/2 mouse emulation when activated.
- at item @code{disk:@var{file}}
+ at item disk:@var{file}
Mass storage device based on @var{file} (@pxref{disk_images})
- at item @code{host:@var{bus.addr}}
+ at item host:@var{bus.addr}
Pass through the host device identified by @var{bus.addr}
(Linux only)
- at item @code{host:@var{vendor_id:product_id}}
+ at item host:@var{vendor_id:product_id}
Pass through the host device identified by @var{vendor_id:product_id}
(Linux only)
- at item @code{wacom-tablet}
+ at item wacom-tablet
Virtual Wacom PenPartner tablet. This device is similar to the @code{tablet}
above but it can be used with the tslib library because in addition to touch
coordinates it reports touch pressure.
- at item @code{keyboard}
+ at item keyboard
Standard USB keyboard. Will override the PS/2 keyboard (if present).
+ at item serial:[vendorid=@var{vendor_id}][,product_id=@var{product_id}]:@var{dev}
+Serial converter. This emulates an FTDI FT232BM chip connected to host character
+device @var{dev}. The available character devices are the same as for the
+ at code{-serial} option. The @code{vendorid} and @code{productid} options can be
+used to override the default 0403:6001. For instance,
+ at example
+usb_add serial:productid=FA00:tcp:192.168.0.2:4444
+ at end example
+will connect to tcp port 4444 of ip 192.168.0.2, and plug that to the virtual
+serial converter, faking a Matrix Orbital LCD Display (USB ID 0403:FA00).
@end table
@node host_usb_devices
Modified: trunk/src/host/qemu-neo1973/s390-dis.c
===================================================================
--- trunk/src/host/qemu-neo1973/s390-dis.c 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/s390-dis.c 2008-01-22 21:03:36 UTC (rev 3928)
@@ -1,23 +1,23 @@
/* s390-dis.c -- Disassemble S390 instructions
- Copyright 2000, 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky at de.ibm.com).
- This file is part of the GNU opcodes library.
+ This file is part of GDB, GAS and the GNU binutils.
- This library is free software; you can redistribute it and/or modify
+ This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
- It is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this file; see the file COPYING. If not, write to the
- Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <stdio.h>
#include "dis-asm.h"
@@ -397,25 +397,25 @@
}
}
/* s390-opc.c -- S390 opcode list
- Copyright 2000, 2001, 2003, 2007 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky at de.ibm.com).
- This file is part of the GNU opcodes library.
+ This file is part of GDB, GAS, and the GNU binutils.
- This library is free software; you can redistribute it and/or modify
+ This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
- It is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this file; see the file COPYING. If not, write to the
- Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
- MA 02110-1301, USA. */
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
#include <stdio.h>
Modified: trunk/src/host/qemu-neo1973/softmmu_header.h
===================================================================
--- trunk/src/host/qemu-neo1973/softmmu_header.h 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/softmmu_header.h 2008-01-22 21:03:36 UTC (rev 3928)
@@ -207,9 +207,11 @@
"2:\n"
:
: "r" (ptr),
-/* NOTE: 'q' would be needed as constraint, but we could not use it
- with T1 ! */
+#if DATA_SIZE == 1
+ "q" (v),
+#else
"r" (v),
+#endif
"i" ((CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS),
"i" (TARGET_PAGE_BITS - CPU_TLB_ENTRY_BITS),
"i" (TARGET_PAGE_MASK | (DATA_SIZE - 1)),
Modified: trunk/src/host/qemu-neo1973/vl.c
===================================================================
--- trunk/src/host/qemu-neo1973/vl.c 2008-01-22 17:43:39 UTC (rev 3927)
+++ trunk/src/host/qemu-neo1973/vl.c 2008-01-22 21:03:36 UTC (rev 3928)
@@ -2079,6 +2079,20 @@
}
}
+static void fd_chr_close(struct CharDriverState *chr)
+{
+ FDCharDriver *s = chr->opaque;
+
+ if (s->fd_in >= 0) {
+ if (nographic && s->fd_in == 0) {
+ } else {
+ qemu_set_fd_handler2(s->fd_in, NULL, NULL, NULL, NULL);
+ }
+ }
+
+ qemu_free(s);
+}
+
/* open a character device to a unix fd */
static CharDriverState *qemu_chr_open_fd(int fd_in, int fd_out)
{
@@ -2098,6 +2112,7 @@
chr->opaque = s;
chr->chr_write = fd_chr_write;
chr->chr_update_read_handler = fd_chr_update_read_handler;
+ chr->chr_close = fd_chr_close;
qemu_chr_reset(chr);
@@ -2184,6 +2199,7 @@
/* init terminal so that we can grab keys */
static struct termios oldtty;
static int old_fd0_flags;
+static int term_atexit_done;
static void term_exit(void)
{
@@ -2213,11 +2229,20 @@
tcsetattr (0, TCSANOW, &tty);
- atexit(term_exit);
+ if (!term_atexit_done++)
+ atexit(term_exit);
fcntl(0, F_SETFL, O_NONBLOCK);
}
+static void qemu_chr_close_stdio(struct CharDriverState *chr)
+{
+ term_exit();
+ stdio_nb_clients--;
+ qemu_set_fd_handler2(0, NULL, NULL, NULL, NULL);
+ fd_chr_close(chr);
+}
+
static CharDriverState *qemu_chr_open_stdio(void)
{
CharDriverState *chr;
@@ -2225,6 +2250,7 @@
if (stdio_nb_clients >= STDIO_MAX_CLIENTS)
return NULL;
chr = qemu_chr_open_fd(0, 1);
+ chr->chr_close = qemu_chr_close_stdio;
qemu_set_fd_handler2(0, stdio_read_poll, stdio_read, NULL, chr);
stdio_nb_clients++;
term_init();
@@ -3447,6 +3473,7 @@
{
if (chr->chr_close)
chr->chr_close(chr);
+ qemu_free(chr);
}
/***********************************************************/
More information about the commitlog
mailing list