- prepared USB OHCI support in build system and common devices code (OHCI patch
by Ben Lunt will be tested and merged soon) - renamed specific pciusb stuff to 'usb_uhci' (files, objects) - minor USB-related changes - TODO: changes in siminterface and bochsrc options
This commit is contained in:
parent
c8fa6f6b90
commit
0b782cd749
@ -211,7 +211,8 @@
|
||||
#define BX_USE_PIDE_SMF 1 // PCI-IDE
|
||||
#define BX_USE_PCIVGA_SMF 1 // PCI-VGA
|
||||
#define BX_USE_PCIDEV_SMF 1 // PCI-DEV
|
||||
#define BX_USE_PCIUSB_SMF 1 // USB hub
|
||||
#define BX_USE_USB_UHCI_SMF 1 // USB UHCI hub
|
||||
#define BX_USE_USB_OHCI_SMF 1 // USB OHCI hub
|
||||
#define BX_USE_PCIPNIC_SMF 1 // PCI pseudo NIC
|
||||
#define BX_USE_NE2K_SMF 1 // NE2K
|
||||
#define BX_USE_EFI_SMF 1 // External FPU IRQ
|
||||
@ -229,10 +230,10 @@
|
||||
|| !BX_USE_PAR_SMF || !BX_USE_PIC_SMF || !BX_USE_PIT_SMF \
|
||||
|| !BX_USE_SER_SMF || !BX_USE_UM_SMF || !BX_USE_VGA_SMF \
|
||||
|| !BX_USE_SB16_SMF || !BX_USE_DEV_SMF || !BX_USE_PCI_SMF \
|
||||
|| !BX_USE_P2I_SMF || !BX_USE_PCIVGA_SMF || !BX_USE_PCIUSB_SMF \
|
||||
|| !BX_USE_PCIPNIC_SMF || !BX_USE_PIDE_SMF || !BX_USE_ACPI_SMF \
|
||||
|| !BX_USE_NE2K_SMF || !BX_USE_EFI_SMF || !BX_USE_GAMEPORT_SMF \
|
||||
|| !BX_USE_PCIDEV_SMF || !BX_USE_CIRRUS_SMF)
|
||||
|| !BX_USE_P2I_SMF || !BX_USE_PCIVGA_SMF || !BX_USE_USB_UHCI_SMF \
|
||||
|| !BX_USE_USB_OHCI_SMF || !BX_USE_PCIPNIC_SMF || !BX_USE_PIDE_SMF \
|
||||
|| !BX_USE_ACPI_SMF || !BX_USE_NE2K_SMF || !BX_USE_EFI_SMF \
|
||||
|| !BX_USE_GAMEPORT_SMF || !BX_USE_PCIDEV_SMF || !BX_USE_CIRRUS_SMF)
|
||||
#error You must use SMF to have plugins
|
||||
#endif
|
||||
|
||||
@ -706,12 +707,15 @@ typedef
|
||||
#endif
|
||||
|
||||
// limited USB on PCI
|
||||
#define BX_SUPPORT_PCIUSB 0
|
||||
#define BX_SUPPORT_USB_UHCI 0
|
||||
#define BX_SUPPORT_USB_OHCI 0
|
||||
#define BX_SUPPORT_PCIUSB (BX_SUPPORT_USB_UHCI || BX_SUPPORT_USB_OHCI)
|
||||
|
||||
#if (BX_SUPPORT_PCIUSB && !BX_SUPPORT_PCI)
|
||||
#error To enable USB, you must also enable PCI
|
||||
#endif
|
||||
|
||||
// Experimental bus mouse support
|
||||
#define BX_SUPPORT_BUSMOUSE 0
|
||||
|
||||
#define BX_SUPPORT_ALIGNMENT_CHECK 0
|
||||
|
115
bochs/configure
vendored
115
bochs/configure
vendored
@ -1561,7 +1561,8 @@ Optional Features:
|
||||
--enable-acpi enable ACPI support
|
||||
--enable-pci enable limited i440FX PCI support
|
||||
--enable-pcidev enable PCI host device mapping support (linux host only)
|
||||
--enable-usb enable limited USB support
|
||||
--enable-usb enable limited USB UHCI support
|
||||
--enable-usb-ohci enable limited USB OHCI support
|
||||
--enable-pnic enable PCI pseudo NIC support
|
||||
--enable-large-pages support for large pages (2M/4M pages)
|
||||
--enable-pae support Physical Address Extensions
|
||||
@ -4375,7 +4376,7 @@ ia64-*-hpux*)
|
||||
;;
|
||||
*-*-irix6*)
|
||||
# Find out which ABI we are using.
|
||||
echo '#line 4378 "configure"' > conftest.$ac_ext
|
||||
echo '#line 4379 "configure"' > conftest.$ac_ext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||
(eval $ac_compile) 2>&5
|
||||
ac_status=$?
|
||||
@ -6577,11 +6578,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:6580: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:6581: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:6584: \$? = $ac_status" >&5
|
||||
echo "$as_me:6585: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -6810,11 +6811,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:6813: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:6814: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:6817: \$? = $ac_status" >&5
|
||||
echo "$as_me:6818: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -6877,11 +6878,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:6880: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:6881: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:6884: \$? = $ac_status" >&5
|
||||
echo "$as_me:6885: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -9006,7 +9007,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 9009 "configure"
|
||||
#line 9010 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -9104,7 +9105,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 9107 "configure"
|
||||
#line 9108 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -11279,11 +11280,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:11282: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:11283: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:11286: \$? = $ac_status" >&5
|
||||
echo "$as_me:11287: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -11346,11 +11347,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:11349: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:11350: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:11353: \$? = $ac_status" >&5
|
||||
echo "$as_me:11354: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -12656,7 +12657,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 12659 "configure"
|
||||
#line 12660 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -12754,7 +12755,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 12757 "configure"
|
||||
#line 12758 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -13577,11 +13578,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:13580: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:13581: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:13584: \$? = $ac_status" >&5
|
||||
echo "$as_me:13585: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -13644,11 +13645,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:13647: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:13648: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:13651: \$? = $ac_status" >&5
|
||||
echo "$as_me:13652: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -15655,11 +15656,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15658: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15659: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:15662: \$? = $ac_status" >&5
|
||||
echo "$as_me:15663: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -15888,11 +15889,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15891: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15892: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>conftest.err)
|
||||
ac_status=$?
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:15895: \$? = $ac_status" >&5
|
||||
echo "$as_me:15896: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s "$ac_outfile"; then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
# So say no if there are warnings
|
||||
@ -15955,11 +15956,11 @@ else
|
||||
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
|
||||
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
|
||||
-e 's:$: $lt_compiler_flag:'`
|
||||
(eval echo "\"\$as_me:15958: $lt_compile\"" >&5)
|
||||
(eval echo "\"\$as_me:15959: $lt_compile\"" >&5)
|
||||
(eval "$lt_compile" 2>out/conftest.err)
|
||||
ac_status=$?
|
||||
cat out/conftest.err >&5
|
||||
echo "$as_me:15962: \$? = $ac_status" >&5
|
||||
echo "$as_me:15963: \$? = $ac_status" >&5
|
||||
if (exit $ac_status) && test -s out/conftest2.$ac_objext
|
||||
then
|
||||
# The compiler can only warn and ignore the option if not recognized
|
||||
@ -18084,7 +18085,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18087 "configure"
|
||||
#line 18088 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -18182,7 +18183,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 18185 "configure"
|
||||
#line 18186 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -20369,7 +20370,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 20372 "configure"
|
||||
#line 20373 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -33549,27 +33550,25 @@ _ACEOF
|
||||
fi
|
||||
|
||||
|
||||
USBDEV_OBJS=''
|
||||
SCSI_OBJS=''
|
||||
{ echo "$as_me:$LINENO: checking for limited USB support" >&5
|
||||
echo $ECHO_N "checking for limited USB support... $ECHO_C" >&6; }
|
||||
use_usb=0
|
||||
{ echo "$as_me:$LINENO: checking for limited USB UHCI support" >&5
|
||||
echo $ECHO_N "checking for limited USB UHCI support... $ECHO_C" >&6; }
|
||||
# Check whether --enable-usb was given.
|
||||
if test "${enable_usb+set}" = set; then
|
||||
enableval=$enable_usb; if test "$enableval" = yes; then
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; }
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define BX_SUPPORT_PCIUSB 1
|
||||
#define BX_SUPPORT_USB_UHCI 1
|
||||
_ACEOF
|
||||
|
||||
PCI_OBJ="$PCI_OBJ pciusb.o"
|
||||
USBDEV_OBJS="usb_common.o usb_hid.o usb_msd.o"
|
||||
SCSI_OBJS="scsi_device.o"
|
||||
PCI_OBJ="$PCI_OBJ usb_uhci.o"
|
||||
use_usb=1
|
||||
else
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define BX_SUPPORT_PCIUSB 0
|
||||
#define BX_SUPPORT_USB_UHCI 0
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
@ -33578,7 +33577,7 @@ else
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define BX_SUPPORT_PCIUSB 0
|
||||
#define BX_SUPPORT_USB_UHCI 0
|
||||
_ACEOF
|
||||
|
||||
|
||||
@ -33586,9 +33585,47 @@ _ACEOF
|
||||
fi
|
||||
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for limited USB OHCI support" >&5
|
||||
echo $ECHO_N "checking for limited USB OHCI support... $ECHO_C" >&6; }
|
||||
# Check whether --enable-usb-ohci was given.
|
||||
if test "${enable_usb_ohci+set}" = set; then
|
||||
enableval=$enable_usb_ohci; if test "$enableval" = yes; then
|
||||
{ echo "$as_me:$LINENO: result: yes" >&5
|
||||
echo "${ECHO_T}yes" >&6; }
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define BX_SUPPORT_USB_OHCI 1
|
||||
_ACEOF
|
||||
|
||||
PCI_OBJ="$PCI_OBJ usb_ohci.o"
|
||||
use_usb=1
|
||||
else
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define BX_SUPPORT_USB_OHCI 0
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
else
|
||||
|
||||
{ echo "$as_me:$LINENO: result: no" >&5
|
||||
echo "${ECHO_T}no" >&6; }
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define BX_SUPPORT_USB_OHCI 0
|
||||
_ACEOF
|
||||
|
||||
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test "$use_usb" = 1; then
|
||||
USBDEV_OBJS="usb_common.o usb_hid.o usb_msd.o"
|
||||
SCSI_OBJS="scsi_device.o"
|
||||
|
||||
|
||||
fi
|
||||
|
||||
{ echo "$as_me:$LINENO: checking for PCI pseudo NIC support" >&5
|
||||
echo $ECHO_N "checking for PCI pseudo NIC support... $ECHO_C" >&6; }
|
||||
# Check whether --enable-pnic was given.
|
||||
|
@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(bochs.h)
|
||||
AC_REVISION([[$Id: configure.in,v 1.382 2009-01-18 13:11:27 vruppert Exp $]])
|
||||
AC_REVISION([[$Id: configure.in,v 1.383 2009-01-19 09:48:11 vruppert Exp $]])
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
AC_CONFIG_HEADER(ltdlconf.h)
|
||||
|
||||
@ -753,29 +753,49 @@ AC_ARG_ENABLE(pcidev,
|
||||
]
|
||||
)
|
||||
|
||||
USBDEV_OBJS=''
|
||||
SCSI_OBJS=''
|
||||
AC_MSG_CHECKING(for limited USB support)
|
||||
use_usb=0
|
||||
AC_MSG_CHECKING(for limited USB UHCI support)
|
||||
AC_ARG_ENABLE(usb,
|
||||
[ --enable-usb enable limited USB support],
|
||||
[ --enable-usb enable limited USB UHCI support],
|
||||
[if test "$enableval" = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(BX_SUPPORT_PCIUSB, 1)
|
||||
PCI_OBJ="$PCI_OBJ pciusb.o"
|
||||
USBDEV_OBJS="usb_common.o usb_hid.o usb_msd.o"
|
||||
SCSI_OBJS="scsi_device.o"
|
||||
AC_DEFINE(BX_SUPPORT_USB_UHCI, 1)
|
||||
PCI_OBJ="$PCI_OBJ usb_uhci.o"
|
||||
use_usb=1
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_SUPPORT_PCIUSB, 0)
|
||||
AC_DEFINE(BX_SUPPORT_USB_UHCI, 0)
|
||||
fi],
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_SUPPORT_PCIUSB, 0)
|
||||
AC_DEFINE(BX_SUPPORT_USB_UHCI, 0)
|
||||
]
|
||||
)
|
||||
|
||||
AC_SUBST(USBDEV_OBJS)
|
||||
AC_SUBST(SCSI_OBJS)
|
||||
AC_MSG_CHECKING(for limited USB OHCI support)
|
||||
AC_ARG_ENABLE(usb-ohci,
|
||||
[ --enable-usb-ohci enable limited USB OHCI support],
|
||||
[if test "$enableval" = yes; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(BX_SUPPORT_USB_OHCI, 1)
|
||||
PCI_OBJ="$PCI_OBJ usb_ohci.o"
|
||||
use_usb=1
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_SUPPORT_USB_OHCI, 0)
|
||||
fi],
|
||||
[
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE(BX_SUPPORT_USB_OHCI, 0)
|
||||
]
|
||||
)
|
||||
|
||||
if test "$use_usb" = 1; then
|
||||
USBDEV_OBJS="usb_common.o usb_hid.o usb_msd.o"
|
||||
SCSI_OBJS="scsi_device.o"
|
||||
AC_SUBST(USBDEV_OBJS)
|
||||
AC_SUBST(SCSI_OBJS)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(for PCI pseudo NIC support)
|
||||
AC_ARG_ENABLE(pnic,
|
||||
|
@ -165,8 +165,11 @@ libbx_serial.la: serial.lo serial_raw.lo
|
||||
libbx_vga.la: vga.lo svga_cirrus.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module vga.lo svga_cirrus.lo -o libbx_vga.la -rpath $(PLUGIN_PATH)
|
||||
|
||||
libbx_pciusb.la: pciusb.lo $(USBDEV_OBJS:.o=.lo) scsi_device.lo hdimage.lo cdrom.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module pciusb.lo $(USBDEV_OBJS:.o=.lo) scsi_device.lo hdimage.lo cdrom.lo -o libbx_pciusb.la -rpath $(PLUGIN_PATH)
|
||||
libbx_usb_uhci.la: usb_uhci.lo $(USBDEV_OBJS:.o=.lo) scsi_device.lo hdimage.lo cdrom.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module usb_uhci.lo $(USBDEV_OBJS:.o=.lo) scsi_device.lo hdimage.lo cdrom.lo -o libbx_usb_uhci.la -rpath $(PLUGIN_PATH)
|
||||
|
||||
libbx_usb_ohci.la: usb_ohci.lo $(USBDEV_OBJS:.o=.lo) scsi_device.lo hdimage.lo cdrom.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module usb_ohci.lo $(USBDEV_OBJS:.o=.lo) scsi_device.lo hdimage.lo cdrom.lo -o libbx_usb_ohci.la -rpath $(PLUGIN_PATH)
|
||||
|
||||
#### building DLLs for win32 (tested on cygwin only)
|
||||
bx_%.dll: %.o
|
||||
@ -200,8 +203,11 @@ bx_serial.dll: serial.o serial_raw.o
|
||||
bx_vga.dll: vga.o svga_cirrus.o
|
||||
$(CXX) $(CXXFLAGS) -shared -o bx_vga.dll vga.o svga_cirrus.o $(WIN32_DLL_IMPORT_LIBRARY)
|
||||
|
||||
bx_pciusb.dll: pciusb.o $(USBDEV_OBJS) scsi_device.o hdimage.o cdrom.o
|
||||
$(CXX) $(CXXFLAGS) -shared -o bx_pciusb.dll pciusb.o $(USBDEV_OBJS) scsi_device.o hdimage.o cdrom.o $(WIN32_DLL_IMPORT_LIBRARY)
|
||||
bx_usb_uhci.dll: usb_uhci.o $(USBDEV_OBJS) scsi_device.o hdimage.o cdrom.o
|
||||
$(CXX) $(CXXFLAGS) -shared -o bx_usb_uhci.dll usb_uhci.o $(USBDEV_OBJS) scsi_device.o hdimage.o cdrom.o $(WIN32_DLL_IMPORT_LIBRARY)
|
||||
|
||||
bx_usb_ohci.dll: usb_ohci.o $(USBDEV_OBJS) scsi_device.o hdimage.o cdrom.o
|
||||
$(CXX) $(CXXFLAGS) -shared -o bx_usb_ohci.dll usb_ohci.o $(USBDEV_OBJS) scsi_device.o hdimage.o cdrom.o $(WIN32_DLL_IMPORT_LIBRARY)
|
||||
|
||||
##### end DLL section
|
||||
|
||||
@ -425,13 +431,6 @@ pcipnic.o: pcipnic.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h ../iodev/vga.h \
|
||||
../iodev/svga_cirrus.h ../iodev/ioapic.h ../cpu/apic.h
|
||||
pciusb.o: pciusb.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h ../iodev/vga.h \
|
||||
../iodev/svga_cirrus.h ../iodev/ioapic.h ../cpu/apic.h pci.h \
|
||||
usb_common.h usb_hid.h usb_msd.h pciusb.h
|
||||
pcivga.o: pcivga.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
@ -541,6 +540,20 @@ usb_msd.o: usb_msd.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h usb_common.h hdimage.h \
|
||||
scsi_device.h usb_msd.h
|
||||
usb_ohci.o: usb_ohci.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h ../iodev/vga.h \
|
||||
../iodev/svga_cirrus.h ../iodev/ioapic.h ../cpu/apic.h pci.h \
|
||||
usb_common.h usb_hid.h usb_msd.h usb_ohci.h
|
||||
usb_uhci.o: usb_uhci.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h ../iodev/vga.h \
|
||||
../iodev/svga_cirrus.h ../iodev/ioapic.h ../cpu/apic.h pci.h \
|
||||
usb_common.h usb_hid.h usb_msd.h usb_uhci.h
|
||||
vga.o: vga.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
@ -766,13 +779,6 @@ pcipnic.lo: pcipnic.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h ../iodev/vga.h \
|
||||
../iodev/svga_cirrus.h ../iodev/ioapic.h ../cpu/apic.h
|
||||
pciusb.lo: pciusb.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h ../iodev/vga.h \
|
||||
../iodev/svga_cirrus.h ../iodev/ioapic.h ../cpu/apic.h pci.h \
|
||||
usb_common.h usb_hid.h usb_msd.h pciusb.h
|
||||
pcivga.lo: pcivga.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
@ -882,6 +888,20 @@ usb_msd.lo: usb_msd.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h usb_common.h hdimage.h \
|
||||
scsi_device.h usb_msd.h
|
||||
usb_ohci.lo: usb_ohci.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h ../iodev/vga.h \
|
||||
../iodev/svga_cirrus.h ../iodev/ioapic.h ../cpu/apic.h pci.h \
|
||||
usb_common.h usb_hid.h usb_msd.h usb_ohci.h
|
||||
usb_uhci.lo: usb_uhci.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../gui/textconfig.h \
|
||||
../gui/keymap.h ../instrument/stubs/instrument.h ../iodev/vga.h \
|
||||
../iodev/svga_cirrus.h ../iodev/ioapic.h ../cpu/apic.h pci.h \
|
||||
usb_common.h usb_hid.h usb_msd.h usb_uhci.h
|
||||
vga.lo: vga.@CPP_SUFFIX@ iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: devices.cc,v 1.133 2009-01-15 17:34:20 vruppert Exp $
|
||||
// $Id: devices.cc,v 1.134 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -79,8 +79,11 @@ void bx_devices_c::init_stubs()
|
||||
#if BX_SUPPORT_ACPI
|
||||
pluginACPIController = &stubACPIController;
|
||||
#endif
|
||||
#if BX_SUPPORT_PCIUSB
|
||||
pluginPciUSBAdapter = &stubUsbAdapter;
|
||||
#if BX_SUPPORT_USB_UHCI
|
||||
pluginUSB_UHCI = &stubUsbAdapter;
|
||||
#endif
|
||||
#if BX_SUPPORT_USB_OHCI
|
||||
pluginUSB_OHCI = &stubUsbAdapter;
|
||||
#endif
|
||||
#endif
|
||||
pluginKeyboard = &stubKeyboard;
|
||||
@ -109,7 +112,7 @@ void bx_devices_c::init(BX_MEM_C *newmem)
|
||||
unsigned i;
|
||||
const char def_name[] = "Default";
|
||||
|
||||
BX_DEBUG(("Init $Id: devices.cc,v 1.133 2009-01-15 17:34:20 vruppert Exp $"));
|
||||
BX_DEBUG(("Init $Id: devices.cc,v 1.134 2009-01-19 09:48:11 vruppert Exp $"));
|
||||
mem = newmem;
|
||||
|
||||
/* set builtin default handlers, will be overwritten by the real default handler */
|
||||
@ -195,9 +198,14 @@ void bx_devices_c::init(BX_MEM_C *newmem)
|
||||
PLUG_load_plugin(pcivga, PLUGTYPE_OPTIONAL);
|
||||
}
|
||||
#endif
|
||||
#if BX_SUPPORT_PCIUSB
|
||||
if (is_usb_enabled()) {
|
||||
PLUG_load_plugin(pciusb, PLUGTYPE_OPTIONAL);
|
||||
#if BX_SUPPORT_USB_UHCI
|
||||
if (is_usb_uhci_enabled()) {
|
||||
PLUG_load_plugin(usb_uhci, PLUGTYPE_OPTIONAL);
|
||||
}
|
||||
#endif
|
||||
#if BX_SUPPORT_USB_OHCI
|
||||
if (is_usb_ohci_enabled()) {
|
||||
PLUG_load_plugin(usb_ohci, PLUGTYPE_OPTIONAL);
|
||||
}
|
||||
#endif
|
||||
#if BX_SUPPORT_PCIDEV
|
||||
@ -971,18 +979,6 @@ bx_bool bx_devices_c::is_serial_enabled(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool bx_devices_c::is_usb_enabled(void)
|
||||
{
|
||||
char pname[20];
|
||||
|
||||
for (int i=0; i<BX_N_USB_HUBS; i++) {
|
||||
sprintf(pname, "ports.usb.%d.enabled", i+1);
|
||||
if (SIM->get_param_bool(pname)->get())
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool bx_devices_c::is_parallel_enabled(void)
|
||||
{
|
||||
char pname[26];
|
||||
@ -995,11 +991,31 @@ bx_bool bx_devices_c::is_parallel_enabled(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool bx_devices_c::is_usb_ohci_enabled(void)
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_bool bx_devices_c::is_usb_uhci_enabled(void)
|
||||
{
|
||||
if (SIM->get_param_bool("ports.usb.1.enabled")->get()) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// common mouse device handlers
|
||||
void bx_devices_c::mouse_enabled_changed(bx_bool enabled)
|
||||
{
|
||||
mouse_captured = enabled;
|
||||
#if BX_SUPPORT_PCIUSB
|
||||
if (pluginPciUSBAdapter->usb_mouse_enabled_changed(enabled)) {
|
||||
#if BX_SUPPORT_USB_UHCI
|
||||
if (pluginUSB_UHCI->usb_mouse_enabled_changed(enabled)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if BX_SUPPORT_USB_OHCI
|
||||
if (pluginUSB_OHCI->usb_mouse_enabled_changed(enabled)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@ -1015,9 +1031,14 @@ void bx_devices_c::mouse_motion(int delta_x, int delta_y, int delta_z, unsigned
|
||||
if (!mouse_captured)
|
||||
return;
|
||||
|
||||
#if BX_SUPPORT_PCIUSB
|
||||
// if an usb mouse is connected, redirect mouse data to the usb device
|
||||
if (pluginPciUSBAdapter->usb_mouse_enq(delta_x, delta_y, delta_z, button_state)) {
|
||||
#if BX_SUPPORT_USB_UHCI
|
||||
if (pluginUSB_UHCI->usb_mouse_enq(delta_x, delta_y, delta_z, button_state)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if BX_SUPPORT_USB_OHCI
|
||||
if (pluginUSB_OHCI->usb_mouse_enq(delta_x, delta_y, delta_z, button_state)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: iodev.h,v 1.106 2009-01-16 11:53:38 vruppert Exp $
|
||||
// $Id: iodev.h,v 1.107 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -440,8 +440,11 @@ public:
|
||||
bx_floppy_stub_c *pluginFloppyDevice;
|
||||
bx_cmos_stub_c *pluginCmosDevice;
|
||||
bx_serial_stub_c *pluginSerialDevice;
|
||||
#if BX_SUPPORT_PCIUSB
|
||||
bx_pci_usb_stub_c *pluginPciUSBAdapter;
|
||||
#if BX_SUPPORT_USB_UHCI
|
||||
bx_pci_usb_stub_c *pluginUSB_UHCI;
|
||||
#endif
|
||||
#if BX_SUPPORT_USB_OHCI
|
||||
bx_pci_usb_stub_c *pluginUSB_OHCI;
|
||||
#endif
|
||||
bx_vga_stub_c *pluginVgaDevice;
|
||||
bx_pic_stub_c *pluginPicDevice;
|
||||
@ -529,9 +532,11 @@ private:
|
||||
Bit8u mouse_type;
|
||||
|
||||
int timer_handle;
|
||||
|
||||
bx_bool is_serial_enabled();
|
||||
bx_bool is_usb_enabled();
|
||||
bx_bool is_parallel_enabled();
|
||||
bx_bool is_usb_ohci_enabled();
|
||||
bx_bool is_usb_uhci_enabled();
|
||||
};
|
||||
|
||||
// memory stub has an assumption that there are no memory accesses splitting 4K page
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: keyboard.cc,v 1.138 2009-01-16 11:53:38 vruppert Exp $
|
||||
// $Id: keyboard.cc,v 1.139 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -125,7 +125,7 @@ void bx_keyb_c::resetinternals(bx_bool powerup)
|
||||
|
||||
void bx_keyb_c::init(void)
|
||||
{
|
||||
BX_DEBUG(("Init $Id: keyboard.cc,v 1.138 2009-01-16 11:53:38 vruppert Exp $"));
|
||||
BX_DEBUG(("Init $Id: keyboard.cc,v 1.139 2009-01-19 09:48:11 vruppert Exp $"));
|
||||
Bit32u i;
|
||||
|
||||
DEV_register_irq(1, "8042 Keyboard controller");
|
||||
@ -860,9 +860,14 @@ void bx_keyb_c::gen_scancode(Bit32u key)
|
||||
else
|
||||
scancode=(unsigned char *)scancodes[(key&0xFF)][BX_KEY_THIS s.kbd_controller.current_scancodes_set].make;
|
||||
|
||||
#if BX_SUPPORT_PCIUSB
|
||||
// if we have a keyboard/keypad installed, we need to call its handler first
|
||||
if (DEV_usb_key_enq(scancode)) {
|
||||
#if BX_SUPPORT_USB_UHCI
|
||||
if (DEV_usb_uhci_key_enq(scancode)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if BX_SUPPORT_USB_OHCI
|
||||
if (DEV_usb_ohci_key_enq(scancode)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_common.cc,v 1.1 2009-01-18 13:11:27 vruppert Exp $
|
||||
// $Id: usb_common.cc,v 1.2 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Benjamin D Lunt (fys at frontiernet net)
|
||||
@ -53,7 +53,6 @@
|
||||
|
||||
#if BX_SUPPORT_PCI && BX_SUPPORT_PCIUSB
|
||||
|
||||
#include "pci.h"
|
||||
#include "usb_common.h"
|
||||
#include "usb_hid.h"
|
||||
#include "usb_msd.h"
|
||||
@ -62,7 +61,7 @@
|
||||
|
||||
|
||||
// Dumps the contents of a buffer to the log file
|
||||
void usb_device_t::usb_dump_packet(Bit8u *data, unsigned size)
|
||||
void usb_device_c::usb_dump_packet(Bit8u *data, unsigned size)
|
||||
{
|
||||
char the_packet[256], str[16];
|
||||
strcpy(the_packet, "Packet contents (in hex):");
|
||||
@ -80,7 +79,7 @@ void usb_device_t::usb_dump_packet(Bit8u *data, unsigned size)
|
||||
BX_DEBUG(("%s", the_packet));
|
||||
}
|
||||
|
||||
int usb_device_t::set_usb_string(Bit8u *buf, const char *str)
|
||||
int usb_device_c::set_usb_string(Bit8u *buf, const char *str)
|
||||
{
|
||||
size_t len, i;
|
||||
Bit8u *q;
|
||||
@ -106,7 +105,7 @@ int usb_device_t::set_usb_string(Bit8u *buf, const char *str)
|
||||
#define SETUP_STATE_DATA 1
|
||||
#define SETUP_STATE_ACK 2
|
||||
|
||||
int usb_device_t::handle_packet(USBPacket *p)
|
||||
int usb_device_c::handle_packet(USBPacket *p)
|
||||
{
|
||||
int l, ret = 0;
|
||||
int len = p->len;
|
||||
@ -239,7 +238,7 @@ int usb_device_t::handle_packet(USBPacket *p)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void usb_device_t::register_state(bx_list_c *parent)
|
||||
void usb_device_c::register_state(bx_list_c *parent)
|
||||
{
|
||||
bx_list_c *list = new bx_list_c(parent, "d", "Common USB Device State");
|
||||
new bx_shadow_num_c(list, "addr", &d.addr);
|
||||
@ -249,7 +248,7 @@ void usb_device_t::register_state(bx_list_c *parent)
|
||||
}
|
||||
|
||||
// base class for USB devices
|
||||
usb_device_t::usb_device_t(void) {
|
||||
usb_device_c::usb_device_c(void) {
|
||||
memset((void*)&d, 0, sizeof(d));
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_common.h,v 1.1 2009-01-18 13:11:27 vruppert Exp $
|
||||
// $Id: usb_common.h,v 1.2 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Benjamin D Lunt (fys at frontiernet net)
|
||||
@ -18,8 +18,8 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#ifndef BX_USB_COMMON_H
|
||||
#define BX_USB_COMMON_H
|
||||
#ifndef BX_IODEV_USB_COMMON_H
|
||||
#define BX_IODEV_USB_COMMON_H
|
||||
|
||||
#define USB_TOKEN_IN 0x69
|
||||
#define USB_TOKEN_OUT 0xE1
|
||||
@ -115,10 +115,10 @@ enum usbdev_type {
|
||||
};
|
||||
|
||||
|
||||
class usb_device_t : public logfunctions {
|
||||
class usb_device_c : public logfunctions {
|
||||
public:
|
||||
usb_device_t(void);
|
||||
virtual ~usb_device_t(void) {}
|
||||
usb_device_c(void);
|
||||
virtual ~usb_device_c(void) {}
|
||||
|
||||
virtual int handle_packet(USBPacket *p);
|
||||
virtual void handle_reset() {}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_hid.cc,v 1.9 2009-01-18 13:11:27 vruppert Exp $
|
||||
// $Id: usb_hid.cc,v 1.10 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Volker Ruppert
|
||||
@ -353,7 +353,7 @@ struct KEYPAD keypad_lookup[KEYPAD_LEN] = {
|
||||
{ { 0xE0, 0x5A }, { 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00 } }, // Enter
|
||||
};
|
||||
|
||||
usb_hid_device_t::usb_hid_device_t(usbdev_type type)
|
||||
usb_hid_device_c::usb_hid_device_c(usbdev_type type)
|
||||
{
|
||||
d.type = type;
|
||||
d.speed = USB_SPEED_LOW;
|
||||
@ -370,11 +370,11 @@ usb_hid_device_t::usb_hid_device_t(usbdev_type type)
|
||||
put("USBHI");
|
||||
}
|
||||
|
||||
usb_hid_device_t::~usb_hid_device_t(void)
|
||||
usb_hid_device_c::~usb_hid_device_c(void)
|
||||
{
|
||||
}
|
||||
|
||||
void usb_hid_device_t::register_state_specific(bx_list_c *parent)
|
||||
void usb_hid_device_c::register_state_specific(bx_list_c *parent)
|
||||
{
|
||||
bx_list_c *key;
|
||||
Bit8u i;
|
||||
@ -400,13 +400,13 @@ void usb_hid_device_t::register_state_specific(bx_list_c *parent)
|
||||
}
|
||||
}
|
||||
|
||||
void usb_hid_device_t::handle_reset()
|
||||
void usb_hid_device_c::handle_reset()
|
||||
{
|
||||
memset((void*)&s, 0, sizeof(s));
|
||||
BX_DEBUG(("Reset"));
|
||||
}
|
||||
|
||||
int usb_hid_device_t::handle_control(int request, int value, int index, int length, Bit8u *data)
|
||||
int usb_hid_device_c::handle_control(int request, int value, int index, int length, Bit8u *data)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@ -588,7 +588,7 @@ int usb_hid_device_t::handle_control(int request, int value, int index, int leng
|
||||
return ret;
|
||||
}
|
||||
|
||||
int usb_hid_device_t::handle_data(USBPacket *p)
|
||||
int usb_hid_device_c::handle_data(USBPacket *p)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@ -623,7 +623,7 @@ int usb_hid_device_t::handle_data(USBPacket *p)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int usb_hid_device_t::mouse_poll(Bit8u *buf, int len)
|
||||
int usb_hid_device_c::mouse_poll(Bit8u *buf, int len)
|
||||
{
|
||||
int l = 0;
|
||||
|
||||
@ -658,7 +658,7 @@ int usb_hid_device_t::mouse_poll(Bit8u *buf, int len)
|
||||
return l;
|
||||
}
|
||||
|
||||
void usb_hid_device_t::mouse_enq(int delta_x, int delta_y, int delta_z, unsigned button_state)
|
||||
void usb_hid_device_c::mouse_enq(int delta_x, int delta_y, int delta_z, unsigned button_state)
|
||||
{
|
||||
if (d.type == USB_DEV_TYPE_MOUSE) {
|
||||
// scale down the motion
|
||||
@ -711,7 +711,7 @@ void usb_hid_device_t::mouse_enq(int delta_x, int delta_y, int delta_z, unsigned
|
||||
s.b_state = (Bit8u) button_state;
|
||||
}
|
||||
|
||||
int usb_hid_device_t::keypad_poll(Bit8u *buf, int len)
|
||||
int usb_hid_device_c::keypad_poll(Bit8u *buf, int len)
|
||||
{
|
||||
int l = 0;
|
||||
|
||||
@ -722,7 +722,7 @@ int usb_hid_device_t::keypad_poll(Bit8u *buf, int len)
|
||||
return l;
|
||||
}
|
||||
|
||||
bx_bool usb_hid_device_t::key_enq(Bit8u *scan_code)
|
||||
bx_bool usb_hid_device_c::key_enq(Bit8u *scan_code)
|
||||
{
|
||||
bx_bool is_break_code = 0;
|
||||
Bit8u our_scan_code[8];
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_hid.h,v 1.6 2009-01-18 13:11:27 vruppert Exp $
|
||||
// $Id: usb_hid.h,v 1.7 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Volker Ruppert
|
||||
@ -24,10 +24,10 @@
|
||||
#define BX_IODEV_USB_HID_H
|
||||
|
||||
|
||||
class usb_hid_device_t : public usb_device_t {
|
||||
class usb_hid_device_c : public usb_device_c {
|
||||
public:
|
||||
usb_hid_device_t(usbdev_type type);
|
||||
virtual ~usb_hid_device_t(void);
|
||||
usb_hid_device_c(usbdev_type type);
|
||||
virtual ~usb_hid_device_c(void);
|
||||
|
||||
virtual void handle_reset();
|
||||
virtual int handle_control(int request, int value, int index, int length, Bit8u *data);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_msd.cc,v 1.10 2009-01-18 13:11:27 vruppert Exp $
|
||||
// $Id: usb_msd.cc,v 1.11 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Volker Ruppert
|
||||
@ -130,7 +130,7 @@ static const Bit8u bx_msd_config_descriptor[] = {
|
||||
0x00 /* u8 ep_bInterval; */
|
||||
};
|
||||
|
||||
usb_msd_device_t::usb_msd_device_t(void)
|
||||
usb_msd_device_c::usb_msd_device_c(void)
|
||||
{
|
||||
d.type = USB_DEV_TYPE_DISK;
|
||||
d.speed = USB_SPEED_FULL;
|
||||
@ -140,14 +140,14 @@ usb_msd_device_t::usb_msd_device_t(void)
|
||||
put("USBMS");
|
||||
}
|
||||
|
||||
usb_msd_device_t::~usb_msd_device_t(void)
|
||||
usb_msd_device_c::~usb_msd_device_c(void)
|
||||
{
|
||||
delete s.scsi_dev;
|
||||
s.hdimage->close();
|
||||
delete s.hdimage;
|
||||
}
|
||||
|
||||
bx_bool usb_msd_device_t::init(const char *filename)
|
||||
bx_bool usb_msd_device_c::init(const char *filename)
|
||||
{
|
||||
s.hdimage = new default_image_t();
|
||||
if (s.hdimage->open(filename) < 0) {
|
||||
@ -162,7 +162,7 @@ bx_bool usb_msd_device_t::init(const char *filename)
|
||||
}
|
||||
}
|
||||
|
||||
void usb_msd_device_t::register_state_specific(bx_list_c *parent)
|
||||
void usb_msd_device_c::register_state_specific(bx_list_c *parent)
|
||||
{
|
||||
s.sr_list = new bx_list_c(parent, "s", "USB MSD Device State", 8);
|
||||
new bx_shadow_num_c(s.sr_list, "mode", &s.mode);
|
||||
@ -174,13 +174,13 @@ void usb_msd_device_t::register_state_specific(bx_list_c *parent)
|
||||
new bx_shadow_num_c(s.sr_list, "result", &s.result);
|
||||
}
|
||||
|
||||
void usb_msd_device_t::handle_reset()
|
||||
void usb_msd_device_c::handle_reset()
|
||||
{
|
||||
BX_DEBUG(("Reset"));
|
||||
s.mode = USB_MSDM_CBW;
|
||||
}
|
||||
|
||||
int usb_msd_device_t::handle_control(int request, int value, int index, int length, Bit8u *data)
|
||||
int usb_msd_device_c::handle_control(int request, int value, int index, int length, Bit8u *data)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@ -306,7 +306,7 @@ int usb_msd_device_t::handle_control(int request, int value, int index, int leng
|
||||
return ret;
|
||||
}
|
||||
|
||||
int usb_msd_device_t::handle_data(USBPacket *p)
|
||||
int usb_msd_device_c::handle_data(USBPacket *p)
|
||||
{
|
||||
struct usb_msd_cbw cbw;
|
||||
int ret = 0;
|
||||
@ -456,7 +456,7 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void usb_msd_device_t::copy_data()
|
||||
void usb_msd_device_c::copy_data()
|
||||
{
|
||||
Bit32u len = s.usb_len;
|
||||
if (len > s.scsi_len)
|
||||
@ -480,7 +480,7 @@ void usb_msd_device_t::copy_data()
|
||||
}
|
||||
}
|
||||
|
||||
void usb_msd_device_t::send_status()
|
||||
void usb_msd_device_c::send_status()
|
||||
{
|
||||
struct usb_msd_csw csw;
|
||||
|
||||
@ -491,13 +491,13 @@ void usb_msd_device_t::send_status()
|
||||
memcpy(s.usb_buf, &csw, 13);
|
||||
}
|
||||
|
||||
void usb_msd_device_t::usb_msd_command_complete(void *this_ptr, int reason, Bit32u tag, Bit32u arg)
|
||||
void usb_msd_device_c::usb_msd_command_complete(void *this_ptr, int reason, Bit32u tag, Bit32u arg)
|
||||
{
|
||||
usb_msd_device_t *class_ptr = (usb_msd_device_t *) this_ptr;
|
||||
usb_msd_device_c *class_ptr = (usb_msd_device_c *) this_ptr;
|
||||
class_ptr->command_complete(reason, tag, arg);
|
||||
}
|
||||
|
||||
void usb_msd_device_t::command_complete(int reason, Bit32u tag, Bit32u arg)
|
||||
void usb_msd_device_c::command_complete(int reason, Bit32u tag, Bit32u arg)
|
||||
{
|
||||
USBPacket *p = s.packet;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: usb_msd.h,v 1.7 2009-01-18 13:11:27 vruppert Exp $
|
||||
// $Id: usb_msd.h,v 1.8 2009-01-19 09:48:12 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Volker Ruppert
|
||||
@ -27,10 +27,10 @@ class device_image_t;
|
||||
class scsi_device_t;
|
||||
|
||||
|
||||
class usb_msd_device_t : public usb_device_t {
|
||||
class usb_msd_device_c : public usb_device_c {
|
||||
public:
|
||||
usb_msd_device_t(void);
|
||||
virtual ~usb_msd_device_t(void);
|
||||
usb_msd_device_c(void);
|
||||
virtual ~usb_msd_device_c(void);
|
||||
|
||||
bx_bool init(const char *filename);
|
||||
virtual void handle_reset();
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: pciusb.h,v 1.34 2009-01-18 13:11:27 vruppert Exp $
|
||||
// $Id: usb_uhci.h,v 1.1 2009-01-19 09:48:12 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Benjamin D Lunt (fys at frontiernet net)
|
||||
@ -18,20 +18,17 @@
|
||||
// License along with this library; if not, write to the Free Software
|
||||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
#ifndef BX_IODEV_PCIUSB_H
|
||||
#define BX_IODEV_PCIUSB_H
|
||||
#ifndef BX_IODEV_USB_UHCI_H
|
||||
#define BX_IODEV_USB_UHCI_H
|
||||
|
||||
#if BX_USE_PCIUSB_SMF
|
||||
# define BX_USB_THIS theUSBDevice->
|
||||
# define BX_USB_THIS_PTR theUSBDevice
|
||||
#if BX_USE_USB_UHCI_SMF
|
||||
# define BX_UHCI_THIS theUSB_UHCI->
|
||||
# define BX_UHCI_THIS_PTR theUSB_UHCI
|
||||
#else
|
||||
# define BX_USB_THIS this->
|
||||
# define BX_USB_THIS_PTR this
|
||||
# define BX_UHCI_THIS this->
|
||||
# define BX_UHCI_THIS_PTR this
|
||||
#endif
|
||||
|
||||
#define BX_USB_MAXDEV 1
|
||||
#define BX_USB_CONFDEV 1 /* only 1 USB hub currently */
|
||||
|
||||
#define USB_NUM_PORTS 2 /* UHCI supports 2 ports per root hub */
|
||||
|
||||
typedef struct {
|
||||
@ -143,7 +140,7 @@ typedef struct {
|
||||
// Can only write in WORD sizes (Read in byte sizes???)
|
||||
struct {
|
||||
// our data
|
||||
usb_device_t *device; // device connected to this port
|
||||
usb_device_c *device; // device connected to this port
|
||||
|
||||
// bit reps of actual port
|
||||
bx_bool suspend;
|
||||
@ -163,7 +160,7 @@ typedef struct {
|
||||
|
||||
int statusbar_id[2]; // IDs of the status LEDs
|
||||
|
||||
} bx_usb_t;
|
||||
} bx_usb_uhci_t;
|
||||
|
||||
#pragma pack (push, 1)
|
||||
struct TD {
|
||||
@ -184,10 +181,10 @@ struct HCSTACK {
|
||||
bx_bool t;
|
||||
};
|
||||
|
||||
class bx_pciusb_c : public bx_pci_usb_stub_c {
|
||||
class bx_usb_uhci_c : public bx_pci_usb_stub_c {
|
||||
public:
|
||||
bx_pciusb_c();
|
||||
virtual ~bx_pciusb_c();
|
||||
bx_usb_uhci_c();
|
||||
virtual ~bx_usb_uhci_c();
|
||||
virtual void init(void);
|
||||
virtual void reset(unsigned);
|
||||
virtual bx_bool usb_mouse_enq(int delta_x, int delta_y, int delta_z, unsigned button_state);
|
||||
@ -202,19 +199,18 @@ public:
|
||||
const char *oldval, const char *val, int maxlen);
|
||||
|
||||
private:
|
||||
bx_bool busy;
|
||||
bx_usb_uhci_t hub;
|
||||
Bit8u global_reset;
|
||||
bx_bool busy;
|
||||
Bit8u *device_buffer;
|
||||
|
||||
bx_usb_t hub[BX_USB_CONFDEV];
|
||||
Bit8u global_reset;
|
||||
|
||||
static void set_irq_level(bx_bool level);
|
||||
Bit8u *device_buffer;
|
||||
|
||||
usb_hid_device_t *mousedev;
|
||||
usb_hid_device_t *keybdev;
|
||||
usb_hid_device_c *mousedev;
|
||||
usb_hid_device_c *keybdev;
|
||||
|
||||
USBPacket usb_packet;
|
||||
|
||||
static void set_irq_level(bx_bool level);
|
||||
|
||||
static void init_device(Bit8u port, const char *devname);
|
||||
static void usb_set_connect_status(Bit8u port, int type, bx_bool connected);
|
||||
|
||||
@ -226,11 +222,11 @@ private:
|
||||
|
||||
static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len);
|
||||
static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
|
||||
#if !BX_USE_PCIUSB_SMF
|
||||
#if !BX_USE_USB_UHCI_SMF
|
||||
Bit32u read(Bit32u address, unsigned io_len);
|
||||
void write(Bit32u address, Bit32u value, unsigned io_len);
|
||||
#endif
|
||||
void usb_send_msg(usb_device_t *dev, int msg);
|
||||
void usb_send_msg(usb_device_c *dev, int msg);
|
||||
};
|
||||
|
||||
#endif
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: plugin.h,v 1.71 2009-01-13 19:01:19 vruppert Exp $
|
||||
// $Id: plugin.h,v 1.72 2009-01-19 09:48:11 vruppert Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 The Bochs Project
|
||||
@ -60,7 +60,8 @@ extern "C" {
|
||||
#define BX_PLUGIN_EXTFPUIRQ "extfpuirq"
|
||||
#define BX_PLUGIN_PCIVGA "pcivga"
|
||||
#define BX_PLUGIN_PCIDEV "pcidev"
|
||||
#define BX_PLUGIN_PCIUSB "pciusb"
|
||||
#define BX_PLUGIN_USB_UHCI "usb_uhci"
|
||||
#define BX_PLUGIN_USB_OHCI "usb_ohci"
|
||||
#define BX_PLUGIN_PCIPNIC "pcipnic"
|
||||
#define BX_PLUGIN_GAMEPORT "gameport"
|
||||
#define BX_PLUGIN_SPEAKER "speaker"
|
||||
@ -220,10 +221,14 @@ extern "C" {
|
||||
#define DEV_speaker_beep_on(frequency) bx_devices.pluginSpeaker->beep_on(frequency)
|
||||
#define DEV_speaker_beep_off() bx_devices.pluginSpeaker->beep_off()
|
||||
|
||||
///////// USB device macro
|
||||
#if BX_SUPPORT_PCIUSB
|
||||
#define DEV_usb_key_enq(scan_code) \
|
||||
(bx_devices.pluginPciUSBAdapter->usb_key_enq(scan_code))
|
||||
///////// USB device macros
|
||||
#if BX_SUPPORT_USB_UHCI
|
||||
#define DEV_usb_uhci_key_enq(scan_code) \
|
||||
(bx_devices.pluginUSB_UHCI->usb_key_enq(scan_code))
|
||||
#endif
|
||||
#if BX_SUPPORT_USB_OHCI
|
||||
#define DEV_usb_ohci_key_enq(scan_code) \
|
||||
(bx_devices.pluginUSB_OHCI->usb_key_enq(scan_code))
|
||||
#endif
|
||||
|
||||
//////// Memory macros
|
||||
@ -372,7 +377,8 @@ DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pci2isa)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pci_ide)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pcivga)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pcidev)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pciusb)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(usb_uhci)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(usb_ohci)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(pcipnic)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(sb16)
|
||||
DECLARE_PLUGIN_INIT_FINI_FOR_MODULE(ne2k)
|
||||
|
Loading…
Reference in New Issue
Block a user