Here is an IMO simple interface scheme:

int target->type->get_interface(int id, void **interface);

The ID is a unique ID across OpenOCD. The interface can be
either a single fn pointer or a structure which contains a list
of fn pointers.

Note that target or e.g. arm code can provide default implementations
of an interface. The arm11 could provide it's interfaces and pass
over to target.c to do the rest..

All the fn pointers take a pointer to target as the first argument.

The return value is a boolean ERROR_OK success/failure. No
interpretation is to be done of the return value according to
the error handling rules in OpenOCD.

In the case where the caller needs to distinguish between
is not supported yet and should never be supported, then
a separate interface like target->type->has_mmu must be added.



-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to