70 |
MOD_NUMBER. */ |
MOD_NUMBER. */ |
71 |
unsigned int mods_count; |
unsigned int mods_count; |
72 |
|
|
73 |
/* The physical memory and task server master control capabilities for |
/* The physical memory, task and deva server master control |
74 |
the root filesystem. */ |
capabilities for the root filesystem. */ |
75 |
hurd_cap_handle_t physmem_master; |
hurd_cap_handle_t physmem_master; |
76 |
hurd_cap_handle_t task_master; |
hurd_cap_handle_t task_master; |
77 |
|
hurd_cap_handle_t deva_master; |
78 |
|
|
79 |
/* The wortel task capability object handle. */ |
/* The wortel task capability object handle. */ |
80 |
hurd_cap_handle_t task_wortel; |
hurd_cap_handle_t task_wortel; |
882 |
/* This is to keep information about created task caps. */ |
/* This is to keep information about created task caps. */ |
883 |
unsigned int cur_task = (unsigned int) -1; |
unsigned int cur_task = (unsigned int) -1; |
884 |
|
|
885 |
|
/* This is to keep information about created deva caps. */ |
886 |
|
unsigned int cur_deva = 0; |
887 |
|
|
888 |
/* Make a list of all the containers we want. */ |
/* Make a list of all the containers we want. */ |
889 |
for (i = 0; i < mods_count; i++) |
for (i = 0; i < mods_count; i++) |
890 |
{ |
{ |
1142 |
l4_reply (bootstrap_final_task); |
l4_reply (bootstrap_final_task); |
1143 |
|
|
1144 |
/* Send the reply to deva's bootstrap final RPC. */ |
/* Send the reply to deva's bootstrap final RPC. */ |
1145 |
|
l4_msg_append_word (msg, l4_nilthread); |
1146 |
|
l4_msg_append_word (msg, 0); |
1147 |
|
l4_msg_append_word (msg, mods[MOD_DEVA].server_thread); |
1148 |
|
l4_msg_append_word (msg, mods[MOD_DEVA].deva); |
1149 |
l4_msg_clear (msg); |
l4_msg_clear (msg); |
1150 |
/* It already has its caps. */ |
/* It already has its caps. */ |
1151 |
l4_msg_load (msg); |
l4_msg_load (msg); |
1256 |
|
|
1257 |
l4_msg_clear (msg); |
l4_msg_clear (msg); |
1258 |
l4_msg_load (msg); |
l4_msg_load (msg); |
1259 |
|
l4_reply (from); |
1260 |
|
} |
1261 |
|
else if (label == WORTEL_MSG_GET_DEVA_CAP_REQUEST) |
1262 |
|
{ |
1263 |
|
if (cur_deva > mods_count) |
1264 |
|
panic ("deva does not stop requesting capability requests"); |
1265 |
|
else if (cur_deva == mods_count) |
1266 |
|
{ |
1267 |
|
/* Request the global control capability now. */ |
1268 |
|
l4_msg_clear (msg); |
1269 |
|
l4_msg_append_word |
1270 |
|
(msg, l4_version (mods[MOD_ROOT_FS].server_thread)); |
1271 |
|
/* Is master? */ |
1272 |
|
l4_msg_append_word (msg, 1); |
1273 |
|
l4_msg_load (msg); |
1274 |
|
l4_reply (from); |
1275 |
|
} |
1276 |
|
else |
1277 |
|
{ |
1278 |
|
/* We are allowed to make a capability request now. */ |
1279 |
|
|
1280 |
|
/* We know that cur_deva == 0 is one of the good |
1281 |
|
cases. */ |
1282 |
|
l4_msg_clear (msg); |
1283 |
|
l4_set_msg_label (msg, 0); |
1284 |
|
l4_msg_append_word (msg, mods[cur_deva].task_id); |
1285 |
|
/* Is master? */ |
1286 |
|
l4_msg_append_word (msg, 0); |
1287 |
|
l4_msg_load (msg); |
1288 |
|
l4_reply (from); |
1289 |
|
} |
1290 |
|
} |
1291 |
|
else if (label == WORTEL_MSG_GET_DEVA_CAP_REPLY) |
1292 |
|
{ |
1293 |
|
if (l4_untyped_words (tag) != 1 || l4_typed_words (tag) != 0) |
1294 |
|
panic ("Invalid format of get deva cap reply msg"); |
1295 |
|
|
1296 |
|
if (cur_deva > mods_count) |
1297 |
|
panic ("Invalid get deva cap reply message"); |
1298 |
|
else if (cur_deva == mods_count) |
1299 |
|
deva_master = l4_msg_word (msg, 0); |
1300 |
|
else |
1301 |
|
mods[cur_deva].deva = l4_msg_word (msg, 0); |
1302 |
|
|
1303 |
|
do |
1304 |
|
cur_deva++; |
1305 |
|
while (cur_deva < mods_count && !MOD_IS_TASK (cur_deva)); |
1306 |
|
|
1307 |
|
l4_msg_clear (msg); |
1308 |
|
l4_msg_load (msg); |
1309 |
l4_reply (from); |
l4_reply (from); |
1310 |
} |
} |
1311 |
else |
else |