Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Dec 2003 17:16:36 -0800 (PST)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 43331 for review
Message-ID:  <200312030116.hB31GaNN091398@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=43331

Change 43331 by peter@peter_overcee on 2003/12/02 17:16:27

	add bsfq/bsrq functions that work on 64 bit quantities.

Affected files ...

.. //depot/projects/hammer/sys/amd64/include/cpufunc.h#12 edit

Differences ...

==== //depot/projects/hammer/sys/amd64/include/cpufunc.h#12 (text+ko) ====

@@ -77,6 +77,15 @@
 	return (result);
 }
 
+static __inline u_long
+bsfq(u_long mask)
+{
+	u_long	result;
+
+	__asm __volatile("bsfq %1,%0" : "=r" (result) : "rm" (mask));
+	return (result);
+}
+
 static __inline u_int
 bsrl(u_int mask)
 {
@@ -86,6 +95,15 @@
 	return (result);
 }
 
+static __inline u_long
+bsrq(u_long mask)
+{
+	u_long	result;
+
+	__asm __volatile("bsrl %1,%0" : "=r" (result) : "rm" (mask));
+	return (result);
+}
+
 static __inline void
 disable_intr(void)
 {



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