Messages in this thread | | | Date | Fri, 26 Nov 2010 17:31:36 +0100 | From | Tejun Heo <> | Subject | Re: [thiscpuops upgrade 03/10] percpu: Generic support for this_cpu_add,sub,dec,inc_return |
| |
On 11/24/2010 12:51 AM, Christoph Lameter wrote: > Introduce generic support for this_cpu_add_return etc. > > The fallback is to realize these operations with __this_cpu_ops. > > Signed-off-by: Christoph Lameter <cl@linux.com> > > --- > include/linux/percpu.h | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 70 insertions(+) > > Index: linux-2.6/include/linux/percpu.h > =================================================================== > --- linux-2.6.orig/include/linux/percpu.h 2010-11-23 17:29:46.000000000 -0600 > +++ linux-2.6/include/linux/percpu.h 2010-11-23 17:31:14.000000000 -0600 > @@ -240,6 +240,20 @@ extern void __bad_size_call_parameter(vo > pscr_ret__; \ > }) > > +#define __pcpu_size_call_return2(stem, variable, ...) \ > +({ typeof(variable) pscr_ret__; \ > + __verify_pcpu_ptr(&(variable)); \ > + switch(sizeof(variable)) { \ > + case 1: pscr_ret__ = stem##1(variable, __VA_ARGS__);break; \ > + case 2: pscr_ret__ = stem##2(variable, __VA_ARGS__);break; \ > + case 4: pscr_ret__ = stem##4(variable, __VA_ARGS__);break; \ > + case 8: pscr_ret__ = stem##8(variable, __VA_ARGS__);break; \ > + default: \ > + __bad_size_call_parameter();break; \ > + } \ > + pscr_ret__; \ > +})
If we're gonna do __VA_ARGS__, can't we just replace __pcpu_size_call_return()? Other than that, looks good to me.
Thanks.
-- tejun
| |