lkml.org 
[lkml]   [2007]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 01/28] cpu alloc: The allocator
From
Date
On Thu, 2007-11-08 at 13:34 +0100, Peter Zijlstra wrote:
> On Tue, 2007-11-06 at 11:51 -0800, Christoph Lameter wrote:

> > +#ifndef _LINUX_CPU_ALLOC_H_
> > +#define _LINUX_CPU_ALLOC_H_
> > +
> > +#define CPU_OFFSET(__cpu) \
> > + ((unsigned long)(__cpu) << (CONFIG_CPU_AREA_ORDER + PAGE_SHIFT))
> > +
> > +#define CPU_PTR(__p, __cpu) ((__typeof__(__p))((void *)(__p) + \
> > + CPU_OFFSET(__cpu)))
> > +
> > +#define CPU_ALLOC(type, flags) cpu_alloc(sizeof(type), flags, \
> > + __alignof__(type))
> > +#define CPU_FREE(pointer) cpu_free(pointer, sizeof(*(pointer)))
> > +
> > +#define THIS_CPU(__p) CPU_PTR(__p, smp_processor_id())
> > +#define __THIS_CPU(__p) CPU_PTR(__p, raw_smp_processor_id())
> > +
> > +/*
> > + * Raw calls
> > + */
> > +void *cpu_alloc(unsigned long size, gfp_t gfp, unsigned long align);
> > +void cpu_free(void *cpu_pointer, unsigned long size);
> > +
> > +#endif /* _LINUX_CPU_ALLOC_H_ */
>
> Like said in the previous mail (which due to creative mailing from your
> end never made it out to the lists), I dislike those shouting macros.
> Please lowercase them.

sed -i -e 's/CPU_OFFSET/cpu_offset/g' -e 's/CPU_PTR/cpu_ptr/' -e
's/CPU_ALLOC/cpu_alloc_type/g' -e 's/cpu_free/__cpu_free/g' -e
's/CPU_FREE/cpu_free/' -e 's/THIS_CPU/this_cpu/g' patches/*.patch

should get you there.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-11-08 13:41    [W:0.167 / U:0.604 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site