[okl4-developer] IDL & vtables
Nelson Tam
nelson at ok-labs.com
Tue Mar 4 19:18:16 EST 2008
Hi Ryan,
Is there any reason why you're using the 2006 version? The current
public release (1.5.2) doesn't use vtables anymore. Is it possible
for you to switch to the latest release?
As for your second question, it seems like you're using 1.5.2 there (I
don't think device_core existed back in 2006). You should use
driverv2, which is the new driver framework, because it has updated
drivers for supported platforms. If you need to use packet_t, you're
better off copying the packet_t definition to libs/driverv2/include/
driver.h.
Also, have a look at stream_pkt_t in libs/driverv2/include/stream.h
and see if that's suitable for your purposes.
On 04/03/2008, at 11:12 AM, Ryan Heffernan wrote:
> I'm currently dealing with some code written for an old (2006) version
> of Nicta L4 and Iguana, and I'm at a standstill with the IDL compiler
> and some vtables. Firstly, i wanted to ask if vtables are still in use
> in OKL4/Iguana, and if so how they get generated? Looking at the timer
> and serial main.c files it looks like they use vtables, but then I
> don't
> think that code gets compiled because virtual drivers are used.
>
> Here's an example of the vtable use in my code:
>
> void *device_vtable[DEVICE_DEFAULT_VTABLE_SIZE] =
> DEVICE_DEFAULT_VTABLE;
>
> and later on...
>
>
> int a = (magpie_get_interface_bigid(&msgbuf));
> switch (a) {
> case 42:
> idl4_process_request(&partner, &msgtag,
> &msgbuf,
> &cnt, device_vtable[idl4_get_function_id(&msgtag) & DEVICE_FID_MASK]);
>
> The .idl4 file for this server does indeed contain a "device"
> interface,
> but the build system gives the following complaints:
>
> `DEVICE_DEFAULT_VTABLE_SIZE' undeclared here (not in a function)
> `DEVICE_DEFAULT_VTABLE' undeclared here (not in a function)
>
> If vtables are still being used, they must be defined and/or generated
> differently than they were in 2006, so it would be a big help to me if
> someone could explain how this process works or just simply how I can
> work around it. Thanks!
>
> Also, my code needs to make use of the packet_t structure defined in
> driver/include/driver.h, but the iguana SConstruct builds
> driverv2/include/driver.h instead. So I hacked the following code in
> the
> Sconstruct to make it build the driver files I want:
>
> if ig_env.machine.device_core is not None:
> ig_env.Package("libs/driver")#NEW
> ig_env.Package("drivers/drv_smc91x")#NEW
>
> Do you think this could eventually have disastrous consequences?
--
(nt)
Nelson Tam
nelson at ok-labs.com
More information about the Developer
mailing list