Module: xenomai-2.6
Branch: master
Commit: 3cac7bf085227f74d8dfbe8b6039c99b311f267c
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=3cac7bf085227f74d8dfbe8b6039c99b311f267c

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Sun Jan 19 13:50:03 2014 +0100

skins/posix: make hardcoded constants configurable

with Kconfig.

---

 ksrc/skins/posix/Kconfig  |   27 +++++++++++++++++++++++++++
 ksrc/skins/posix/module.c |    3 ++-
 ksrc/skins/posix/timer.c  |    2 +-
 3 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/ksrc/skins/posix/Kconfig b/ksrc/skins/posix/Kconfig
index 201f26f..a5a4525 100644
--- a/ksrc/skins/posix/Kconfig
+++ b/ksrc/skins/posix/Kconfig
@@ -25,6 +25,33 @@ config XENO_OPT_POSIX_PERIOD
 
        If in doubt, leave zero in this field.
 
+config XENO_OPT_POSIX_REGISTRY_NRSLOTS
+       int "Number of registry slots"
+       default 64
+       help
+
+       The POSIX skin registry is used for POSIX shared memories,
+       named semaphores, and message queues.
+
+       This option defines the maximum number of such objects.
+
+config XENO_OPT_POSIX_REGISTRY_NRDESCS
+       int "Number of file descriptors"
+       default 128
+       help
+
+       This option defines the maximum number of POSIX skin file
+       descriptors, used for shared memories and message queues.
+
+       of such objects.  
+
+config XENO_OPT_POSIX_NRTIMERS
+       int "Number of timers"
+       default 128
+       help
+
+       This option defines the maximum number of POSIX skin timers.
+
 config XENO_OPT_POSIX_SHM
        bool "Shared memory"
        help
diff --git a/ksrc/skins/posix/module.c b/ksrc/skins/posix/module.c
index e0f4db6..eea6e13 100644
--- a/ksrc/skins/posix/module.c
+++ b/ksrc/skins/posix/module.c
@@ -143,7 +143,8 @@ int SKIN_INIT(posix)
                return err;
        }
 
-       pse51_reg_pkg_init(64, 128);    /* FIXME: replace with compilation 
constants. */
+       pse51_reg_pkg_init(CONFIG_XENO_OPT_POSIX_REGISTRY_NRSLOTS, 
+                       CONFIG_XENO_OPT_POSIX_REGISTRY_NRDESCS);
        pse51_signal_pkg_init();
        pse51_mutex_pkg_init();
        pse51_sem_pkg_init();
diff --git a/ksrc/skins/posix/timer.c b/ksrc/skins/posix/timer.c
index b8aff08..85e11cf 100644
--- a/ksrc/skins/posix/timer.c
+++ b/ksrc/skins/posix/timer.c
@@ -25,7 +25,7 @@
 #include <posix/thread.h>
 #include <posix/timer.h>
 
-#define PSE51_TIMER_MAX  128
+#define PSE51_TIMER_MAX CONFIG_XENO_OPT_POSIX_NRTIMERS
 
 struct pse51_timer {
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to