This is to avoid API conflict of crc32() with zlib.h.
ABI conflict can be avoided with -DZ_PREFIX but that requires header file split.
Use and honor Gary S. Brown as filename prefix.
Details
No functionality changes are made.
% make buildworld buildkernel TARGET_ARCH=<arch>
% make installkernel
... reboot etc.
% make installworld
... reboot etc
% make -C .../tests/sys/kern
with nooptions SCTP and options SCTP for i386, amd64 and aach64/arm64
And some/few regression tests.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 24575 Build 23361: arc lint + arc unit
Event Timeline
sys/sys/crc32.h | ||
---|---|---|
61 ↗ | (On Diff #57161) | There should be no line split in the function declaration after the return type. |
sys/sys/crc32.h | ||
---|---|---|
40 ↗ | (On Diff #57161) | Should this extern declaration conditionalized for _KERNEL ? Is this header supposed to be useful for usermode at all ? |
sys/sys/crc32.h | ||
---|---|---|
40 ↗ | (On Diff #57161) | crc32_tab[] is used in crc32_raw() below. Do you mean to surround all of crc32 functions with ifdef _KERNEL? zlib provides crc32() function as well and easy to link with -lz. |
I'd like to rename libkern/crc32.c to libkern/kern_crc32.c so that we don't get object filename conflict with zlib/crc32.c as well.
I'm having difficulties with arc diff...
Rename libkern/crc32.c to libkern/kern_crc32.c to avoid having same object
filename as zlib/crc32.c.
I wonder if we'd better rename the header to sys/kern_crc32.h as well.
sys/libkern/x86/crc32_sse42.c | ||
---|---|---|
32 | Unrelated to your change, but maybe we can change this to #if(n)def _KERNEL (along with the comment above) and simply drop USERSPACE_TESTING in tests/sys/kern/Makefile? |
sys/libkern/x86/crc32_sse42.c | ||
---|---|---|
32 | Now, I get kib's _KERNEL question at last. I adjusted and ran 'make -c tests/sys/kern' to test. |
sys/libkern/crc32.c | ||
---|---|---|
1 | By the way, there are files named sys/kern/kern_xxx.c and sys/libkern/xxx.c. What's the policy between kern and libkern directory? |
After research, I found that our crc32 functions are based on the code written
by Gary S Brown. We also have many other *crc32.[hc] files, too. Rather than,
prefixing with kern, prefix with his initial to honor his work.
It looks kern prefix is used for sub-systems.
Xin committed this change with minor adjustments and https://svnweb.freebsd.org/base?view=revision&revision=349151 was the revision.