*
* Note: either local or remote memory must be registered
*/
- rpc register(in cap memory, out errval msgerr);
+ rpc register_(in cap memory, out errval msgerr);
/**
*/
- rpc register(in uint8 id,
+ rpc register_(in uint8 id,
in uint64 local_apt_base,
in uint64 local_apt_size,
out errval msgerr,
interface xeon_phi_driver "Xeon Phi Service Interface" {
- rpc register(in uint8 id,
+ rpc register_(in uint8 id,
in uint64 local_apt_base,
in uint64 local_apt_size,
out errval msgerr,
#include <errors/errno.h>
/* forward declaration */
-struct acpi_rpc_client;
+struct acpi_binding;
typedef uint64_t acpi_device_handle_t;
-struct acpi_rpc_client* get_acpi_rpc_client(void);
+struct acpi_binding* get_acpi_binding(void);
errval_t connect_to_acpi(void);
errval_t acpi_client_get_device_handle(const char *dev_id,
struct skb_state {
bool request_done;
- struct skb_rpc_client *skb;
+ struct skb_binding *skb;
};
struct slot_alloc_state {
};
struct terminal_state;
-struct octopus_rpc_client;
+struct octopus_binding;
struct domain_state;
struct spawn_state;
struct monitor_binding;
-struct mem_rpc_client;
-struct spawn_rpc_client;
-struct arrakis_rpc_client;
+struct monitor_blocking_binding;
+struct mem_binding;
+struct spawn_binding;
+struct arrakis_binding;
struct core_state_generic {
struct waitset default_waitset;
struct monitor_binding *monitor_binding;
- struct monitor_blocking_rpc_client *monitor_blocking_rpc_client;
- struct mem_rpc_client *mem_st;
+ struct monitor_blocking_binding *monitor_blocking_binding;
+ struct mem_binding *mem_st;
struct morecore_state morecore_state;
struct ram_alloc_state ram_alloc_state;
- struct octopus_rpc_client *octopus_rpc_client;
- struct spawn_rpc_client *spawn_rpc_clients[MAX_CPUS];
- struct arrakis_rpc_client *arrakis_rpc_clients[MAX_CPUS];
+ struct octopus_binding *octopus_binding;
+ struct spawn_binding *spawn_bindings[MAX_CPUS];
+ struct arrakis_binding *arrakis_bindings[MAX_CPUS];
struct terminal_state *terminal_state;
struct domain_state *domain_state;
struct spawn_state *spawn_state;
typedef void (*domain_spanned_callback_t)(void *arg, errval_t err);
-struct mem_rpc_client;
-struct octopus_rpc_client;
+struct mem_binding;
+struct octopus_binding;
struct monitor_binding;
-struct monitor_blocking_rpc_client;
+struct monitor_blocking_binding;
struct waitset;
-struct spawn_rpc_client;
-struct arrakis_rpc_client;
+struct spawn_binding;
+struct arrakis_binding;
struct waitset *get_default_waitset(void);
void disp_set_core_id(coreid_t core_id);
coreid_t disp_handle_get_core_id(dispatcher_handle_t handle);
void set_monitor_binding(struct monitor_binding *b);
struct monitor_binding *get_monitor_binding(void);
-void set_monitor_blocking_rpc_client(struct monitor_blocking_rpc_client *st);
-struct monitor_blocking_rpc_client *get_monitor_blocking_rpc_client(void);
-void set_mem_client(struct mem_rpc_client *st);
-struct mem_rpc_client *get_mem_client(void);
+void set_monitor_blocking_binding(struct monitor_blocking_binding *st);
+struct monitor_blocking_binding *get_monitor_blocking_binding(void);
+void set_mem_client(struct mem_binding *st);
+struct mem_binding *get_mem_client(void);
struct pinned_state *get_current_pinned_state(void);
struct vspace *get_current_vspace(void);
struct pmap *get_current_pmap(void);
struct morecore_state *get_morecore_state(void);
struct ram_alloc_state *get_ram_alloc_state(void);
-void set_octopus_rpc_client(struct octopus_rpc_client *st);
-struct octopus_rpc_client *get_octopus_rpc_client(void);
-void set_spawn_rpc_client(coreid_t core, struct spawn_rpc_client *st);
-void set_arrakis_rpc_client(coreid_t core, struct arrakis_rpc_client *st);
-struct spawn_rpc_client *get_spawn_rpc_client(coreid_t core);
-struct arrakis_rpc_client *get_arrakis_rpc_client(coreid_t core);
+void set_octopus_binding(struct octopus_binding *st);
+struct octopus_binding *get_octopus_binding(void);
+void set_spawn_binding(coreid_t core, struct spawn_binding *st);
+void set_arrakis_binding(coreid_t core, struct arrakis_binding *st);
+struct spawn_binding *get_spawn_binding(coreid_t core);
+struct arrakis_binding *get_arrakis_binding(coreid_t core);
struct terminal_state *get_terminal_state(void);
void set_terminal_state(struct terminal_state *st);
struct domain_state *get_domain_state(void);
errval_t spawn_wait(domainid_t domainid, uint8_t *exitcode, bool nohang);
errval_t spawn_wait_core(coreid_t coreid, domainid_t domainid,
uint8_t *exitcode, bool nohang);
-errval_t spawn_rpc_client(coreid_t coreid, struct spawn_rpc_client **ret_client);
+errval_t spawn_binding(coreid_t coreid, struct spawn_binding **ret_client);
errval_t spawn_get_domain_list(uint8_t **domains, size_t *len);
errval_t spawn_get_status(uint8_t domain, struct spawn_ps_entry *pse,
char **argbuf, size_t *arglen, errval_t *reterr);
#include <usb/usb_request.h>
#include <if/usb_manager_defs.h>
-#include <if/usb_manager_rpcclient_defs.h>
+#include <if/usb_manager_defs.h>
#endif /* LIB_USB_DRIVER_H_ */
#include <barrelfish/nameservice_client.h>
#include <if/acpi_defs.h>
-#include <if/acpi_rpcclient_defs.h>
+#include <if/acpi_defs.h>
#include <acpi_client/acpi_client.h>
errval_t err;
} state;
-static struct acpi_rpc_client* rpc_client;
+static struct acpi_binding* binding;
errval_t acpi_client_get_device_handle(const char *dev_id,
acpi_device_handle_t *ret_handle)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.get_handle(rpc_client, dev_id, ret_handle, &msgerr);
+ err = binding->rpc_tx_vtbl.get_handle(binding, dev_id, ret_handle, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
errval_t acpi_client_eval_integer(acpi_device_handle_t handle,
const char *path, uint64_t *data)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.eval_integer(rpc_client, handle, path, data, &msgerr);
+ err = binding->rpc_tx_vtbl.eval_integer(binding, handle, path, data, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
errval_t acpi_reset(void)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.reset(rpc_client, &msgerr);
+ err = binding->rpc_tx_vtbl.reset(binding, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
errval_t acpi_sleep(int st)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.sleep(rpc_client, st, &msgerr);
+ err = binding->rpc_tx_vtbl.sleep(binding, st, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
// Kludge for VBE driver
errval_t acpi_get_vbe_bios_cap(struct capref *retcap, size_t *retsize)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
assert(retcap != NULL);
assert(retsize != NULL);
if (err_is_fail(err)) {
return err;
}
- err = rpc_client->vtbl.get_vbe_bios_cap(rpc_client, &msgerr, retcap, &s);
+ err = binding->rpc_tx_vtbl.get_vbe_bios_cap(binding, &msgerr, retcap, &s);
*retsize = s;
return err_is_fail(err) ? err : msgerr;
}
errval_t vtd_create_domain(struct capref pml4)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.create_domain(rpc_client, pml4, &msgerr);
+ err = binding->rpc_tx_vtbl.create_domain(binding, pml4, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
errval_t vtd_delete_domain(struct capref pml4)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.delete_domain(rpc_client, pml4, &msgerr);
+ err = binding->rpc_tx_vtbl.delete_domain(binding, pml4, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
-errval_t vtd_domain_add_device(int seg, int bus, int dev, int func, struct capref pml4)
+errval_t vtd_domain_add_device(int seg, int bus, int dev, int func, struct capref pml4)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.vtd_add_device(rpc_client, seg, bus, dev, func, pml4, &msgerr);
+ err = binding->rpc_tx_vtbl.vtd_add_device(binding, seg, bus, dev, func, pml4, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
-errval_t vtd_domain_remove_device(int seg, int bus, int dev, int func, struct capref pml4)
+errval_t vtd_domain_remove_device(int seg, int bus, int dev, int func, struct capref pml4)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.vtd_remove_device(rpc_client, seg, bus, dev, func, pml4, &msgerr);
+ err = binding->rpc_tx_vtbl.vtd_remove_device(binding, seg, bus, dev, func, pml4, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
errval_t vtd_add_devices(void)
{
- assert(rpc_client != NULL);
+ assert(binding != NULL);
errval_t err, msgerr;
- err = rpc_client->vtbl.vtd_id_dom_add_devices(rpc_client, &msgerr);
+ err = binding->rpc_tx_vtbl.vtd_id_dom_add_devices(binding, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
-struct acpi_rpc_client* get_acpi_rpc_client(void)
+struct acpi_binding* get_acpi_binding(void)
{
- assert(rpc_client != NULL);
- return rpc_client;
+ assert(binding != NULL);
+ return binding;
}
static void rpc_bind_cb(void *st, errval_t err, struct acpi_binding* b)
{
if (err_is_ok(err)) {
- rpc_client = malloc(sizeof(struct acpi_rpc_client));
- assert(rpc_client != NULL);
-
- err = acpi_rpc_client_init(rpc_client, b);
- if (err_is_fail(err)) {
- free(rpc_client);
- }
+ binding = b;
+ acpi_rpc_client_init(binding);
} // else: Do nothing
assert(!state.is_done);
#include <barrelfish/waitset.h>
#include <if/ata_rw28_defs.h>
#include <if/ata_rw28_ahci_defs.h>
-#include <if/ata_rw28_rpcclient_defs.h>
+#include <if/ata_rw28_defs.h>
#include <storage/vsic.h>
struct ahci_vsic {
struct ahci_ata_rw28_binding ahci_ata_rw28_binding;
- struct ata_rw28_rpc_client ata_rw28_rpc;
+ struct ata_rw28_binding ata_rw28_rpc;
struct ata_rw28_binding *ata_rw28_binding;
struct ahci_binding *ahci_binding;
errval_t bind_err;
struct ahci_vsic *mydata = vsic->data;
errval_t status;
- errval_t err = mydata->ata_rw28_rpc.vtbl.
+ errval_t err = mydata->ata_rw28_rpc->rpc_tx_vtbl.
write_dma(&mydata->ata_rw28_rpc, buffer, STORAGE_VSIC_ROUND(vsic, size),
offset, &status);
if (err_is_fail(err)) {
uint8_t *buf = NULL;
size_t bytes_read, toread = STORAGE_VSIC_ROUND(vsic, size);
- errval_t err = mydata->ata_rw28_rpc.vtbl.
+ errval_t err = mydata->ata_rw28_rpc->rpc_tx_vtbl.
read_dma(&mydata->ata_rw28_rpc, toread, offset, &buf, &bytes_read);
if (err_is_fail(err))
USER_PANIC_ERR(err, "read_dma rpc");
struct ahci_vsic *mydata = vsic->data;
errval_t outerr;
- errval_t err = mydata->ata_rw28_rpc.vtbl.
+ errval_t err = mydata->ata_rw28_rpc->rpc_tx_vtbl.
flush_cache(&mydata->ata_rw28_rpc, &outerr);
assert(err_is_ok(err));
(struct ata_rw28_binding*)&mydata->ahci_ata_rw28_binding;
// init RPC client
- err = ata_rw28_rpc_client_init(&mydata->ata_rw28_rpc,
+ err = ata_rw28_binding_init(&mydata->ata_rw28_rpc,
mydata->ata_rw28_binding);
if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "ata_rw28_rpc_client_init");
+ USER_PANIC_ERR(err, "ata_rw28_binding_init");
}
// Init VSIC data structure
#include <barrelfish/waitset.h>
#include <if/monitor_defs.h>
#include <if/terminal_session_defs.h>
-#include <if/terminal_session_rpcclient_defs.h>
-#include <if/octopus_rpcclient_defs.h>
+#include <if/terminal_session_defs.h>
+#include <if/octopus_defs.h>
#include <octopus/getset.h> /* For SET_DEFAULT */
#include <octopus/trigger.h> /* For NOP_TRIGGER */
errval_t err = SYS_ERR_OK;
errval_t error = SYS_ERR_OK;
struct _angler_state *state = NULL;
- struct terminal_session_rpc_client rpc_client;
struct waitset ws;
iref_t in_iref;
iref_t out_iref;
}
/* Initialize rpc client. */
- err = terminal_session_rpc_client_init(&rpc_client, state->binding);
- if (err_is_fail(err)) {
- err = err_push(err, ANGLER_ERR_INIT_RPCCLIENT);
- goto out;
- }
+ terminal_session_rpc_client_init(state->binding);
/* Associate session with terminal. */
- err = rpc_client.vtbl.session_associate_with_terminal
- (&rpc_client, *session_id, &in_iref, &out_iref, &conf_iref, &error);
+ err = state->binding->rpc_tx_vtbl.session_associate_with_terminal
+ (state->binding, *session_id, &in_iref, &out_iref, &conf_iref, &error);
if (err_is_fail(err)) {
err = err_push(err, ANGLER_ERR_ASSOCIATE_WITH_TERMINAL);
goto out;
{
errval_t err = SYS_ERR_OK;
errval_t error;
- struct octopus_rpc_client *rpc_client = NULL;
+ struct octopus_binding *rpc_client = NULL;
char *attributes = NULL;
size_t attributes_len = 0;
octopus_trigger_id_t tid;
- rpc_client = get_octopus_rpc_client();
+ rpc_client = get_octopus_binding();
assert(rpc_client != NULL);
/* Build attributes. */
/* Store record at octopus. */
- err = rpc_client->vtbl.set_with_idcap(rpc_client, *session_id, attributes,
+ err = rpc_client->rpc_tx_vtbl.set_with_idcap(rpc_client, *session_id, attributes,
SET_DEFAULT, NOP_TRIGGER, false,
NULL, &tid, &error);
if (err_is_fail(err)) {
#include <barrelfish/caddr.h>
#include <barrelfish/lmp_endpoints.h>
#include <if/monitor_defs.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <barrelfish/monitor_client.h>
#include <trace/trace.h>
#include <stdio.h>
gensize_t objsize, size_t count, capaddr_t to,
capaddr_t slot, int to_level)
{
- struct monitor_blocking_rpc_client *mrc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mrc = get_monitor_blocking_binding();
if (!mrc) {
return LIB_ERR_MONITOR_RPC_NULL;
}
errval_t err, remote_cap_err;
int send_count = 0;
do {
- err = mrc->vtbl.remote_cap_retype(mrc, src_root, dest_root, src,
+ err = mrc->rpc_tx_vtbl.remote_cap_retype(mrc, src_root, dest_root, src,
offset, (uint64_t)new_type, objsize,
count, to, slot, to_level, &remote_cap_err);
if (err_is_fail(err)){
*/
static errval_t cap_delete_remote(struct capref root, capaddr_t src, uint8_t level)
{
- struct monitor_blocking_rpc_client *mrc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mrc = get_monitor_blocking_binding();
if (!mrc) {
return LIB_ERR_MONITOR_RPC_NULL;
}
errval_t err, remote_cap_err;
int count = 0;
do {
- err = mrc->vtbl.remote_cap_delete(mrc, root, src, level,
+ err = mrc->rpc_tx_vtbl.remote_cap_delete(mrc, root, src, level,
&remote_cap_err);
if (err_is_fail(err)){
DEBUG_ERR(err, "remote cap delete\n");
*/
static errval_t cap_revoke_remote(struct capref root, capaddr_t src, uint8_t level)
{
- struct monitor_blocking_rpc_client *mrc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mrc = get_monitor_blocking_binding();
if (!mrc) {
return LIB_ERR_MONITOR_RPC_NULL;
}
errval_t err, remote_cap_err;
int count = 0;
do {
- err = mrc->vtbl.remote_cap_revoke(mrc, root, src, level,
+ err = mrc->rpc_tx_vtbl.remote_cap_revoke(mrc, root, src, level,
&remote_cap_err);
if (err_is_fail(err)){
DEBUG_ERR(err, "remote cap delete\n");
#include <barrelfish/debug.h>
#include <barrelfish/sys_debug.h>
#include <barrelfish/dispatch.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
struct capability capability;
} u;
- struct monitor_blocking_rpc_client *r = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *r = get_monitor_blocking_binding();
if (!r) {
return LIB_ERR_MONITOR_RPC_NULL;
}
- err = r->vtbl.cap_identify(r, cap, &msgerr, &u.caprep);
+ err = r->rpc_tx_vtbl.cap_identify(r, cap, &msgerr, &u.caprep);
if (err_is_fail(err)){
return err;
} else if (err_is_fail(msgerr)) {
/**
* \brief set the blocking rpc monitor client binding on the dispatcher priv
*/
-void set_monitor_blocking_rpc_client(struct monitor_blocking_rpc_client *st)
+void set_monitor_blocking_binding(struct monitor_blocking_binding *st)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
- disp->core_state.c.monitor_blocking_rpc_client = st;
+ disp->core_state.c.monitor_blocking_binding = st;
}
/**
* \brief Returns the blocking rpc monitor client binding on the
* dispatcher priv
*/
-struct monitor_blocking_rpc_client *get_monitor_blocking_rpc_client(void)
+struct monitor_blocking_binding *get_monitor_blocking_binding(void)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
- return disp->core_state.c.monitor_blocking_rpc_client;
+ return disp->core_state.c.monitor_blocking_binding;
}
/**
* \brief set the mem client on the dispatcher priv
*/
-void set_mem_client(struct mem_rpc_client *st)
+void set_mem_client(struct mem_binding *st)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
/**
* \brief Returns the mem client on the dispatcher priv
*/
-struct mem_rpc_client *get_mem_client(void)
+struct mem_binding *get_mem_client(void)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
/**
* \brief Returns a pointer to the octopus rpc client on the dispatcher priv
*/
-struct octopus_rpc_client *get_octopus_rpc_client(void)
+struct octopus_binding *get_octopus_binding(void)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
- return disp->core_state.c.octopus_rpc_client;
+ return disp->core_state.c.octopus_binding;
}
/**
* \brief Sets the octopus rpc client on the dispatcher priv
*/
-void set_octopus_rpc_client(struct octopus_rpc_client *c)
+void set_octopus_binding(struct octopus_binding *c)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
- disp->core_state.c.octopus_rpc_client = c;
+ disp->core_state.c.octopus_binding = c;
}
/**
* \brief Returns a pointer to the chips_context state on the dispatcher priv
*/
-struct spawn_rpc_client *get_spawn_rpc_client(coreid_t core)
+struct spawn_binding *get_spawn_binding(coreid_t core)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
assert(core < MAX_CPUS);
- return disp->core_state.c.spawn_rpc_clients[core];
+ return disp->core_state.c.spawn_bindings[core];
}
/**
* \brief set the chips_context state on the dispatcher priv
*/
-void set_spawn_rpc_client(coreid_t core, struct spawn_rpc_client *c)
+void set_spawn_binding(coreid_t core, struct spawn_binding *c)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
assert(core < MAX_CPUS);
- disp->core_state.c.spawn_rpc_clients[core] = c;
+ disp->core_state.c.spawn_bindings[core] = c;
}
-struct arrakis_rpc_client *get_arrakis_rpc_client(coreid_t core)
+struct arrakis_binding *get_arrakis_binding(coreid_t core)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
assert(core < MAX_CPUS);
- return disp->core_state.c.arrakis_rpc_clients[core];
+ return disp->core_state.c.arrakis_bindings[core];
}
/**
* \brief set the chips_context state on the dispatcher priv
*/
-void set_arrakis_rpc_client(coreid_t core, struct arrakis_rpc_client *c)
+void set_arrakis_binding(coreid_t core, struct arrakis_binding *c)
{
dispatcher_handle_t handle = curdispatcher();
struct dispatcher_generic* disp = get_dispatcher_generic(handle);
assert(core < MAX_CPUS);
- disp->core_state.c.arrakis_rpc_clients[core] = c;
+ disp->core_state.c.arrakis_bindings[core] = c;
}
/**
#include <barrelfish/barrelfish.h>
#include <barrelfish/inthandler.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
struct waitset *barrelfish_interrupt_waitset = NULL;
{
errval_t err, msgerr;
- struct monitor_blocking_rpc_client *r = get_monitor_blocking_rpc_client();
- err = r->vtbl.arm_irq_handle(r, ep, irq, &msgerr);
+ struct monitor_blocking_binding *r = get_monitor_blocking_binding();
+ err = r->rpc_tx_vtbl.arm_irq_handle(r, ep, irq, &msgerr);
if (err_is_fail(err)){
return err;
} else {
{
errval_t err, msgerr;
- struct monitor_blocking_rpc_client *r = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *r = get_monitor_blocking_binding();
err = slot_alloc(retcap);
if (err_is_fail(err)) {
return err;
}
- err = r->vtbl.get_irq_dest_cap(r, retcap, &msgerr);
+ err = r->rpc_tx_vtbl.get_irq_dest_cap(r, retcap, &msgerr);
if (err_is_fail(err)){
return err;
} else {
#include <barrelfish/dispatcher_arch.h>
#include <if/monitor_defs.h>
#include <barrelfish/monitor_client.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <string.h>
#include <inttypes.h>
{
return ERR_NOTIMP;
#if 0
- struct monitor_blocking_rpc_client *mc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mc = get_monitor_blocking_binding();
assert(mc != NULL);
errval_t err, reterr;
- err = mc->vtbl.cap_set_remote(mc, cap, remote, &reterr);
+ err = mc->rpc_tx_vtbl.cap_set_remote(mc, cap, remote, &reterr);
if(err_is_fail(err)) {
return err;
} else {
struct bind_state *st = st_arg;
if (err_is_ok(err)) {
- struct monitor_blocking_rpc_client *r =
- malloc(sizeof(struct monitor_blocking_rpc_client));
- assert(r != NULL);
- err = monitor_blocking_rpc_client_init(r, b);
- if (err_is_fail(err)) {
- free(r);
- USER_PANIC_ERR(err, "error in mem_rpc_client_init");
- } else {
- set_monitor_blocking_rpc_client(r);
- }
+ monitor_blocking_rpc_client_init(b);
+ set_monitor_blocking_binding(b);
}
st->err = err;
#include <barrelfish/nameservice_client.h>
#include <if/octopus_defs.h>
-#include <if/octopus_rpcclient_defs.h>
#include <if/monitor_defs.h>
#include <octopus/getset.h> // for oct_read TODO
#include <octopus/trigger.h> // for NOP_TRIGGER
{
errval_t err;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
struct octopus_get_names_response__rx_args reply;
- err = r->vtbl.get(r, iface, NOP_TRIGGER, reply.output, &reply.tid,
+ err = r->rpc_tx_vtbl.get(r, iface, NOP_TRIGGER, reply.output, &reply.tid,
&reply.error_code);
if (err_is_fail(err)) {
goto out;
{
errval_t err;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
struct octopus_wait_for_response__rx_args reply;
- err = r->vtbl.wait_for(r, iface, reply.record, &reply.error_code);
+ err = r->rpc_tx_vtbl.wait_for(r, iface, reply.record, &reply.error_code);
if (err_is_fail(err)) {
goto out;
}
{
errval_t err = SYS_ERR_OK;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
octopus_trigger_id_t tid;
errval_t error_code;
- err = r->vtbl.set(r, record, 0, NOP_TRIGGER, 0, NULL, &tid, &error_code);
+ err = r->rpc_tx_vtbl.set(r, record, 0, NOP_TRIGGER, 0, NULL, &tid, &error_code);
if (err_is_fail(err)) {
goto out;
}
if (err_is_ok(err)) {
b->error_handler = error_handler;
- struct octopus_rpc_client *r;
- r = malloc(sizeof(struct octopus_rpc_client));
- assert(r != NULL);
- err = octopus_rpc_client_init(r, b);
- if (err_is_fail(err)) {
- free(r);
- USER_PANIC_ERR(err, "error in nameservice_rpc_client_init");
- } else {
- set_octopus_rpc_client(r);
- }
+ octopus_rpc_client_init(b);
+ set_octopus_binding(b);
}
st->err = err;
return st.err;
}
-
#include <barrelfish/core_state.h>
#include <if/monitor_defs.h>
-#include <if/mem_rpcclient_defs.h>
+#include <if/mem_defs.h>
/* remote (indirect through a channel) version of ram_alloc, for most domains */
static errval_t ram_alloc_remote(struct capref *ret, uint8_t size_bits,
thread_mutex_lock(&ram_alloc_state->ram_alloc_lock);
- struct mem_rpc_client *b = get_mem_client();
- err = b->vtbl.allocate(b, size_bits, minbase, maxlimit, &result, ret);
+ struct mem_binding *b = get_mem_client();
+ err = b->rpc_tx_vtbl.allocate(b, size_bits, minbase, maxlimit, &result, ret);
thread_mutex_unlock(&ram_alloc_state->ram_alloc_lock);
{
errval_t err;
- struct mem_rpc_client *mc = get_mem_client();
+ struct mem_binding *mc = get_mem_client();
- err = mc->vtbl.available(mc, available, total);
+ err = mc->rpc_tx_vtbl.available(mc, available, total);
if(err_is_fail(err)) {
USER_PANIC_ERR(err, "available");
}
assert(st == get_ram_alloc_state());
if (err_is_ok(err)) {
- struct mem_rpc_client *r = malloc(sizeof(struct mem_rpc_client));
- assert(r != NULL);
- err = mem_rpc_client_init(r, b);
- if (err_is_fail(err)) {
- free(r);
- USER_PANIC_ERR(err, "error in mem_rpc_client_init");
- } else {
- set_mem_client(r);
- }
+ mem_rpc_client_init(b);
+ set_mem_client(b);
}
ram_alloc_state->mem_connect_err = err;
#include <barrelfish/resource_ctrl.h>
#include <barrelfish/curdispatcher_arch.h>
#include <barrelfish/dispatcher_arch.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
errval_t rsrc_manifest(const char *manifest, rsrcid_t *id)
{
- struct monitor_blocking_rpc_client *b = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *b = get_monitor_blocking_binding();
struct dispatcher_generic *d = get_dispatcher_generic(curdispatcher());
errval_t err, msgerr;
- err = b->vtbl.rsrc_manifest(b, d->dcb_cap, manifest, id, &msgerr);
+ err = b->rpc_tx_vtbl.rsrc_manifest(b, d->dcb_cap, manifest, id, &msgerr);
assert(err_is_ok(err));
return msgerr;
errval_t rsrc_join(rsrcid_t id)
{
- struct monitor_blocking_rpc_client *b = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *b = get_monitor_blocking_binding();
struct dispatcher_generic *d = get_dispatcher_generic(curdispatcher());
errval_t err, msgerr;
- err = b->vtbl.rsrc_join(b, id, d->dcb_cap, &msgerr);
+ err = b->rpc_tx_vtbl.rsrc_join(b, id, d->dcb_cap, &msgerr);
assert(err_is_ok(err));
return msgerr;
errval_t rsrc_phase(rsrcid_t id, uint32_t phase)
{
- struct monitor_blocking_rpc_client *b = get_monitor_blocking_rpc_client();
- return b->vtbl.rsrc_phase(b, id, phase);
+ struct monitor_blocking_binding *b = get_monitor_blocking_binding();
+ return b->rpc_tx_vtbl.rsrc_phase(b, id, phase);
}
#include <barrelfish/nameservice_client.h>
#include <barrelfish/spawn_client.h>
#include <barrelfish/cpu_arch.h>
-#include <if/spawn_rpcclient_defs.h>
-#include <if/arrakis_rpcclient_defs.h>
+#include <if/spawn_defs.h>
+#include <if/arrakis_defs.h>
#include <if/monitor_defs.h>
#include <vfs/vfs_path.h>
// For spawn_program_on_all_cores
#include <octopus/getset.h> // for oct_read TODO
#include <octopus/trigger.h> // for NOP_TRIGGER
-#include <if/octopus_rpcclient_defs.h>
+#include <if/octopus_defs.h>
extern char **environ;
static errval_t bind_client(coreid_t coreid)
{
- struct spawn_rpc_client *cl;
+ struct spawn_binding *cl;
errval_t err = SYS_ERR_OK;
// do we have a spawn client connection for this core?
assert(coreid < MAX_CPUS);
- cl = get_spawn_rpc_client(coreid);
+ cl = get_spawn_binding(coreid);
if (cl == NULL) {
char namebuf[16];
snprintf(namebuf, sizeof(namebuf), "spawn.%u", coreid);
spawn_b = bindst.b;
- cl = malloc(sizeof(struct spawn_rpc_client));
- if (cl == NULL) {
- return err_push(err, LIB_ERR_MALLOC_FAIL);
- }
-
- err = spawn_rpc_client_init(cl, bindst.b);
- if (err_is_fail(err)) {
- DEBUG_ERR(err, "spawn_rpc_client_init failed");
- return err;
- }
-
- set_spawn_rpc_client(coreid, cl);
+ spawn_rpc_client_init(bindst.b);
+ set_spawn_binding(coreid, bindst.b);
}
return err;
return err;
}
- struct spawn_rpc_client *cl = get_spawn_rpc_client(coreid);
+ struct spawn_binding *cl = get_spawn_binding(coreid);
assert(cl != NULL);
// construct argument "string"
}
if (capref_is_null(inheritcn_cap) && capref_is_null(argcn_cap)) {
- err = cl->vtbl.spawn_domain(cl, path, argstr, argstrlen,
+ err = cl->rpc_tx_vtbl.spawn_domain(cl, path, argstr, argstrlen,
envstr, envstrlen, flags,
&msgerr, &domain_id);
} else {
- err = cl->vtbl.spawn_domain_with_caps(cl, path, argstr, argstrlen,
+ err = cl->rpc_tx_vtbl.spawn_domain_with_caps(cl, path, argstr, argstrlen,
envstr, envstrlen, inheritcn_cap,
argcn_cap, flags, &msgerr, &domain_id);
}
struct capref argcn_cap, spawn_flags_t flags,
domainid_t *ret_domainid)
{
- struct arrakis_rpc_client *cl;
+ struct arrakis_binding *cl;
errval_t err, msgerr;
// default to copying our environment
// do we have a arrakis client connection for this core?
assert(coreid < MAX_CPUS);
- cl = get_arrakis_rpc_client(coreid);
+ cl = get_arrakis_binding(coreid);
if (cl == NULL) {
char namebuf[16];
snprintf(namebuf, sizeof(namebuf), "arrakis.%u", coreid);
}
assert(bindst.b != NULL);
- cl = malloc(sizeof(struct arrakis_rpc_client));
- assert(cl != NULL);
-
- err = arrakis_rpc_client_init(cl, bindst.b);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "arrakis_rpc_client_init failed");
- }
-
- set_arrakis_rpc_client(coreid, cl);
+ arrakis_rpc_client_init(bindst.b);
+ set_arrakis_binding(coreid, bindst.b);
}
// construct argument "string"
path = pathbuf;
}
- err = cl->vtbl.spawn_arrakis_domain(cl, path, argstr, argstrlen,
+ err = cl->rpc_tx_vtbl.spawn_arrakis_domain(cl, path, argstr, argstrlen,
envstr, envstrlen, &msgerr, &domain_id);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "error sending arrakis request");
// TODO: handle flags, domain ID
errval_t err = SYS_ERR_OK;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
static char* spawnds = "r'spawn.[0-9]+' { iref: _ }";
struct octopus_get_names_response__rx_args reply;
- err = r->vtbl.get_names(r, spawnds, NOP_TRIGGER, reply.output, &reply.tid,
+ err = r->rpc_tx_vtbl.get_names(r, spawnds, NOP_TRIGGER, reply.output, &reply.tid,
&reply.error_code);
if (err_is_fail(err) || err_is_fail(reply.error_code)) {
err = err_push(err, SPAWN_ERR_FIND_SPAWNDS);
return err;
}
-errval_t spawn_rpc_client(coreid_t coreid, struct spawn_rpc_client **ret_client)
+errval_t spawn_binding(coreid_t coreid, struct spawn_binding **ret_client)
{
errval_t err = bind_client(coreid);
if (err_is_fail(err)) {
return err;
}
- *ret_client = get_spawn_rpc_client(coreid);
+ *ret_client = get_spawn_binding(coreid);
return SYS_ERR_OK;
}
if (err_is_fail(err)) {
return err;
}
- struct spawn_rpc_client *cl = get_spawn_rpc_client(disp_get_core_id());
+ struct spawn_binding *cl = get_spawn_binding(disp_get_core_id());
assert(cl != NULL);
- err = cl->vtbl.kill(cl, domainid, &reterr);
+ err = cl->rpc_tx_vtbl.kill(cl, domainid, &reterr);
if (err_is_fail(err)) {
return err;
}
if (err_is_fail(err)) {
return err;
}
- struct spawn_rpc_client *cl = get_spawn_rpc_client(disp_get_core_id());
+ struct spawn_binding *cl = get_spawn_binding(disp_get_core_id());
assert(cl != NULL);
- err = cl->vtbl.exit(cl, disp_get_domain_id(), exitcode);
+ err = cl->rpc_tx_vtbl.exit(cl, disp_get_domain_id(), exitcode);
if (err_is_fail(err)) {
return err;
}
if (err_is_fail(err)) {
return err;
}
- struct spawn_rpc_client *cl = get_spawn_rpc_client(coreid);
+ struct spawn_binding *cl = get_spawn_binding(coreid);
assert(cl != NULL);
- err = cl->vtbl.wait(cl, domainid, nohang, exitcode, &reterr);
+ err = cl->rpc_tx_vtbl.wait(cl, domainid, nohang, exitcode, &reterr);
if (err_is_fail(err)) {
return err;
}
{
errval_t err;
- struct spawn_rpc_client *cl;
- err = spawn_rpc_client(disp_get_core_id(), &cl);
+ struct spawn_binding *cl;
+ err = spawn_binding(disp_get_core_id(), &cl);
if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "spawn_rpc_client");
+ USER_PANIC_ERR(err, "spawn_binding");
}
assert(cl != NULL);
struct spawn_get_domainlist_response__rx_args reply;
- err = cl->vtbl.get_domainlist(cl, reply.domains, len);
+ err = cl->rpc_tx_vtbl.get_domainlist(cl, reply.domains, len);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "get_domainlist");
}
{
errval_t err;
- struct spawn_rpc_client *cl;
- err = spawn_rpc_client(disp_get_core_id(), &cl);
+ struct spawn_binding *cl;
+ err = spawn_binding(disp_get_core_id(), &cl);
if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "spawn_rpc_client");
+ USER_PANIC_ERR(err, "spawn_binding");
}
assert(cl != NULL);
struct spawn_status_response__rx_args reply;
- err = cl->vtbl.status(cl, domain, (spawn_ps_entry_t *)pse, reply.argv,
+ err = cl->rpc_tx_vtbl.status(cl, domain, (spawn_ps_entry_t *)pse, reply.argv,
arglen, reterr);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "status");
if (err_is_fail(err)) {
return err;
}
- struct spawn_rpc_client *cl = get_spawn_rpc_client(disp_get_core_id());
+ struct spawn_binding *cl = get_spawn_binding(disp_get_core_id());
assert(cl != NULL);
- err = cl->vtbl.dump_capabilities(cl, domainid, &reterr);
+ err = cl->rpc_tx_vtbl.dump_capabilities(cl, domainid, &reterr);
if (err_is_fail(err)) {
return err;
}
#include <pci/pci.h>
#include <if/net_ports_defs.h>
-#include <if/net_ports_rpcclient_defs.h>
+#include <if/net_ports_defs.h>
+#include <if/net_ARP_defs.h>
#include <if/net_ARP_defs.h>
-#include <if/net_ARP_rpcclient_defs.h>
#include <if/e10k_defs.h>
#include <dev/e10k_dev.h>
};
-static struct net_ports_rpc_client net_ports_rpc;
+static struct net_ports_binding *net_ports_rpc;
static bool net_ports_connected = false;
-static struct net_ARP_rpc_client net_arp_rpc;
+static struct net_ARP_binding *net_arp_rpc;
static bool net_arp_connected = false;
static errval_t update_rxtail(void *opaque, size_t tail);
{
errval_t err, msgerr;
- err = net_ports_rpc.vtbl.bind_port(&net_ports_rpc, net_ports_PORT_UDP, port,
+ err = net_ports_rpc->rpc_tx_vtbl.bind_port(net_ports_rpc, net_ports_PORT_UDP, port,
b_rx, b_tx, 0, q, &msgerr);
if (err_is_fail(err)) {
return err;
{
errval_t err, msgerr;
- err = net_ports_rpc.vtbl.get_port(&net_ports_rpc, net_ports_PORT_UDP,
+ err = net_ports_rpc->rpc_tx_vtbl.get_port(net_ports_rpc, net_ports_PORT_UDP,
b_rx, b_tx, 0, q, &msgerr, port);
if (err_is_fail(err)) {
return err;
static void p_bind_cb(void *st, errval_t err, struct net_ports_binding *b)
{
assert(err_is_ok(err));
- err = net_ports_rpc_client_init(&net_ports_rpc, b);
- assert(err_is_ok(err));
+ net_ports_rpc = b;
+ net_ports_rpc_client_init(net_ports_rpc);
net_ports_connected = true;
}
{
errval_t err, msgerr;
- err = net_arp_rpc.vtbl.ip_info(&net_arp_rpc, 0, &msgerr, ip, gw, mask);
+ err = net_arp_rpc->rpc_tx_vtbl.ip_info(net_arp_rpc, 0, &msgerr, ip, gw, mask);
if (err_is_fail(err)) {
return err;
}
{
errval_t err, msgerr;
- err = net_arp_rpc.vtbl.ARP_lookup(&net_arp_rpc, ip, 0, true, &msgerr, mac);
+ err = net_arp_rpc->rpc_tx_vtbl.ARP_lookup(net_arp_rpc, ip, 0, true, &msgerr, mac);
if (err_is_fail(err)) {
return err;
}
static void a_bind_cb(void *st, errval_t err, struct net_ARP_binding *b)
{
assert(err_is_ok(err));
- err = net_ARP_rpc_client_init(&net_arp_rpc, b);
- assert(err_is_ok(err));
+ net_arp_rpc = b;
+ net_ARP_rpc_client_init(net_arp_rpc);
net_arp_connected = true;
}
{
return arp_lookup(htonl(ip), mac);
}
-
#include <devif/backends/descq.h>
#include <if/descq_data_defs.h>
#include <if/descq_ctrl_defs.h>
-#include <if/descq_ctrl_rpcclient_defs.h>
+#include <if/descq_ctrl_defs.h>
#include "../../queue_interface_internal.h"
#include "descq_debug.h"
// Flounder
struct descq_data_binding* data;
struct descq_ctrl_binding* ctrl;
- struct descq_ctrl_rpc_client* rpc;
+ struct descq_ctrl_binding* rpc;
// linked list
struct descq* next;
struct descq* queue = (struct descq*) q;
/*
DESCQ_DEBUG("start \n");
- err = queue->rpc->vtbl.notify(queue->rpc, &err2);
+ err = queue->rpc->rpc_tx_vtbl.notify(queue->rpc, &err2);
err = err_is_fail(err) ? err : err2;
DESCQ_DEBUG("end\n");
*/
struct descq* queue = (struct descq*) q;
DESCQ_DEBUG("start \n");
- err = queue->rpc->vtbl.control(queue->rpc, cmd, value, &err2);
+ err = queue->rpc->rpc_tx_vtbl.control(queue->rpc, cmd, value, &err2);
err = err_is_fail(err) ? err : err2;
DESCQ_DEBUG("end\n");
return err;
struct descq* queue = (struct descq*) q;
DESCQ_DEBUG("start %p\n", queue);
- err = queue->rpc->vtbl.register_region(queue->rpc, cap, rid, &err2);
+ err = queue->rpc->rpc_tx_vtbl.register_region(queue->rpc, cap, rid, &err2);
err = err_is_fail(err) ? err : err2;
DESCQ_DEBUG("end\n");
return err;
errval_t err, err2;
struct descq* queue = (struct descq*) q;
- err = queue->rpc->vtbl.deregister_region(queue->rpc, rid, &err2);
+ err = queue->rpc->rpc_tx_vtbl.deregister_region(queue->rpc, rid, &err2);
err = err_is_fail(err) ? err : err2;
return err;
}
struct descq* q = (struct descq*) st;
DESCQ_DEBUG("Control interface bound \n");
q->ctrl = b;
- q->rpc = malloc(sizeof(struct descq_ctrl_rpc_client));
+ q->rpc = malloc(sizeof(struct descq_ctrl_binding));
assert(q->rpc != NULL);
- err = descq_ctrl_rpc_client_init(q->rpc, b);
+ err = descq_ctrl_binding_init(q->rpc, b);
assert(err_is_ok(err));
b->rx_vtbl = ctrl_rx_vtbl;
}
errval_t err2;
- err = tmp->rpc->vtbl.create_queue(tmp->rpc, slots, rx, tx, &err2);
+ err = tmp->rpc->rpc_tx_vtbl.create_queue(tmp->rpc, slots, rx, tx, &err2);
if (err_is_fail(err) || err_is_fail(err2)) {
err = err_is_fail(err) ? err: err2;
goto cleanup5;
#include <devif/queue_interface.h>
#include <pci/pci.h>
#include <if/sfn5122f_devif_defs.h>
-#include <if/sfn5122f_devif_rpcclient_defs.h>
+#include <if/sfn5122f_devif_defs.h>
#include <devif/backends/net/sfn5122f_devif.h>
#include "../../../queue_interface_internal.h"
#include "hw_queue.h"
// Initi RPC client
queue->b = b;
- queue->rpc = malloc(sizeof(struct sfn5122f_devif_rpc_client));
- assert(queue->rpc != NULL);
- err = sfn5122f_devif_rpc_client_init(queue->rpc, b);
- if (err_is_fail(err)) {
- free(queue->rpc);
- }
-
- queue->bound = true;
+ sfn5122f_devif_binding_init(queue->b);
+ queue->bound = true;
}
static errval_t sfn5122f_register(struct devq* q, struct capref cap,
- regionid_t rid)
+ regionid_t rid)
{
uint64_t buftbl_idx = 0;
errval_t err, err2;
struct sfn5122f_queue* queue = (struct sfn5122f_queue*) q;
if (queue->userspace) {
- err = queue->rpc->vtbl.register_region(queue->rpc, queue->id, cap,
+ err = queue->b->b_tx_vtbl.register_region(queue->b, queue->id, cap,
&buftbl_idx, &err2);
if (err_is_fail(err) || err_is_fail(err2)) {
err = err_is_fail(err) ? err: err2;
while (cur->next != NULL) {
cur = cur->next;
- }
+ }
cur->next = entry;
return SYS_ERR_OK;
}
-static errval_t sfn5122f_deregister(struct devq* q, regionid_t rid)
+static errval_t sfn5122f_deregister(struct devq* q, regionid_t rid)
{
errval_t err, err2;
struct sfn5122f_queue* queue = (struct sfn5122f_queue*) q;
- // find region and translate to buftlb entry
+ // find region and translate to buftlb entry
struct region_entry* cur = queue->regions;
if (cur == NULL) {
while (cur->next != NULL && cur->rid != rid) {
cur = cur->next;
- }
+ }
// do rpc do inform carddriver to remove buftbl entries
if (queue->userspace) {
- err = queue->rpc->vtbl.deregister_region(queue->rpc, cur->buftbl_idx, cur->size,
+ err = queue->b->b_tx_vtbl.deregister_region(queue->b, cur->buftbl_idx, cur->size,
&err2);
if (err_is_fail(err) || err_is_fail(err2)) {
err = err_is_fail(err) ? err: err2;
}
static errval_t enqueue_rx_buf(struct sfn5122f_queue* q, regionid_t rid,
- bufferid_t bid, lpaddr_t base, size_t len,
+ bufferid_t bid, lpaddr_t base, size_t len,
uint64_t flags)
{
DEBUG_QUEUE("Enqueueing RX buf \n");
// check if there is space
if (sfn5122f_queue_free_rxslots(q) == 0) {
- printf("SFN5122F_%d: Not enough space in RX ring, not adding buffer\n",
+ printf("SFN5122F_%d: Not enough space in RX ring, not adding buffer\n",
q->id);
return SFN_ERR_ENQUEUE;
}
// compute buffer table entry of the rx buffer and the within it offset
uint64_t buftbl_idx = entry->buftbl_idx + (bid/BUF_SIZE);
- uint16_t offset = bid & 0x00000FFF;
+ uint16_t offset = bid & 0x00000FFF;
// still in the same buffer table entry
assert(buftbl_idx == (entry->buftbl_idx + ((bid+len-1)/BUF_SIZE)));
- DEBUG_QUEUE("RX_BUF tbl_idx=%lu offset=%d flags=%lu \n",
+ DEBUG_QUEUE("RX_BUF tbl_idx=%lu offset=%d flags=%lu \n",
buftbl_idx, offset, flags);
if (q->userspace) {
sfn5122f_queue_add_user_rxbuf_devif(q, buftbl_idx, offset,
rid, bid, base, len, flags);
} else {
- sfn5122f_queue_add_rxbuf_devif(q, rid, bid, base,
+ sfn5122f_queue_add_rxbuf_devif(q, rid, bid, base,
len, flags);
}
sfn5122f_queue_bump_rxtail(q);
static errval_t enqueue_tx_buf(struct sfn5122f_queue* q, regionid_t rid,
- bufferid_t bid, lpaddr_t base, size_t len,
+ bufferid_t bid, lpaddr_t base, size_t len,
uint64_t flags)
{
DEBUG_QUEUE("Enqueueing TX buf \n");
// check if there is space
if (sfn5122f_queue_free_txslots(q) == 0) {
- printf("SFN5122F_%d: Not enough space in TX ring, not adding buffer\n",
+ printf("SFN5122F_%d: Not enough space in TX ring, not adding buffer\n",
q->id);
return SFN_ERR_ENQUEUE;
}
// compute buffer table entry of the rx buffer and the within it offset
uint64_t buftbl_idx = entry->buftbl_idx + (bid/BUF_SIZE);
- uint16_t offset = bid & 0x00000FFF;
+ uint16_t offset = bid & 0x00000FFF;
// still in the same buffer table entry
} else {
DEBUG_QUEUE("TX_BUF flags=%lu \n", flags);
- sfn5122f_queue_add_txbuf_devif(q, rid, bid, base,
+ sfn5122f_queue_add_txbuf_devif(q, rid, bid, base,
len, flags);
}
sfn5122f_queue_bump_txtail(q);
return SYS_ERR_OK;
}
-static errval_t sfn5122f_enqueue(struct devq* q, regionid_t rid, bufferid_t bid,
+static errval_t sfn5122f_enqueue(struct devq* q, regionid_t rid, bufferid_t bid,
lpaddr_t base, size_t len, uint64_t flags)
{
errval_t err;
err = enqueue_rx_buf(queue, rid, bid, base, len, flags);
if (err_is_fail(err)) {
return err;
- }
+ }
} else if (flags & NETIF_TXFLAG) {
assert(len <= BASE_PAGE_SIZE);
err = enqueue_tx_buf(queue, rid, bid, base, len, flags);
if (err_is_fail(err)) {
return err;
- }
+ }
}
return SYS_ERR_OK;
}
-static errval_t sfn5122f_dequeue(struct devq* q, regionid_t* rid, bufferid_t* bid,
+static errval_t sfn5122f_dequeue(struct devq* q, regionid_t* rid, bufferid_t* bid,
lpaddr_t* base, size_t* len, uint64_t* flags)
{
uint8_t ev_code;
- errval_t err = DEVQ_ERR_RX_EMPTY;
+ errval_t err = DEVQ_ERR_RX_EMPTY;
struct sfn5122f_queue* queue = (struct sfn5122f_queue*) q;
*len = queue->bufs[queue->last_deq].len;
queue->num_left--;
queue->last_deq++;
- return SYS_ERR_OK;
- }
+ return SYS_ERR_OK;
+ }
while(true) {
ev_code = sfn5122f_get_event_code(queue);
case EV_CODE_RX:
// TODO multiple packets
err = sfn5122f_queue_handle_rx_ev_devif(queue, rid, bid, base,
- len, flags);
+ len, flags);
if (err_is_ok(err)) {
DEBUG_QUEUE(" RX_EV Q_ID: %d len %ld \n", queue->id, *len);
}
sfn5122f_queue_bump_evhead(queue);
return SYS_ERR_OK;
case EV_CODE_TX:
- err = sfn5122f_queue_handle_tx_ev_devif(queue, rid, bid, base,
+ err = sfn5122f_queue_handle_tx_ev_devif(queue, rid, bid, base,
len, flags);
if (err_is_ok(err)) {
- DEBUG_QUEUE("TX EVENT OK %d \n", queue->id);
+ DEBUG_QUEUE("TX EVENT OK %d \n", queue->id);
} else {
DEBUG_QUEUE("TX EVENT ERR %d \n", queue->id);
}
sfn5122f_queue_bump_evhead(queue);
break;
case EV_CODE_NONE:
- sfn5122f_evq_rptr_reg_wr(queue->device, queue->id,
+ sfn5122f_evq_rptr_reg_wr(queue->device, queue->id,
queue->ev_head);
return err;
}
*
*/
-errval_t sfn5122f_queue_create(struct sfn5122f_queue** q, sfn5122f_event_cb_t cb,
+errval_t sfn5122f_queue_create(struct sfn5122f_queue** q, sfn5122f_event_cb_t cb,
bool userlevel, bool interrupts)
{
DEBUG_QUEUE("create called \n");
.update_rxtail = update_rxtail
};
- /* Allocate memory for descriptor rings
+ /* Allocate memory for descriptor rings
No difference for userspace networking*/
// TODO too large ...
total_size = sizeof(uint64_t)*(TX_ENTRIES + RX_ENTRIES + EV_ENTRIES);
if (!interrupts) {
printf("Solarflare queue used in polling mode \n");
- err = queue->rpc->vtbl.create_queue(queue->rpc, frame, userlevel, interrupts,
+ err = queue->b->b_tx_vtbl.create_queue(queue->b, frame, userlevel, interrupts,
0, 0, &queue->id, ®s, &err2);
if (err_is_fail(err) || err_is_fail(err2)) {
err = err_is_fail(err) ? err: err2;
queue->core = disp_get_core_id();
- err = queue->rpc->vtbl.create_queue(queue->rpc, frame, userlevel,
+ err = queue->b->b_tx_vtbl.create_queue(queue->b, frame, userlevel,
interrupts, queue->core,
- queue->vector, &queue->id,
+ queue->vector, &queue->id,
®s, &err2);
if (err_is_fail(err) || err_is_fail(err2)) {
err = err_is_fail(err) ? err: err2;
return err;
}
- err = vspace_map_one_frame_attr(&queue->device_va, id.bytes, regs,
+ err = vspace_map_one_frame_attr(&queue->device_va, id.bytes, regs,
VREGION_FLAGS_READ_WRITE, NULL, NULL);
if (err_is_fail(err)) {
return err;
errval_t sfn5122f_queue_destroy(struct sfn5122f_queue* q)
{
errval_t err, err2;
- err = q->rpc->vtbl.destroy_queue(q->rpc, q->id, &err2);
+ err = q->b->b_tx_vtbl.destroy_queue(q->b, q->id, &err2);
if (err_is_fail(err) || err_is_fail(err2)) {
err = err_is_fail(err) ? err: err2;
return err;
}
free(q->device);
- free(q->rpc);
+ free(q->b);
err = devq_destroy(&(q->q));
if (err_is_fail(err)){
return SYS_ERR_OK;
}
-
}
static struct dma_rx_vtbl dma_rxvtbl = {
- .register_response = register_response_rx,
+ .register__response = register_response_rx,
.deregister_response = deregister_response_rx,
.memcpy_response = memcpy_response_rx,
.done = done_msg_rx
{
struct svc_msg_st *st = (struct svc_msg_st *) msg_st;
- return dma_register_call__tx(msg_st->queue->binding, TXQCONT(msg_st),
+ return dma_register__call__tx(msg_st->queue->binding, TXQCONT(msg_st),
st->args.cap);
}
#include <debug.h>
#include <if/dma_mgr_defs.h>
-#include <if/dma_mgr_rpcclient_defs.h>
+#include <if/dma_mgr_defs.h>
/// DMA manager RPC client
-static struct dma_mgr_rpc_client dma_mgr_client;
+static struct dma_mgr_binding *dma_mgr_client;
/// connected flag
uint8_t dma_mgr_connected = 0x0;
}
DMAMGR_DEBUG("connect: connection to {%s} established.\n", DMA_MGR_SVC_NAME);
-
- bindst->err = dma_mgr_rpc_client_init(&dma_mgr_client, b);
-
- if (err_is_fail(bindst->err)) {
- DMAMGR_DEBUG("connect: RPC client init failed.\n");
- }
+ dma_mgr_client = b;
+ dma_mgr_rpc_client_init(dma_mgr_client);
bindst->bound = 0x1;
}
//XXX need to figure this out otherwise
uint8_t numa_node = (disp_get_core_id() >= 20);
- err = dma_mgr_client.vtbl.register_driver(&dma_mgr_client, mem_low, mem_high,
+ err = dma_mgr_client->rpc_tx_vtbl.register_driver(dma_mgr_client, mem_low, mem_high,
numa_node, type, iref, &msgerr);
if (err_is_fail(err)) {
DMAMGR_DEBUG("register driver: RPC failed %s\n", err_getstring(err));
uint8_t numa_node = (disp_get_core_id() >= 20);
- err = dma_mgr_client.vtbl.lookup_driver(&dma_mgr_client, addr, size,
+ err = dma_mgr_client->rpc_tx_vtbl.lookup_driver(dma_mgr_client, addr, size,
numa_node, &msgerr, &info->mem_low,
&info->mem_high, &info->numa_node,
(uint8_t*) &info->type, &info->iref);
DMAMGR_DEBUG("lookup driver by iref:%"PRIxIREF"\n", iref);
- err = dma_mgr_client.vtbl.lookup_driver_by_iref(&dma_mgr_client, iref,
+ err = dma_mgr_client->rpc_tx_vtbl.lookup_driver_by_iref(dma_mgr_client, iref,
&msgerr, &info->mem_low,
&info->mem_high,
&info->numa_node,
iref_t dummy_iref;
return nameservice_blocking_lookup(buf, &dummy_iref);
}
-
{
struct dma_binding *b = msg_st->queue->binding;
- return dma_register_response__tx(b, TXQCONT(msg_st), msg_st->err);
+ return dma_register__response__tx(b, TXQCONT(msg_st), msg_st->err);
}
static void dma_register_call_rx(struct dma_binding *_binding,
}
struct dma_rx_vtbl dma_rx_vtbl = {
- .register_call = dma_register_call_rx,
+ .register__call = dma_register_call_rx,
.deregister_call = dma_deregister_call_rx,
.memcpy_call = dma_memcpy_call_rx,
};
#include <int_route/int_route_debug.h>
#include <if/int_route_service_defs.h>
-#include <if/int_route_service_rpcclient_defs.h>
+#include <if/int_route_service_defs.h>
static struct int_route_state {
bool request_done;
- struct int_route_rpc_client * client;
+ struct int_route_binding * client;
struct int_route_service_binding * binding;
- struct int_route_service_rpc_client rpc_client;
} int_route_state_st;
static void bind_cb(void *st, errval_t binderr, struct int_route_service_binding *b) {
assert(err_is_ok(binderr));
- errval_t err;
int_route_state_st.binding = b;
int_route_state_st.request_done = true;
- err = int_route_service_rpc_client_init(&(int_route_state_st.rpc_client), b);
- assert(err_is_ok(err));
+ int_route_service_rpc_client_init(b);
}
//errval_t int_route_add_controller(int bus, int dev, int fun,
errval_t int_route_client_route(struct capref intsrc, struct capref intdest){
assert(int_route_state_st.request_done);
- struct int_route_service_rpc_client * cl = &int_route_state_st.rpc_client;
+ struct int_route_service_binding * cl = int_route_state_st.binding;
errval_t msgerr, err;
- msgerr = cl->vtbl.route(cl, intsrc, intdest, &err);
+ msgerr = cl->rpc_tx_vtbl.route(cl, intsrc, intdest, &err);
if(err_is_fail(msgerr)){
return msgerr;
}
#include <barrelfish/net_constants.h>
#include <if/net_ARP_defs.h>
-#include <if/net_ARP_rpcclient_defs.h>
+#include <if/net_ARP_defs.h>
// standard include files
#include <stdio.h>
// *****************************************************************
// local states
// *****************************************************************
-static struct net_ARP_rpc_client net_ARP_rpc;
+static struct net_ARP_binding *net_ARP_binding;
static bool net_ARP_service_connected = false;
static struct netif netif;
abort();
}
LWIPBF_DEBUG("net_ARP_bind_cb: called\n");
-
- err = net_ARP_rpc_client_init(&net_ARP_rpc, b);
- if (!err_is_ok(err)) {
- printf("net_ARP_bind_cb failed in init\n");
- abort();
- }
-
+ net_ARP_binding = b;
+ net_ARP_rpc_client_init(b);
net_ARP_service_connected = true;
LWIPBF_DEBUG("net_ARP_bind_cb: net_ARP bind successful!\n");
}
struct ip_addr ip, gw, nm;
uint32_t iface = 0;
- err = net_ARP_rpc.vtbl.ip_info(&net_ARP_rpc, iface, &remote_err,
+ err = net_ARP_binding->rpc_tx_vtbl.ip_info(net_ARP_binding, iface, &remote_err,
&ip.addr, &gw.addr, &nm.addr);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "error in making ip_info call");
bool force = false;
uint64_t mac = 0;
- err = net_ARP_rpc.vtbl.ARP_lookup(&net_ARP_rpc, ip, iface, force,
+ err = net_ARP_binding->rpc_tx_vtbl.ARP_lookup(net_ARP_binding, ip, iface, force,
&remote_err, &mac);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "error in making ARP_lookup call");
LWIPBF_DEBUG("idc_ARP_lookup: got answer\n");
return mac;
} // end function: idc_ARP_lookup
-
-
#include "idc_barrelfish.h"
#include <if/net_queue_manager_defs.h>
//#include <if/net_ports_defs.h>
-//#include <if/net_ports_rpcclient_defs.h>
+//#include <if/net_ports_defs.h>
#include <barrelfish/bulk_transfer_arch.h>
#include <net_interfaces/net_interfaces.h>
#include "lwip/init.h"
#include <netbench/netbench.h>
#include <if/net_ports_defs.h>
-#include <if/net_ports_rpcclient_defs.h>
+#include <if/net_ports_defs.h>
#include <stdio.h>
#include <assert.h>
#include "lwip/barrelfish.h"
* @{
*
****************************************************************/
-static struct net_ports_rpc_client net_ports_rpc;
+static struct net_ports_binding *net_ports_binding;
static bool net_ports_service_connected = false;
static net_ports_appid_t appid_delete = 0;
}
LWIPBF_DEBUG("net_ports_bind_cb: called\n");
- err = net_ports_rpc_client_init(&net_ports_rpc, b);
- if (!err_is_ok(err)) {
- printf("net_ports_bind_cb failed in init\n");
- abort();
- }
-
+ net_ports_binding = b;
+ net_ports_rpc_client_init(net_ports_binding);
net_ports_service_connected = true;
LWIPBF_DEBUG("net_ports_bind_cb: net_ports bind successful!\n");
}
errval_t err;
struct ip_addr ip, gw, nm;
- err = net_ports_rpc.vtbl.get_ip_info(&net_ports_rpc, &ip.addr, &gw.addr,
+ err = net_ports_binding->rpc_tx_vtbl.get_ip_info(net_ports_binding, &ip.addr, &gw.addr,
&nm.addr);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "error sending get_ip_info");
errval_t err, msgerr;
- err = net_ports_rpc.vtbl.close_port(&net_ports_rpc, port_type, port,
+ err = net_ports_binding->rpc_tx_vtbl.close_port(net_ports_binding, port_type, port,
appid_delete, lwip_queue_id,
&msgerr);
if (err_is_fail(err)) {
errval_t err, msgerr;
/* getting the proper buffer id's here */
- err = net_ports_rpc.vtbl.bind_port(&net_ports_rpc, port_type, port,
+ err = net_ports_binding->rpc_tx_vtbl.bind_port(net_ports_binding, port_type, port,
/* buffer for RX */
get_rx_bufferid(),
/* buffer for TX */
//assert(!"NYI");
/* getting the proper buffer id's here */
- err = net_ports_rpc.vtbl.get_port(&net_ports_rpc, port_type,
+ err = net_ports_binding->rpc_tx_vtbl.get_port(net_ports_binding, port_type,
/* buffer for RX */
get_rx_bufferid(),
/* buffer for TX */
#if 0
/* getting the proper buffer id's here */
err =
- net_ports_rpc.vtbl.redirect(&net_ports_rpc, port_type, local_ip->addr, local_port,
+ net_ports_binding->rpc_tx_vtbl.redirect(net_ports_binding, port_type, local_ip->addr, local_port,
remote_ip->addr, remote_port,
/* buffer for RX */
get_rx_bufferid(),
#if 0
/* getting the proper buffer id's here */
err =
- net_ports_rpc.vtbl.redirect_pause(&net_ports_rpc, port_type, local_ip->addr,
+ net_ports_binding->rpc_tx_vtbl.redirect_pause(net_ports_binding, port_type, local_ip->addr,
local_port, remote_ip->addr, remote_port,
/* buffer for RX */
((struct client_closure_NC *)
bind_port = bind_port_ptr;
close_port = close_port_ptr;
}
-
#include <barrelfish/bulk_transfer.h>
//#include <net_device_manager/net_ports_service.h>
#include <if/net_soft_filters_defs.h>
-#include <if/net_soft_filters_rpcclient_defs.h>
+#include <if/net_soft_filters_defs.h>
//#include <if/net_ports_defs.h>
// For filter generation
}
NDM_DEBUG("soft_filters_bind_cb: started\n");
- struct net_soft_filters_rpc_client *rpc_client = malloc(sizeof(struct net_soft_filters_rpc_client));
- net_soft_filters_rpc_client_init(rpc_client, enb);
- enb->st = rpc_client;
+ net_soft_filters_rpc_client_init(enb);
soft_filters_connection = enb;
NDM_DEBUG(" soft_filters_bind_cb: connection made,"
static void register_filter_memory(struct capref cap)
{
struct net_soft_filters_binding *b = soft_filters_connection;
- struct net_soft_filters_rpc_client *rpc = b->st;
errval_t err, rerr;
- err = rpc->vtbl.register_filter_memory(rpc, cap, &rerr);
+ err = b->rpc_tx_vtbl.register_filter_memory(b, cap, &rerr);
assert(err_is_ok(err));
assert(err_is_ok(rerr));
soft_filters_ready = true;
static void sf_mac_lookup(void)
{
struct net_soft_filters_binding *b = soft_filters_connection;
- struct net_soft_filters_rpc_client *rpc = b->st;
uint64_t mac_addr;
errval_t err, rerr;
- err = rpc->vtbl.mac_address(rpc, &rerr, &mac_addr);
+ err = b->rpc_tx_vtbl.mac_address(b, &rerr, &mac_addr);
assert(err_is_ok(err));
assert(err_is_ok(rerr));
mac = my_convert_uint64_to_eth_addr(mac_addr);
" and type %x, paused = %d\n", id, ftype, paused);
struct net_soft_filters_binding *b = soft_filters_connection;
- struct net_soft_filters_rpc_client *rpc = b->st;
errval_t err, rerr;
uint64_t filter_id;
- err = rpc->vtbl.register_filter(rpc, id, len_rx, len_tx, buffer_id_rx, buffer_id_tx, ftype, paused, &rerr, &filter_id);
+ err = b->rpc_tx_vtbl.register_filter(b, id, len_rx, len_tx, buffer_id_rx, buffer_id_tx, ftype, paused, &rerr, &filter_id);
assert(err_is_ok(err));
assert(err_is_ok(rerr));
NDM_DEBUG("filter at id [%" PRIu64 "] type[%" PRIu64
static void unregister_soft_filter(uint64_t filter_id, qid_t qid)
{
struct net_soft_filters_binding *b = soft_filters_connection;
- struct net_soft_filters_rpc_client *rpc = b->st;
errval_t err, rerr;
- err = rpc->vtbl.deregister_filter(rpc, filter_id, &rerr);
+ err = b->rpc_tx_vtbl.deregister_filter(b, filter_id, &rerr);
assert(err_is_ok(err));
assert(err_is_ok(rerr));
} // end function: unregister_soft_filter
{
NDM_DEBUG("register_arp_soft_filter: called\n");
struct net_soft_filters_binding *b = soft_filters_connection;
- struct net_soft_filters_rpc_client *rpc = b->st;
errval_t err, rerr;
- err = rpc->vtbl.register_arp_filter(rpc, id, len_rx, len_tx, &rerr);
+ err = b->rpc_tx_vtbl.register_arp_filter(b, id, len_rx, len_tx, &rerr);
assert(err_is_ok(err));
assert(err_is_ok(rerr));
return id;
}
-
#include <net_queue_manager/net_queue_manager.h>
#include <bfdmuxvm/vm.h>
#include <if/net_soft_filters_defs.h>
-#include <if/net_soft_filters_rpcclient_defs.h>
+#include <if/net_soft_filters_defs.h>
#include <if/net_queue_manager_defs.h>
#include "queue_manager_local.h"
#include "queue_manager_debug.h"
#include <pci/pci.h>
#include <pci/pci_client_debug.h>
#include <if/pci_defs.h>
-#include <if/pci_rpcclient_defs.h>
-#include <if/acpi_rpcclient_defs.h>
+#include <if/acpi_defs.h>
#include <acpi_client/acpi_client.h>
#include <int_route/int_model.h>
#include <int_route/int_route_client.h>
#define INVALID_VECTOR ((uint64_t)-1)
#define INVALID_VECTOR_32 ((uint32_t)-1)
-static struct pci_rpc_client *pci_client = NULL;
+static struct pci_binding *pci_client = NULL;
/*
assert(vector != INVALID_VECTOR);
}
- err = pci_client->vtbl.
+ err = pci_client->rpc_tx_vtbl.
reregister_interrupt(pci_client, class, subclass, prog_if, vendor,
device, bus, dev, fun, disp_get_current_core_id(),
vector, &msgerr);
}
// Activate PCI interrupt
- err = pci_client->vtbl.irq_enable(pci_client, &msgerr);
+ err = pci_client->rpc_tx_vtbl.irq_enable(pci_client, &msgerr);
assert(err_is_ok(err));
if(err_is_fail(msgerr)){
DEBUG_ERR(msgerr, "irq_enable");
uint8_t nbars;
errval_t err, msgerr;
- err = pci_client->vtbl.
+ err = pci_client->rpc_tx_vtbl.
init_pci_device(pci_client, class, subclass, prog_if, vendor,
device, bus, dev, fun, &msgerr,
&nbars, caps_per_bar, caps_per_bar + 1, caps_per_bar + 2,
err = slot_alloc(&cap);
assert(err_is_ok(err));
- err = pci_client->vtbl.get_bar_cap(pci_client, nb, nc, &msgerr, &cap,
+ err = pci_client->rpc_tx_vtbl.get_bar_cap(pci_client, nb, nc, &msgerr, &cap,
&type, &bar->bar_nr);
if (err_is_fail(err) || err_is_fail(msgerr)) {
if (err_is_ok(err)) {
// Connect to PCI without interrupts
err = slot_alloc(&iocap);
assert(err_is_ok(err));
- err = pci_client->vtbl.init_legacy_device(pci_client, iomin, iomax, 0,
+ err = pci_client->rpc_tx_vtbl.init_legacy_device(pci_client, iomin, iomax, 0,
disp_get_core_id(), INVALID_VECTOR_32,
&msgerr, &iocap);
if (err_is_fail(err)) {
err = slot_alloc(&iocap);
assert(err_is_ok(err));
- err = pci_client->vtbl.init_legacy_device(pci_client, iomin, iomax, irq,
+ err = pci_client->rpc_tx_vtbl.init_legacy_device(pci_client, iomin, iomax, irq,
disp_get_core_id(), vector,
&msgerr, &iocap);
if (err_is_fail(err)) {
errval_t pci_read_conf_header(uint32_t dword, uint32_t *val)
{
errval_t err, msgerr;
- err = pci_client->vtbl.read_conf_header(pci_client, dword, &msgerr, val);
+ err = pci_client->rpc_tx_vtbl.read_conf_header(pci_client, dword, &msgerr, val);
return err_is_fail(err) ? err : msgerr;
}
errval_t pci_write_conf_header(uint32_t dword, uint32_t val)
{
errval_t err, msgerr;
- err = pci_client->vtbl.write_conf_header(pci_client, dword, val, &msgerr);
+ err = pci_client->rpc_tx_vtbl.write_conf_header(pci_client, dword, val, &msgerr);
return err_is_fail(err) ? err : msgerr;
}
{
errval_t err, msgerr;
if (addr == NULL) {
- err = pci_client->vtbl.msix_enable(pci_client, &msgerr, count);
+ err = pci_client->rpc_tx_vtbl.msix_enable(pci_client, &msgerr, count);
} else {
- err = pci_client->vtbl.msix_enable_addr(pci_client, addr->bus, addr->device,
+ err = pci_client->rpc_tx_vtbl.msix_enable_addr(pci_client, addr->bus, addr->device,
addr->function, &msgerr, count);
}
return err_is_fail(err) ? err : msgerr;
{
errval_t err, msgerr;
if (addr == NULL) {
- err = pci_client->vtbl.msix_vector_init(pci_client, idx, destination,
+ err = pci_client->rpc_tx_vtbl.msix_vector_init(pci_client, idx, destination,
vector, &msgerr);
} else {
- err = pci_client->vtbl.msix_vector_init_addr(pci_client, addr->bus,
+ err = pci_client->rpc_tx_vtbl.msix_vector_init_addr(pci_client, addr->bus,
addr->device, addr->function,
idx, destination,
vector, &msgerr);
{
errval_t *reterr = st;
if (err_is_ok(err)) {
- struct pci_rpc_client *r = malloc(sizeof(*r));
- assert(r != NULL);
- err = pci_rpc_client_init(r, b);
- if (err_is_ok(err)) {
- pci_client = r;
- } else {
- free(r);
- }
+ pci_rpc_client_init(b);
+ pci_client = b;
}
*reterr = err;
}
#include <barrelfish/waitset.h>
#include <collections/list.h>
#include <if/octopus_defs.h>
-#include <if/octopus_rpcclient_defs.h>
+#include <if/octopus_defs.h>
#include <octopus/octopus.h>
#include <posixcompat.h>
#include <term/server/server.h>
{
errval_t err;
- struct octopus_rpc_client *oc = get_octopus_rpc_client();
+ struct octopus_binding *oc = get_octopus_binding();
struct octopus_set_response__rx_args reply;
/* request a system-wide unique number at octopus */
char *query = PTY_PTS_OCTOPUS_PREFIX;
- oc->vtbl.set(oc, query, SET_SEQUENTIAL, NOP_TRIGGER, true, reply.record,
+ oc->rpc_tx_vtbl.set(oc, query, SET_SEQUENTIAL, NOP_TRIGGER, true, reply.record,
&reply.tid, &err);
if (err_is_fail(err)) {
goto finish;
#include <barrelfish/barrelfish.h>
#include <barrelfish/nameservice_client.h>
#include <skb/skb.h>
-#include <if/skb_rpcclient_defs.h>
+#include <if/skb_defs.h>
#include <barrelfish/core_state_arch.h>
/* ------------------------- Connecting to skb ------------------------------ */
abort();
}
- skb_state->skb = malloc(sizeof(struct skb_rpc_client));
- assert(skb_state->skb != NULL);
- err = skb_rpc_client_init(skb_state->skb, b);
- if (err_is_fail(err)) {
- free(skb_state->skb);
- DEBUG_ERR(err, "error in skb_rpc_client_init");
- abort();
- }
-
+ skb_state->skb = b;
+ skb_rpc_client_init(skb_state->skb);
assert(!skb_state->request_done);
skb_state->request_done = true;
}
return LIB_ERR_MALLOC_FAIL;
}
}
- err = skb_state->skb->vtbl.run(skb_state->skb, query, result,
+ err = skb_state->skb->rpc_tx_vtbl.run(skb_state->skb, query, result,
str_error, int_error);
if (err_is_fail(err)) {
if (result) {
#include <string.h>
#include <barrelfish/barrelfish.h>
#include <skb/skb.h>
-#include <if/skb_rpcclient_defs.h>
+#include <if/skb_defs.h>
#include <barrelfish/core_state_arch.h>
#include "skb_debug.h"
struct skb_state *skb_state = get_skb_state();
last_goal = goal;
- err = skb_state->skb->vtbl.run(skb_state->skb, goal, output,
+ err = skb_state->skb->rpc_tx_vtbl.run(skb_state->skb, goal, output,
error_output, &error_code);
if (err_is_fail(err)) {
return err_push(err, SKB_ERR_RUN);
#include <spawndomain/spawndomain.h>
#include <if/octopus_defs.h>
-#include <if/octopus_rpcclient_defs.h>
+#include <if/octopus_defs.h>
#include <if/monitor_defs.h>
#include <octopus/getset.h> // for oct_read TODO
#include <octopus/trigger.h> // for NOP_TRIGGER
}
snprintf(omp_entry, len+1, "%s.omp.%"PRIu32, binary, idx);
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
}
struct octopus_get_response__rx_args reply;
- err = r->vtbl.get(r, omp_entry, NOP_TRIGGER,
+ err = r->rpc_tx_vtbl.get(r, omp_entry, NOP_TRIGGER,
reply.output, &reply.tid, &reply.error_code);
if (err_is_fail(err)) {
goto out;
errval_t err = SYS_ERR_OK;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
octopus_trigger_id_t tid;
errval_t error_code;
- err = r->vtbl.set(r, record, 0, NOP_TRIGGER,
+ err = r->rpc_tx_vtbl.set(r, record, 0, NOP_TRIGGER,
0, NULL, &tid, &error_code);
if (err_is_fail(err)) {
goto out;
#include <collections/list.h>
#include <if/monitor_defs.h>
#include <if/octopus_defs.h>
-#include <if/octopus_rpcclient_defs.h>
+#include <if/octopus_defs.h>
#include <if/terminal_defs.h>
#include <if/terminal_config_defs.h>
#include <octopus/getset.h>
{
errval_t err;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
assert(r != NULL);
struct octopus_get_with_idcap_response__rx_args reply;
- err = r->vtbl.get_with_idcap(r, session_id, NOP_TRIGGER, reply.output, &reply.tid,
+ err = r->rpc_tx_vtbl.get_with_idcap(r, session_id, NOP_TRIGGER, reply.output, &reply.tid,
&reply.error_code);
if (err_is_fail(err)) {
err_push(err, TERM_ERR_LOOKUP_SESSION_RECORD);
#include <barrelfish/barrelfish.h>
#include <if/usb_manager_defs.h>
-#include <if/usb_manager_rpcclient_defs.h>
+#include <if/usb_manager_defs.h>
#include <usb/usb.h>
#include <usb/usb_device.h>
/// the usb manager RPC client structure
-struct usb_manager_rpc_client usb_manager;
+struct usb_manager_binding *usb_manager;
/*
* -------------------------------------------------------------------------
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "USB manager binding failed");
}
-
- err = usb_manager_rpc_client_init(&usb_manager, b);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "rpc client initialization failed\n");
- }
- debug_printf("vtbl.connect=%p\n", usb_manager.vtbl.connect);
+
+ usb_manager = b;
+ usb_manager_rpc_client_init(usb_manager);
+ debug_printf("vtbl.connect=%p\n", usb_manager->rpc_tx_vtbl.connect);
uint32_t ret_status;
uint8_t tmp[2048];
/* connect with the USB Manager */
- err = usb_manager.vtbl.connect(&usb_manager, client_st->usb_driver_iref, client_st->init_config,
+ err = usb_manager->rpc_tx_vtbl.connect(usb_manager, client_st->usb_driver_iref, client_st->init_config,
&ret_status, tmp, &length);
if (((usb_error_t) ret_status) != USB_ERR_OK) {
#define USB_MANAGER_CLIENT_H_
#include <if/usb_manager_defs.h>
-#include <if/usb_manager_rpcclient_defs.h>
#include <if/usb_driver_defs.h>
-extern struct usb_manager_rpc_client usb_manager;
+extern struct usb_manager_binding *usb_manager;
void usb_driver_rx_detach_notify(struct usb_driver_binding *b);
void usb_driver_rx_done_notify(struct usb_driver_binding *b,
\r
USB_DEBUG_IDC("libusb: usb_do_request()\n");\r
\r
- err = usb_manager.vtbl.request(&usb_manager, (uint8_t*) req, sizeof(*req),\r
+ err = usb_manager->rpc_tx_vtbl.request(usb_manager, (uint8_t*) req, sizeof(*req),\r
&ret_status);\r
\r
if (err_is_fail(err)) {\r
\r
USB_DEBUG_IDC("libusb: usb_do_request_write()\n");\r
\r
- err = usb_manager.vtbl.request_write(&usb_manager, (uint8_t*) req,\r
+ err = usb_manager->rpc_tx_vtbl.request_write(usb_manager, (uint8_t*) req,\r
sizeof(*req), (uint8_t *) data, length, &ret_status);\r
\r
if (err_is_fail(err)) {\r
\r
USB_DEBUG_IDC("libusb: usb_do_request_read()\n");\r
\r
- err = usb_manager.vtbl.request_read(&usb_manager, (uint8_t*) req,\r
+ err = usb_manager->rpc_tx_vtbl.request_read(usb_manager, (uint8_t*) req,\r
sizeof(*req), data, &length, &ret_status);\r
\r
*ret_length = length;\r
\r
usb_manager_setup_param_t *params = (usb_manager_setup_param_t *) setup;\r
\r
- usb_manager.vtbl.transfer_setup(&usb_manager, (uint8_t) USB_TYPE_CTRL,\r
+ usb_manager->rpc_tx_vtbl.transfer_setup(usb_manager, (uint8_t) USB_TYPE_CTRL,\r
*params, &ret_error, &ret_tid);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
\r
usb_manager_setup_param_t *params = (usb_manager_setup_param_t *) setup;\r
\r
- usb_manager.vtbl.transfer_setup(&usb_manager, (uint8_t) USB_TYPE_ISOC,\r
+ usb_manager->rpc_tx_vtbl.transfer_setup(usb_manager, (uint8_t) USB_TYPE_ISOC,\r
*params, &ret_error, &ret_tid);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
\r
usb_manager_setup_param_t *params = (usb_manager_setup_param_t *) setup;\r
\r
- usb_manager.vtbl.transfer_setup(&usb_manager, (uint8_t) USB_TYPE_BULK,\r
+ usb_manager->rpc_tx_vtbl.transfer_setup(usb_manager, (uint8_t) USB_TYPE_BULK,\r
*params, &ret_error, &ret_tid);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
\r
usb_manager_setup_param_t *params = (usb_manager_setup_param_t *) setup;\r
\r
- usb_manager.vtbl.transfer_setup(&usb_manager, (uint8_t) USB_TYPE_INTR,\r
+ usb_manager->rpc_tx_vtbl.transfer_setup(usb_manager, (uint8_t) USB_TYPE_INTR,\r
*params, &ret_error, &ret_tid);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
}\r
uint32_t ret_error = 0;\r
\r
- usb_manager.vtbl.transfer_unsetup(&usb_manager, tid, &ret_error);\r
+ usb_manager->rpc_tx_vtbl.transfer_unsetup(usb_manager, tid, &ret_error);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
return ((usb_error_t) ret_error);\r
\r
uint32_t ret_error = 0;\r
\r
- usb_manager.vtbl.transfer_start(&usb_manager, tid, &ret_error);\r
+ usb_manager->rpc_tx_vtbl.transfer_start(usb_manager, tid, &ret_error);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
return ((usb_error_t) ret_error);\r
}\r
uint32_t ret_error = 0;\r
\r
- usb_manager.vtbl.transfer_stop(&usb_manager, tid, &ret_error);\r
+ usb_manager->rpc_tx_vtbl.transfer_stop(usb_manager, tid, &ret_error);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
return ((usb_error_t) ret_error);\r
}\r
uint32_t ret_error = 0;\r
\r
- usb_manager.vtbl.transfer_clear_stall(&usb_manager, tid, &ret_error);\r
+ usb_manager->rpc_tx_vtbl.transfer_clear_stall(usb_manager, tid, &ret_error);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
return ((usb_error_t) ret_error);\r
uint32_t ret_error = 0;\r
uint32_t idc_ret_state = 0;\r
\r
- usb_manager.vtbl.transfer_state(&usb_manager, tid, &ret_error,\r
+ usb_manager->rpc_tx_vtbl.transfer_state(usb_manager, tid, &ret_error,\r
&idc_ret_state);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
\r
uint32_t ret_error = 0;\r
\r
- usb_manager.vtbl.transfer_status(&usb_manager, tid, &ret_error,\r
+ usb_manager->rpc_tx_vtbl.transfer_status(usb_manager, tid, &ret_error,\r
ret_actlen, ret_length, ret_actframes, ret_numframes);\r
\r
if (((usb_error_t) ret_error) != USB_ERR_OK) {\r
#include <barrelfish/bulk_transfer.h>
#include <barrelfish/nameservice_client.h>
#include <vfs/vfs.h>
-#include <if/bcache_rpcclient_defs.h>
+#include <if/bcache_defs.h>
#ifdef WITH_BUFFER_CACHE
#define MAX_CACHES 10
struct bcache_client {
- struct bcache_rpc_client rpc;
+ struct bcache_binding rpc;
struct bulk_transfer_slave bulk_slave;
struct capref cache_memory;
bool bound;
#ifndef FAKE_SCALABLE_CACHE
errval_t err;
- err = bcc->rpc.vtbl.get_start(&bcc->rpc, key, key_len, &index, &haveit,
+ err = bcc->rpc->rpc_tx_vtbl.get_start(&bcc->rpc, key, key_len, &index, &haveit,
transid, block_length);
/* err = bcc->rpc.b->tx_vtbl.get_start_call(bcc->rpc.b, key, key_len); */
if(err_is_fail(err)) {
#ifndef FAKE_SCALABLE_CACHE
errval_t err;
- err = bcc->rpc.vtbl.get_stop(&bcc->rpc, transid, index, block_length);
+ err = bcc->rpc->rpc_tx_vtbl.get_stop(&bcc->rpc, transid, index, block_length);
if(err_is_fail(err)) {
USER_PANIC_ERR(err, "get_stop");
}
void cache_print_stats(void)
{
struct bcache_client *bcc = cache[0];
- errval_t err = bcc->rpc.vtbl.print_stats(&bcc->rpc);
+ errval_t err = bcc->rpc->rpc_tx_vtbl.print_stats(&bcc->rpc);
assert(err_is_ok(err));
printf("cache[%d] stats\n", disp_get_core_id());
USER_PANIC_ERR(err, "bind failed");
}
- err = bcache_rpc_client_init(&cl->rpc, b);
+ err = bcache_binding_init(&cl->rpc, b);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "RPC init failed");
}
if(err_is_fail(err)) {
USER_PANIC_ERR(err, "slot_alloc for new_client");
}
- err = client->rpc.vtbl.new_client(&client->rpc, &client->cache_memory);
+ err = client->rpc->rpc_tx_vtbl.new_client(&client->rpc, &client->cache_memory);
if(err_is_fail(err)) {
USER_PANIC_ERR(err, "new_client");
}
#include <barrelfish/barrelfish.h>
#include <barrelfish/nameservice_client.h>
#include <if/ahci_mgmt_defs.h>
-#include <if/ahci_mgmt_rpcclient_defs.h>
+#include <if/ahci_mgmt_defs.h>
#include <dev/ata_identify_dev.h>
#include <dev/ahci_port_dev.h>
#include <ahci/ahci.h>
#include "vfs_blockdevfs.h"
-static struct ahci_mgmt_rpc_client ahci_mgmt_rpc;
static struct ahci_mgmt_binding *ahci_mgmt_binding;
static bool ahci_mgmt_bound = false;
}
ahci_mgmt_binding = b;
- err = ahci_mgmt_rpc_client_init(&ahci_mgmt_rpc, b);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "ahci_mgmt RPC init failed");
- }
+ ahci_mgmt_rpc_client_init(ahci_mgmt_binding);
ahci_mgmt_bound = true;
struct ahci_mgmt_list_response__rx_args reply;
- err = ahci_mgmt_rpc.vtbl.list(&ahci_mgmt_rpc, reply.port_ids, &reply.len);
+ err = ahci_mgmt_binding->rpc_tx_vtbl.list(ahci_mgmt_binding, reply.port_ids, &reply.len);
assert(err_is_ok(err));
for (size_t i = 0; i < reply.len; i++) {
struct ahci_mgmt_identify_response__rx_args identify_reply;
- err = ahci_mgmt_rpc.vtbl.identify(&ahci_mgmt_rpc,
+ err = ahci_mgmt_binding->rpc_tx_vtbl.identify(ahci_mgmt_binding,
reply.port_ids[i], identify_reply.identify_data,
&identify_reply.data_len);
assert(err_is_ok(err));
#include <barrelfish/barrelfish.h>
#include <barrelfish/nameservice_client.h>
#include <if/ahci_mgmt_defs.h>
-#include <if/ahci_mgmt_rpcclient_defs.h>
+#include <if/ahci_mgmt_defs.h>
#include <if/ahci_mgmt_defs.h>
#include <if/ata_rw28_defs.h>
#include <if/ata_rw28_ahci_defs.h>
-#include <if/ata_rw28_rpcclient_defs.h>
+#include <if/ata_rw28_defs.h>
#include <dev/ata_identify_dev.h>
#include <dev/ahci_port_dev.h>
#include <ahci/ahci.h>
#include "vfs_blockdevfs.h"
-static struct ahci_mgmt_rpc_client ahci_mgmt_rpc;
static struct ahci_mgmt_binding *ahci_mgmt_binding;
static bool ahci_mgmt_bound = false;
struct ata_handle {
struct ahci_binding *ahci_binding;
struct ata_rw28_binding *ata_rw28_binding;
- struct ata_rw28_rpc_client ata_rw28_rpc;
uint8_t port_num;
bool waiting;
errval_t wait_status;
ahci_ata_rw28_binding = calloc(1, sizeof(struct ahci_ata_rw28_binding));
ahci_ata_rw28_init(ahci_ata_rw28_binding, get_default_waitset(), h->ahci_binding);
h->ata_rw28_binding = (struct ata_rw28_binding*)ahci_ata_rw28_binding;
- err = ata_rw28_rpc_client_init(&h->ata_rw28_rpc, h->ata_rw28_binding);
- if (err_is_fail(err)) {
- // TODO: bindings leak
- VFS_BLK_DEBUG("blockdevfs_ata_open: failed to init ata_rw28 rpc client\n");
- return err;
- }
+ ata_rw28_rpc_client_init(h->ata_rw28_binding);
VFS_BLK_DEBUG("blockdevfs_ata_open: exiting\n");
return h->wait_status;
}
{
struct ata_handle *h = handle;
errval_t err, status;
- err = h->ata_rw28_rpc.vtbl.flush_cache(&h->ata_rw28_rpc, &status);
+ err = h->ata_rw28_binding->rpc_tx_vtbl.flush_cache(h->ata_rw28_binding, &status);
if (err_is_fail(err)) {
printf("failed calling flush_cache\n");
return err;
struct ata_handle *h = handle;
errval_t err, status;
- err = h->ata_rw28_rpc.vtbl.flush_cache(&h->ata_rw28_rpc, &status);
+ err = h->ata_rw28_binding->rpc_tx_vtbl.flush_cache(h->ata_rw28_binding, &status);
if (err_is_fail(err)) {
printf("failed calling flush_cache\n");
return err;
//VFS_BLK_DEBUG("bdfs_ahci: read begin: %zu -> %zu\n", bytes, aligned_bytes);
- err = h->ata_rw28_rpc.vtbl.read_dma(&h->ata_rw28_rpc,
+ err = h->ata_rw28_binding->rpc_tx_vtbl.read_dma(h->ata_rw28_binding,
aligned_bytes, blockpos, buffer, bytes_read);
return err;
size_t blockpos = pos / PR_SIZE;
errval_t status;
- err = h->ata_rw28_rpc.vtbl.write_dma(&h->ata_rw28_rpc,
+ err = h->ata_rw28_binding->rpc_tx_vtbl.write_dma(h->ata_rw28_binding,
buffer, aligned_bytes, blockpos, &status);
*bytes_written = aligned_bytes;
return err;
}
ahci_mgmt_binding = b;
- err = ahci_mgmt_rpc_client_init(&ahci_mgmt_rpc, b);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "ahci_mgmt RPC init failed");
- }
-
+ ahci_mgmt_rpc_client_init(ahci_mgmt_binding);
ahci_mgmt_bound = true;
// populate list
struct ahci_mgmt_list_response__rx_args reply;
- err = ahci_mgmt_rpc.vtbl.list(&ahci_mgmt_rpc, reply.port_ids, &reply.len);
+ err = ahci_mgmt_binding->rpc_tx_vtbl.list(ahci_mgmt_binding, reply.port_ids, &reply.len);
assert(err_is_ok(err));
for (size_t i = 0; i < reply.len; i++) {
break;
}
struct ahci_mgmt_identify_response__rx_args identify_reply;
- err = ahci_mgmt_rpc.vtbl.identify(&ahci_mgmt_rpc, reply.port_ids[i],
+ err = ahci_mgmt_binding->rpc_tx_vtbl.identify(ahci_mgmt_binding, reply.port_ids[i],
identify_reply.identify_data,
&identify_reply.data_len);
assert(err_is_ok(err));
#include <dev/fat_direntry_dev.h>
#include <if/ata_rw28_defs.h>
#include <if/ata_rw28_ahci_defs.h>
-#include <if/ata_rw28_rpcclient_defs.h>
+#include <if/ata_rw28_defs.h>
#include <ahci/ahci.h>
#include "vfs_fat_conv.h"
#include "vfs_backends.h"
struct fat_mount {
struct ata_rw28_binding *ata_rw28_binding;
- struct ata_rw28_rpc_client ata_rw28_rpc;
struct ahci_binding *ahci_binding;
errval_t bind_err;
else if (err == FS_CACHE_NOTPRESENT) {
size_t read_size;
data_ = malloc(size);
- err = mount->ata_rw28_rpc.vtbl.read_dma(&mount->ata_rw28_rpc,
+ err = mount->ata_rw28_binding->rpc_tx_vtbl.read_dma(mount->ata_rw28_binding,
size, block, data_, &read_size);
if (err_is_fail(err)) {
return err;
struct fat_mount *mount = (struct fat_mount*) st;
- err = ata_rw28_rpc_client_init(&mount->ata_rw28_rpc, b);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "RPC initialization failed");
- }
-
+ ata_rw28_binding_init(b);
mount->ata_rw28_binding = b;
}
#endif
}
FAT_DEBUG("ahci_ata_rw28_init completed");
mount->ata_rw28_binding = (struct ata_rw28_binding*)ahci_ata_rw28_binding;
- err = ata_rw28_rpc_client_init(&mount->ata_rw28_rpc, mount->ata_rw28_binding);
- if (err_is_fail(err)) {
- goto ata_rw28_init_failed;
- }
- FAT_DEBUG("ata_rw28_rpc_client_init completed");
+ ata_rw28_rpc_client_init(mount->ata_rw28_binding);
+ FAT_DEBUG("ata_rw28_binding_init completed");
#elif defined(__pandaboard__)
FAT_DEBUG("wait for mmchs service\n");
iref_t iref;
size_t size;
// read data from fat boot sector
uint8_t *data = malloc(ata_rw28__read_dma_block_response_buffer_MAX_ARGUMENT_SIZE);
- err = mount->ata_rw28_rpc.vtbl.read_dma_block(&mount->ata_rw28_rpc,
+ err = mount->ata_rw28_binding->rpc_tx_vtbl.read_dma_block(mount->ata_rw28_binding,
mount->startblock, mount->bootsec_data, &size);
if (err_is_fail(err)) {
goto bootsec_read_failed;
goto fs_check_failed;
}
struct ata_rw28_read_dma_block_response__rx_args reply;
- mount->ata_rw28_rpc.vtbl.read_dma_block(&mount->ata_rw28_rpc,
+ mount->ata_rw28_binding->rpc_tx_vtbl.read_dma_block(mount->ata_rw28_binding,
mount->startblock + fs_info_sector, reply.buffer ,
&reply.buffer_size);
if (memcmp(reply.buffer+0, "RRaA", 4) != 0 ||
#include <barrelfish/bulk_transfer.h>
#include <vfs/vfs_path.h>
#include <if/trivfs_defs.h>
-#include <if/trivfs_rpcclient_defs.h>
+#include <if/trivfs_defs.h>
#include <if/monitor_defs.h>
#include "vfs_backends.h"
#define BULK_BLOCK_SIZE BULK_MEM_SIZE // (it's RPC)
struct ramfs_client {
- struct trivfs_rpc_client rpc;
+ struct trivfs_binding *rpc;
struct bulk_transfer bulk;
trivfs_fh_t rootfh;
bool bound;
// lookup
trivfs_fh_t nextfh;
- err = cl->rpc.vtbl.lookup(&cl->rpc, fh, pathbuf, &msgerr, &nextfh, &isdir);
+ err = cl->rpc->rpc_tx_vtbl.lookup(cl->rpc, fh, pathbuf, &msgerr, &nextfh, &isdir);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in lookup");
return err;
} else if (err_is_fail(msgerr)) {
if (err_no(msgerr) == FS_ERR_INVALID_FH) {
if (fh == cl->rootfh) { // revalidate root
- err = cl->rpc.vtbl.getroot(&cl->rpc, &cl->rootfh);
+ err = cl->rpc->rpc_tx_vtbl.getroot(cl->rpc, &cl->rootfh);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed to get root fh");
}
}
// create the last part of the path
- err = cl->rpc.vtbl.create(&cl->rpc, fh, &path[pos], &msgerr, &fh);
+ err = cl->rpc->rpc_tx_vtbl.create(cl->rpc, fh, &path[pos], &msgerr, &fh);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in create");
return err;
return FS_ERR_NOTFILE;
}
- err = cl->rpc.vtbl.delete(&cl->rpc, fh, &msgerr);
+ err = cl->rpc->rpc_tx_vtbl.delete(cl->rpc, fh, &msgerr);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in delete");
return err;
assert(!h->isdir);
restart:
- err = cl->rpc.vtbl.read(&cl->rpc, h->fh, h->pos, bytes,
+ err = cl->rpc->rpc_tx_vtbl.read(cl->rpc, h->fh, h->pos, bytes,
&msgerr, buffer, bytes_read);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in read");
assert(!h->isdir);
restart:
- err = cl->rpc.vtbl.write(&cl->rpc, h->fh, h->pos, buffer, bytes, &msgerr);
+ err = cl->rpc->rpc_tx_vtbl.write(cl->rpc, h->fh, h->pos, buffer, bytes, &msgerr);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in write");
return err;
int restarts = 0;
restart:
- err = cl->rpc.vtbl.read_bulk(&cl->rpc, h->fh, h->pos, reqlen,
+ err = cl->rpc->rpc_tx_vtbl.read_bulk(cl->rpc, h->fh, h->pos, reqlen,
txbufid, &msgerr, &retlen);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in read");
int restarts = 0;
restart:
- err = cl->rpc.vtbl.write_bulk(&cl->rpc, h->fh, h->pos, reqlen, bufid,
+ err = cl->rpc->rpc_tx_vtbl.write_bulk(cl->rpc, h->fh, h->pos, reqlen, bufid,
&msgerr);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in write");
assert(!h->isdir);
restart:
- err = cl->rpc.vtbl.truncate(&cl->rpc, h->fh, bytes, &msgerr);
+ err = cl->rpc->rpc_tx_vtbl.truncate(cl->rpc, h->fh, bytes, &msgerr);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in truncate");
return err;
int restarts = 0;
restart:
- err = cl->rpc.vtbl.getattr(&cl->rpc, h->fh, &msgerr, &isdir, &size);
+ err = cl->rpc->rpc_tx_vtbl.getattr(cl->rpc, h->fh, &msgerr, &isdir, &size);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in getattr");
return err;
struct trivfs_readdir_response__rx_args reply;
restart:
- err = cl->rpc.vtbl.readdir(&cl->rpc, h->fh, h->pos,
+ err = cl->rpc->rpc_tx_vtbl.readdir(cl->rpc, h->fh, h->pos,
&reply.err, reply.name, &reply.isdir, &reply.size);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in readdir");
if (err_no(reply.err) == FS_ERR_INVALID_FH && !restarts++) {
// revalidate handle and try again
if (h->fh == cl->rootfh) { // XXX: revalidate root
- err = cl->rpc.vtbl.getroot(&cl->rpc, &cl->rootfh);
+ err = cl->rpc->rpc_tx_vtbl.getroot(cl->rpc, &cl->rootfh);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed to get root fh");
}
// create child
trivfs_fh_t newfh;
- err = cl->rpc.vtbl.mkdir(&cl->rpc, parent, childname, &msgerr, &newfh);
+ err = cl->rpc->rpc_tx_vtbl.mkdir(cl->rpc, parent, childname, &msgerr, &newfh);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in mkdir");
return err;
return FS_ERR_NOTDIR;
}
- err = cl->rpc.vtbl.delete(&cl->rpc, fh, &msgerr);
+ err = cl->rpc->rpc_tx_vtbl.delete(cl->rpc, fh, &msgerr);
if (err_is_fail(err)) {
DEBUG_ERR(err, "transport error in delete");
return err;
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "bind failed");
}
-
- err = trivfs_rpc_client_init(&cl->rpc, b);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "RPC init failed");
- }
-
+
+ cl->rpc = b;
+ trivfs_rpc_client_init(cl->rpc);
cl->bound = true;
}
}
// get root fh
- err = client->rpc.vtbl.getroot(&client->rpc, &client->rootfh);
+ err = client->rpc->rpc_tx_vtbl.getroot(client->rpc, &client->rootfh);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed to get root fh");
}
}
// Send bulk frame cap to server
- err = client->rpc.vtbl.bulk_init(&client->rpc, shared_frame, &msgerr);
+ err = client->rpc->rpc_tx_vtbl.bulk_init(client->rpc, shared_frame, &msgerr);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "failed to call bulk_init");
} else if (err_is_fail(msgerr)) {
#include <virtio/virtio_guest.h>
#include <if/virtio_defs.h>
-#include <if/virtio_rpcclient_defs.h>
+#include <if/virtio_defs.h>
#include "channel.h"
#include "debug.h"
-static struct virtio_rpc_client virtio_rpc_client;
+static struct virtio_binding *virtio_binding;
static iref_t virtio_rpc_svc_iref;
-enum virtio_rpc_client_state {
+enum virtio_binding_state {
RPC_CLIENT_STATE_INVALID,
RPC_CLIENT_STATE_BINDING,
RPC_CLIENT_STATE_FAILED,
RPC_CLIENT_STATE_READY
};
-static enum virtio_rpc_client_state rpc_client_state = RPC_CLIENT_STATE_INVALID;
+static enum virtio_binding_state rpc_client_state = RPC_CLIENT_STATE_INVALID;
/**
return -1;
}
- err = virtio_rpc_client.vtbl.open(&virtio_rpc_client,
+ err = virtio_binding->rpc_tx_vtbl.open(virtio_binding,
backend,
&msg_err,
ret_frame);
return -1;
}
- err = virtio_rpc_client.vtbl.close(&virtio_rpc_client);
+ err = virtio_binding->rpc_tx_vtbl.close(virtio_binding);
if (err_is_fail(err)) {
return err;
}
uint16_t ndesc = virtio_virtqueue_get_num_desc(vq);
- err = virtio_rpc_client.vtbl.add(&virtio_rpc_client, id, ndesc, buffers, frame, &msg_err);
+ err = virtio_binding->rpc_tx_vtbl.add(virtio_binding, id, ndesc, buffers, frame, &msg_err);
if (err_is_fail(err)) {
return err;
}
return -1;
}
- err = virtio_rpc_client.vtbl.extend(&virtio_rpc_client, vq_id, vbuf, &msg_err);
+ err = virtio_binding->rpc_tx_vtbl.extend(virtio_binding, vq_id, vbuf, &msg_err);
if (err_is_fail(err)) {
return err;
}
return -1;
}
- err = virtio_rpc_client.vtbl.req(&virtio_rpc_client, size, &msg_err, cap);
+ err = virtio_binding->rpc_tx_vtbl.req(virtio_binding, size, &msg_err, cap);
if (err_is_fail(err)) {
return err;
}
}
VIRTIO_DEBUG_CHAN("Initializing RPC client\n");
- err = virtio_rpc_client_init(&virtio_rpc_client, b);
- if (err_is_fail(err)) {
- rpc_client_state = RPC_CLIENT_STATE_FAILED;
- }
-
+ virtio_binding = b;
+ virtio_rpc_client_init(virtio_binding);
vguest_chan_fn = &vguest_fc_fn;
rpc_client_state = RPC_CLIENT_STATE_READY;
#include <virtio/virtio_host.h>
#include <if/virtio_defs.h>
-#include <if/virtio_rpcclient_defs.h>
+#include <if/virtio_defs.h>
#include "channel.h"
#include "device.h"
#include <xeon_phi/xeon_phi_client.h>
#include <if/octopus_defs.h>
-#include <if/octopus_rpcclient_defs.h>
+#include <if/octopus_defs.h>
//#include <if/monitor_defs.h>
#include <octopus/getset.h> // for oct_read TODO
#include <octopus/trigger.h> // for NOP_TRIGGER
#else
errval_t err;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
struct octopus_get_response__rx_args reply;
- err = r->vtbl.get(r, iface, NOP_TRIGGER, reply.output, &reply.tid, &reply.error_code);
+ err = r->rpc_tx_vtbl.get(r, iface, NOP_TRIGGER, reply.output, &reply.tid, &reply.error_code);
if (err_is_fail(err)) {
goto out;
}
#else
errval_t err;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
struct octopus_wait_for_response__rx_args reply;
- err = r->vtbl.wait_for(r, iface, reply.record, &reply.error_code);
+ err = r->rpc_tx_vtbl.wait_for(r, iface, reply.record, &reply.error_code);
if (err_is_fail(err)) {
goto out;
}
#else
errval_t err = SYS_ERR_OK;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
octopus_trigger_id_t tid;
errval_t error_code;
- err = r->vtbl.set(r, record, 0, NOP_TRIGGER, 0, NULL, &tid, &error_code);
+ err = r->rpc_tx_vtbl.set(r, record, 0, NOP_TRIGGER, 0, NULL, &tid, &error_code);
if (err_is_fail(err)) {
goto out;
}
#include <xeon_phi/xeon_phi_manager_client.h>
#include <if/xeon_phi_manager_defs.h>
-#include <if/xeon_phi_manager_rpcclient_defs.h>
+#include <if/xeon_phi_manager_defs.h>
/// the name of the Xeon Phi Manager service
#define XEON_PHI_MANAGER_SERVICE_NAME "xeon_phi_manager"
/// Flounder binind go the Xeon Phi manager
static struct xeon_phi_manager_binding *xpm_binding = NULL;
-static struct xeon_phi_manager_rpc_client xpm_rpc_client;
-
/// connection state
static enum xpm_state conn_state = XPM_STATE_INVALID;
conn_state = XPM_STATE_BIND_OK;
- xeon_phi_manager_rpc_client_init(&xpm_rpc_client, binding);
+ xeon_phi_manager_rpc_client_init(xpm_binding);
DEBUG_XPMC("binding to "XEON_PHI_MANAGER_SERVICE_NAME" succeeded\n");
}
xeon_phi_manager_cards_t cards;
- err = xpm_rpc_client.vtbl.register_driver(&xpm_rpc_client, svc_iref, id,
+ err = xpm_binding->rpc_tx_vtbl.register_driver(xpm_binding, svc_iref, id,
&cards, &msgerr);
if (err_is_fail(err)) {
return err;
return err;
}
- err = xpm_rpc_client.vtbl.lookup(&xpm_rpc_client, xid, svc_iref, &msgerr);
+ err = xpm_binding->rpc_tx_vtbl.lookup(xpm_binding, xid, svc_iref, &msgerr);
if (err_is_fail(err)) {
return err;
}
-- Name of the type of a message function
msg_sig_type :: String -> MessageDef -> Direction -> String
-msg_sig_type ifn m@(RPC _ _ _) _ = idscope ifn (msg_name m) "rpc_method_fn"
+msg_sig_type ifn m@(RPC _ _ _) TX = idscope ifn (msg_name m) "rpc_tx_method_fn"
+msg_sig_type ifn m@(RPC _ _ _) RX = idscope ifn (msg_name m) "rpc_rx_method_fn"
msg_sig_type ifn m TX = idscope ifn (msg_name m) "tx_method_fn"
msg_sig_type ifn m RX = idscope ifn (msg_name m) "rx_method_fn"
-msg_sig_type_rpc_rx :: String -> MessageDef -> String
-msg_sig_type_rpc_rx ifn m@(RPC _ _ _) = idscope ifn (msg_name m) "rpc_rx_method_fn"
-
-- Name of a given message definition
msg_name :: MessageDef -> String
msg_name (Message _ n _ _) = n
import Data.Char
import qualified CAbsSyntax as C
-import Syntax (Interface (Interface), MessageDef(Message, RPC), TypeDef, MessageType(MMessage, MCall, MResponse), RPCArgument(RPCArgIn, RPCArgOut))
-import GHBackend (flounder_backends, export_fn_name, bind_fn_name, accept_fn_name, connect_fn_name, connect_handlers_fn_name, disconnect_handlers_fn_name)
+import Syntax
+import GHBackend (flounder_backends, export_fn_name, bind_fn_name, accept_fn_name, connect_fn_name, connect_handlers_fn_name, disconnect_handlers_fn_name, rpc_tx_vtbl_type, rpc_init_fn_name)
import qualified Backend
import BackendCommon
import LMP (lmp_bind_type, lmp_bind_fn_name)
import qualified Multihop (m_bind_type, m_bind_fn_name)
import Local (local_init_fn_name)
+
+-- import GHBackend (msg_signature_generic, intf_vtbl_param)
+
-- name of the bind continuation function
bind_cont_name :: String -> String
bind_cont_name ifn = ifscope ifn "bind_continuation_direct"
bind_cont_name2 :: String -> String
bind_cont_name2 ifn = ifscope ifn "bind_contination_multihop"
+-- Name of the RPC function
+rpc_fn_name ifn mn = idscope ifn mn "rpc"
+local_rpc_fn_name ifn mn = idscope ifn mn "local_rpc"
+
+-- Name of the RPC vtable
+rpc_vtbl_name ifn = ifscope ifn "rpc_vtbl"
+local_rpc_vtbl_name ifn = ifscope ifn "local_rpc_vtbl"
+
+-- Name of the error handler
+rpc_error_fn_name :: String -> String
+rpc_error_fn_name ifn = ifscope ifn "rpc_client_error"
+
compile :: String -> String -> Interface -> String
compile infile outfile interface =
unlines $ C.pp_unit $ stub_body infile interface
C.MultiComment [ "Disconnect handlers function" ],
disconnect_handlers_fn_def ifn messages,
+ C.Blank,
+
+ C.MultiComment [ "RPC wrapper functions" ],
+ C.UnitList [ rpc_fn ifn types m | m <- rpcs ],
+ C.UnitList [ local_rpc_fn ifn types m | m <- rpcs ],
+ C.Blank,
+
+ C.MultiComment [ "RPC Vtable" ],
+ rpc_vtbl ifn rpcs,
+ local_rpc_vtbl ifn rpcs,
+
+ C.MultiComment [ "RPC init function" ],
+ rpc_init_fn ifn rpcs,
+
C.Blank]
where
C.Param (C.Ptr $ C.Struct "waitset") "waitset",
C.Param (C.TypeName "idc_bind_flags_t") "flags" ]
+rpc_rx_union_elem :: String -> String -> C.Expr
+rpc_rx_union_elem mn fn =
+ C.FieldOf (C.FieldOf (C.DerefField bindvar "rx_union")
+ (rpc_resp_name mn)) fn
+
+rpc_fn :: String -> [TypeDef] -> MessageDef -> C.Unit
+rpc_fn ifn typedefs msg@(RPC n args _) =
+ C.FunctionDef C.Static (C.TypeName "errval_t") (rpc_fn_name ifn n) params [
+ localvar (C.TypeName "errval_t") errvar_name (Just $ C.Variable "SYS_ERR_OK"),
+ C.Ex $ C.Call "assert" [C.Unary C.Not rpc_progress_var],
+ C.Ex $ C.Call "assert" [C.Binary C.Equals async_err_var (C.Variable "SYS_ERR_OK")],
+ C.Ex $ C.Call "thread_set_rpc_in_progress" [C.Variable "true"],
+ C.SBlank,
+ C.SComment "set provided caprefs on underlying binding",
+ binding_save_rx_slots,
+ C.SBlank,
+ C.SComment "call send function",
+ C.Ex $ C.Assignment binding_error (C.Variable "SYS_ERR_OK"),
+ C.Ex $ C.Call "thread_set_outgoing_token" [C.Call "thread_set_token" [message_chanstate]],
+ C.Ex $ C.Assignment errvar $ C.CallInd tx_func tx_func_args,
+ C.If (C.Call "err_is_fail" [errvar]) [
+ C.Goto "out"] [],
+ C.SBlank,
+ C.SComment "wait for message to be sent and reply or error to be present",
+ C.Ex $ C.Assignment errvar $ C.Call "wait_for_channel"
+ [waitset_var, message_chanstate, C.AddressOf binding_error],
+ C.SBlank,
+ C.If (C.Call "err_is_fail" [errvar]) [
+ C.Goto "out"] [],
+ C.SBlank,
+
+ C.StmtList [assign typedefs arg | arg <- rxargs],
+ C.Ex $ C.Assignment errvar $ C.CallInd receive_next [bindvar],
+ C.Label "out",
+ C.Ex $ C.Call "thread_set_rpc_in_progress" [C.Variable "false"],
+ C.Ex $ C.Call "thread_clear_token" [receiving_chanstate],
+ C.Return errvar
+ ]
+ where
+ params = [C.Param (C.Ptr $ C.Struct $ intf_bind_type ifn) intf_bind_var]
+ ++ concat [rpc_argdecl2 TX ifn typedefs a | a <- args]
+ rpc_progress_var = C.Call "thread_get_rpc_in_progress" []
+ async_err_var = C.Call "thread_get_async_error" []
+ waitset_var = C.DerefField bindvar "waitset"
+ tx_func = C.DerefField bindvar "tx_vtbl" `C.FieldOf` (rpc_call_name n)
+ tx_func_args = [bindvar, C.Variable "BLOCKING_CONT"] ++ (map C.Variable $ concat $ map mkargs txargs)
+ mkargs (Arg _ (Name an)) = [an]
+ mkargs (Arg _ (StringArray an _)) = [an]
+ mkargs (Arg _ (DynamicArray an al _)) = [an, al]
+ (txargs, rxargs) = partition_rpc_args args
+ is_cap_arg (Arg (Builtin t) _) = t == Cap || t == GiveAwayCap
+ is_cap_arg (Arg _ _) = False
+ rx_cap_args = filter is_cap_arg rxargs
+ binding_save_rx_slot (Arg tr (Name an)) = C.Ex $
+ C.Call "thread_store_recv_slot" [(C.DerefPtr $ C.Variable an)]
+ binding_save_rx_slots = C.StmtList [ binding_save_rx_slot c | c <- rx_cap_args ]
+ token_name = "token"
+ outgoing_token = bindvar `C.DerefField` "outgoing_token"
+ receiving_chanstate = C.CallInd (bindvar `C.DerefField` "get_receiving_chanstate") [bindvar]
+ binding_error = C.DerefField bindvar "error"
+ message_chanstate = C.Binary C.Plus (C.DerefField bindvar "message_chanstate") (C.Variable $ msg_enum_elem_name ifn (rpc_resp_name n))
+ receive_next = C.DerefField bindvar "receive_next"
+ assign td (Arg tr (Name an)) = case lookup_typeref typedefs tr of
+ TArray t n _ -> C.If (rpc_rx_union_elem n an) [ C.Ex $ C.Call "mem__cpy" [
+ (rpc_rx_union_elem n an),
+ (C.Variable an),
+ C.SizeOfT $ C.TypeName (type_c_name1 ifn n)]][]
+ _ -> C.If (C.Variable an) [
+ C.Ex $ C.Assignment (C.DerefPtr $ C.Variable an) (rpc_rx_union_elem n an)] []
+ assign _ (Arg _ (StringArray an l)) = C.If (C.Variable an) [
+ C.Ex $ C.Call "strncpy" [(C.Variable an), (rpc_rx_union_elem n an), C.NumConstant l]
+ ] []
+ assign _ (Arg _ (DynamicArray an al l)) = C.If (C.Binary C.And (C.Variable an) (C.Variable al)) [
+ C.Ex $ C.Assignment (C.DerefPtr $ C.Variable al) (rpc_rx_union_elem n al),
+ C.Ex $ C.Call "memcpy" [(C.Variable an), (rpc_rx_union_elem n an), C.DerefPtr $ C.Variable al]
+ ] []
+ errvar_name = "_err"
+ errvar = C.Variable errvar_name
+
+
+
+local_rpc_fn :: String -> [TypeDef] -> MessageDef -> C.Unit
+local_rpc_fn ifn typedefs msg@(RPC n args _) =
+ C.FunctionDef C.Static (C.TypeName "errval_t") (local_rpc_fn_name ifn n) params [
+ C.Return $ C.CallInd tx_func (localbindvar:(map C.Variable $ concat $ map mkargs rpc_args))
+ ]
+ where
+ params = [C.Param (C.Ptr $ C.Struct $ intf_bind_type ifn) intf_bind_var]
+ ++ concat [rpc_argdecl2 TX ifn typedefs a | a <- args]
+ rpc_args = map rpc_arg args
+ tx_func = C.DerefField localbindvar "rpc_rx_vtbl" `C.FieldOf` (rpc_call_name n)
+ localbindvar = C.DerefField bindvar "local_binding"
+ rpc_arg (RPCArgIn t v) = Arg t v
+ rpc_arg (RPCArgOut t v) = Arg t v
+ mkargs (Arg _ (Name an)) = [an]
+ mkargs (Arg _ (StringArray an _)) = [an]
+ mkargs (Arg _ (DynamicArray an al _)) = [an, al]
+ (txargs, rxargs) = partition_rpc_args args
+
+rpc_vtbl :: String -> [MessageDef] -> C.Unit
+rpc_vtbl ifn ml =
+ C.StructDef C.Static (rpc_tx_vtbl_type ifn) (rpc_vtbl_name ifn) fields
+ where
+ fields = [let mn = msg_name m in (mn, rpc_fn_name ifn mn) | m <- ml]
+
+local_rpc_vtbl :: String -> [MessageDef] -> C.Unit
+local_rpc_vtbl ifn ml =
+ C.StructDef C.Static (rpc_tx_vtbl_type ifn) (local_rpc_vtbl_name ifn) fields
+ where
+ fields = [let mn = msg_name m in (mn, local_rpc_fn_name ifn mn) | m <- ml]
+
+
+arg_names :: MessageArgument -> [String]
+arg_names (Arg _ v) = var_names v
+ where
+ var_names (Name n) = [n]
+ var_names (StringArray n _) = [n]
+ var_names (DynamicArray n1 n2 _) = [n1, n2]
+
+rpc_init_fn :: String -> [MessageDef] -> C.Unit
+rpc_init_fn ifn ml = C.FunctionDef C.NoScope (C.Void)
+ (rpc_init_fn_name ifn) (rpc_init_fn_params ifn) $
+ [
+ C.SBlank,
+ C.SComment "Setup state of RPC client object",
+ C.If (C.DerefField bindvar "local_binding") [
+ C.Ex $ C.Assignment (C.DerefField bindvar "rpc_tx_vtbl") (C.Variable $ local_rpc_vtbl_name ifn)
+ ][
+ C.Ex $ C.Assignment (C.DerefField bindvar "rpc_tx_vtbl") (C.Variable $ rpc_vtbl_name ifn)
+ ],
+ C.SBlank,
+ C.SComment "Set RX handlers on binding object for RPCs",
+ C.StmtList [C.Ex $ C.Assignment (C.FieldOf (C.DerefField bindvar "rx_vtbl")
+ (rpc_resp_name mn))
+ (C.Variable "NULL") | RPC mn _ _ <- ml],
+ C.Ex $ C.Assignment (bindvar `C.DerefField` "error_handler") (C.Variable "NULL"),
+ C.SBlank,
+ C.ReturnVoid]
+ where
+ rpc_init_fn_params n = [C.Param (C.Ptr $ C.Struct (intf_bind_type n)) "_binding"]
+
----------------------------------------------------------------------------
-- everything that we need to know about a backend to attempt a generic bind
----------------------------------------------------------------------------
bindst = C.Variable "b"
binding = bindst `C.DerefField` "binding"
-iref = bindst `C.DerefField` "iref"
+bind_iref = bindst `C.DerefField` "iref"
waitset = bindst `C.DerefField` "waitset"
flags = bindst `C.DerefField` "flags"
C.Call "malloc" [C.SizeOfT $ C.Struct $ lmp_bind_type ifn],
C.Ex $ C.Call "assert" [C.Binary C.NotEquals binding (C.Variable "NULL")],
C.Ex $ C.Assignment errvar $
- C.Call (lmp_bind_fn_name ifn) [binding, iref, cont, C.Variable "b", waitset,
+ C.Call (lmp_bind_fn_name ifn) [binding, bind_iref, cont, C.Variable "b", waitset,
flags,
C.Variable "DEFAULT_LMP_BUF_WORDS"]
],
C.Ex $ C.Call "assert" [C.Binary C.NotEquals binding (C.Variable "NULL")],
localvar (C.Ptr $ C.Struct "idc_export") "e" $ Nothing,
localvar (C.Ptr $ C.Void) "ret_binding" $ Nothing,
- C.Ex $ C.Assignment errvar $ C.Call "idc_get_service" [iref, C.AddressOf $ C.Variable "e"],
+ C.Ex $ C.Assignment errvar $ C.Call "idc_get_service" [bind_iref, C.AddressOf $ C.Variable "e"],
C.Ex $ C.CallInd (C.DerefField (C.Variable "e") "local_connect_callback") [C.Variable "e", binding, C.AddressOf $ C.Variable "ret_binding"],
C.Ex $ C.Call (local_init_fn_name ifn) [binding, waitset, C.Variable "ret_binding"],
C.Ex $ C.Call cont [C.Variable "b", C.Variable "SYS_ERR_OK", binding]
C.Call "malloc" [C.SizeOfT $ C.Struct $ UMP.bind_type ifn],
C.Ex $ C.Call "assert" [C.Binary C.NotEquals binding (C.Variable "NULL")],
C.Ex $ C.Assignment errvar $
- C.Call (UMP.bind_fn_name ifn) [binding, iref, cont, C.Variable "b", waitset,
+ C.Call (UMP.bind_fn_name ifn) [binding, bind_iref, cont, C.Variable "b", waitset,
flags,
C.Variable "DEFAULT_UMP_BUFLEN",
C.Variable "DEFAULT_UMP_BUFLEN"]
C.Call "malloc" [C.SizeOfT $ C.Struct $ UMP_IPI.bind_type ifn],
C.Ex $ C.Call "assert" [C.Binary C.NotEquals binding (C.Variable "NULL")],
C.Ex $ C.Assignment errvar $
- C.Call (UMP_IPI.bind_fn_name ifn) [binding, iref, cont, C.Variable "b", waitset,
+ C.Call (UMP_IPI.bind_fn_name ifn) [binding, bind_iref, cont, C.Variable "b", waitset,
flags,
C.Variable "DEFAULT_UMP_BUFLEN",
C.Variable "DEFAULT_UMP_BUFLEN"]
C.Call "malloc" [C.SizeOfT $ C.Struct $ Multihop.m_bind_type ifn],
C.Ex $ C.Call "assert" [C.Binary C.NotEquals binding (C.Variable "NULL")],
C.Ex $ C.Assignment errvar $
- C.Call (Multihop.m_bind_fn_name ifn) [binding, iref, cont, C.Variable "b", waitset, flags]],
+ C.Call (Multihop.m_bind_fn_name ifn) [binding, bind_iref, cont, C.Variable "b", waitset, flags]],
test_cb_success = C.Call "err_is_ok" [errvar],
test_cb_try_next = C.Variable "true",
cleanup_bind = [ C.Ex $ C.Call "free" [binding] ]
connect_handlers_fn_name n = ifscope n "connect_handlers"
disconnect_handlers_fn_name n = ifscope n "disconnect_handlers"
+-- Name of the init function
+rpc_init_fn_name :: String -> String
+rpc_init_fn_name ifn = ifscope ifn "rpc_client_init"
+
rpc_rx_vtbl_type ifn = ifscope ifn "rpc_rx_vtbl"
+rpc_tx_vtbl_type ifn = ifscope ifn "rpc_tx_vtbl"
+local_rpc_tx_vtbl_type ifn = ifscope ifn "local_rpc_tx_vtbl"
------------------------------------------------------------------------
-- Language mapping: Create the generic header file for the interface
C.Blank,
C.MultiComment [ "RPC RX function signatures" ],
- C.UnitList [ msg_signature_rpc_rx name types (binding_param name) m
+ C.UnitList [ msg_signature_generic RX name types (binding_param name) m
+ | m <- rpcs ],
+ C.Blank,
+
+ C.MultiComment [ "RPC TX Function signatures" ],
+ C.UnitList [ msg_signature_generic TX name types (binding_param name) m
| m <- rpcs ],
C.Blank,
rpc_rx_vtbl_decl name rpcs,
C.Blank,
+ C.MultiComment [ "VTable struct definition for the rpc interface (transmit)" ],
+ rpc_tx_vtbl_decl name rpcs,
+ C.Blank,
+
C.MultiComment [ "Incoming connect callback type" ],
connect_callback_fn name,
C.Blank,
C.MultiComment [ "Backend-specific includes" ],
C.UnitList $ backend_includes name,
+ C.MultiComment [ "Function to initialise an RPC client" ],
+ rpc_init_fn_proto name,
+
C.MultiComment [ "And we're done" ]
]
-- Generate type definitions for each message signature
--
msg_signature_generic :: Direction -> String -> [TypeDef] -> C.Param -> MessageDef -> C.Unit
-msg_signature_generic dirn ifname typedefs firstparam m = case dirn of
- TX -> C.TypeDef (C.Function C.NoScope (C.TypeName "errval_t") params) name
- RX -> C.TypeDef (C.Function C.NoScope (C.TypeName "void") params) name
+msg_signature_generic dirn ifname typedefs firstparam m =
+ C.TypeDef (C.Function C.NoScope (return_type dirn m) params) name
where
name = msg_sig_type ifname m dirn
continuation = C.Param (C.Struct "event_closure") intf_cont_var
params = [ firstparam ] ++ opt_continuation ++ concat payload
payload = case m of
Message _ _ args _ -> [ msg_argdecl dirn ifname a | a <- args ]
- RPC s args _ -> [ rpc_argdecl2 TX ifname typedefs a | a <- args ]
+ RPC s args _ -> [ rpc_argdecl2 dirn ifname typedefs a | a <- args ]
+ return_type RX m@(Message _ _ _ _) = C.TypeName "void"
+ return_type _ _ = C.TypeName "errval_t"
msg_signature :: Direction -> String -> MessageDef -> C.Unit
msg_signature dir ifn = msg_signature_generic dir ifn [] (binding_param ifn)
-msg_signature_rpc_rx :: String -> [TypeDef] -> C.Param -> MessageDef -> C.Unit
-msg_signature_rpc_rx ifname typedefs firstparam m@(RPC s args _) = C.TypeDef (C.Function C.NoScope (C.TypeName "errval_t") params) name
- where
- name = msg_sig_type_rpc_rx ifname m
- params = [ firstparam ] ++ concat payload
- payload = [rpc_argdecl2 RX ifname typedefs a | a <- args]
-
rpc_rx_vtbl_decl :: String -> [MessageDef] -> C.Unit
rpc_rx_vtbl_decl n ml =
C.StructDecl (rpc_rx_vtbl_type n) [ param n m | m <- ml ]
where
- param ifn m = C.Param (C.Ptr $ C.TypeName $ msg_sig_type_rpc_rx ifn m) ((msg_name m) ++ "_call")
+ param ifn m = C.Param (C.Ptr $ C.TypeName $ msg_sig_type ifn m RX) ((msg_name m) ++ "_call")
+
+rpc_tx_vtbl_decl :: String -> [MessageDef] -> C.Unit
+rpc_tx_vtbl_decl n ml =
+ C.StructDecl (rpc_tx_vtbl_type n) [ intf_vtbl_param n m TX | m <- ml ]
+
--
-- Get the maximum size of the arguments
C.Param (C.Struct $ rpc_rx_vtbl_type n) "rpc_rx_vtbl",
C.ParamBlank,
+ C.ParamComment "RPC send functions (filled in by binding)",
+ C.Param (C.Struct $ rpc_tx_vtbl_type n) "rpc_tx_vtbl",
+ C.ParamBlank,
+
C.ParamComment "Message channels",
C.Param (C.Array (toInteger ((length ml) + 3)) (C.Struct "waitset_chanstate")) "message_chanstate",
C.Param (C.Ptr $ C.Struct "waitset") "ws",
C.Param (C.TypeName "idc_bind_flags_t") "flags" ]
+rpc_init_fn_proto :: String -> C.Unit
+rpc_init_fn_proto n =
+ C.GVarDecl C.Extern C.NonConst
+ (C.Function C.NoScope (C.Void) (rpc_init_fn_params n)) name Nothing
+ where
+ name = rpc_init_fn_name n
+ rpc_init_fn_params n = [C.Param (C.Ptr $ C.Struct (intf_bind_type n)) "binding"]
+
--
-- Generate send function inline wrappers for each message signature
--
-- string and array arguments need special treatment
mkvars (Arg (Builtin String) (Name n)) = [C.Call "strdup" [C.Variable n]]
+ mkvars (Arg _ (StringArray n _)) = [C.Variable n]
mkvars (Arg _ (DynamicArray n l _)) = [C.Variable $ array_copy_name n, C.Variable l]
mkvars (Arg _ (Name n)) = [C.Variable n]
rpc_header_body :: String -> Interface -> [C.Unit]
rpc_header_body infile interface@(Interface name descr decls) = [
- intf_preamble infile name descr,
- C.Blank,
- C.MultiComment [ "RPC client" ],
- C.Blank,
- C.Include C.Standard ("if/" ++ name ++ "_defs.h"),
- C.Blank,
- C.MultiComment [ "Forward declaration of binding type" ],
- C.StructForwardDecl (rpc_bind_type name),
- C.Blank,
- C.MultiComment [ "Function signatures" ],
- C.UnitList [ msg_signature_generic TX name types (rpc_binding_param name) m
- | m <- rpcs ],
- C.Blank,
- C.MultiComment [ "VTable struct definition for the interface" ],
- rpc_vtbl_decl name rpcs,
- C.Blank,
- C.MultiComment [ "The Binding structure" ],
- rpc_binding_struct name,
- C.Blank,
- C.MultiComment [ "Function to initialise an RPC client" ],
- rpc_init_fn_proto name,
C.Blank]
- where
- (types, messagedecls) = Backend.partitionTypesMessages decls
- rpcs = [m | m@(RPC _ _ _) <- messagedecls]
rpc_vtbl_decl :: String -> [MessageDef] -> C.Unit
rpc_vtbl_decl n ml =
C.Include C.Standard "barrelfish/barrelfish.h",
C.Include C.Standard "flounder/flounder_support.h",
C.Include C.Standard ("if/" ++ ifn ++ "_rpcclient_defs.h"),
- C.Blank,
-
- C.MultiComment [ "RPC wrapper functions" ],
- C.UnitList [ rpc_fn ifn types m | m <- rpcs ],
- C.UnitList [ local_rpc_fn ifn types m | m <- rpcs ],
- C.Blank,
-
- C.MultiComment [ "RPC Vtable" ],
- rpc_vtbl ifn rpcs,
- local_rpc_vtbl ifn rpcs,
- C.Blank,
-
-
- C.MultiComment [ "Init function" ],
- rpc_init_fn ifn rpcs]
+ C.Blank]
where
(types, messagedecls) = Backend.partitionTypesMessages decls
rpcs = [m | m@(RPC _ _ _) <- messagedecls]
C.SBlank,
C.SComment "Setup state of RPC client object",
C.Ex $ C.Assignment (C.DerefField rpcvar "b") bindvar,
+
+
+
C.If (C.DerefField bindvar "local_binding") [
C.Ex $ C.Assignment (C.DerefField rpcvar "vtbl") (C.Variable $ local_rpc_vtbl_name ifn)
][
C.Ex $ C.Assignment (C.DerefField rpcvar "vtbl") (C.Variable $ rpc_vtbl_name ifn)
],
+ C.SBlank,
+ C.SComment "Set RX handlers on binding object for RPCs",
+ C.StmtList [C.Ex $ C.Assignment (C.FieldOf (C.DerefField bindvar "rx_vtbl")
+ (rpc_resp_name mn))
+ (C.Variable "NULL") | RPC mn _ _ <- ml],
+
+
+
+
C.Ex $ C.Assignment (C.DerefField bindvar "st") rpcvar,
C.SBlank,
C.SComment "Set RX handlers on binding object for RPCs",
/**
* \file acpi_generic.c
- * \brief
+ * \brief
*/
#include <barrelfish/barrelfish.h>
#include <barrelfish/capabilities.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <mm/mm.h>
ACPI_DEBUG("acpi: initializing allocators\n");
- struct monitor_blocking_rpc_client *cl = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *cl = get_monitor_blocking_binding();
assert(cl != NULL);
ACPI_DEBUG("acpi: obtaining boot info...\n");
USER_PANIC_ERR(err, "slot_alloc for monitor->get_bootinfo");
}
- msgerr = cl->vtbl.get_bootinfo(cl, &err, &bootinfo_frame, &bootinfo_size);
+ msgerr = cl->rpc_tx_vtbl.get_bootinfo(cl, &err, &bootinfo_frame, &bootinfo_size);
if (err_is_fail(msgerr) || err_is_fail(err)) {
USER_PANIC_ERR(err_is_fail(msgerr) ? msgerr : err, "failed in get_bootinfo");
}
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "slot_alloc for monitor->get_phyaddr_cap");
}
- err = cl->vtbl.get_phyaddr_cap(cl, &requested_caps, &msgerr);
+ err = cl->rpc_tx_vtbl.get_phyaddr_cap(cl, &requested_caps, &msgerr);
assert(err_is_ok(err) && err_is_ok(msgerr));
physical_caps = requested_caps;
#include <stdio.h>
#include <stdlib.h>
#include <mm/mm.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <octopus/octopus.h>
#include <skb/skb.h>
/**
* \file acpi_generic.c
- * \brief
+ * \brief
*/
#include <barrelfish/barrelfish.h>
#include <barrelfish/capabilities.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include "acpi_debug.h"
#include "acpi_shared.h"
{
errval_t err;
- struct monitor_blocking_rpc_client *cl = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *cl = get_monitor_blocking_binding();
assert(cl != NULL);
// Request I/O Cap
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "slot_alloc for monitor->get_io_cap");
}
- err = cl->vtbl.get_io_cap(cl, &requested_caps, &error_code);
+ err = cl->rpc_tx_vtbl.get_io_cap(cl, &requested_caps, &error_code);
assert(err_is_ok(err) && err_is_ok(error_code));
// Copy into correct slot
struct capref caps_io = {
#include <vfs/vfs_path.h>
#include <spawndomain/spawndomain.h>
#include <if/arrakis_defs.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
/* #include <timer/timer.h> */
#include "ps.h"
free(image);
/* request connection from monitor */
- struct monitor_blocking_rpc_client *mrpc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mrpc = get_monitor_blocking_binding();
struct capref monep;
- err = mrpc->vtbl.alloc_monitor_ep(mrpc, &msgerr, &monep);
+ err = mrpc->rpc_tx_vtbl.alloc_monitor_ep(mrpc, &msgerr, &monep);
if (err_is_fail(err)) {
return err_push(err, SPAWN_ERR_MONITOR_CLIENT);
} else if (err_is_fail(msgerr)) {
static int freemem(void)
{
- struct mem_rpc_client *mc = get_mem_client();
+ struct mem_binding *mc = get_mem_client();
assert(mc != NULL);
errval_t err;
genpaddr_t available, total;
*/
#include "coreboot.h"
+#include <if/monitor_blocking_defs.h>
extern bool done;
extern coreid_t core_count;
errval_t give_kcb_to_new_core(coreid_t destination_id, struct capref new_kcb)
{
- struct monitor_blocking_rpc_client *mc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mc = get_monitor_blocking_binding();
DEBUG("%s:%s:%d: Send KCB to local monitor for forwarding to destination_id = %"PRIuCOREID"\n",
__FILE__, __FUNCTION__, __LINE__, destination_id);
errval_t ret_err;
- errval_t err = mc->vtbl.forward_kcb_request(mc, destination_id, new_kcb,
+ errval_t err = mc->rpc_tx_vtbl.forward_kcb_request(mc, destination_id, new_kcb,
&ret_err);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "forward_kcb_request failed.");
{
errval_t err, msgerr;
- struct monitor_blocking_rpc_client *mc = get_monitor_blocking_rpc_client();
- err = mc->vtbl.cap_set_remote(mc, cap, true, &msgerr);
+ struct monitor_blocking_binding *mc = get_monitor_blocking_binding();
+ err = mc->rpc_tx_vtbl.cap_set_remote(mc, cap, true, &msgerr);
if (err_is_fail(err)) {
debug_printf("cap_set_remote RPC transmission failed\n");
return err;
#include <spawndomain/spawndomain.h>
#include <if/monitor_defs.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
#include <if/intermon_defs.h>
#if defined(__x86__) && !defined(__k1om__)
#include <acpi_client/acpi_client.h>
-#include <if/acpi_rpcclient_defs.h>
+#include <if/acpi_defs.h>
#endif
#define DEBUG_CPUBOOT 0
#include <getopt.h>
#include "coreboot.h"
#include <hw_records.h>
+#include <if/monitor_blocking_defs.h>
coreid_t my_arch_id;
static void load_arch_id(void)
{
- struct monitor_blocking_rpc_client *mc = get_monitor_blocking_rpc_client();
- errval_t err = mc->vtbl.get_arch_core_id(mc, (uintptr_t *)&my_arch_id);
+ struct monitor_blocking_binding *mc = get_monitor_blocking_binding();
+ errval_t err = mc->rpc_tx_vtbl.get_arch_core_id(mc, (uintptr_t *)&my_arch_id);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "get_arch_core_id failed.");
}
static void load_ipi_cap(void)
{
errval_t err;
- struct monitor_blocking_rpc_client *mc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mc = get_monitor_blocking_binding();
err = slot_alloc(&ipi_cap);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "slot_alloc for monitor->get_ipi_cap failed");
}
- err = mc->vtbl.get_ipi_cap(mc, &ipi_cap);
+ err = mc->rpc_tx_vtbl.get_ipi_cap(mc, &ipi_cap);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "get_ipi_cap failed.");
}
USER_PANIC_ERR(err, "Can not get KCB.");
}
- struct monitor_blocking_rpc_client *mc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mc = get_monitor_blocking_binding();
// send message to monitor to be relocated -> don't switch kcb ->
// remove kcb from ring -> msg ->
// (disp_save_rm_kcb -> next/home/... kcb -> enable switching)
errval_t ret_err;
- err = mc->vtbl.forward_kcb_rm_request(mc, target_id, kcb, &ret_err);
+ err = mc->rpc_tx_vtbl.forward_kcb_rm_request(mc, target_id, kcb, &ret_err);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "forward_kcb_request failed.");
}
#include <arch/x86/start_aps.h>
#include <target/x86_64/offsets_target.h>
#include <target/x86_32/offsets_target.h>
+#include <if/acpi_defs.h>
+#include <if/monitor_blocking_defs.h>
#define MON_URPC_CHANNEL_LEN (32 * UMP_MSG_BYTES)
*arch_page_size = X86_64_BASE_PAGE_SIZE;
*monitor_binary = (cmd_monitor_binary == NULL) ?
"/" BF_BINARY_PREFIX "x86_64/sbin/monitor" :
- get_binary_path("/" BF_BINARY_PREFIX "x86_64/sbin/%s",
+ get_binary_path("/" BF_BINARY_PREFIX "x86_64/sbin/%s",
cmd_monitor_binary);
*cpu_binary = (cmd_kernel_binary == NULL) ?
"/" BF_BINARY_PREFIX "x86_64/sbin/cpu" :
- get_binary_path("/" BF_BINARY_PREFIX "x86_64/sbin/%s",
+ get_binary_path("/" BF_BINARY_PREFIX "x86_64/sbin/%s",
cmd_kernel_binary);
}
break;
*arch_page_size = X86_32_BASE_PAGE_SIZE;
*monitor_binary = (cmd_monitor_binary == NULL) ?
"/" BF_BINARY_PREFIX "x86_32/sbin/monitor" :
- get_binary_path("/" BF_BINARY_PREFIX "x86_32/sbin/%s",
+ get_binary_path("/" BF_BINARY_PREFIX "x86_32/sbin/%s",
cmd_monitor_binary);
*cpu_binary = (cmd_kernel_binary == NULL) ?
"/" BF_BINARY_PREFIX "x86_32/sbin/cpu" :
- get_binary_path("/" BF_BINARY_PREFIX "x86_32/sbin/%s",
+ get_binary_path("/" BF_BINARY_PREFIX "x86_32/sbin/%s",
cmd_kernel_binary);
}
break;
*arch_page_size = X86_64_BASE_PAGE_SIZE;
*monitor_binary = (cmd_kernel_binary == NULL) ?
"/" BF_BINARY_PREFIX "k1om/sbin/monitor" :
- get_binary_path("/" BF_BINARY_PREFIX "k1om/sbin/%s",
+ get_binary_path("/" BF_BINARY_PREFIX "k1om/sbin/%s",
cmd_monitor_binary);
*cpu_binary = (cmd_kernel_binary == NULL) ?
"/" BF_BINARY_PREFIX "k1om/sbin/cpu" :
- get_binary_path("/" BF_BINARY_PREFIX "k1om/sbin/%s",
+ get_binary_path("/" BF_BINARY_PREFIX "k1om/sbin/%s",
cmd_kernel_binary);
}
break;
#else
- struct acpi_rpc_client* acl = get_acpi_rpc_client();
+ struct acpi_binding* acl = get_acpi_binding();
err = slot_alloc(&bootcap);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "slot_alloc for mm_realloc_range_proxy");
}
errval_t error_code;
- err = acl->vtbl.mm_realloc_range_proxy(acl, 16, 0x0,
+ err = acl->rpc_tx_vtbl.mm_realloc_range_proxy(acl, 16, 0x0,
&bootcap, &error_code);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "mm_alloc_range_proxy failed.");
genpaddr_t global;
- struct monitor_blocking_rpc_client *mc =
- get_monitor_blocking_rpc_client();
- err = mc->vtbl.get_global_paddr(mc, &global);
+ struct monitor_blocking_binding *mc =
+ get_monitor_blocking_binding();
+ err = mc->rpc_tx_vtbl.get_global_paddr(mc, &global);
if (err_is_fail(err)) {
DEBUG_ERR(err, "invoke spawn core");
return err_push(err, MON_ERR_SPAWN_CORE);
uint8_t *real_end = (uint8_t *) &x86_32_start_ap_end;
struct capref bootcap;
- struct acpi_rpc_client* acl = get_acpi_rpc_client();
+ struct acpi_binding* acl = get_acpi_binding();
errval_t err, error_code;
err = slot_alloc(&bootcap);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "slot_alloc for mm_alloc_range_proxy");
}
- err = acl->vtbl.mm_realloc_range_proxy(acl, 16, 0x0,
+ err = acl->rpc_tx_vtbl.mm_realloc_range_proxy(acl, 16, 0x0,
&bootcap, &error_code);
if (err_is_fail(err)) {
USER_PANIC_ERR(err, "mm_alloc_range_proxy failed.");
genpaddr_t global;
- struct monitor_blocking_rpc_client *mc =
- get_monitor_blocking_rpc_client();
- err = mc->vtbl.get_global_paddr(mc, &global);
+ struct monitor_blocking_binding *mc =
+ get_monitor_blocking_binding();
+ err = mc->rpc_tx_vtbl.get_global_paddr(mc, &global);
if (err_is_fail(err)) {
DEBUG_ERR(err, "invoke spawn core");
return err_push(err, MON_ERR_SPAWN_CORE);
#include <acpi_client/acpi_client.h>
#ifdef VF
# include <if/e10k_vf_defs.h>
-# include <if/e10k_vf_rpcclient_defs.h>
+# include <if/e10k_vf_defs.h>
# include <dev/e10k_vf_dev.h>
#endif
static uint32_t pci_device = PCI_DONT_CARE;
static uint32_t pci_function = 0;
-static struct e10k_vf_rpc_client *e10k_vf_client = NULL;
+static struct e10k_vf_binding *e10k_vf_client = NULL;
static void setup_interrupt(size_t *msix_index, uint8_t core, uint8_t vector)
{
assert(initialized);
// Tell PF driver
- err = e10k_vf_client->vtbl.init_done(e10k_vf_client, vf_num);
+ err = e10k_vf_client->rpc_tx_vtbl.init_done(e10k_vf_client, vf_num);
assert(err_is_ok(err));
#if 0
{
assert(err_is_ok(err));
- struct e10k_vf_rpc_client *r = malloc(sizeof(*r));
+ struct e10k_vf_binding *r = malloc(sizeof(*r));
assert(r != NULL);
- err = e10k_vf_rpc_client_init(r, b);
+ err = e10k_vf_binding_init(r, b);
if (err_is_ok(err)) {
e10k_vf_client = r;
} else {
messages_wait_and_handle_next();
}
- err = e10k_vf_client->vtbl.get_mac_address(e10k_vf_client, vf_num, &d_mac);
+ err = e10k_vf_client->rpc_tx_vtbl.get_mac_address(e10k_vf_client, vf_num, &d_mac);
assert(err_is_ok(err));
return err2;
#include <barrelfish/debug.h>
#include <if/sfn5122f_defs.h>
#include <if/sfn5122f_devif_defs.h>
-#include <if/sfn5122f_devif_rpcclient_defs.h>
-#include <if/net_ARP_rpcclient_defs.h>
+#include <if/sfn5122f_devif_defs.h>
+#include <if/net_ARP_defs.h>
#include <if/net_ARP_defs.h>
static uint32_t wol_filter_id = 0;
// ARP rpc client
-static struct net_ARP_rpc_client arp_rpc;
+static struct net_ARP_binding arp_rpc;
static bool net_arp_connected = false;
static struct waitset rpc_ws;
uint32_t gw;
uint32_t mask;
- err = arp_rpc.vtbl.ip_info(&arp_rpc, 0, &msgerr, &ip, &gw, &mask);
+ err = arp_rpc->rpc_tx_vtbl.ip_info(&arp_rpc, 0, &msgerr, &ip, &gw, &mask);
if (err_is_fail(err)) {
return err;
}
static void a_bind_cb(void *st, errval_t err, struct net_ARP_binding *b)
{
assert(err_is_ok(err));
- err = net_ARP_rpc_client_init(&arp_rpc, b);
+ err = net_ARP_binding_init(&arp_rpc, b);
assert(err_is_ok(err));
net_arp_connected = true;
}
#define USB_TRANSFER_H_
#include <if/usb_manager_defs.h>
-#include <if/usb_manager_rpcclient_defs.h>
+#include <if/usb_manager_defs.h>
struct usb_device;
struct usb_xfer;
#include <barrelfish/spawn_client.h>
#include <if/usb_manager_defs.h>
-#include <if/usb_manager_rpcclient_defs.h>
+#include <if/usb_manager_defs.h>
#include <usb/usb.h>
#include <usb/class/usb_hid.h>
#include <if/usb_driver_defs.h>
#include <if/usb_manager_defs.h>
-#include <if/usb_manager_rpcclient_defs.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/usb_manager_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <usb_controller.h>
#include <usb_request.h>
/* the default tuple size is 2, since on x86 the interrupts can be routed */
uint8_t arg_tuple_size = 2;
- struct monitor_blocking_rpc_client *cl = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *cl = get_monitor_blocking_binding();
assert(cl != NULL);
uint32_t arch, platform;
- err = cl->vtbl.get_platform(cl, &arch, &platform);
+ err = cl->rpc_tx_vtbl.get_platform(cl, &arch, &platform);
assert(err_is_ok(err));
if (arch == PI_ARCH_ARMV7A && platform == PI_PLATFORM_OMAP44XX) {
#include <barrelfish/barrelfish.h>
#include <if/usb_manager_defs.h>
-#include <if/usb_manager_rpcclient_defs.h>
+#include <if/usb_manager_defs.h>
#include <usb/usb.h>
#include <usb/usb_request.h>
#include <octopus/octopus.h>
#include <if/octopus_defs.h>
-#include <if/octopus_rpcclient_defs.h>
+#include <if/octopus_defs.h>
#include <if/octopus_thc.h>
#include "xeon_phi_internal.h"
{
errval_t err;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
struct octopus_get_response__rx_args reply;
- err = r->vtbl.get(r, iface, NOP_TRIGGER, reply.output, &reply.tid,
+ err = r->rpc_tx_vtbl.get(r, iface, NOP_TRIGGER, reply.output, &reply.tid,
&reply.error_code);
if (err_is_fail(err)) {
goto out;
{
errval_t err = SYS_ERR_OK;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
+ struct octopus_binding *r = get_octopus_binding();
if (r == NULL) {
return LIB_ERR_NAMESERVICE_NOT_BOUND;
}
octopus_trigger_id_t tid;
errval_t error_code;
- err = r->vtbl.set(r, record, 0, NOP_TRIGGER, 0, NULL, &tid, &error_code);
+ err = r->rpc_tx_vtbl.set(r, record, 0, NOP_TRIGGER, 0, NULL, &tid, &error_code);
if (err_is_fail(err)) {
goto out;
}
struct xeon_phi *phi = topology->local;
- err = xeon_phi_driver_register_response__tx(topology->binding, txcont, err,
+ err = xeon_phi_driver_register__response__tx(topology->binding, txcont, err,
phi->apt.pbase, phi->apt.length);
if (err_is_fail(err)) {
if (err_no(err) == FLOUNDER_ERR_TX_BUSY) {
topology->state = XNODE_STATE_REGISTERING;
- err = xeon_phi_driver_register_call__tx(topology->binding, txcont, phi->id,
+ err = xeon_phi_driver_register__call__tx(topology->binding, txcont, phi->id,
phi->apt.pbase, phi->apt.length);
if (err_is_fail(err)) {
if (err_no(err) == FLOUNDER_ERR_TX_BUSY) {
/// Receive handler table
static struct xeon_phi_driver_rx_vtbl xps_rx_vtbl = {
- .register_call = register_call_recv,
- .register_response = register_response_recv,
+ .register__call = register_call_recv,
+ .register__response = register_response_recv,
.bootstrap_call = bootstrap_call_rx,
.bootstrap_response = bootstrap_response_rx
};
return SYS_ERR_OK;
}
-
#include <barrelfish/nameservice_client.h>
#include <if/xmplrpc_defs.h>
-#include <if/xmplrpc_rpcclient_defs.h>
+#include <if/xmplrpc_defs.h>
const char *service_name = "xmplrpc_rpc_service";
/* --------------------- Client ------------------------------ */
-static struct xmplrpc_rpc_client xmplrpc_client;
+static struct xmplrpc_binding xmplrpc_client;
static void send_myrpc(void)
{
debug_printf("client: sending myrpc\n");
in = 42;
- err = xmplrpc_client.vtbl.myrpc(&xmplrpc_client, in, &s_out);
+ err = xmplrpc_client->rpc_tx_vtbl.myrpc(&xmplrpc_client, in, &s_out);
if (err_is_ok(err)) {
debug_printf("client: myrpc(in: %u, out: '%s')\n", in, s_out);
USER_PANIC_ERR(err, "bind failed");
}
- xmplrpc_rpc_client_init(&xmplrpc_client, b);
- printf("client: finished xmlrpc_rpc_client_init\n");
+ xmplrpc_binding_init(&xmplrpc_client, b);
+ printf("client: finished xmlrpc_binding_init\n");
send_myrpc();
}
#include <stdlib.h>
#include <barrelfish/barrelfish.h>
#include <barrelfish/nameservice_client.h>
-#include <if/fb_rpcclient_defs.h>
+#include <if/fb_defs.h>
#include "demo.h"
-static struct fb_rpc_client fb_client;
+static struct fb_binding *fb_client;
static bool init = false;
static void fb_bind_cb(void *st, errval_t err, struct fb_binding *b)
{
assert(err_is_ok(err));
- err = fb_rpc_client_init(&fb_client, b);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "error in mem_rpc_client_init");
- }
-
+ fb_client = b;
+ fb_rpc_client_init(fb_client);
init = true;
}
void wait_for_vsync(void)
{
- errval_t err = fb_client.vtbl.vsync(&fb_client);
+ errval_t err = fb_client->rpc_tx_vtbl.vsync(fb_client);
assert(err_is_ok(err));
}
fb_client_connect();
- err = fb_client.vtbl.set_videomode(&fb_client, xres, yres, bpp, &ret);
+ err = fb_client->rpc_tx_vtbl.set_videomode(fb_client, xres, yres, bpp, &ret);
assert(err_is_ok(err));
if(err_is_fail(ret)) {
fprintf(stderr, "Error: failed to set video mode %dx%d %dbpp\n",
// Get and map framebuffer
struct capref fbcap;
uint32_t fboffset;
- err = fb_client.vtbl.get_framebuffer(&fb_client, &ret, &fbcap, &fboffset);
+ err = fb_client->rpc_tx_vtbl.get_framebuffer(fb_client, &ret, &fbcap, &fboffset);
assert(err_is_ok(err));
assert(err_is_ok(ret));
#include <vfs/vfs_path.h>
#include <if/pixels_defs.h>
-#include <if/octopus_rpcclient_defs.h>
+#include <if/octopus_defs.h>
#include <octopus/getset.h> // for oct_read TODO
#include <octopus/trigger.h> // for NOP_TRIGGER
#include <octopus/init.h> // oct_init
static int freecmd(int argc, char *argv[])
{
- struct mem_rpc_client *mc = get_mem_client();
+ struct mem_binding *mc = get_mem_client();
assert(mc != NULL);
errval_t err;
genpaddr_t available, total;
oct_init();
struct octopus_get_names_response__rx_args reply;
- struct octopus_rpc_client *r = get_octopus_rpc_client();
- err = r->vtbl.get_names(r, spawnds, NOP_TRIGGER, reply.output,
+ struct octopus_binding *r = get_octopus_binding();
+ err = r->rpc_tx_vtbl.get_names(r, spawnds, NOP_TRIGGER, reply.output,
&reply.tid, &reply.error_code);
if (err_is_fail(err) || err_is_fail(reply.error_code)) {
DEBUG_ERR(err, "get_names failed");
#include <hw_records_arch.h>
#include <barrelfish/barrelfish.h>
#include <barrelfish_kpi/platform.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <skb/skb.h>
#include <octopus/getset.h>
}
}
- struct monitor_blocking_rpc_client *m = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *m = get_monitor_blocking_binding();
assert(m != NULL);
uint32_t arch, platform;
- err = m->vtbl.get_platform(m, &arch, &platform);
+ err = m->rpc_tx_vtbl.get_platform(m, &arch, &platform);
assert(err_is_ok(err));
assert(arch == PI_ARCH_ARMV7A);
struct arch_info_armv7 *arch_info= (struct arch_info_armv7 *)buf;
size_t buflen;
- err = m->vtbl.get_platform_arch(m, buf, &buflen);
+ err = m->rpc_tx_vtbl.get_platform_arch(m, buf, &buflen);
assert(buflen == sizeof(struct arch_info_armv7));
/* Query the SKB for the available cores on this platform - we can't
#include <barrelfish/barrelfish.h>
#include <barrelfish/spawn_client.h>
#include <barrelfish_kpi/platform.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <arch/arm/omap44xx/device_registers.h>
#include <omap44xx_map.h>
errval_t err;
- struct monitor_blocking_rpc_client *m=
- get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *m=
+ get_monitor_blocking_binding();
assert(m != NULL);
uint32_t arch, platform;
- err = m->vtbl.get_platform(m, &arch, &platform);
+ err = m->rpc_tx_vtbl.get_platform(m, &arch, &platform);
assert(err_is_ok(err));
assert(arch == PI_ARCH_ARMV7A);
#include <barrelfish/barrelfish.h>
#include <skb/skb.h>
#include <barrelfish_kpi/platform.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include "kaluga.h"
{
errval_t err = SYS_ERR_OK;
- struct monitor_blocking_rpc_client *m = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *m = get_monitor_blocking_binding();
assert(m != NULL);
uint32_t arch, platform;
- err = m->vtbl.get_platform(m, &arch, &platform);
+ err = m->rpc_tx_vtbl.get_platform(m, &arch, &platform);
assert(err_is_ok(err));
assert(arch == PI_ARCH_ARMV8A);
#include <stdio.h>
#include <stdlib.h>
#include <mm/mm.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include "kaluga.h"
errval_t err, error_code;
// Request I/O Cap
- struct monitor_blocking_rpc_client *cl = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *cl = get_monitor_blocking_binding();
assert(cl != NULL);
struct capref requested_cap;
err = slot_alloc(&requested_cap);
assert(err_is_ok(err));
- err = cl->vtbl.get_io_cap(cl, &requested_cap, &error_code);
+ err = cl->rpc_tx_vtbl.get_io_cap(cl, &requested_cap, &error_code);
assert(err_is_ok(err) && err_is_ok(error_code));
// Initialize the memory allocator to handle PhysAddr caps
#include <pci/pci.h> // for pci_address
#ifdef __arm__
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#endif
#ifdef __aarch64__
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#endif
#include "kaluga.h"
/* debug_printf("doing pandaboard related setup...\n"); */
/* errval_t err; */
-/* struct monitor_blocking_rpc_client *cl = get_monitor_blocking_rpc_client(); */
+/* struct monitor_binding *cl = get_monitor_blocking_binding(); */
/* assert(cl != NULL); */
/* // Request I/O Cap */
/* struct capref requested_caps; */
/* errval_t error_code; */
-/* err = cl->vtbl.get_io_cap(cl, &requested_caps, &error_code); */
+/* err = cl->rpc_tx_vtbl.get_io_cap(cl, &requested_caps, &error_code); */
/* assert(err_is_ok(err) && err_is_ok(error_code)); */
/* // Copy into correct slot */
#if 0
static bool in_rpc_init = false;
- if (do_rpc_init && !in_rpc_init && !get_monitor_blocking_rpc_client()) {
+ if (do_rpc_init && !in_rpc_init && !get_monitor_blocking_binding()) {
// XXX: this is an ugly hack try and get a monitor rpc client once
// the monitor is ready
in_rpc_init = true;
#include <dist/barrier.h>
#include <if/mem_defs.h>
-#include <if/mem_rpcclient_defs.h>
+#include <if/mem_defs.h>
#include <if/monitor_defs.h>
// #include "barrier.h"
#include <dist/barrier.h>
#include <if/mem_defs.h>
-#include <if/mem_rpcclient_defs.h>
#include <if/monitor_defs.h>
-#include <if/spawn_rpcclient_defs.h>
+#include <if/spawn_defs.h>
#include "skb.h"
#include "args.h"
/*
* TODO:
- * - currently requests too much memory from initial mem_serv and other
+ * - currently requests too much memory from initial mem_serv and other
* (non_dist) mem_serv clients may suffer
*/
/// MM per-core allocator instance data: B-tree to manage mem regions
struct mm mm_percore;
-// static storage for MM allocator to get it started
+// static storage for MM allocator to get it started
static char percore_nodebuf[SLAB_STATIC_SIZE(MINSPARENODES,
MM_NODE_SIZE(MAXCHILDBITS))];
/// MM allocator for reserve of emergency memory used within the mem_serv only
struct mm mm_local;
-// static storage for MM allocator to get it started
+// static storage for MM allocator to get it started
static char local_nodebuf[SLAB_STATIC_SIZE(MINSPARENODES,
MM_NODE_SIZE(MAXCHILDBITS))];
{
errval_t err;
- // refill slab allocator if needed
+ // refill slab allocator if needed
while (slab_freecount(slabs) <= MINSPARENODES) {
- // debug_printf("running low on free slabs: slabs=%ld\n",
+ // debug_printf("running low on free slabs: slabs=%ld\n",
// slab_freecount(&mm_percore.slabs));
struct capref frame;
err = slot_alloc(&frame);
return SYS_ERR_OK;
}
-static errval_t percore_free(struct capref ramcap)
+static errval_t percore_free(struct capref ramcap)
{
struct capability info;
errval_t ret;
#if 0
printf("%d: Cap is type %d Ram base 0x%"PRIxGENPADDR
" (%"PRIuGENPADDR") Bits %d\n", disp_get_core_id(),
- info.type, info.u.ram.base, info.u.ram.base,
+ info.type, info.u.ram.base, info.u.ram.base,
info.u.ram.bits);
#endif
return do_free(&mm_percore, ramcap, base, bits, &mem_avail);
}
-memsize_t mem_available_handler_common(void)
+memsize_t mem_available_handler_common(void)
{
return mem_avail;
}
return err;
}
-static errval_t get_more_ram(uint8_t bits, genpaddr_t minbase,
+static errval_t get_more_ram(uint8_t bits, genpaddr_t minbase,
genpaddr_t maxlimit)
{
errval_t err;
// make the cap available for a subsequent alloc
percore_free(cap);
- return SYS_ERR_OK;
+ return SYS_ERR_OK;
}
static errval_t do_slot_prealloc_refill(struct slot_prealloc *slot_alloc_inst)
}
errval_t percore_allocate_handler_common(uint8_t bits,
- genpaddr_t minbase,
+ genpaddr_t minbase,
genpaddr_t maxlimit,
struct capref *retcap)
{
trace_event(TRACE_SUBSYS_MEMSERV, TRACE_EVENT_MEMSERV_PERCORE_ALLOC, bits);
- // refill slot allocator if needed
+ // refill slot allocator if needed
err = do_slot_prealloc_refill(mm_slots->slot_alloc_inst);
if (err_is_fail(err)) {
DEBUG_ERR(err, "Warning: failure in slot_prealloc_refill");
}
- // refill slab allocators if needed
+ // refill slab allocators if needed
err = slab_refill(&mm_percore.slabs);
if (err_is_fail(err)) {
DEBUG_ERR(err, "Warning: failure when refilling mm_percore slab");
memsize_t all_mem_avail, mem_percore, tot_mem;
// send message to mem_serv
- struct mem_rpc_client *b = get_mem_client();
- err = b->vtbl.available(b, &all_mem_avail, &tot_mem);
+ struct mem_binding *b = get_mem_client();
+ err = b->rpc_tx_vtbl.available(b, &all_mem_avail, &tot_mem);
if (err_is_fail(err)) {
DEBUG_ERR(err, "Warning: failure in call to mem_serv.available");
return PERCORE_MEM;
}
- debug_printf("available memory: %"PRIuMEMSIZE" bytes over %d cores\n",
+ debug_printf("available memory: %"PRIuMEMSIZE" bytes over %d cores\n",
all_mem_avail, num_cores);
mem_percore = all_mem_avail / num_cores;
- debug_printf("available memory per core: %"PRIuMEMSIZE" bytes\n",
+ debug_printf("available memory per core: %"PRIuMEMSIZE" bytes\n",
mem_percore);
return mem_percore;
#else
// Use predetermined amount of memory per core
- debug_printf("available memory per core: %"PRIuMEMSIZE" bytes\n",
+ debug_printf("available memory per core: %"PRIuMEMSIZE" bytes\n",
PERCORE_MEM);
return PERCORE_MEM;
#endif
-static memsize_t fill_mm(struct mm *mm, memsize_t mem_requested, uint8_t bits,
+static memsize_t fill_mm(struct mm *mm, memsize_t mem_requested, uint8_t bits,
memsize_t *mem_tot)
{
errval_t err;
struct capref ramcap;
struct capability info;
- // get as much of the requested memory as we can, requesting ever
+ // get as much of the requested memory as we can, requesting ever
// smaller RAM caps until we hit the smallest RAM cap size
while (bits >= MINALLOCBITS) {
- // debug_printf("adding memory %"PRIuMEMSIZE" (%d bits)\n",
+ // debug_printf("adding memory %"PRIuMEMSIZE" (%d bits)\n",
// (memsize_t)1<<bits, bits);
err = ram_alloc(&ramcap, bits);
// skip this size and try the next size down
bits--;
continue;
- }
+ }
// XXX: Hack until we have cross-core cap management
// Forget about remote relations of this cap. This will ensure
#if 0
debug_printf("Cap is type %d Ram base 0x%"PRIxGENPADDR
" (%"PRIuGENPADDR") Bits %d\n",
- info.type, info.u.ram.base, info.u.ram.base,
+ info.type, info.u.ram.base, info.u.ram.base,
info.u.ram.bits);
#endif
assert(bits == log2ceil(info.u.ram.bytes));
return err_push(err, MM_ERR_MM_ADD);
}
- // try to refill slot allocator (may fail or do nothing)
+ // try to refill slot allocator (may fail or do nothing)
slot_prealloc_refill(mm->slot_alloc_inst);
return SYS_ERR_OK;
.slot = 0,
};
- // init slot allocator
+ // init slot allocator
err = slot_prealloc_init(slot_alloc_inst, MAXCHILDBITS,
cnode_start_cap, L2_CNODE_SLOTS, mm);
if (err_is_fail(err)) {
return SYS_ERR_OK;
}
-errval_t initialize_percore_mem_serv(coreid_t core, coreid_t *cores,
+errval_t initialize_percore_mem_serv(coreid_t core, coreid_t *cores,
int len_cores, memsize_t percore_mem)
{
errval_t err;
// TODO: is this necessary?
slot_prealloc_refill(mm_slots->slot_alloc_inst);
- // refill slab allocator if needed and possible
+ // refill slab allocator if needed and possible
if (slab_freecount(&mm_percore.slabs) <= MINSPARENODES
&& mem_avail > (1UL << (CNODE_BITS + OBJBITS_CTE)) * 2
+ 10 * BASE_PAGE_SIZE) {
*/
errval_t set_local_spawnd_memserv(coreid_t coreid)
{
- struct spawn_rpc_client *cl;
- errval_t err = spawn_rpc_client(coreid, &cl);
+ struct spawn_binding *cl;
+ errval_t err = spawn_binding(coreid, &cl);
if (err_is_fail(err)) {
return err;
}
- return cl->vtbl.use_local_memserv(cl);
+ return cl->rpc_tx_vtbl.use_local_memserv(cl);
}
// debug_printf("Distributed mem_serv. percore server on core %d\n", core);
// this should never return
- percore_mem_serv(core, args->cores, args->cores_len, args->ram);
+ percore_mem_serv(core, args->cores, args->cores_len, args->ram);
return EXIT_FAILURE; // so we should never reach here
}
if (args->ram > 0) {
percore_mem = args->ram;
} else {
- percore_mem = get_percore_size(args->cores_len);
+ percore_mem = get_percore_size(args->cores_len);
}
// debug_printf("spawning on %d cores\n", args->cores_len);
// -r <percore_mem>
char *new_argv[7];
new_argv[0] = args->path;
- new_argv[1] = "-w";
+ new_argv[1] = "-w";
new_argv[2] = "-c";
new_argv[3] = list_to_string(args->cores, args->cores_len);
assert(new_argv[3] != NULL);
new_argv[6] = NULL;
for (int i = 0; i < args->cores_len; i++) {
- err = spawn_program(args->cores[i], new_argv[0], new_argv,
+ err = spawn_program(args->cores[i], new_argv[0], new_argv,
NULL, 0, NULL);
if (err_is_fail(err)) {
DEBUG_ERR(err, "spawning percore mem_serv on core %d", i);
return run_master(core, &my_args);
} else {
return run_worker(core, &my_args);
- }
+ }
return EXIT_SUCCESS;
}
#include <trace_definitions/trace_defs.h>
#include <mm/mm.h>
#include <if/mem_defs.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <thc/thc.h>
#include <thc/thcsync.h>
#include <if/mem_defs.h>
-#include <if/mem_rpcclient_defs.h>
+#include <if/mem_defs.h>
#include <if/mem_thc.h>
// #include "barrier.h"
#include <thc/thcsync.h>
#include <if/mem_defs.h>
-#include <if/mem_rpcclient_defs.h>
+#include <if/mem_defs.h>
#include <if/mem_thc.h>
#include <if/monitor_defs.h>
#include "delete_int.h"
#include "internal.h"
#include "ram_alloc.h"
-#include <if/mem_rpcclient_defs.h>
+#include <if/mem_defs.h>
struct delete_remote_mc_st {
struct capsend_mc_st mc_st;
struct ram_alloc_state *ram_alloc_state = get_ram_alloc_state();
thread_mutex_lock(&ram_alloc_state->ram_alloc_lock);
- struct mem_rpc_client *b = get_mem_client();
+ struct mem_binding *b = get_mem_client();
if (!b) {
DEBUG_CAPOPS("%s: forwarding to monitor.0\n", __FUNCTION__);
// we're not on core 0, so forward free_monitor msg to monitor.0
DEBUG_CAPOPS("%s: we are monitor.0\n", __FUNCTION__);
// XXX: This should not be an RPC! It could stall the monitor, but
// we trust mem_serv for the moment.
- err = b->vtbl.free_monitor(b, cap, ram.base, log2ceil(ram.bytes), &result);
+ err = b->rpc_tx_vtbl.free_monitor(b, cap, ram.base, log2ceil(ram.bytes), &result);
assert(err_is_ok(err));
assert(err_is_ok(result));
}
#include <barrelfish/core_state.h>
#include <barrelfish/dispatch.h>
#include "monitor.h"
-#include <if/mem_rpcclient_defs.h>
+#include <if/mem_defs.h>
#if !defined(__arm__) && !defined(__aarch64__)
static errval_t reclaim_memory(genpaddr_t base, uint8_t bits)
struct ram_alloc_state *ram_alloc_state = get_ram_alloc_state();
errval_t result;
thread_mutex_lock(&ram_alloc_state->ram_alloc_lock);
- struct mem_rpc_client *b = get_mem_client();
+ struct mem_binding *b = get_mem_client();
// XXX: This should not be an RPC! It could stall the monitor, but
// we trust mem_serv for the moment.
- err = b->vtbl.free_monitor(b, ramcap, base, bits, &result);
+ err = b->rpc_tx_vtbl.free_monitor(b, ramcap, base, bits, &result);
thread_mutex_unlock(&ram_alloc_state->ram_alloc_lock);
if(err_is_fail(err)) {
return err;
* ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
*/
-#include <if/octopus_rpcclient_defs.h>
+#include <if/octopus_defs.h>
#include <octopus/getset.h> // for oct_read TODO
#include <octopus/trigger.h> // for NOP_TRIGGER
#include "monitor.h"
if (err_is_ok(err)) {
b->error_handler = error_handler;
- struct octopus_rpc_client *r;
- r = malloc(sizeof(struct octopus_rpc_client));
- assert(r != NULL);
- err = octopus_rpc_client_init(r, b);
- if (err_is_fail(err)) {
- free(r);
- USER_PANIC_ERR(err, "error in nameservice_rpc_client_init");
- } else {
- set_octopus_rpc_client(r);
- }
+ octopus_rpc_client_init(b);
+ set_octopus_binding(b);
}
st->err = err;
};
debug_printf("%s: storing cap\n", __FUNCTION__);
- struct octopus_rpc_client *orpc = get_octopus_rpc_client();
- err = orpc->vtbl.put_cap(orpc, kcb_key, bspkcb, &octerr);
+ struct octopus_binding *orpc = get_octopus_binding();
+ err = orpc->rpc_tx_vtbl.put_cap(orpc, kcb_key, bspkcb, &octerr);
if (err_is_fail(err)) {
DEBUG_ERR(err, "oct_put_capability(bspkcb)");
return err;
return err;
}
debug_printf("%s: setting mapping\n", __FUNCTION__);
- err = orpc->vtbl.set(orpc, mapping, SET_DEFAULT, NOP_TRIGGER, false,
+ err = orpc->rpc_tx_vtbl.set(orpc, mapping, SET_DEFAULT, NOP_TRIGGER, false,
NULL, NULL, &octerr);
if (err_is_fail(err)) {
DEBUG_ERR(err, "oct_set(\"kcb.0 { ... }\")");
#include "monitor.h"
#include "capops.h"
#include <if/monitor_mem_defs.h>
-#include <if/monitor_mem_rpcclient_defs.h>
-#include <if/mem_rpcclient_defs.h>
+#include <if/monitor_mem_defs.h>
+#include <if/mem_defs.h>
static uint8_t mem_core_id;
-static struct monitor_mem_rpc_client monitor_mem_client;
+static struct monitor_mem_binding *monitor_mem_client;
static bool mem_setup_complete = false;
iref_t monitor_mem_iref = 0;
}
DEBUG_CAPOPS("%s: created local copy, sending to memserv\n", __FUNCTION__);
- struct mem_rpc_client *mb = get_mem_client();
+ struct mem_binding *mb = get_mem_client();
assert(mb);
- err = mb->vtbl.free_monitor(mb, cap, base, bits, result);
+ err = mb->rpc_tx_vtbl.free_monitor(mb, cap, base, bits, result);
if (err_is_fail(err)) {
*result = err;
}
intermon_caprep_t caprep;
errval_t reterr;
- err = monitor_mem_client.vtbl.alloc(&monitor_mem_client, size_bits,
+ err = monitor_mem_client->rpc_tx_vtbl.alloc(monitor_mem_client, size_bits,
minbase, maxlimit, my_core_id, &reterr,
(monitor_mem_caprep_t *) &caprep);
if (err_is_fail(err)) {
}
// setup RPC client above binding
- err = monitor_mem_rpc_client_init(&monitor_mem_client, b);
- if(err_is_fail(err)) {
- DEBUG_ERR(err, "in monitor_mem_rpc_client_init");
- } else {
- mem_setup_complete = true;
- }
+ monitor_mem_client = b;
+ monitor_mem_rpc_client_init(monitor_mem_client);
+ mem_setup_complete = true;
}
errval_t mon_ram_alloc_init(coreid_t core_id, struct intermon_binding *b)
STATIC_ASSERT_SIZEOF(caprep, sizeof(caprep2));
memcpy(&caprep2, &caprep, sizeof(caprep));
- err = monitor_mem_client.vtbl.free(&monitor_mem_client, caprep2, base, bits, &status);
+ err = monitor_mem_client->rpc_tx_vtbl.free(monitor_mem_client, caprep2, base, bits, &status);
if (err_is_fail(err)) {
return err;
}
return status;
}
-
#include <dev/ht_config_dev.h>
#include "pci_debug.h"
-#include <if/acpi_rpcclient_defs.h>
+#include <if/acpi_defs.h>
#define BAR_PROBE 0xffffffff
pciaddr_t high,
pcisize_t size)
{
- struct acpi_rpc_client* acl = get_acpi_rpc_client();
+ struct acpi_binding* acl = get_acpi_binding();
struct device_caps *c = &dev_caps[bus][dev][fun][idx];
errval_t err;
errval_t error_code;
err = slot_alloc(&c->phys_cap[i]);
assert(err_is_ok(err));
- err = acl->vtbl.mm_alloc_range_proxy(acl, bits, base + i * framesize,
+ err = acl->rpc_tx_vtbl.mm_alloc_range_proxy(acl, bits, base + i * framesize,
base + (i + 1) * framesize,
&c->phys_cap[i], &error_code);
assert(err_is_ok(err));
if (err_no(err) == MM_ERR_MISSING_CAPS && bits > PAGE_BITS) {
/* try again with smaller page-sized caps */
for (int j = 0; j < i; j++) {
- err = acl->vtbl.mm_free_proxy(acl, c->phys_cap[i],
+ err = acl->rpc_tx_vtbl.mm_free_proxy(acl, c->phys_cap[i],
base + j * framesize, bits,
&error_code);
assert(err_is_ok(err) && err_is_ok(error_code));
PCI_DEBUG("pci: init_device_handler_irq: init interrupt.\n");
PCI_DEBUG("pci: irq = %u, core = %hhu, vector = %u\n",
irq, coreid, vector);
- struct acpi_rpc_client* cl = get_acpi_rpc_client();
+ struct acpi_binding* cl = get_acpi_binding();
errval_t ret_error;
- err = cl->vtbl.enable_and_route_interrupt(cl, irq, coreid, vector, &ret_error);
+ err = cl->rpc_tx_vtbl.enable_and_route_interrupt(cl, irq, coreid, vector, &ret_error);
assert(err_is_ok(err));
assert(err_is_ok(ret_error)); // FIXME
// printf("IRQ for this device is %d\n", irq);
errval_t error_code;
PCI_DEBUG("get irq table for (%hhu,%hhu,%hhu)\n", (*busnum) + 2,
addr.device, addr.function);
- struct acpi_rpc_client* cl = get_acpi_rpc_client();
+ struct acpi_binding* cl = get_acpi_binding();
// XXX: why do we have two different types for the same thing?
acpi_pci_address_t xaddr = {
.bus = addr.bus,
.device = addr.device,
.function = addr.function,
};
- errval_t err = cl->vtbl.read_irq_table(cl, handle, xaddr, (*busnum) + 2,
+ errval_t err = cl->rpc_tx_vtbl.read_irq_table(cl, handle, xaddr, (*busnum) + 2,
&error_code, child);
if (err_is_ok(err) && error_code == ACPI_ERR_NO_CHILD_BRIDGE){
PCI_DEBUG("No corresponding ACPI entry for bridge found\n");
return irq;
}
- struct acpi_rpc_client* cl = get_acpi_rpc_client();
+ struct acpi_binding* cl = get_acpi_binding();
errval_t error_code;
- err = cl->vtbl.set_device_irq(cl, ldev, irq, &error_code);
+ err = cl->rpc_tx_vtbl.set_device_irq(cl, ldev, irq, &error_code);
assert(err_is_ok(err));
if (err_is_fail(error_code)) {
//DEBUG_ERR(error_code, "set device irq failed.");
#include <barrelfish/sys_debug.h>
#include <if/pci_defs.h>
-#include <if/acpi_rpcclient_defs.h>
+#include <if/acpi_defs.h>
#include <acpi_client/acpi_client.h>
#include <mm/mm.h>
/* determine IOAPIC INTI for given GSI and map to core */
if (vector != (uint32_t)-1) {
- struct acpi_rpc_client* cl = get_acpi_rpc_client();
+ struct acpi_binding* cl = get_acpi_binding();
errval_t ret_error;
- e = cl->vtbl.enable_and_route_interrupt(cl, irq, coreid, vector, &ret_error);
+ e = cl->rpc_tx_vtbl.enable_and_route_interrupt(cl, irq, coreid, vector, &ret_error);
assert(err_is_ok(e));
if (err_is_fail(ret_error)) {
DEBUG_ERR(e, "failed to route interrupt %d -> %d\n", irq, vector);
#include <pci/confspace/pci_confspace.h>
#include <acpi_client/acpi_client.h>
#include <skb/skb.h>
-#include <if/acpi_rpcclient_defs.h>
+#include <if/acpi_defs.h>
#include "pci.h"
#include "pci_debug.h"
uint8_t sbus;
uint8_t ebus;
- struct acpi_rpc_client* cl = get_acpi_rpc_client();
- cl->vtbl.get_pcie_confspace(cl, &err, &address, &segment, &sbus, &ebus);
+ struct acpi_binding* cl = get_acpi_binding();
+ cl->rpc_tx_vtbl.get_pcie_confspace(cl, &err, &address, &segment, &sbus, &ebus);
if (err_is_ok(err)) {
size_t region_pages = (ebus + 1 - sbus) << 8;
uint8_t region_bits = log2ceil(region_bytes);
struct capref pcie_cap;
- struct acpi_rpc_client* acl = get_acpi_rpc_client();
+ struct acpi_binding* acl = get_acpi_binding();
errval_t error_code;
err = slot_alloc(&pcie_cap);
if (err_is_fail(err)) {
return err;
}
- err = acl->vtbl.mm_alloc_range_proxy(acl, region_bits, address,
+ err = acl->rpc_tx_vtbl.mm_alloc_range_proxy(acl, region_bits, address,
address + (1UL << region_bits), &pcie_cap, &error_code);
if (err_is_fail(err)) {
return err;
#include <barrelfish/barrelfish.h>
#include <barrelfish/nameservice_client.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <mm/mm.h>
#include <octopus/init.h>
{
errval_t err;
- struct monitor_blocking_rpc_client *cl = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *cl = get_monitor_blocking_binding();
assert(cl != NULL);
// Request I/O Cap
errval_t error_code;
err = slot_alloc(&requested_caps);
assert(err_is_ok(err));
- err = cl->vtbl.get_io_cap(cl, &requested_caps, &error_code);
+ err = cl->rpc_tx_vtbl.get_io_cap(cl, &requested_caps, &error_code);
assert(err_is_ok(err) && err_is_ok(error_code));
// Copy into correct slot
#include <barrelfish/barrelfish.h>
#include <barrelfish/nameservice_client.h>
#include <if/monitor_defs.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <if/trivfs_defs.h>
#include <spawndomain/spawndomain.h>
#include "ramfs.h"
{
errval_t err, msgerr;
- struct monitor_blocking_rpc_client *cl = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *cl = get_monitor_blocking_binding();
assert(cl != NULL);
struct capref bootinfo_frame;
if (err_is_fail(err)) {
return err;
}
- msgerr = cl->vtbl.get_bootinfo(cl, &err, &bootinfo_frame, &bootinfo_size);
+ msgerr = cl->rpc_tx_vtbl.get_bootinfo(cl, &err, &bootinfo_frame, &bootinfo_size);
if (err_is_fail(msgerr)) {
err = msgerr;
}
#include <stdlib.h>
#include <string.h>
#include <barrelfish/barrelfish.h>
-#include <if/fb_rpcclient_defs.h>
+#include <if/fb_defs.h>
#include <if/keyboard_defs.h>
#include <barrelfish/nameservice_client.h>
#include <vfs/vfs.h>
#include "slideshow.h"
-static struct fb_rpc_client fb_client;
+static struct fb_binding *fb_client;
static struct keyboard_binding *kb_client;
static char *vidmem; /// Pointer to video memory
void wait_for_vsync(void)
{
- errval_t err = fb_client.vtbl.vsync(&fb_client);
+ errval_t err = fb_client->rpc_tx_vtbl.vsync(fb_client);
assert(err_is_ok(err));
}
// Restore font backup
memcpy(vidmem, fontbackup, 65536);
- err = fb_client.vtbl.set_vesamode(&fb_client, origmode, origlinear,
+ err = fb_client->rpc_tx_vtbl.set_vesamode(fb_client, origmode, origlinear,
true, &ret);
assert(err_is_ok(err));
assert(err_is_ok(ret));
{
assert(err_is_ok(err));
- err = fb_rpc_client_init(&fb_client, b);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "error in mem_rpc_client_init");
- }
+ fb_client = b;
+ fb_rpc_client_init(fb_client);
}
static void start_keyboard_client(void)
load_slides(argv[4]);
// Get current video mode
- err = fb_client.vtbl.get_vesamode(&fb_client, &origmode, &origlinear, &ret);
+ err = fb_client->rpc_tx_vtbl.get_vesamode(fb_client, &origmode, &origlinear, &ret);
assert(err_is_ok(err));
assert(err_is_ok(ret));
// Set videomode
- err = fb_client.vtbl.set_videomode(&fb_client, xres, yres, bpp, &ret);
+ err = fb_client->rpc_tx_vtbl.set_videomode(fb_client, xres, yres, bpp, &ret);
assert(err_is_ok(err));
assert(err_is_ok(ret));
// Get and map framebuffer
struct capref fbcap;
uint32_t fboffset;
- err = fb_client.vtbl.get_framebuffer(&fb_client, &ret, &fbcap, &fboffset);
+ err = fb_client->rpc_tx_vtbl.get_framebuffer(fb_client, &ret, &fbcap, &fboffset);
assert(err_is_ok(err));
assert(err_is_ok(ret));
#include <vfs/vfs_path.h>
#include <dist/barrier.h>
#include <if/spawn_defs.h>
-#include <if/monitor_blocking_rpcclient_defs.h>
+#include <if/monitor_blocking_defs.h>
#include <barrelfish/dispatcher_arch.h>
#include <barrelfish/invocations_arch.h>
free(image);
/* request connection from monitor */
- struct monitor_blocking_rpc_client *mrpc = get_monitor_blocking_rpc_client();
+ struct monitor_blocking_binding *mrpc = get_monitor_blocking_binding();
struct capref monep;
err = slot_alloc(&monep);
if (err_is_fail(err)) {
return err_push(err, SPAWN_ERR_MONEP_SLOT_ALLOC);
}
- err = mrpc->vtbl.alloc_monitor_ep(mrpc, &msgerr, &monep);
+ err = mrpc->rpc_tx_vtbl.alloc_monitor_ep(mrpc, &msgerr, &monep);
if (err_is_fail(err)) {
return err_push(err, SPAWN_ERR_MONITOR_CLIENT);
} else if (err_is_fail(msgerr)) {
#include <barrelfish/waitset.h>
#include <if/ata_rw28_defs.h>
#include <if/ata_rw28_ahci_defs.h>
-#include <if/ata_rw28_rpcclient_defs.h>
+#include <if/ata_rw28_defs.h>
struct ahci_ata_rw28_binding ahci_ata_rw28_binding;
-struct ata_rw28_rpc_client ata_rw28_rpc;
struct ata_rw28_binding *ata_rw28_binding = NULL;
struct ahci_binding *ahci_binding = NULL;
volatile errval_t bind_err = SYS_ERR_OK;
printf("writing data\n");
errval_t status;
- err = ata_rw28_rpc.vtbl.write_dma(&ata_rw28_rpc, buf, bytes, start_lba, &status);
+ err = ata_rw28_binding->rpc_tx_vtbl.write_dma(ata_rw28_binding, buf, bytes, start_lba, &status);
if (err_is_fail(err))
USER_PANIC_ERR(err, "write_dma rpc");
if (err_is_fail(status))
printf("reading data\n");
struct ata_rw28_read_dma_response__rx_args reply;
- err = ata_rw28_rpc.vtbl.read_dma(&ata_rw28_rpc, bytes, start_lba, reply.buffer, &reply.buffer_size);
+ err = ata_rw28_binding->rpc_tx_vtbl.read_dma(ata_rw28_binding, bytes, start_lba, reply.buffer, &reply.buffer_size);
if (err_is_fail(err))
USER_PANIC_ERR(err, "read_dma rpc");
if (reply.buffer_size != bytes)
ata_rw28_binding = (struct ata_rw28_binding*)&ahci_ata_rw28_binding;
// init RPC client
- err = ata_rw28_rpc_client_init(&ata_rw28_rpc, ata_rw28_binding);
- if (err_is_fail(err)) {
- USER_PANIC_ERR(err, "ata_rw28_rpc_client_init");
- }
+ ata_rw28_rpc_client_init(ata_rw28_binding);
// run tests
run_tests();
#include <barrelfish/barrelfish.h>
#include <barrelfish/nameservice_client.h>
#include <if/mt_waitset_defs.h>
-#include <if/mt_waitset_rpcclient_defs.h>
+#include <if/mt_waitset_defs.h>
#include <barrelfish/deferred.h>
#include <barrelfish/inthandler.h>
#include <bench/bench.h>
static int client_thread(void * arg)
{
- struct mt_waitset_rpc_client *rpc_client;
+ struct mt_waitset_binding *binding;
errval_t err;
- rpc_client = arg;
+ binding = arg;
int i, j, k, l;
uint64_t payload[512];
uint64_t result[512];
for (i = 0; i < j; i++)
payload[i] = i2 + i;
- err = rpc_client->vtbl.rpc_method(rpc_client, i2, (uint8_t *)payload, 8 * j, i1, &o1, (uint8_t *)result, &result_size, &o2);
+ err = binding->rpc_tx_vtbl.rpc_method(binding, i2, (uint8_t *)payload, 8 * j, i1, &o1, (uint8_t *)result, &result_size, &o2);
assert(err == SYS_ERR_OK);
l = 0;
disp_enable(handle);
// all threads have finished, we're done, inform the server
payload[0] = mmm;
- err = rpc_client->vtbl.rpc_method(rpc_client, mmm, (uint8_t *)payload, 8, 65536, &o1, (uint8_t *)result, &result_size, &o2);
+ err = binding->rpc_tx_vtbl.rpc_method(binding, mmm, (uint8_t *)payload, 8, 65536, &o1, (uint8_t *)result, &result_size, &o2);
show_stats();
} else
disp_enable(handle);
static void bind_cb(void *st, errval_t err, struct mt_waitset_binding *b)
{
- struct mt_waitset_rpc_client *rpc_client;
int i = (long int)st;
- rpc_client = malloc(sizeof(struct mt_waitset_rpc_client));
- mt_waitset_rpc_client_init(rpc_client, b);
+ mt_waitset_rpc_client_init(b);
client_counter = client_threads;
for (i = 1; i < client_threads; i++)
- thread_create(client_thread, rpc_client);
- client_thread(rpc_client);
+ thread_create(client_thread, b);
+ client_thread(b);
}
static void start_client(void)
#include <barrelfish/nameservice_client.h>
#include <if/test_rpc_cap_defs.h>
-#include <if/test_rpc_cap_rpcclient_defs.h>
+#include <if/test_rpc_cap_defs.h>
static const char *my_service_name = "rpc_cap_test";
uint8_t is_server = 0x0;
/* ------------------------------ CLIENT ------------------------------ */
-static struct test_rpc_cap_rpc_client rpc_client;
+static struct test_rpc_cap_binding rpc_client;
static void client_call_test_1(void){
uint32_t res=0;
errval_t err;
- err = rpc_client.vtbl.echo(&rpc_client, client_id, &res);
+ err = rpc_client->rpc_tx_vtbl.echo(&rpc_client, client_id, &res);
if(err_is_fail(err)){
my_debug_printf("Error in rpc call (1)\n");
} else if(res != client_id) {
err = frame_alloc(&my_frame, BASE_PAGE_SIZE, NULL);
assert(err_is_ok(err));
- err = rpc_client.vtbl.send_cap_one(&rpc_client, my_frame, &msg_err);
+ err = rpc_client->rpc_tx_vtbl.send_cap_one(&rpc_client, my_frame, &msg_err);
if(err_is_fail(err)){
USER_PANIC_ERR(err, "Error in rpc call (2)\n");
} else if(err_is_fail(msg_err)) {
my_debug_printf("Calling send_cap_two: %s\n", buf);
- err = rpc_client.vtbl.send_cap_two(&rpc_client, frame1, frame2, &msg_err);
+ err = rpc_client->rpc_tx_vtbl.send_cap_two(&rpc_client, frame1, frame2, &msg_err);
if(err_is_fail(err)){
USER_PANIC_ERR(err, "Error in rpc call (3)\n");
} else if(err_is_fail(msg_err)) {
my_debug_printf("client: bound!\n");
- test_rpc_cap_rpc_client_init(&rpc_client, b);
+ test_rpc_cap_binding_init(&rpc_client, b);
client_call_test_1();
client_call_test_2();