Module: xenomai-forge
Branch: master
Commit: 8a6fd498c51e35a3d9a6f9c7dbd3318ef789f5e6
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=8a6fd498c51e35a3d9a6f9c7dbd3318ef789f5e6

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Jan  1 16:46:03 2012 +0100

nucleus/queue: remove support for generic queues

No in-tree client since the pSOS emulator moved to userland.

---

 include/cobalt/nucleus/module.h |   15 ----
 include/cobalt/nucleus/queue.h  |  138 ---------------------------------------
 kernel/cobalt/nucleus/module.c  |   33 ---------
 3 files changed, 0 insertions(+), 186 deletions(-)

diff --git a/include/cobalt/nucleus/module.h b/include/cobalt/nucleus/module.h
index 3fa83c8..e0167b5 100644
--- a/include/cobalt/nucleus/module.h
+++ b/include/cobalt/nucleus/module.h
@@ -23,21 +23,6 @@
 #include <nucleus/queue.h>
 #include <nucleus/clock.h>
 
-#define XNMOD_GHOLDER_REALLOC   128 /* Realloc count */
-#define XNMOD_GHOLDER_THRESHOLD 64  /* Safety threshold */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void xnmod_alloc_glinks(xnqueue_t *freehq);
-
-#ifdef __cplusplus
-}
-#endif
-
-extern xnqueue_t xnmod_glink_queue;
-
 extern u_long xnmod_sysheap_size;
 
 #endif /* !_XENO_NUCLEUS_MODULE_H */
diff --git a/include/cobalt/nucleus/queue.h b/include/cobalt/nucleus/queue.h
index e94f8c3..35b7747 100644
--- a/include/cobalt/nucleus/queue.h
+++ b/include/cobalt/nucleus/queue.h
@@ -461,142 +461,4 @@ static inline int emptypq_p(xnpqueue_t *pqslot)
        return emptyq_p(&pqslot->pqueue);
 }
 
-/* Generic prioritized element holder */
-
-typedef struct xngholder {
-
-       xnpholder_t glink;
-       void *data;
-
-} xngholder_t;
-
-static inline void initgh(xngholder_t *holder, void *data)
-{
-       inith(&holder->glink.plink);
-       holder->data = data;
-}
-
-/* Generic element queue */
-
-typedef struct xngqueue {
-
-       xnpqueue_t gqueue;
-       xnqueue_t *freehq;
-       void (*starvation) (xnqueue_t *);
-       int threshold;
-
-} xngqueue_t;
-
-static inline void initgq(xngqueue_t *gqslot,
-                         xnqueue_t *freehq,
-                         void (*starvation) (xnqueue_t *),
-                         int threshold)
-{
-       initpq(&gqslot->gqueue);
-       gqslot->freehq = freehq;
-       gqslot->starvation = starvation;
-       gqslot->threshold = threshold;
-}
-
-static inline xngholder_t *allocgh(xngqueue_t *gqslot)
-{
-       if (countq(gqslot->freehq) < gqslot->threshold)
-               gqslot->starvation(gqslot->freehq);
-
-       return (xngholder_t *)getq(gqslot->freehq);
-}
-
-static inline void *removegh(xngqueue_t *gqslot, xngholder_t *holder)
-{
-       removepq(&gqslot->gqueue, &holder->glink);
-       appendq(gqslot->freehq, &holder->glink.plink);
-       return holder->data;
-}
-
-static inline void insertgqf(xngqueue_t *gqslot, void *data, int prio)
-{
-       xngholder_t *holder = allocgh(gqslot);
-       holder->data = data;
-       return insertpqf(&gqslot->gqueue, &holder->glink, prio);
-}
-
-static inline void insertgql(xngqueue_t *gqslot, void *data, int prio)
-{
-       xngholder_t *holder = allocgh(gqslot);
-       holder->data = data;
-       insertpql(&gqslot->gqueue, &holder->glink, prio);
-}
-
-static inline void appendgq(xngqueue_t *gqslot, void *data)
-{
-       xngholder_t *holder = allocgh(gqslot);
-       holder->data = data;
-       appendpq(&gqslot->gqueue, &holder->glink);
-}
-
-static inline void prependgq(xngqueue_t *gqslot, void *data)
-{
-       xngholder_t *holder = allocgh(gqslot);
-       holder->data = data;
-       prependpq(&gqslot->gqueue, &holder->glink);
-}
-
-static inline xngholder_t *getheadgq(xngqueue_t *gqslot)
-{
-       return (xngholder_t *)getheadpq(&gqslot->gqueue);
-}
-
-static inline xngholder_t *nextgq(xngqueue_t *gqslot, xngholder_t *holder)
-{
-       return (xngholder_t *)nextpq(&gqslot->gqueue, &holder->glink);
-}
-
-static inline void *getgq(xngqueue_t *gqslot)
-{
-       xngholder_t *holder = getheadgq(gqslot);
-
-       if (!holder)
-               return NULL;
-
-       appendq(gqslot->freehq, &getpq(&gqslot->gqueue)->plink);
-
-       return holder->data;
-}
-
-static inline xngholder_t *popgq(xngqueue_t *gqslot, xngholder_t *holder)
-{
-       xngholder_t *nextholder = nextgq(gqslot, holder);
-       removegh(gqslot, holder);
-       return nextholder;
-}
-
-static inline xngholder_t *findgq(xngqueue_t *gqslot, void *data)
-{
-       xnholder_t *holder;
-
-       for (holder = gqslot->gqueue.pqueue.head.next;
-            holder != &gqslot->gqueue.pqueue.head; holder = holder->next) {
-               if (((xngholder_t *)holder)->data == data)
-                       return (xngholder_t *)holder;
-       }
-
-       return NULL;
-}
-
-static inline void *removegq(xngqueue_t *gqslot, void *data)
-{
-       xngholder_t *holder = findgq(gqslot, data);
-       return holder ? removegh(gqslot, holder) : NULL;
-}
-
-static inline int countgq(xngqueue_t *gqslot)
-{
-       return countpq(&gqslot->gqueue);
-}
-
-static inline int emptygq_p(xngqueue_t *gqslot)
-{
-       return emptypq_p(&gqslot->gqueue);
-}
-
 #endif /* !_XENO_NUCLEUS_QUEUE_H */
diff --git a/kernel/cobalt/nucleus/module.c b/kernel/cobalt/nucleus/module.c
index 4584782..4b58810 100644
--- a/kernel/cobalt/nucleus/module.c
+++ b/kernel/cobalt/nucleus/module.c
@@ -44,9 +44,6 @@ u_long sysheap_size_arg = CONFIG_XENO_OPT_SYS_HEAPSZ;
 module_param_named(sysheap_size, sysheap_size_arg, ulong, 0444);
 MODULE_PARM_DESC(sysheap_size, "System heap size (Kb)");
 
-xnqueue_t xnmod_glink_queue;
-EXPORT_SYMBOL_GPL(xnmod_glink_queue);
-
 u_long xnmod_sysheap_size;
 
 int xeno_nucleus_status = -EINVAL;
@@ -54,34 +51,6 @@ int xeno_nucleus_status = -EINVAL;
 struct xnsys_ppd __xnsys_global_ppd;
 EXPORT_SYMBOL_GPL(__xnsys_global_ppd);
 
-void xnmod_alloc_glinks(xnqueue_t *freehq)
-{
-       xngholder_t *sholder, *eholder;
-
-       sholder = xnheap_alloc(&kheap,
-                              sizeof(xngholder_t) * XNMOD_GHOLDER_REALLOC);
-
-       if (!sholder) {
-               /* If we are running out of memory but still have some free
-                  holders, just return silently, hoping that the contention
-                  will disappear before we have no other choice than
-                  allocating memory eventually. Otherwise, we have to raise a
-                  fatal error right now. */
-
-               if (emptyq_p(freehq))
-                       xnpod_fatal("cannot allocate generic holders");
-
-               return;
-       }
-
-       for (eholder = sholder + XNMOD_GHOLDER_REALLOC;
-            sholder < eholder; sholder++) {
-               inith(&sholder->glink.plink);
-               appendq(freehq, &sholder->glink.plink);
-       }
-}
-EXPORT_SYMBOL_GPL(xnmod_alloc_glinks);
-
 #ifdef CONFIG_XENO_OPT_DEBUG
 #define boot_notice " [DEBUG]"
 #else
@@ -136,8 +105,6 @@ int __init xenomai_init(void)
        xnloginfo("Xenomai/cobalt v%s enabled%s\n",
                  XENO_VERSION_STRING, boot_notice);
 
-       initq(&xnmod_glink_queue);
-
        xeno_nucleus_status = 0;
 
        xnarch_cpus_and(nkaffinity, nkaffinity, xnarch_supported_cpus);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to