Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177549201
D61209.1794687338.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
697 B
Referenced Files
None
Subscribers
None
D61209.1794687338.diff
View Options
Index: sys/compat/linuxkpi/common/include/linux/int_log.h
===================================================================
--- /dev/null
+++ sys/compat/linuxkpi/common/include/linux/int_log.h
@@ -0,0 +1,27 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2026 The FreeBSD Foundation
+ */
+
+#ifndef _LINUXKPI_LINUX_INT_LOG_H_
+#define _LINUXKPI_LINUX_INT_LOG_H_
+
+static inline unsigned int
+intlog10(uint32_t value)
+{
+ unsigned int log;
+
+ if (value == 0)
+ return (0);
+
+ for (log = 1; value; value /= 10, ++log)
+ continue;
+
+ log--;
+
+ /* The result is shifted left by 24 bits on Linux. */
+ return (log << 24);
+}
+
+#endif /* _LINUXKPI_LINUX_INT_LOG_H__ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 14, 8:15 PM (15 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41712080
Default Alt Text
D61209.1794687338.diff (697 B)
Attached To
Mode
D61209: linuxkpi: Add `int_log10()`
Attached
Detach File
Event Timeline