[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: netbase (ping6) and kernel



The reason that ping6 probably uses the kernel set_bit() and friends
is that the kernel versions may be extremely optimised.  Remember
that they have to work on arbitrary ranges of memory (i.e. not
just a word).

For instance, on the ARM, I almost finished implementing versions
of these functions which used, where possible, David Seal's look-up
trick (involving Gray codes), to do extremely fast bit getting;
in this particular case, for example, the kernel version would be
far better than anything the C compiler is likely to come up with
(at least under gcc).

I dunno what the optimal solution is; #ifdef __arm__ and a bunch
of cut and pastes from the kernel source, I suppose, for the time
being.  File a bug report, I suppose.

-- 
Chris <chris@fluff.org>                         ( http://www.fluff.org/chris )


Reply to: