Artem Kachitchkine wrote:
>
>> (I'm thinking of code that does PIOs into little endian PCI devices, 
>> for example.  Endian swap of data like audio data is another good 
>> example.)
>
> Drivers should use ddi_rep_* functions, which are optimized.
>
> -Artem
OpenGrok shows a number of instances where ddi_swap32 is used.  Not all 
accesses are necessarily ddi_rep_* appropriate (although big chunks of 
PIO certainly seem like they would qualify.)

I'm thinking also of places where lots of swapping is required to deal 
with on-disk data structures.  For example, the audio mixing logic may 
need to swap endianness of audio data streams.  I wonder if filesystem 
code could use this as well.  For example, I see lots of calls to 
SWAP_32() (a locally defined macro) in udfs.  It wouldn't surprise me to 
find this elsewhere as well.

The thing is, taken as a few cycles, it doesn't matter much.  But taken 
over the sum total of everything that the machine does, these cycles 
ultimately consume time and power.  Some of this stuff is in critical 
paths.  We can do better.

    -- Garrett
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to