From aacdbf2a3b804ede71658310ba0b63498ef50dda Mon Sep 17 00:00:00 2001 From: Ville Juven Date: Wed, 1 Nov 2023 14:33:48 +0200 Subject: [PATCH] risc-v/addrenv: Improve the commenting on struct arch_addrenv_s I can never remember whether the static page table list contains the table's physical or kernel virtual address.. Add the fact as a comment there. Also add the limitations that come from this static page table approach for Sv32. --- arch/risc-v/include/arch.h | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/risc-v/include/arch.h b/arch/risc-v/include/arch.h index 1bf88a7622..6425a897f4 100644 --- a/arch/risc-v/include/arch.h +++ b/arch/risc-v/include/arch.h @@ -69,6 +69,11 @@ * * The implications ? They depend on the MMU type. * + * For Sv32 this means that: + * - A task can not have more than 4GB of memory allocated. + * - The minimum amount of memory needed for page tables per task is 8K, + * which gives access to 4MB of memory. This is plenty for many tasks. + * * For Sv39 this means that: * - A task can not have more than 1GB of memory allocated. This should be * plenty enough... @@ -78,26 +83,20 @@ struct arch_addrenv_s { - /* Pointers to MAX_LEVELS-1 tables here, one of each are allocated for the - * task when it is created. + /* Physical addresses of the static page tables (levels N-1) here, these + * are allocated when a task is created. */ uintptr_t spgtables[ARCH_SPGTS]; - /* For convenience store the text base here */ + /* The text, data, heap bases and heap size here */ uintptr_t textvbase; - - /* For convenience store the data base here */ - uintptr_t datavbase; - - /* For convenience store the heap base and initial size here */ - uintptr_t heapvbase; size_t heapsize; - /* For convenience store the satp value here */ + /* The page directory root (satp) value */ uintptr_t satp; };