Add two useful macros that I have been meaning to add for quite
authorHiten Pandya <hmp@dragonflybsd.org>
Wed, 27 Aug 2003 17:13:22 +0000 (17:13 +0000)
committerHiten Pandya <hmp@dragonflybsd.org>
Wed, 27 Aug 2003 17:13:22 +0000 (17:13 +0000)
commitf754816e98c48671805f81055cf309543b3add1e
tree1d6059cf152aa4035a4cb4ee4f52cc2e95a51d1b
parentc7158d945f4cca26b22a5ca859aeee40c30c60c7
Add two useful macros that I have been meaning to add for quite
some time.

__cachealign:

The __cachealign macro can be used for cache line aligning structures
of small to medium size.  It aligns the particular structure or
storage type to a system default cache line alignment, thus giving us
a much more better cache utilization by making the hardware work at
its best burst speeds.

__usereg:

The __usereg macro can/should be used when a function contains
arguments not more than 3.  It can be very useful to us due to the
message-passing nature of the kernel.

NOTE: I have not modified any other source files to make use of this
macro yet.  After I do some analysis, headers in sys/ which contain
small to medium sized structures will be modified to use the
__cachealign macro.

NOTE: No source files have been modified to make use of the __usereg
macro yet.  This process can be automated, because the maximum number
of arguments that apply to this macro is 3.

Reviewed by: Matt
sys/sys/cdefs.h