Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Sep 2020 04:37:56 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365022 - head/sys/libkern
Message-ID:  <202009010437.0814buhY098368@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009010437.0814buhY098368>