Print this page
3364 dboot should check boot archive integrity
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Dan McDonald <danmcd@nexenta.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Garrett D'Amore <garrett@damore.org>

@@ -30,17 +30,17 @@
  * standard, available at http://www.itl.nist.gov/fipspubs/fip180-1.htm
  * Not as fast as one would like -- further optimizations are encouraged
  * and appreciated.
  */
 
-#ifndef _KERNEL
+#if !defined(_KERNEL) && !defined(_BOOT)
 #include <stdint.h>
 #include <strings.h>
 #include <stdlib.h>
 #include <errno.h>
 #include <sys/systeminfo.h>
-#endif  /* !_KERNEL */
+#endif  /* !_KERNEL && !_BOOT */
 
 #include <sys/types.h>
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/sysmacros.h>

@@ -50,10 +50,15 @@
 #ifdef _LITTLE_ENDIAN
 #include <sys/byteorder.h>
 #define HAVE_HTONL
 #endif
 
+#ifdef  _BOOT
+#define bcopy(_s, _d, _l)       ((void) memcpy((_d), (_s), (_l)))
+#define bzero(_m, _l)           ((void) memset((_m), 0, (_l)))
+#endif
+
 static void Encode(uint8_t *, const uint32_t *, size_t);
 
 #if     defined(__sparc)
 
 #define SHA1_TRANSFORM(ctx, in) \