casaroli commented on code in PR #19772: URL: https://github.com/apache/nuttx/pull/19772#discussion_r3757995431
########## arch/xtensa/src/esp32s3/esp32s3_pgalloc.c: ########## @@ -0,0 +1,227 @@ +/**************************************************************************** + * arch/xtensa/src/esp32s3/esp32s3_pgalloc.c + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. The + * ASF licenses this file to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance with the + * License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> + +#include <assert.h> +#include <debug.h> +#include <inttypes.h> + +#include <nuttx/addrenv.h> +#include <nuttx/arch.h> +#include <nuttx/pgalloc.h> +#include <nuttx/sched.h> + +#include "sched/sched.h" + +#include "esp32s3_addrenv.h" + +#ifdef CONFIG_ESP32S3_SPIRAM +# include "esp32s3_spiram.h" +#endif + +#ifdef CONFIG_MM_PGALLOC + +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +/**************************************************************************** + * Name: up_allocate_pgheap + * + * Description: + * If there is a page allocator in the configuration, then this function + * must be provided by the platform-specific code. The OS initialization + * logic will call this function early in the initialization sequence to + * get the page heap information needed to configure the page allocator. + * + * On the ESP32-S3 the page pool is a slice of the external octal PSRAM. + * The pool is described by its *physical* base -- for the cache MMU that + * is the zero-based offset into the PSRAM device -- because mm_pgalloc() + * hands out physical page addresses. The whole pool is also permanently + * mapped into the kernel (WORLD0) data-bus window at + * CONFIG_ARCH_PGPOOL_VBASE so the kernel can reach any page it allocates + * (see esp32s3_pgvaddr()). + * + * Input Parameters: + * heap_start - Receives the physical base address of the page pool. + * heap_size - Receives the size of the page pool in bytes. + * + ****************************************************************************/ + +void up_allocate_pgheap(void **heap_start, size_t *heap_size) Review Comment: Maybe just pgalloc, because it might be similar enough to LX6 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
