diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-05-27 16:11:52 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 1999-05-27 16:11:52 +0000 |
commit | 5adf355aa3cf66dc768d502b5a4855d734ce9d49 (patch) | |
tree | b90fcecbc3f776a903655a4b97e1a9769bfb7983 /c/src/lib/libc/termiosreserveresources.c | |
parent | Split out polled io, debug puts, and console reserve resources to (diff) | |
download | rtems-5adf355aa3cf66dc768d502b5a4855d734ce9d49.tar.bz2 |
Split initialization and reserve resources from termios to reduce
size of mininum application.
Diffstat (limited to 'c/src/lib/libc/termiosreserveresources.c')
-rw-r--r-- | c/src/lib/libc/termiosreserveresources.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/c/src/lib/libc/termiosreserveresources.c b/c/src/lib/libc/termiosreserveresources.c new file mode 100644 index 0000000000..2d9c05c988 --- /dev/null +++ b/c/src/lib/libc/termiosreserveresources.c @@ -0,0 +1,28 @@ +/* + * Reserve enough resources to open every physical device once. + * + * $Id$ + */ + +#include <rtems.h> + +static int first_time; /* assumed to be zeroed by BSS initialization */ + +void rtems_termios_reserve_resources ( + rtems_configuration_table *configuration, + rtems_unsigned32 number_of_devices +) +{ + rtems_api_configuration_table *rtems_config; + + if (!configuration) + rtems_fatal_error_occurred (0xFFF0F001); + rtems_config = configuration->RTEMS_api_configuration; + if (!rtems_config) + rtems_fatal_error_occurred (0xFFF0F002); + if (!first_time) + rtems_config->maximum_semaphores += 1; + first_time = 1; + rtems_config->maximum_semaphores += (4 * number_of_devices); +} + |