Commit a0069e3c authored by Aftab Hussain's avatar Aftab Hussain
Browse files

added annotations

parent 92aede29
......@@ -36,7 +36,7 @@ MODULE_PARM_DESC(numdummies, "Number of dummy pseudo devices");
struct foobar_device *dev_dummy;
static int __init dummy_init_module(void)
static int __init dummy_init_module(void)// the entry point to the dummy device driver
{
int err;
......@@ -50,13 +50,13 @@ static int __init dummy_init_module(void)
dev_dummy->features = FOOBAR_PRIV_ALLOC;
dev_dummy->flags = FOO_LOOPBACK;
err = register_foobar(dev_dummy);
err = register_foobar(dev_dummy);//the call to dev.c fn to register dummy
if (err < 0)
goto err;
return 0;
err:
free_foobardev(dev_dummy);
free_foobardev(dev_dummy);// free the foobar device if an error code is received
return err;
}
......
//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 {
unsigned long [in,out] features
// 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;
unsigned long [in,out] hw_features;
unsigned long [out] wanted_features;
unsigned int flags;
......
......@@ -8,6 +8,13 @@ int register_foobar(struct foobar_device *dev)
{
int ret;
/*
Access info for members of foobar_device structure in this function:
hw_features : read and write
features : read and write
wanted_features: write
*/
dev->hw_features |= FOOBAR_IRQ_DELAY;
dev->features |= FOOBAR_SOFTIRQ_ENABLE;
dev->wanted_features = dev->features & dev->hw_features;
......
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