summaryrefslogtreecommitdiff
path: root/drivers/xen/events/events_internal.h
diff options
context:
space:
mode:
authorDavid Vrabel <david.vrabel@citrix.com>2013-10-17 15:23:15 +0100
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2014-01-06 10:07:47 -0500
commitd0b075ffeede257342c3afdbeadd2fda8504ecee (patch)
tree1c512a95b2e335301917ba5f77553545c14ae215 /drivers/xen/events/events_internal.h
parent083858758f67bb20ef6be5bc8442be91cca8ee2d (diff)
downloadlwn-d0b075ffeede257342c3afdbeadd2fda8504ecee.tar.gz
lwn-d0b075ffeede257342c3afdbeadd2fda8504ecee.zip
xen/events: Refactor evtchn_to_irq array to be dynamically allocated
Refactor static array evtchn_to_irq array to be dynamically allocated by implementing get and set functions for accesses to the array. Two new port ops are added: max_channels (maximum supported number of event channels) and nr_channels (number of currently usable event channels). For the 2-level ABI, these numbers are both the same as the shared data structure is a fixed size. For the FIFO ABI, these will be different as the event array is expanded dynamically. This allows more than 65000 event channels so an unsigned short is no longer sufficient for an event channel port number and unsigned int is used instead. Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen/events/events_internal.h')
-rw-r--r--drivers/xen/events/events_internal.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/xen/events/events_internal.h b/drivers/xen/events/events_internal.h
index dc9650265e04..a3d9aeceda1a 100644
--- a/drivers/xen/events/events_internal.h
+++ b/drivers/xen/events/events_internal.h
@@ -35,7 +35,7 @@ struct irq_info {
int refcnt;
enum xen_irq_type type; /* type */
unsigned irq;
- unsigned short evtchn; /* event channel */
+ unsigned int evtchn; /* event channel */
unsigned short cpu; /* cpu bound */
union {
@@ -55,6 +55,9 @@ struct irq_info {
#define PIRQ_SHAREABLE (1 << 1)
struct evtchn_ops {
+ unsigned (*max_channels)(void);
+ unsigned (*nr_channels)(void);
+
int (*setup)(struct irq_info *info);
void (*bind_to_cpu)(struct irq_info *info, unsigned cpu);
@@ -70,12 +73,23 @@ struct evtchn_ops {
extern const struct evtchn_ops *evtchn_ops;
-extern int *evtchn_to_irq;
+extern int **evtchn_to_irq;
+int get_evtchn_to_irq(unsigned int evtchn);
struct irq_info *info_for_irq(unsigned irq);
unsigned cpu_from_irq(unsigned irq);
unsigned cpu_from_evtchn(unsigned int evtchn);
+static inline unsigned xen_evtchn_max_channels(void)
+{
+ return evtchn_ops->max_channels();
+}
+
+static inline unsigned xen_evtchn_nr_channels(void)
+{
+ return evtchn_ops->nr_channels();
+}
+
/*
* Do any ABI specific setup for a bound event channel before it can
* be unmasked and used.