1/*
2 * Copyright (c) 2007, 2008, 2009, 2010, 2011, ETH Zurich.
3 * All rights reserved.
4 *
5 * This file is distributed under the terms in the attached LICENSE file.
6 * If you do not find this file, copies can be found by writing to:
7 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
8 */
9
10interface monitor "The monitor to client Interface" {
11    alias vci uint64;
12    alias capid uint32;
13
14    message alloc_iref_request(
15        uintptr service_id);
16
17    message alloc_iref_reply(
18        uintptr service_id,
19        iref iref,
20        errval err);
21
22    message get_service_id_request(iref iref);
23    message get_service_id_reply(errval err, iref iref, uintptr service_id);
24
25    /* TODO: move to monitor_blocking as RPC? */
26    message boot_core_request(uint8 id, cap frame);
27    message boot_core_reply(errval err);
28
29    message new_monitor_binding_request(
30        uintptr st);
31
32    message new_monitor_binding_reply(
33        errval err,
34        cap ep,
35        uintptr st);
36
37    // a client sends this to the monitor to initiate a bind
38    message bind_lmp_client_request(
39        iref iref,
40        uintptr conn_id,
41        size buflen,
42        cap ep);
43
44    // Request multiboot caps from the monitor.
45    // I imagine only a file system doing this.
46    /* TODO: move to monitor_blocking as RPC? */
47    message multiboot_cap_request(uint32 slot);
48    message multiboot_cap_reply(cap cap, errval err);
49
50    // the monitor sends this to a service to pass on a bind request
51    message bind_lmp_service_request(
52        uintptr service_id,
53        uintptr mon_id,
54        size buflen,
55        cap ep);
56
57
58    message bind_lmp_reply_monitor(
59        errval err,
60        uintptr mon_id,
61        uintptr conn_id,
62        cap ep);
63
64    message bind_lmp_reply_client(
65        errval err,
66        uintptr mon_id,
67        uintptr conn_id,
68        cap ep);
69
70    // a client sends this to the monitor to initiate a bind
71    message bind_ump_client_request(
72        iref iref,
73        uintptr conn_id,
74        cap frame,
75        size channel_length_in,
76        size channel_length_out,
77        cap notify);
78
79    // the monitor sends this to a service to pass on a bind request
80    message bind_ump_service_request(
81        uintptr service_id,
82        uintptr mon_id,
83        cap frame,
84        size channel_length_in,
85        size channel_length_out,
86        cap notify);
87
88    message bind_ump_reply_monitor(
89        uintptr mon_id,
90        uintptr conn_id,
91        errval err,
92        cap notify);
93
94    message bind_ump_reply_client(
95        uintptr mon_id,
96        uintptr conn_id,
97        errval err,
98        cap notify);
99
100    message ipi_alloc_notify_request(cap ep, uintptr state);
101    message ipi_alloc_notify_reply(uintptr state, cap notify, errval err);
102
103    message get_mem_iref_request();
104    message get_mem_iref_reply(iref iref);
105
106    message get_name_iref_request(uintptr st);
107    message get_name_iref_reply(iref iref, uintptr st);
108
109    message get_ramfs_iref_request(uintptr st);
110    message get_ramfs_iref_reply(iref iref, uintptr st);
111    message set_ramfs_iref_request(iref iref);
112
113    message set_proc_mgmt_ep_request(cap ep);
114
115    message set_spawn_iref_request(iref iref);
116
117    message set_mem_iref_request(iref iref);
118
119    message set_name_iref_request(iref iref);
120    message set_name_iref_reply(errval err);
121
122    message get_monitor_rpc_ep_request(uintptr st);
123    message get_monitor_rpc_ep_reply(errval err, cap ep, uintptr st);
124
125    /* for UMP/BMP cap tx */
126    message cap_send_request(
127        uintptr mon_id,
128        cap cap,
129        capid capid);
130    message cap_move_request(
131        uintptr mon_id,
132        give_away_cap cap,
133        capid capid);
134    message cap_receive_request(
135        uintptr conn_id,
136        errval err,
137        give_away_cap cap,
138        capid capid);
139
140    message span_domain_request(
141        uintptr domain_id,
142        uint8 core_id,
143        cap vroot,
144        cap disp);
145    message span_domain_reply(
146        errval err,
147        uintptr domain_id);
148
149    /**
150     * \brief Migrates a dispatcher to a distant core
151     *
152     * \note Currently in a proof concept stage. We just migrate
153     * and hope for the best, no reply that talks about the success.
154     *
155     * \param core_id Destination core id
156     * \param vroot Address space capability
157     * \param disp Dispatcher Capability
158     */
159    message migrate_dispatcher_request(
160        uint8 core_id,
161        cap vroot,
162        cap disp);
163
164    /* Multi-hop interconnect driver */
165
166    // Send routing table
167    // First message, which describes the set of valid core IDs
168    message multihop_routing_table_new(coreid max_coreid, coreid nentries);
169    // Subsequent messages (repeated) which each contain
170    // a portion of the routing table from a single core
171    message multihop_routing_table_set(coreid from, coreid to[len, 128]);
172
173    // Connection set-up between monitor and client
174    message multihop_bind_client_request(iref iref, vci sender_vci);
175    message multihop_bind_client_reply(vci receiver_vci, vci sender_vci,
176                                        errval err);
177
178    // Connection set-up between monitor and service
179    message multihop_bind_service_request(uintptr service_id, vci sender_vci);
180    message multihop_bind_service_reply(vci receiver_vci , vci sender_vci,
181                                         errval err);
182
183    // user message
184    message multihop_message(vci vci, uint8 direction, uint8 flags, uint32 ack,
185                             uint8 payload[size, 2048]);
186
187    // cap transfer
188    message multihop_cap_send(vci vci, uint8 direction, errval err, cap cap,
189                           capid capid);
190
191    /* Tracing Framework */
192
193    // Notify a core that it should prepare the tracing state. The origin core
194    // is the one who initiated the preparation request.
195    message trace_prepare(coreid origin_core);
196
197    // Notify the core who initiated the preparation that it is finished.
198    message trace_prepare_finished();
199
200    /* bfscope - the tracing server */
201
202    // Send a message to bfscope, to notify that it should flush
203    message bfscope_flush_send(iref iref);
204
205    // Notify the initiatior of the flush request that it has been completed.
206    message bfscope_flush_ack();
207
208    message migrate_dispatcher(uintptr domain_id);
209
210    // Capability debugging
211    message debug_print_capabilities();
212
213
214    //
215    message cap_revoke_request(uintptr cap, uintptr id);
216    message cap_revoke_response(uintptr id);
217};
218