On 10.02.23 14:19, martinerikwerner....@gmail.com wrote:
Some BSP drivers use rtems objects in their implementation, for example
GRCAN creating semaphores in bsps/shared/grlib/can/grcan.c.

(GRCAN is only used as an example, there seems to be many BSP drivers
which do this, the fact that GRCAN use the driver manager might make it
not the best example..?)

How is the application supposed to calculate the correct resource
amount to set for the drivers it is using? Is there any support for
this in either code or documentation?

Or is the idea that a user needs to:
* Know exactly what drivers are used/available.
* Read the source code of each of these drivers and count up the rtems
resources used.

For example, in GRCAN, it looks like 4 semaphores are used for each
device, so a user would then do something like:

#define CONFIGURE_MAXIMUM_SEMAPHORES \
   (MY_SEMAPHORES + MY_GRCAN_MAXIMUM_DEVICES * 4)

As the number of drivers used increases, this seems like it could
become quite hard to manage and prone to errors, if this manual method
needs to be used.

Or is it assumed that the system will be configured with unlimited
resources instead in most cases where this could become an issue?

Yes, it is quite difficult to do the resource accounting for the Classic API objects. We rewrote a lot of drivers to use the self-contained synchronization objects:

https://docs.rtems.org/branches/master/c-user/self_contained_objects.html

--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.hu...@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
_______________________________________________
users mailing list
users@rtems.org
http://lists.rtems.org/mailman/listinfo/users

Reply via email to