Probe for existence of the bvm debug port instead of just assuming that it is
always present. Suggested by: grehan Obtained from: NetApp
This commit is contained in:
parent
e365fca6c8
commit
1ea1e18490
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/projects/bhyve/; revision=242194
@ -49,6 +49,8 @@ GDB_DBGPORT(bvm, bvm_dbg_probe, bvm_dbg_init, bvm_dbg_term,
|
|||||||
#define BVM_DBG_PORT 0x224
|
#define BVM_DBG_PORT 0x224
|
||||||
static int bvm_dbg_port = BVM_DBG_PORT;
|
static int bvm_dbg_port = BVM_DBG_PORT;
|
||||||
|
|
||||||
|
#define BVM_DBG_SIG ('B' << 8 | 'V')
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bvm_dbg_probe(void)
|
bvm_dbg_probe(void)
|
||||||
{
|
{
|
||||||
@ -56,18 +58,22 @@ bvm_dbg_probe(void)
|
|||||||
|
|
||||||
disabled = 0;
|
disabled = 0;
|
||||||
resource_int_value("bvmdbg", 0, "disabled", &disabled);
|
resource_int_value("bvmdbg", 0, "disabled", &disabled);
|
||||||
if (disabled)
|
|
||||||
return (-1);
|
|
||||||
|
|
||||||
|
if (!disabled) {
|
||||||
if (resource_int_value("bvmdbg", 0, "port", &port) == 0)
|
if (resource_int_value("bvmdbg", 0, "port", &port) == 0)
|
||||||
bvm_dbg_port = port;
|
bvm_dbg_port = port;
|
||||||
|
|
||||||
|
if (inw(bvm_dbg_port) == BVM_DBG_SIG) {
|
||||||
/*
|
/*
|
||||||
* Return a higher priority than 0 to override other
|
* Return a higher priority than 0 to override other
|
||||||
* gdb dbgport providers that may be present (e.g. uart)
|
* gdb dbgport providers that may be present (e.g. uart)
|
||||||
*/
|
*/
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
bvm_dbg_init(void)
|
bvm_dbg_init(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user