Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152755894
D56282.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
946 B
Referenced Files
None
Subscribers
None
D56282.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/ascii85.h b/sys/compat/linuxkpi/common/include/linux/ascii85.h
new file mode 100644
--- /dev/null
+++ b/sys/compat/linuxkpi/common/include/linux/ascii85.h
@@ -0,0 +1,46 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2026 The FreeBSD Foundation
+ */
+
+#ifndef _LINUXKPI_LINUX_ASCII85_H_
+#define _LINUXKPI_LINUX_ASCII85_H_
+
+#include <sys/param.h>
+
+#define ASCII85_BUFSZ 6
+
+static inline long
+ascii85_encode_len(long in_len)
+{
+ long out_len;
+
+ out_len = howmany(in_len, 4);
+
+ return (out_len);
+}
+
+static inline const char *
+ascii85_encode(uint32_t in, char *out)
+{
+ int i;
+
+ if (in == 0) {
+ out[0] = 'z';
+ out[1] = '\0';
+ return (out);
+ }
+
+ for (i = ASCII85_BUFSZ - 2; i >= 0; i--) {
+ out[i] = in % 85;
+ out[i] += 33;
+
+ in /= 85;
+ }
+ out[ASCII85_BUFSZ - 1] = '\0';
+
+ return (out);
+}
+
+#endif /* _LINUXKPI_LINUX_ASCII85_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 17, 10:26 PM (19 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31043621
Default Alt Text
D56282.diff (946 B)
Attached To
Mode
D56282: linuxkpi: Add <linux/ascii85.h>
Attached
Detach File
Event Timeline
Log In to Comment