From 466e44bb94c10842f9e34b4692e01bd7210c2a89 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 12 Aug 2002 20:27:45 -0700 Subject: [PATCH] get_cpu_var patch This makes introduces get_cpu_var()/put_cpu_var() which gets a per-cpu variable and disables preemption, and renames the (unsafe under preemption) "this_cpu()" macro to __get_cpu_var(). It also deletes the redundant definitions in linux/smp.h. --- kernel/softirq.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'kernel') diff --git a/kernel/softirq.c b/kernel/softirq.c index 58825a0bbc62..c5089c2cd2c9 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -159,8 +159,8 @@ void __tasklet_schedule(struct tasklet_struct *t) unsigned long flags; local_irq_save(flags); - t->next = this_cpu(tasklet_vec).list; - this_cpu(tasklet_vec).list = t; + t->next = __get_cpu_var(tasklet_vec).list; + __get_cpu_var(tasklet_vec).list = t; cpu_raise_softirq(smp_processor_id(), TASKLET_SOFTIRQ); local_irq_restore(flags); } @@ -170,8 +170,8 @@ void __tasklet_hi_schedule(struct tasklet_struct *t) unsigned long flags; local_irq_save(flags); - t->next = this_cpu(tasklet_hi_vec).list; - this_cpu(tasklet_hi_vec).list = t; + t->next = __get_cpu_var(tasklet_hi_vec).list; + __get_cpu_var(tasklet_hi_vec).list = t; cpu_raise_softirq(smp_processor_id(), HI_SOFTIRQ); local_irq_restore(flags); } @@ -181,8 +181,8 @@ static void tasklet_action(struct softirq_action *a) struct tasklet_struct *list; local_irq_disable(); - list = this_cpu(tasklet_vec).list; - this_cpu(tasklet_vec).list = NULL; + list = __get_cpu_var(tasklet_vec).list; + __get_cpu_var(tasklet_vec).list = NULL; local_irq_enable(); while (list) { @@ -202,8 +202,8 @@ static void tasklet_action(struct softirq_action *a) } local_irq_disable(); - t->next = this_cpu(tasklet_vec).list; - this_cpu(tasklet_vec).list = t; + t->next = __get_cpu_var(tasklet_vec).list; + __get_cpu_var(tasklet_vec).list = t; __cpu_raise_softirq(smp_processor_id(), TASKLET_SOFTIRQ); local_irq_enable(); } @@ -214,8 +214,8 @@ static void tasklet_hi_action(struct softirq_action *a) struct tasklet_struct *list; local_irq_disable(); - list = this_cpu(tasklet_hi_vec).list; - this_cpu(tasklet_hi_vec).list = NULL; + list = __get_cpu_var(tasklet_hi_vec).list; + __get_cpu_var(tasklet_hi_vec).list = NULL; local_irq_enable(); while (list) { @@ -235,8 +235,8 @@ static void tasklet_hi_action(struct softirq_action *a) } local_irq_disable(); - t->next = this_cpu(tasklet_hi_vec).list; - this_cpu(tasklet_hi_vec).list = t; + t->next = __get_cpu_var(tasklet_hi_vec).list; + __get_cpu_var(tasklet_hi_vec).list = t; __cpu_raise_softirq(smp_processor_id(), HI_SOFTIRQ); local_irq_enable(); } -- cgit v1.2.3