Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jan 2018 06:30:50 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327807 - head/sys/contrib/zstd/lib/freebsd
Message-ID:  <201801110630.w0B6UoFg053314@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Thu Jan 11 06:30:50 2018
New Revision: 327807
URL: https://svnweb.freebsd.org/changeset/base/327807

Log:
  Zstd: Add bswap intrinsics for small MIPS systems (e.g., Onion Omega)
  
  Reported by:	mizhka
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c

Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c
==============================================================================
--- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c	Thu Jan 11 05:36:13 2018	(r327806)
+++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c	Thu Jan 11 06:30:50 2018	(r327807)
@@ -27,6 +27,7 @@
  */
 
 #include "zstd_kfreebsd.h"
+#include <sys/endian.h>
 
 /*
  * The kernel as a standalone target does not link against libgcc or
@@ -43,6 +44,19 @@
  * A subsequent enhancement might create a mini compiler-rt library for kernel
  * use and move these over there instead.
  */
+
+/* Swap endianness */
+int
+__bswapsi2(int x)
+{
+	return (bswap32(x));
+}
+
+long long
+__bswapdi2(long long x)
+{
+	return (bswap64(x));
+}
 
 /* Count trailing zeros */
 int



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