diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2002-08-12 20:27:45 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2002-08-12 20:27:45 -0700 |
| commit | 466e44bb94c10842f9e34b4692e01bd7210c2a89 (patch) | |
| tree | ea671e4c11b6c390a29ddcf192ac3f9916c64f2f /kernel | |
| parent | b7b75b49fd49d23f2467091e57a6c5c08d275b03 (diff) | |
[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.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/softirq.c | 24 |
1 files changed, 12 insertions, 12 deletions
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(); } |
