1/*
2 * Copyright (c) 2007, 2008, 2009, 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 bulk_ctrl "bulk control channel interface" {
11
12    alias error uint64;
13
14    typedef enum {
15        SOURCE,
16        SINK
17    } direction;
18
19    typedef enum {
20        MASTER,
21        SLAVE,
22        GENERIC
23    } role;
24
25    typedef enum {
26        NONE,
27        HALF,
28        FULL
29    } trust;
30
31    typedef struct {
32        uint32 pool_id_machine;
33        uint32 pool_id_dom;
34        uint32 pool_id_local;
35    } poolid;
36
37    typedef struct {
38        uint32 pool_id_machine;
39        uint32 pool_id_dom;
40        uint32 pool_id_local;
41        trust  trust;
42        uint32 buffer_size;
43        uint32 num_buffers;
44        cap    cap;
45    } pool;
46
47    /*
48    rpc negotiate(in  role      role,
49                  in  trust     trust,
50                  out error     error,
51                  out direction match_direction,
52                  out role      match_role,
53                  out uint64    meta_size);
54    */
55
56    message negotiate_call(role      role,
57                           trust     trust);
58
59    message negotiate_response(error     error,
60                               direction match_direction,
61                               role      match_role,
62                               uint64    meta_size);
63
64    /*
65    rpc assign_pool(in  pool   pool,
66                    in  uint64 id,
67                    out error  error,
68                    out uint64 id);
69    */
70
71    message assign_pool_call(pool   pool,
72                             uint64 id);
73
74    message assign_pool_response(error  error,
75                                 uint64 id);
76
77/*
78 * buffer movement operations:
79 *  we have to differentiate between the trusted and untrusted case, because some
80 *  flounder backends (such as UMP) will go to great lenghts to send NULL_CAP's
81 *  (UMP will always get a monitor mutex before sending any messages with caprefs,
82 *   which slows the communication drastically)
83 *  tid is a transaction id, used to mark which request a given reply belongs to
84 *
85 */
86
87    /*
88    rpc move(in poolid poolid,
89             in  uint32     bufferid,
90             in  uint32     tid,
91             in  cap        cap,
92             in  uint8      meta[metasize, 2048],
93             out error      error,
94             out uint32     tid);
95    */
96
97    message move_untrusted_call(poolid poolid,
98                                uint32     bufferid,
99                                uint32     tid,
100                                cap        cap,
101                                uint8      meta[metasize, 2048]);
102
103    message move_trusted_call(poolid poolid,
104                              uint32     bufferid,
105                              uint32     tid,
106                              uint8      meta[metasize, 2048]);
107
108
109    message move_response(error      error,
110                          uint32     tid);
111
112    /*
113    rpc copy(in  poolid     poolid,
114             in  uint32     bufferid,
115             in  uint32     tid,
116             in  cap        cap,
117             in  uint8      meta[metasize, 2048],
118             out error      error,
119             out uint32     tid);
120    */
121
122    message copy_untrusted_call(poolid     poolid,
123                                uint32     bufferid,
124                                uint32     tid,
125                                cap        cap,
126                                uint8      meta[metasize, 2048]);
127
128    message copy_trusted_call(poolid     poolid,
129                              uint32     bufferid,
130                              uint32     tid,
131                              uint8      meta[metasize, 2048]);
132
133
134    message copy_response(error      error,
135                          uint32     tid);
136
137    /*
138    rpc pass(in  poolid     poolid,
139             in  uint32     bufferid,
140             in  uint32     tid,
141             in  cap        cap,
142             in  uint8      meta[metasize, 2048],
143             out error      error,
144             out uint32     tid);
145    */
146
147    message pass_untrusted_call(poolid     poolid,
148                                uint32     bufferid,
149                                uint32     tid,
150                                cap        cap,
151                                uint8      meta[metasize, 2048]);
152
153    message pass_trusted_call(poolid     poolid,
154                              uint32     bufferid,
155                              uint32     tid,
156                              uint8      meta[metasize, 2048]);
157
158    message pass_response(error      error,
159                          uint32     tid);
160
161    /*
162    rpc release(in  poolid      poolid,
163                in  uint32      bufferid,
164                in  uint32      tid,
165                out error       error,
166                out uint32      tid);
167    */
168
169    message release_call(poolid      poolid,
170                         uint32      bufferid,
171                         uint32      tid);
172
173    message release_response(error       error,
174                             uint32      tid);
175};
176
177