00001
00002
00003
00004
00005
00006
00007
00008 #include "local.h"
00009 #include <l4/names/libnames.h>
00010
00011
00012
00013 void l4ore_debug(l4ore_config *c, int flag)
00014 {
00015 DICE_DECLARE_ENV(env);
00016 l4ore_handle_t handle = L4_INVALID_ID;
00017 l4ore_config conf;
00018 l4_threadid_t server_id;
00019
00020 env.malloc = (dice_malloc_func)malloc;
00021 env.free = (dice_free_func)free;
00022 conf.rw_debug = flag;
00023
00024 if (strlen(c->ro_orename) == 0)
00025 strcpy(conf.ro_orename, c->ro_orename);
00026 else
00027 strcpy(conf.ro_orename, "ORe");
00028
00029 if (ore_lookup_server(c->ro_orename, &server_id))
00030 {
00031 LOG("could not lookup server %s\n", c->ro_orename);
00032 return;
00033 }
00034
00035 ore_manager_configure_call(&server_id, &handle, &conf, &conf, &env);
00036 }
00037
00038 l4ore_config l4ore_get_config(int channel)
00039 {
00040 DICE_DECLARE_ENV(env);
00041 l4ore_config conf;
00042 l4ore_config inval = L4ORE_INVALID_CONFIG;
00043 l4ore_handle_t handle = descriptor_table[channel].remote_worker_thread;
00044 l4_threadid_t ore_server = descriptor_table[channel].remote_manager_thread;
00045 env.malloc = (dice_malloc_func)malloc;
00046 env.free = (dice_free_func)free;
00047
00048 if (l4_is_invalid_id(handle))
00049 return L4ORE_INVALID_CONFIG;
00050
00051 ore_manager_configure_call(&ore_server, &handle, &inval, &conf, &env);
00052
00053 return conf;
00054 }
00055
00056 void l4ore_set_config(int channel, l4ore_config *new_conf)
00057 {
00058 DICE_DECLARE_ENV(env);
00059 l4ore_config old;
00060 l4ore_handle_t handle = descriptor_table[channel].remote_worker_thread;
00061 l4_threadid_t ore_server = descriptor_table[channel].remote_manager_thread;
00062 env.malloc = (dice_malloc_func)malloc;
00063 env.free = (dice_free_func)free;
00064
00065 if (new_conf == NULL)
00066 return;
00067
00068 ore_manager_configure_call(&ore_server, &handle, new_conf, &old, &env);
00069 }
00070