]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/mini-os.git/commitdiff
mini-os: remove per-fd evtchn limit
authorAlex Zeffertt <alex.zeffertt@eu.citrix.com>
Thu, 9 Feb 2012 18:33:30 +0000 (18:33 +0000)
committerAlex Zeffertt <alex.zeffertt@eu.citrix.com>
Thu, 9 Feb 2012 18:33:30 +0000 (18:33 +0000)
This changes the minios evtchn implementation to use a list instead of
an array which ahis allows it to grow as necessary to support any number
of ports, only limited by Xen (NR_EVS is 1024, should be enough for now).

Signed-off-by: Diego Ongaro <diego.ongaro@citrix.com>
Signed-off-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com>
Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
include/lib.h

index bd3eeafb0e7e29af1fe4d66f80317593caaf8cd9..3d03cf40f886b4219e1b4cc930e9f50a17403927 100644 (file)
@@ -52,6 +52,7 @@
 #include <stddef.h>
 #include <xen/xen.h>
 #include <xen/event_channel.h>
+#include <sys/queue.h>
 #include "gntmap.h"
 
 #ifdef HAVE_LIBC
@@ -143,7 +144,14 @@ enum fd_type {
     FTYPE_SAVEFILE,
 };
 
-#define MAX_EVTCHN_PORTS 16
+LIST_HEAD(evtchn_port_list, evtchn_port_info);
+
+struct evtchn_port_info {
+        LIST_ENTRY(evtchn_port_info) list;
+        evtchn_port_t port;
+        unsigned long pending;
+        int bound;
+};
 
 extern struct file {
     enum fd_type type;
@@ -158,13 +166,7 @@ extern struct file {
            off_t offset;
        } file;
        struct {
-            /* To each event channel FD is associated a series of ports which
-             * wakes select for this FD. */
-            struct {
-                evtchn_port_t port;
-                unsigned long pending;
-                int bound;
-            } ports[MAX_EVTCHN_PORTS];
+           struct evtchn_port_list ports;
        } evtchn;
        struct gntmap gntmap;
        struct {