mm/pgalloc: support 32 KB and 64 KB page sizes

Add CONFIG_MM_PGSIZE == 32768 and 65536 to the page-size switch (and the
Kconfig help text). The 64 KB size matches the ESP32-S3 cache-MMU page
granularity, so an address-environment port there can use one mm_pgalloc()
page per cache-MMU page (naturally 64 KB-aligned by the granule allocator)
instead of coalescing several smaller pages. Inert for existing configs:
MM_PGSIZE is only used when CONFIG_MM_PGALLOC is enabled (BUILD_KERNEL).

Assisted-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This commit is contained in:
Marco Casaroli 2026-07-30 14:16:02 +02:00 committed by Xiang Xiao
parent a3d4802ff8
commit 4770f7b46c
2 changed files with 10 additions and 3 deletions

View file

@ -69,6 +69,12 @@
#elif CONFIG_MM_PGSIZE == 16384
# define MM_PGSIZE 16384
# define MM_PGSHIFT 14
#elif CONFIG_MM_PGSIZE == 32768
# define MM_PGSIZE 32768
# define MM_PGSHIFT 15
#elif CONFIG_MM_PGSIZE == 65536
# define MM_PGSIZE 65536
# define MM_PGSHIFT 16
#else
# error CONFIG_MM_PGSIZE not supported
#endif

View file

@ -301,9 +301,10 @@ config MM_PGSIZE
int "Page Size"
default 4096
---help---
The MMU page size. Must be one of {1024, 2048, 4096, 8192, or
16384}. This is easily extensible, but only those values are
currently support.
The MMU page size. Must be one of {1024, 2048, 4096, 8192, 16384,
32768, or 65536}. This is easily extensible, but only those values
are currently support. 64 KB (65536) matches the ESP32-S3 cache-MMU
page size.
config DEBUG_PGALLOC
bool "Page Allocator Debug"