Author: imp Date: Tue Sep 1 04:37:55 2020 New Revision: 365022 URL: https://svnweb.freebsd.org/changeset/base/365022
Log: Smaller crc for the boot loader. Save 7k of text space by using simpler crc32 for standalone case. we don't need all that fancy optimization in the boot loader, so use a simplified version of the CRC function. We could save more by doing it one bit at a time rather than 32, but this is the biggest savings at the smallest performance hit. With LUA and verfied exec, gptboot, gptzfsboot and friends are pushing the ~530k limit and every little bit helps. Reviewed By: allanjude Differential Revision: https://reviews.freebsd.org/D24225 Modified: head/sys/libkern/gsb_crc32.c Modified: head/sys/libkern/gsb_crc32.c ============================================================================== --- head/sys/libkern/gsb_crc32.c Tue Sep 1 01:57:56 2020 (r365021) +++ head/sys/libkern/gsb_crc32.c Tue Sep 1 04:37:55 2020 (r365022) @@ -227,6 +227,7 @@ singletable_crc32c(uint32_t crc, const void *buf, size return crc; } +#ifndef _STANDALONE /* * Copyright (c) 2004-2006 Intel Corporation - All Rights Reserved @@ -788,3 +789,10 @@ calculate_crc32c(uint32_t crc32c, return (multitable_crc32c(crc32c, buffer, length)); } } +#else +uint32_t +calculate_crc32c(uint32_t crc32c, const unsigned char *buffer, unsigned int length) +{ + return (singletable_crc32c(crc32c, buffer, length)); +} +#endif _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"