mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 02:40:08 +00:00
parent
36c00cc294
commit
8b44f49d75
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
#include <nic_session/connection.h>
|
#include <nic_session/connection.h>
|
||||||
#include <nic/packet_allocator.h>
|
#include <nic/packet_allocator.h>
|
||||||
#include <base/snprintf.h>
|
|
||||||
|
|
||||||
#include <internal/thread_create.h>
|
#include <internal/thread_create.h>
|
||||||
|
|
||||||
@ -187,7 +186,8 @@ class Nic_client
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Nic_client(Genode::Env &env, PDRVNIC drvtap, char const *label)
|
Nic_client(Genode::Env &env, PDRVNIC drvtap,
|
||||||
|
Genode::Session::Label const &label)
|
||||||
:
|
:
|
||||||
_tx_block_alloc(_packet_allocator()),
|
_tx_block_alloc(_packet_allocator()),
|
||||||
_nic(env, _tx_block_alloc, BUF_SIZE, BUF_SIZE, label),
|
_nic(env, _tx_block_alloc, BUF_SIZE, BUF_SIZE, label),
|
||||||
@ -540,19 +540,17 @@ static DECLCALLBACK(int) drvNicConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uin
|
|||||||
N_("Configuration error: the above device/driver"
|
N_("Configuration error: the above device/driver"
|
||||||
" didn't export the network config interface!\n"));
|
" didn't export the network config interface!\n"));
|
||||||
|
|
||||||
char label[8];
|
|
||||||
uint64_t slot;
|
uint64_t slot;
|
||||||
rc = CFGMR3QueryInteger(pCfg, "Slot", &slot);
|
rc = CFGMR3QueryInteger(pCfg, "Slot", &slot);
|
||||||
if (RT_FAILURE(rc))
|
if (RT_FAILURE(rc))
|
||||||
return PDMDRV_SET_ERROR(pDrvIns, rc,
|
return PDMDRV_SET_ERROR(pDrvIns, rc,
|
||||||
N_("Configuration error: Failed to retrieve the network interface slot"));
|
N_("Configuration error: Failed to retrieve the network interface slot"));
|
||||||
Genode::snprintf(label, sizeof(label), "%d", slot);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Setup Genode nic_session connection
|
* Setup Genode nic_session connection
|
||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
pThis->nic_client = new (vmm_heap()) Nic_client(genode_env(), pThis, label);
|
pThis->nic_client = new (vmm_heap()) Nic_client(genode_env(), pThis, slot);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return VERR_HOSTIF_INIT_FAILED;
|
return VERR_HOSTIF_INIT_FAILED;
|
||||||
}
|
}
|
||||||
|
@ -70,13 +70,9 @@ static Genode::Cpu_connection * cpu_connection(RTTHREADTYPE type)
|
|||||||
if (con[type - 1])
|
if (con[type - 1])
|
||||||
return con[type - 1];
|
return con[type - 1];
|
||||||
|
|
||||||
char * data = new (vmm_heap()) char[16];
|
con[type - 1] = new (vmm_heap()) Cpu_connection(genode_env(),
|
||||||
|
{ "vbox ", unsigned(type) },
|
||||||
Genode::snprintf(data, 16, "vbox %u", type);
|
|
||||||
|
|
||||||
con[type - 1] = new (vmm_heap()) Cpu_connection(genode_env(), data,
|
|
||||||
prio_class(type));
|
prio_class(type));
|
||||||
|
|
||||||
return con[type - 1];
|
return con[type - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user