Commit a3438057 authored by Anton Burtsev's avatar Anton Burtsev
Browse files

Patch IDL

parent 2459f6ee
//For the following,
// caller fns are in the driver (the dummy foobar module - dummy.c)
// callee fns are in the foobar subsystem (the dummy subsystem that registers the module - dev.c)
module foobar() {
projection <struct foobar_device> foobar_device {
module foobar() {
// attribute info for features field:
//in - features undergoes a read in callee register_foobar (need caller to callee marshalling)
//out - features undergoes a write in caller register_foobar (need callee to caller marshalling)
unsigned long [in,out] features;
projection <struct foobar_device> foobar_device_init {
// ...
}
projection <struct foobar_device> foobar_device_uninit {
// ...
}
projection <struct foobar_device_ops> foobar_device_ops_register_foobar {
//
// Here we have the projections for foobar_device_ops's fields.
//
// Since these fields are function pointers, which the dummy
// device registers with the kernel subsystem we have the rpc
// keyword accompanying the projection definitions of these
// function pointers.
// The directions are "in" since we are registering functions
// from the callee side to the caller side.
// Caller is non-isolated kernel
rpc [in] int (*init)(projection foobar_device_init *dev);
// Caller is non-isolated kernel
rpc [in] void (*uninit)(projection foobar_device_uninit *dev);
}
projection <struct foobar_device> foobar_device_register_foobar {
// "features" is both read and written inside register_foobar()
unsigned long [in,out] features;
unsigned long [in,out] hw_features;
unsigned long [out] wanted_features;
// Here the [in] direction is derrived from the global [in]
// direction of the foobar_device_register_foobar projection, i.e.,
// it's used as [in] with the register_foobar() function
unsigned int flags;
// attribute & keyword info for foobar_device_ops field:
// projection - Since "foobar_device_ops" is a structure, it also needs to be accompanied with the
// projection keyword.
// alloc(callee) - Also, it would need to be allocated in the callee side, because it is being read in the callee side.
projection foobar_device_ops [alloc(callee)] *foobar_device_ops;
}
// Attribute & keyword info for foobar_device_ops field:
projection <struct foobar_device_ops> foobar_device_ops {
//here we have the projections for foobar_device_ops's fields. Since these
//fields are function pointers, which the dummy device registers with the kernel subsystem
// we have the rpc keyword accompanying the projection definitions of these function pointers. The directions are "in" since we are registering functions from the callee side
//to the caller side.
rpc [in] int (*init)(projection foobar_device *dev);
rpc [in] void (*uninit)(projection foobar_device *dev);
// projection - Since "foobar_device_ops" is a structure, it
// also needs to be accompanied with the projection keyword.
//
// alloc(callee) - Also, it would need to be allocated in the
// callee side, because it already exists on the caller side
// and will be used on the callee side
projection foobar_device_ops_register_foobar [alloc(callee)] *foobar_device_ops;
}
rpc int register_foobar(projection foobar_device *dev);
//
// Caller side is isolated foobar subsystem
//
rpc int register_foobar(projection foobar_device_register_foobar *dev);
projection <struct foobar_device> foobar_device_unregister_foobar {
}
rpc void unregister_foobar(projection foobar_device_unregister_foobar *dev);
projection <struct foobar_device> foobar_device_alloc_foobardev {
int id;
char name[32];
}
// By default
//
// - all scalar types are [in], e.g., id below
//
// - simple char * (we assume that these are strings if no other
// qualifiers are passed, e.g., for a buffer we need char [out,
// len(...)]*buf
//
// - Return values are "out", i.e., we assume an implicit [out] below, e.g.,
// [out, alloc(caller)], but we don't have to write it since it's a retun
// value and we can derive the "out"
//
// - [alloc(caller)] we cannot derive since it can be "bind"
//
rpc projection foobar_device_alloc_foobardev [alloc(caller)] *alloc_foobardev(int id, char *name);
projection <struct foobar_device> foobar_device_free_foobardev {
}
rpc void free_foobardev(projection foobar_device_free_foobardev [dealloc(caller)] *dev);
// We also want to support scopes
//
//{
// projection <struct foobar_device> foobar_device {};
// rpc void free_foobardev(projection foobar_device [dealloc(caller)] *dev);
//}
}
Subproject commit 58432a5225b4c53bc670f92895a1926d93110083
Subproject commit 0850a11612b57e5a7c43adcbb746ebb48f22f132
Subproject commit 56deb16191e604464c1cafd07cecdce95d3e97c5
Subproject commit 8b465a57488421eefedddca9a197d2e1f136651d
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment