Move functions (and their data) to common code, and invoke the functions
on Arm as well. This is in preparation of dropping the register
parameters from handler functions.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Julien Grall <jgrall@amazon.com>
(cherry picked from commit
f67bddf3bccd99a5fee968c3b3f288db6a57d3be)
{
struct irq_desc *desc = irq_to_desc(irq);
struct irqaction *action;
+ struct cpu_user_regs *old_regs = set_irq_regs(regs);
perfc_incr(irqs);
out_no_end:
spin_unlock(&desc->lock);
irq_exit();
+ set_irq_regs(old_regs);
}
void release_irq(unsigned int irq, const void *dev_id)
extern int opt_irq_vector_map;
-/*
- * Per-cpu current frame pointer - the location of the last exception frame on
- * the stack
- */
-DECLARE_PER_CPU(struct cpu_user_regs *, __irq_regs);
-
-static inline struct cpu_user_regs *get_irq_regs(void)
-{
- return this_cpu(__irq_regs);
-}
-
-static inline struct cpu_user_regs *set_irq_regs(struct cpu_user_regs *new_regs)
-{
- struct cpu_user_regs *old_regs, **pp_regs = &this_cpu(__irq_regs);
-
- old_regs = *pp_regs;
- *pp_regs = new_regs;
- return old_regs;
-}
-
-
#define platform_legacy_irq(irq) ((irq) < 16)
void cf_check event_check_interrupt(struct cpu_user_regs *regs);
DEFINE_PER_CPU(vector_irq_t, vector_irq);
-DEFINE_PER_CPU(struct cpu_user_regs *, __irq_regs);
-
static LIST_HEAD(irq_ratelimit_list);
static DEFINE_SPINLOCK(irq_ratelimit_lock);
static struct timer irq_ratelimit_timer;
#include <xen/irq.h>
#include <xen/errno.h>
+DEFINE_PER_CPU(struct cpu_user_regs *, irq_regs);
+
int init_one_irq_desc(struct irq_desc *desc)
{
int err;
#define irq_disable_none irq_actor_none
#define irq_enable_none irq_actor_none
+/*
+ * Per-cpu interrupted context register state - the inner-most interrupt frame
+ * on the stack.
+ */
+DECLARE_PER_CPU(struct cpu_user_regs *, irq_regs);
+
+static inline struct cpu_user_regs *get_irq_regs(void)
+{
+ return this_cpu(irq_regs);
+}
+
+static inline struct cpu_user_regs *set_irq_regs(struct cpu_user_regs *new_regs)
+{
+ struct cpu_user_regs *old_regs, **pp_regs = &this_cpu(irq_regs);
+
+ old_regs = *pp_regs;
+ *pp_regs = new_regs;
+
+ return old_regs;
+}
+
struct domain;
struct vcpu;