USB debugger: Renamed configure option and config.h macro.

Now --enable-usb-debugger turns on USB debugger if not already done with Bochs debugger.
Now using BX_USB_DEBUGGER macro to prepare the code for implementations other than win32.
This commit is contained in:
Volker Ruppert 2024-07-06 18:48:14 +02:00
parent 2717e90d58
commit 938c2ba307
22 changed files with 84 additions and 90 deletions

View File

@ -31,9 +31,6 @@
#if BX_SUPPORT_PCIUSB
#include "iodev/usb/usb_common.h"
#endif
#if BX_USE_WIN32USBDEBUG
#include "gui/win32usb.h"
#endif
#include "param_names.h"
#include <assert.h>
@ -231,7 +228,7 @@ void bx_init_usb_options(const char *usb_name, const char *pname, int maxports,
usb = new bx_list_c(ports, "usb", "USB Configuration");
usb->set_options(usb->USE_TAB_WINDOW | usb->SHOW_PARENT);
// usb debugging
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
static const char *usb_debug_type[] = { "none", "uhci", "ohci", "ehci", "xhci", NULL };
bx_list_c *usb_debug = new bx_list_c(ports, "usb_debug", "USB Debug Options");
bx_param_enum_c *type = new bx_param_enum_c(usb_debug,
@ -3379,7 +3376,7 @@ static int parse_line_formatted(const char *context, int num_params, char *param
#else
PARSE_WARN(("%s: Bochs is not compiled with iodebug support", context));
#endif
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
} else if (!strcmp(params[0], "usb_debug")) {
if (num_params < 2) {
PARSE_ERR(("%s: usb_debug directive malformed.", context));
@ -3779,7 +3776,7 @@ int bx_write_configuration(const char *rc, int overwrite)
bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_KEYBOARD), NULL, 0);
bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_MOUSE), NULL, 0);
bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_SOUNDLOW),"sound", 0);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
bx_write_param_list(fp, (bx_list_c*) SIM->get_param(BXPN_USB_DEBUG), "usb_debug", 0);
#endif
SIM->save_addon_options(fp);

View File

@ -814,10 +814,8 @@ typedef Bit32u bx_phy_address;
#error To enable EHCI, you must also enable UHCI or OHCI
#endif
#ifdef _WIN32
// set to 1 to include the USB DEBUG CONFIG Interface
#define BX_USE_WIN32USBDEBUG 0
#endif
// set to 1 to include the USB debugger interface
#define BX_USB_DEBUGGER 0
// MS bus mouse support
#define BX_SUPPORT_BUSMOUSE 0

24
bochs/configure vendored
View File

@ -1091,7 +1091,7 @@ enable_usb
enable_usb_ohci
enable_usb_ehci
enable_usb_xhci
enable_win32usbdbg
enable_usb_debugger
enable_ne2000
enable_pnic
enable_e1000
@ -1835,8 +1835,8 @@ Optional Features:
--enable-usb-ohci enable USB OHCI support (no)
--enable-usb-ehci enable USB EHCI support (no)
--enable-usb-xhci enable USB xHCI support (no)
--enable-win32usbdbg compile in support for Bochs Win32 USB debugger
(yes, if debugger is on and USB is on)
--enable-usb-debugger compile in support for Bochs USB debugger (yes, if
debugger is on and USB is on)
--enable-ne2000 enable NE2000 support (no)
--enable-pnic enable PCI pseudo NIC support (no)
--enable-e1000 enable Intel(R) Gigabit Ethernet support (no)
@ -24729,19 +24729,19 @@ fi
usb_debugger=0
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking enable Bochs Win32 USB debugger" >&5
printf %s "checking enable Bochs Win32 USB debugger... " >&6; }
# Check whether --enable-win32usbdbg was given.
if test ${enable_win32usbdbg+y}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking enable Bochs USB debugger" >&5
printf %s "checking enable Bochs USB debugger... " >&6; }
# Check whether --enable-usb-debugger was given.
if test ${enable_usb_debugger+y}
then :
enableval=$enable_win32usbdbg; if test "$enableval" = yes; then
enableval=$enable_usb_debugger; if test "$enableval" = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
usb_debugger=1
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
printf "%s\n" "#define BX_USE_WIN32USBDEBUG 0" >>confdefs.h
printf "%s\n" "#define BX_USB_DEBUGGER 0" >>confdefs.h
usb_debugger=0
fi
@ -24754,7 +24754,7 @@ printf "%s\n" "yes" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
printf "%s\n" "#define BX_USE_WIN32USBDEBUG 0" >>confdefs.h
printf "%s\n" "#define BX_USB_DEBUGGER 0" >>confdefs.h
usb_debugger=0
fi
@ -26661,12 +26661,12 @@ USB_DBG_OBJS=""
if test "$usb_debugger" = 1; then
if test "$DEFAULT_GUI" = win32 -o "$with_win32" = yes; then
USB_DBG_OBJS="usb_debug.o win32usb.o"
printf "%s\n" "#define BX_USE_WIN32USBDEBUG 1" >>confdefs.h
printf "%s\n" "#define BX_USB_DEBUGGER 1" >>confdefs.h
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: The USB debugger supported only for Win32 cannot be compiled here, disabling it" >&5
printf "%s\n" "$as_me: WARNING: The USB debugger supported only for Win32 cannot be compiled here, disabling it" >&2;}
printf "%s\n" "#define BX_USE_WIN32USBDEBUG 0" >>confdefs.h
printf "%s\n" "#define BX_USB_DEBUGGER 0" >>confdefs.h
fi
fi

View File

@ -1672,15 +1672,15 @@ AC_SUBST(USBHC_OBJS)
AC_SUBST(USBHC_DLL_TARGETS)
usb_debugger=0
AC_MSG_CHECKING(enable Bochs Win32 USB debugger)
AC_ARG_ENABLE(win32usbdbg,
AS_HELP_STRING([--enable-win32usbdbg], [compile in support for Bochs Win32 USB debugger (yes, if debugger is on and USB is on)]),
AC_MSG_CHECKING(enable Bochs USB debugger)
AC_ARG_ENABLE(usb-debugger,
AS_HELP_STRING([--enable-usb-debugger], [compile in support for Bochs USB debugger (yes, if debugger is on and USB is on)]),
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
usb_debugger=1
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_WIN32USBDEBUG, 0)
AC_DEFINE(BX_USB_DEBUGGER, 0)
usb_debugger=0
fi],
[
@ -1689,7 +1689,7 @@ AC_ARG_ENABLE(win32usbdbg,
usb_debugger=1
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_USE_WIN32USBDEBUG, 0)
AC_DEFINE(BX_USB_DEBUGGER, 0)
usb_debugger=0
fi
]
@ -3021,10 +3021,10 @@ USB_DBG_OBJS=""
if test "$usb_debugger" = 1; then
if test "$DEFAULT_GUI" = win32 -o "$with_win32" = yes; then
USB_DBG_OBJS="usb_debug.o win32usb.o"
AC_DEFINE(BX_USE_WIN32USBDEBUG, 1)
AC_DEFINE(BX_USB_DEBUGGER, 1)
else
AC_MSG_WARN([The USB debugger supported only for Win32 cannot be compiled here, disabling it])
AC_DEFINE(BX_USE_WIN32USBDEBUG, 0)
AC_DEFINE(BX_USB_DEBUGGER, 0)
fi
fi
AC_SUBST(USB_DBG_OBJS)

View File

@ -33,7 +33,7 @@
#include "gui/bitmaps/paste.h"
#include "gui/bitmaps/configbutton.h"
#include "gui/bitmaps/cdrom1.h"
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#include "gui/bitmaps/usb.h"
#endif
#include "gui/bitmaps/userbutton.h"
@ -236,7 +236,7 @@ void bx_gui_c::init(int argc, char **argv, unsigned max_xres, unsigned max_yres,
BX_GUI_THIS save_restore_bmap_id = create_bitmap(bx_save_restore_bmap,
BX_SAVE_RESTORE_BMAP_X, BX_SAVE_RESTORE_BMAP_Y);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
BX_GUI_THIS usbdbg_bmap_id = create_bitmap(bx_usbdbg_bmap,
BX_USB_BMAP_X, BX_USB_BMAP_Y);
BX_GUI_THIS usbdbg_dis_bmap_id = create_bitmap(bx_usbdbg_dis_bmap,
@ -273,7 +273,7 @@ void bx_gui_c::init(int argc, char **argv, unsigned max_xres, unsigned max_yres,
BX_GRAVITY_LEFT, toggle_mouse_enable);
BX_GUI_THIS set_tooltip(BX_GUI_THIS mouse_hbar_id, "Enable mouse capture");
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
// USB button
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_USB) {
BX_GUI_THIS usbdbg_hbar_id = headerbar_bitmap(BX_GUI_THIS usbdbg_dis_bmap_id,
@ -704,8 +704,7 @@ void bx_gui_c::config_handler(void)
}
}
#if BX_USE_WIN32USBDEBUG
#include "win32usb.h"
#if BX_USB_DEBUGGER
void bx_gui_c::usb_handler(void)
{
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_USB) {

View File

@ -26,7 +26,7 @@
// header bar and status bar stuff
#define BX_HEADER_BAR_Y 32
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#define BX_MAX_PIXMAPS 19
#define BX_MAX_HEADERBAR_ENTRIES 13
#else
@ -47,7 +47,7 @@
#define BX_GUI_DLG_RUNTIME 0x08
#define BX_GUI_DLG_USER 0x10
#define BX_GUI_DLG_SAVE_RESTORE 0x20
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#define BX_GUI_DLG_USB 0x40
#define BX_GUI_DLG_ALL 0x7F
#else
@ -238,7 +238,7 @@ public:
void set_fullscreen_mode(bool active) {fullscreen_mode = active;}
// marklog handler without button, called in gui command mode
static void marklog_handler(void);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
void set_usbdbg_bitmap(bool trigger);
#endif
@ -254,7 +254,7 @@ protected:
static void paste_handler(void);
static void snapshot_handler(void);
static void config_handler(void);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
static void usb_handler(void);
#endif
static void userbutton_handler(void);
@ -291,7 +291,7 @@ protected:
unsigned mouse_bmap_id, nomouse_bmap_id, mouse_hbar_id;
unsigned user_bmap_id, user_hbar_id;
unsigned save_restore_bmap_id, save_restore_hbar_id;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
unsigned usbdbg_bmap_id, usbdbg_dis_bmap_id, usbdbg_trigger_bmap_id, usbdbg_hbar_id;
#endif
// the "classic" Bochs headerbar

View File

@ -28,7 +28,7 @@
#include "iodev.h"
#include "bx_debug/debug.h"
#include "virt_timer.h"
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#include "gui/usb_debug.h"
#endif
@ -179,7 +179,7 @@ public:
config_interface_callback_t callback,
void *userdata);
virtual int configuration_interface(const char* name, ci_command_t command);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
virtual void register_usb_debug_type(int type);
virtual void usb_debug_trigger(int type, int trigger, int wParam, int lParam);
virtual int usb_debug_interface(int type, int wParam, int lParam);
@ -940,7 +940,7 @@ int bx_real_sim_c::configuration_interface(const char *ignore, ci_command_t comm
return retval;
}
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
void bx_real_sim_c::register_usb_debug_type(int type)
{
usb_dbg_register_type(type);

View File

@ -559,7 +559,7 @@ BOCHSAPI extern const char *media_status_names[];
BOCHSAPI extern const char *bochs_bootdisk_names[];
// usb_debug items
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
enum {
USB_DEBUG_NONE,
@ -740,7 +740,7 @@ public:
config_interface_callback_t callback,
void *userdata) {}
virtual int configuration_interface(const char* name, ci_command_t command) {return -1; }
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
virtual void register_usb_debug_type(int type) {}
virtual void usb_debug_trigger(int type, int trigger, int wParam, int lParam) {}
virtual int usb_debug_interface(int type, int wParam, int lParam) { return -1; }

View File

@ -21,7 +21,7 @@
#include "bochs.h"
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#include "usb_debug.h"
#include "siminterface.h"

View File

@ -22,7 +22,7 @@
#ifndef BX_USB_DEBUG_H
#define BX_USB_DEBUG_H
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
extern int usb_debug_type;
@ -34,5 +34,5 @@ void usb_dbg_trigger(int type, int trigger, int wParam, int lParam);
int win32_usb_start(HWND hwnd, int break_type, int wParam, int lParam);
#endif // BX_USE_WIN32USBDEBUG
#endif // BX_USB_DEBUGGER
#endif // BX_USB_DEBUG_H

View File

@ -21,7 +21,7 @@
#include "bochs.h"
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#include "windowsx.h"

View File

@ -22,7 +22,7 @@
#ifndef BX_WIN32_USB_H
#define BX_WIN32_USB_H
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#define COMMON_STR_SIZE 128
@ -135,5 +135,5 @@ struct S_ATTRIBUTES {
void do_attributes(HWND hwnd, DWORD id, const int size, const char *title, const struct S_ATTRIBUTES *attribs);
#endif // BX_USE_WIN32USBDEBUG
#endif // BX_USB_DEBUGGER
#endif // BX_WIN32_USB_H

View File

@ -1077,7 +1077,7 @@ void bx_wx_gui_c::specific_init(int argc, char **argv, unsigned headerbar_y)
new_gfx_api = 1;
new_text_api = 1;
dialog_caps = BX_GUI_DLG_USER | BX_GUI_DLG_SNAPSHOT | BX_GUI_DLG_SAVE_RESTORE;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
dialog_caps |= BX_GUI_DLG_USB;
#endif
}
@ -1209,7 +1209,7 @@ void bx_wx_gui_c::handle_events(void)
} else if (tb_button == 4) {
// userbutton_handler() also calls a dialog.
userbutton_handler();
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
} else if (tb_button == 5) {
// usb_handler() also calls a dialog.
usb_handler();
@ -1476,7 +1476,7 @@ void bx_wx_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
theFrame->SetToolBarBitmap(ID_Edit_FD_1, bmap_id == floppyB_bmap_id);
} else if (hbar_id == cdrom1_hbar_id) {
theFrame->SetToolBarBitmap(ID_Edit_Cdrom1, bmap_id == cdrom1_bmap_id);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
} else if (hbar_id == usbdbg_hbar_id) {
theFrame->SetToolBarBitmap(ID_Toolbar_USB_Debug, bmap_id == usbdbg_trigger_bmap_id);
#endif

View File

@ -98,7 +98,7 @@
//#include "bitmaps/configbutton.xpm"
#include "bitmaps/userbutton.xpm"
#include "bitmaps/saverestore.xpm"
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#include "bitmaps/usbdbg.xpm"
#include "bitmaps/usbdbg_trigger.xpm"
#endif
@ -353,7 +353,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_TOOL(ID_Toolbar_Snapshot, MyFrame::OnToolbarClick)
EVT_TOOL(ID_Toolbar_Mouse_en, MyFrame::OnToolbarClick)
EVT_TOOL(ID_Toolbar_User, MyFrame::OnToolbarClick)
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
EVT_TOOL(ID_Toolbar_USB_Debug, MyFrame::OnToolbarClick)
#endif
END_EVENT_TABLE()
@ -451,7 +451,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size,
BX_ADD_TOOL(ID_Edit_FD_1, floppyb_eject_xpm, wxT("Change floppy B: media"));
BX_ADD_TOOL(ID_Edit_Cdrom1, cdrom1_eject_xpm, wxT("Change first CDROM media"));
BX_ADD_TOOL(ID_Toolbar_Mouse_en, mouse_dis_xpm, wxT("Enable mouse capture"));
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
BX_ADD_TOOL(ID_Toolbar_USB_Debug, usbdbg_xpm, wxT("USB Debugger support not enabled"));
#endif
bxToolBar->AddSeparator();
@ -883,7 +883,7 @@ void MyFrame::UpdateToolBar(bool simPresent)
bxToolBar->SetToolShortHelp(ID_Toolbar_SaveRestore, wxT("Restore simulation state"));
bxToolBar->SetToolShortHelp(ID_Toolbar_Power, wxT("Turn power on"));
}
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
bxToolBar->EnableTool(ID_Toolbar_USB_Debug, false);
#endif
}
@ -1328,7 +1328,7 @@ void MyFrame::SetToolBarBitmap(int id, bool onoff)
case ID_Toolbar_Mouse_en:
bitmap = wxBitmap(onoff ? mouse_xpm : mouse_dis_xpm);
break;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
case ID_Toolbar_USB_Debug:
if (!bxToolBar->GetToolEnabled(ID_Toolbar_USB_Debug)) {
bxToolBar->EnableTool(ID_Toolbar_USB_Debug, true);

View File

@ -800,21 +800,21 @@ bool bx_ohci_core_c::mem_write(bx_phy_address addr, unsigned len, void *data)
case 0x60: // HcRhPortStatus[3]
#if (USB_OHCI_PORTS < 4)
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_OHCI, USB_DEBUG_NONEXIST, 0, 0);
#endif
break;
#endif
case 0x5C: // HcRhPortStatus[2]
#if (USB_OHCI_PORTS < 3)
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_OHCI, USB_DEBUG_NONEXIST, 0, 0);
#endif
break;
#endif
case 0x58: // HcRhPortStatus[1]
#if (USB_OHCI_PORTS < 2)
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_OHCI, USB_DEBUG_NONEXIST, 0, 0);
#endif
break;
@ -829,7 +829,7 @@ bool bx_ohci_core_c::mem_write(bx_phy_address addr, unsigned len, void *data)
if (hub.usb_port[p].HcRhPortStatus.ccs == 0)
hub.usb_port[p].HcRhPortStatus.csc = 1;
else {
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_OHCI, USB_DEBUG_ENABLE, 0, 0);
#endif
hub.usb_port[p].HcRhPortStatus.pes = 1;
@ -848,7 +848,7 @@ bool bx_ohci_core_c::mem_write(bx_phy_address addr, unsigned len, void *data)
if (hub.usb_port[p].HcRhPortStatus.ccs == 0)
hub.usb_port[p].HcRhPortStatus.csc = 1;
else {
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_OHCI, USB_DEBUG_RESET, 0, 0);
#endif
reset_port(p);
@ -918,7 +918,7 @@ void bx_ohci_core_c::ohci_timer(void)
Bit16u zero = 0;
if (hub.op_regs.HcControl.hcfs == OHCI_USB_OPERATIONAL) {
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_OHCI, USB_DEBUG_FRAME, 0, 0);
#endif
// set remaining to the interval amount.
@ -1160,7 +1160,7 @@ int bx_ohci_core_c::process_td(struct OHCI_TD *td, struct OHCI_ED *ed, int toggl
return 0;
}
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_OHCI, USB_DEBUG_COMMAND, 0, 0);
#endif

View File

@ -515,7 +515,7 @@ void bx_uhci_core_c::write(Bit32u address, Bit32u value, unsigned io_len)
case 0x14: // port #3 non existent, but linux systems check it to see if there are more than 2
BX_ERROR(("write to non existent offset 0x14 (port #3)"));
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
// Non existant Register Port (the next one after the last)
SIM->usb_debug_trigger(USB_DEBUG_UHCI, USB_DEBUG_NONEXIST, 0, 0);
#endif
@ -528,7 +528,7 @@ void bx_uhci_core_c::write(Bit32u address, Bit32u value, unsigned io_len)
// If the ports reset bit is set, don't allow any writes unless the new write will clear the reset bit
if (hub.usb_port[port].reset && ((value & (1 << 9)) != 0))
break;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
if ((value & (1 << 9)) && !hub.usb_port[port].reset)
SIM->usb_debug_trigger(USB_DEBUG_UHCI, USB_DEBUG_RESET, port, 0);
#endif
@ -557,7 +557,7 @@ void bx_uhci_core_c::write(Bit32u address, Bit32u value, unsigned io_len)
hub.usb_port[port].reset = (value & (1<<9)) ? 1 : 0;
hub.usb_port[port].resume = (value & (1<<6)) ? 1 : 0;
if (!hub.usb_port[port].enabled && (value & (1<<2))) {
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_UHCI, USB_DEBUG_ENABLE, port, 0);
#endif
hub.usb_port[port].enable_changed = 0;
@ -641,7 +641,7 @@ bool bx_uhci_core_c::uhci_add_queue(struct USB_UHCI_QUEUE_STACK *stack, const Bi
// Called once every 1ms
void bx_uhci_core_c::uhci_timer(void)
{
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_UHCI, USB_DEBUG_FRAME, 0, 0);
#endif
@ -767,7 +767,7 @@ void bx_uhci_core_c::uhci_timer(void)
// write back the status to the TD
DEV_MEM_WRITE_PHYSICAL(address + sizeof(Bit32u), sizeof(Bit32u), (Bit8u *) &td.dword1);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
// trigger again so that the user can see the processed packet
SIM->usb_debug_trigger(USB_DEBUG_UHCI, USB_DEBUG_COMMAND, address, USB_LPARAM_FLAG_AFTER);
#endif
@ -920,7 +920,7 @@ bool bx_uhci_core_c::DoTransfer(Bit32u address, struct TD *td)
BX_DEBUG(("TD found at address 0x%08X: 0x%08X 0x%08X 0x%08X 0x%08X", address, td->dword0, td->dword1, td->dword2, td->dword3));
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_UHCI, USB_DEBUG_COMMAND, address, USB_LPARAM_FLAG_BEFORE);
#endif

View File

@ -285,7 +285,7 @@ void bx_usb_ehci_c::init(void)
BX_EHCI_THIS uhci[0]->init_uhci(devfunc | 0x00, 0x8086, 0x24c2, 0x01, 0x80, BX_PCI_INTA);
BX_EHCI_THIS uhci[1]->init_uhci(devfunc | 0x01, 0x8086, 0x24c4, 0x01, 0x00, BX_PCI_INTB);
BX_EHCI_THIS uhci[2]->init_uhci(devfunc | 0x02, 0x8086, 0x24c7, 0x01, 0x00, BX_PCI_INTC);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
if (SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get() == USB_DEBUG_UHCI) {
SIM->register_usb_debug_type(USB_DEBUG_UHCI);
}
@ -306,7 +306,7 @@ void bx_usb_ehci_c::init(void)
BX_EHCI_THIS ohci[0]->init_ohci(devfunc | 0x00, 0x8086, 0x880C, 0x00, 0x80, BX_PCI_INTA);
BX_EHCI_THIS ohci[1]->init_ohci(devfunc | 0x01, 0x8086, 0x880D, 0x00, 0x00, BX_PCI_INTB);
BX_EHCI_THIS ohci[2]->init_ohci(devfunc | 0x02, 0x8086, 0x880E, 0x00, 0x00, BX_PCI_INTC);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
if (SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get() == USB_DEBUG_OHCI) {
SIM->register_usb_debug_type(USB_DEBUG_OHCI);
}
@ -348,7 +348,7 @@ void bx_usb_ehci_c::init(void)
QTAILQ_INIT(&BX_EHCI_THIS hub.aqueues);
QTAILQ_INIT(&BX_EHCI_THIS hub.pqueues);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
if (SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get() == USB_DEBUG_EHCI) {
SIM->register_usb_debug_type(USB_DEBUG_EHCI);
}
@ -1040,14 +1040,14 @@ bool bx_usb_ehci_c::write_handler(bx_phy_address addr, unsigned len, void *data,
BX_EHCI_THIS hub.usb_port[port].device->usb_send_msg(USB_MSG_RESET);
BX_EHCI_THIS hub.usb_port[port].portsc.csc = 0;
if (BX_EHCI_THIS hub.usb_port[port].device->get_speed() == USB_SPEED_HIGH) {
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_EHCI, USB_DEBUG_ENABLE, 0, 0);
#endif
BX_EHCI_THIS hub.usb_port[port].portsc.ped = 1;
}
}
}
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
if (!oldpr && BX_EHCI_THIS hub.usb_port[port].portsc.pr) {
SIM->usb_debug_trigger(USB_DEBUG_EHCI, USB_DEBUG_RESET, 0, 0);
}
@ -1055,7 +1055,7 @@ bool bx_usb_ehci_c::write_handler(bx_phy_address addr, unsigned len, void *data,
if (oldfpr && !BX_EHCI_THIS hub.usb_port[port].portsc.fpr) {
BX_EHCI_THIS hub.usb_port[port].portsc.sus = 0;
}
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
} else if (port == USB_EHCI_PORTS) {
SIM->usb_debug_trigger(USB_DEBUG_EHCI, USB_DEBUG_NONEXIST, 0, 0);
#endif
@ -1922,7 +1922,7 @@ int bx_usb_ehci_c::state_fetchqtd(EHCIQueue *q)
EHCIqtd qtd;
int again = 0;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_EHCI, USB_DEBUG_COMMAND, 0, 0);
#endif
@ -2381,7 +2381,7 @@ void bx_usb_ehci_c::ehci_frame_timer(void)
usec_elapsed = t_now - BX_EHCI_THIS hub.last_run_usec;
frames = (int)(usec_elapsed / FRAME_TIMER_USEC);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_EHCI, USB_DEBUG_FRAME, 0, 0);
#endif

View File

@ -175,7 +175,7 @@ void bx_usb_ohci_c::init(void)
BX_OHCI_THIS rt_conf_id = SIM->register_runtime_config_handler(BX_OHCI_THIS_PTR, runtime_config_handler);
BX_OHCI_THIS device_change = 0;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
if (SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get() == USB_DEBUG_OHCI) {
SIM->register_usb_debug_type(USB_DEBUG_OHCI);
}

View File

@ -187,7 +187,7 @@ void bx_usb_uhci_c::init(void)
BX_UHCI_THIS rt_conf_id = SIM->register_runtime_config_handler(BX_UHCI_THIS_PTR, runtime_config_handler);
BX_UHCI_THIS device_change = 0;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
if (SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get() == USB_DEBUG_UHCI) {
SIM->register_usb_debug_type(USB_DEBUG_UHCI);
}

View File

@ -417,7 +417,7 @@ void bx_usb_xhci_c::init(void)
protocol->start_index = (BX_XHCI_THIS hub.n_ports / 2) + 1; // 1 based starting index
protocol->count = BX_XHCI_THIS hub.n_ports / 2;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
if (SIM->get_param_enum(BXPN_USB_DEBUG_TYPE)->get() == USB_DEBUG_XHCI) {
SIM->register_usb_debug_type(USB_DEBUG_XHCI);
}
@ -1850,7 +1850,7 @@ bool bx_usb_xhci_c::write_handler(bx_phy_address addr, unsigned len, void *data,
if (((value & (1 << 31)) && BX_XHCI_THIS hub.usb_port[port].is_usb3) ||
(value & (1 << 4))) {
reset_port_usb3(port, (value & (1 << 4)) ? HOT_RESET : WARM_RESET);
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_XHCI, USB_DEBUG_RESET, 0, 0);
#endif
}
@ -1915,7 +1915,7 @@ bool bx_usb_xhci_c::write_handler(bx_phy_address addr, unsigned len, void *data,
}
}
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
// Non existant Register Port (the next one after the last)
else if (offset == (XHCI_PORT_SET_OFFSET + (BX_XHCI_THIS hub.n_ports * 16))) {
SIM->usb_debug_trigger(USB_DEBUG_XHCI, USB_DEBUG_NONEXIST, 0, 0);
@ -2546,7 +2546,7 @@ void bx_usb_xhci_c::process_command_ring(void)
struct SLOT_CONTEXT slot_context;
struct EP_CONTEXT ep_context;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_XHCI, USB_DEBUG_COMMAND, 0, 0);
#endif
@ -3063,7 +3063,7 @@ void bx_usb_xhci_c::write_event_TRB(unsigned interrupter, Bit64u parameter, Bit3
write_TRB((bx_phy_address) BX_XHCI_THIS hub.ring_members.event_rings[interrupter].cur_trb, parameter, status,
command | (Bit32u) BX_XHCI_THIS hub.ring_members.event_rings[interrupter].rcs); // set the cycle bit
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_XHCI, USB_DEBUG_EVENT, interrupter, 0);
#endif
@ -3626,7 +3626,7 @@ void bx_usb_xhci_c::xhci_timer(void)
if (BX_XHCI_THIS hub.op_regs.HcStatus.hch)
return;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_XHCI, USB_DEBUG_FRAME, 0, 0);
#endif
@ -3810,7 +3810,7 @@ bool bx_usb_xhci_c::set_connect_status(Bit8u port, bool connected)
BX_XHCI_THIS hub.usb_port[port].portsc.csc = 1;
if (ped_org != BX_XHCI_THIS hub.usb_port[port].portsc.ped) {
BX_XHCI_THIS hub.usb_port[port].portsc.pec = 1;
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
SIM->usb_debug_trigger(USB_DEBUG_XHCI, USB_DEBUG_ENABLE, 0, 0);
#endif
}

View File

@ -100,7 +100,7 @@ BEGIN
PUSHBUTTON "Cancel", IDCANCEL, 105, 40, 50, 14
END
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#include "win32usbres.rc"
#endif
#include "bxversion.rc"

View File

@ -4,7 +4,7 @@ icon_bochs ICON build/win32/nsis/bochs.ico
#if BX_WITH_WIN32
#include "win32res.rc"
#else
#if BX_USE_WIN32USBDEBUG
#if BX_USB_DEBUGGER
#include "win32usbres.rc"
#endif
#if BX_DEBUGGER_GUI