How to test features provided by a BSP?

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Sep 17 08:31:39 UTC 2008


Hi,
it is quite difficult to write code that can be shared by multiple BSPs
or applications for multiple BSPs (tests and demos) since for example
the APIs for interrupt handling are quite different.  Some of these
issues are currently tackled by individual preprocessor nightmares.  The
best solution would be to unify the APIs but this requires much efford
and time.  So in the meantime it would be nice if we can introduce a
facility to test for features provided by a BSP in a uniform way.  This
test has to be done at compile time because some features require
individual support code.  My proposal is a list of possible feature
defines with the following stucture for a feature XY and special feature
dependent values VALUE_0 up to VALUE_N:

BSP_FEATURE_XY
BSP_FEATURE_XY_VALUE_0
...
BSP_FEATURE_XY_VALUE_N

This global list documents which features may be available by a BSP and
how it is configured.

Example:

#ifdef BSP_FEATURE_IRQ_EXTENSION

sc = rtems_interrupt_handler_install(
	my_vector,
	"My interrupt",
	RTEMS_INTERRUPT_UNIQUE,
	my_handler,
	my_arg
);
CHECK_SC( sc, "Install interrupt handler");

#else
  #error Not implemented
#endif

Have a nice day!

-- 
Sebastian Huber, Embedded Brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list