Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102652212
D40594.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40594.diff
View Options
Index: sys/conf/files.riscv
===================================================================
--- sys/conf/files.riscv
+++ sys/conf/files.riscv
@@ -23,12 +23,6 @@
kern/subr_intr.c standard
kern/subr_physmem.c standard
libkern/bcopy.c standard
-libkern/ffs.c standard
-libkern/ffsl.c standard
-libkern/ffsll.c standard
-libkern/fls.c standard
-libkern/flsl.c standard
-libkern/flsll.c standard
libkern/memcmp.c standard
libkern/memset.c standard
libkern/strcmp.c standard
Index: sys/riscv/include/cpufunc.h
===================================================================
--- sys/riscv/include/cpufunc.h
+++ sys/riscv/include/cpufunc.h
@@ -46,6 +46,63 @@
#ifdef _KERNEL
+#define HAVE_INLINE_FFS
+
+static __inline __pure2 int
+ffs(int mask)
+{
+
+ return (__builtin_ffs(mask));
+}
+
+#define HAVE_INLINE_FFSL
+
+static __inline __pure2 int
+ffsl(long mask)
+{
+
+ return (__builtin_ffsl(mask));
+}
+
+#define HAVE_INLINE_FFSLL
+
+static __inline __pure2 int
+ffsll(long long mask)
+{
+
+ return (__builtin_ffsll(mask));
+}
+
+#define HAVE_INLINE_FLS
+
+static __inline __pure2 int
+fls(int mask)
+{
+
+ return (mask == 0 ? 0 :
+ 8 * sizeof(mask) - __builtin_clz((u_int)mask));
+}
+
+#define HAVE_INLINE_FLSL
+
+static __inline __pure2 int
+flsl(long mask)
+{
+
+ return (mask == 0 ? 0 :
+ 8 * sizeof(mask) - __builtin_clzl((u_long)mask));
+}
+
+#define HAVE_INLINE_FLSLL
+
+static __inline __pure2 int
+flsll(long long mask)
+{
+
+ return (mask == 0 ? 0 :
+ 8 * sizeof(mask) - __builtin_clzll((unsigned long long)mask));
+}
+
#include <machine/riscvreg.h>
static __inline register_t
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 9:11 AM (21 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14656378
Default Alt Text
D40594.diff (1 KB)
Attached To
Mode
D40594: Build riscv kernel with inline ffs, fls
Attached
Detach File
Event Timeline
Log In to Comment