Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Apr 2026 21:08:39 +0000
From:      Bjoern A. Zeeb <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Cc:        Jean-=?utf-8?Q?S=C3=A9bast?==?utf-8?Q?ien P=C3=A9?=dron <dumbbell@FreeBSD.org>
Subject:   git: 4e16185757c1 - stable/15 - linuxkpi: Add <linux/ascii85.h>
Message-ID:  <69e938d7.26d38.5a8add27@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch stable/15 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=4e16185757c10cf5e505ddb74281c07bea5af918

commit 4e16185757c10cf5e505ddb74281c07bea5af918
Author:     Jean-Sébastien Pédron <dumbbell@FreeBSD.org>
AuthorDate: 2026-03-09 19:04:12 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-04-22 20:57:03 +0000

    linuxkpi: Add <linux/ascii85.h>
    
    This is used by the i915 DRM driver for some time to log more details
    about a GPU error, but the code was commented out.
    
    Reviewed by:    emaste
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D56282
    
    (cherry picked from commit 0eaa57625d0fbe9960eabbaaedd522acdf673648)
---
 sys/compat/linuxkpi/common/include/linux/ascii85.h | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/ascii85.h b/sys/compat/linuxkpi/common/include/linux/ascii85.h
new file mode 100644
index 000000000000..06777a130e41
--- /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_ */


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e938d7.26d38.5a8add27>