Uniform Driver Interface: Difference between revisions

Add a bit more stuff here and there
[unchecked revision][unchecked revision]
(Add a bit more stuff here and there)
Line 37:
All channel operation invocations have the following form:
 
<source lang="c">void meta_op(meta_cbtype_cb_t *cb, ...);</source>
 
Where "meta" is a prefix specific to the metalanguage (e.g., udi or usbdi), "op" is the channel operation and "cbtype" is the control block type (read more on this below). Channel operations take zero or more parameters, depending on which operation we're talking about. The target channel is specified by the value of cb->gcb.channel.
 
This will result in the environemnt running an operation in the other region. The convention is for the operation to have the following declaration:
 
<source lang="c">static void ddd_meta_op(meta_cbtype_cb_t *cb, ...);</source>
 
The same observations as above apply, plus "ddd" being a driver-specific prefix.
 
===Metalanguages===
Line 53 ⟶ 59:
===Configuration===
 
There's a special configuration method for static properties of UDI drivers using a file called udiprops.txt. This file is distributed independently in each driver package for source code distributions and linked into a special section (called .udiprops) for binary distributions.
 
The udiprops.txt file doesn't only allow for static configuration options, but is also used in the building process for UDI drivers since they do not use makefiles - not that it would be technically unfeasible. The UDI specification defines tools for building, packaging and installing UDI drivers for simplicity's sake since, unlike POSIX tools, they don't require operating systems to have any extra functionality (e.g., a VFS).
Line 59 ⟶ 65:
==Data objects==
 
There are several types of data we need to look at. First, there's modlue-global data - which resides in the .bss section. The reason why this data is global is that it's read-only and thus won't cause any race conditions - remember that although only one thread of execution can be active per region, several regions of the same driver instance may run in parallel. Secondly, there's region-local and region-global data.
{{stub}}
 
However, none of these are actually data objects. The difference between data types and data objects is that data objects get allocated via an UDI allocation interface. Let's take a look at the existing data objects.
 
===Control blocks===
 
Control blocks are a semi-opaque (i.e., the driver doesn't see the whole data object) data type that are used in metalanguage operations. There are several types of control blocks, the generic block type being udi_cb_t.
 
==Initial state==
Anonymous user