[PATCH v5 18/23] sparc: Add <bits/pagesize.h>

Florian Weimer fweimer@redhat.com
Fri May 16 15:33:20 GMT 2025


According to arch/sparc/Kconfig in the Linux sources, 32-bit
SPARC has 4K pages, while 64-bit SPARC has 8K pages.  To enable
running 32-bit binaries in compat mode on 64-bit kernels, support
4K and 8K page sizes for 32-bit.  Support 4K pages on 64-bit as well,
to help qemu-user emulation (which inherits host page size).

The 64-bit toolchain defaults to 1 MiB page size support, so bump
the page size range on 64-bit to that, disregarding Linux support.
---
 sysdeps/sparc/sparc32/bits/pagesize.h | 2 ++
 sysdeps/sparc/sparc64/bits/pagesize.h | 4 ++++
 2 files changed, 6 insertions(+)
 create mode 100644 sysdeps/sparc/sparc32/bits/pagesize.h
 create mode 100644 sysdeps/sparc/sparc64/bits/pagesize.h

diff --git a/sysdeps/sparc/sparc32/bits/pagesize.h b/sysdeps/sparc/sparc32/bits/pagesize.h
new file mode 100644
index 0000000000..373d367b7b
--- /dev/null
+++ b/sysdeps/sparc/sparc32/bits/pagesize.h
@@ -0,0 +1,2 @@
+#define __GLIBC_PAGE_SHIFT_MIN 12
+#define __GLIBC_PAGE_SHIFT_MAX 13
diff --git a/sysdeps/sparc/sparc64/bits/pagesize.h b/sysdeps/sparc/sparc64/bits/pagesize.h
new file mode 100644
index 0000000000..845cd319be
--- /dev/null
+++ b/sysdeps/sparc/sparc64/bits/pagesize.h
@@ -0,0 +1,4 @@
+/* The kernel only supports 8K pages, but lower the minimum to 4K to help
+   qemu-user emulation.  */
+#define __GLIBC_PAGE_SHIFT_MIN 12
+#define __GLIBC_PAGE_SHIFT_MAX 20
-- 
2.49.0




More information about the Libc-alpha mailing list