Commit Graph

73 Commits

Author SHA1 Message Date
Ville Juven 0476e30a6d mm/kmm_map: Add support to dynamically map pages into kernel virtual memory
This adds functionality to map pages dynamically into kernel virtual
memory. This allows implementing I/O remap for example, which is a useful
(future) feature.

Now, the first target is to support mapping user pages for the kernel.

Why? There are some userspace structures that might be needed when the
userspace process is not running. Semaphores are one such example. Signals
and the WDT timeout both need access to the user semaphore to work
properly. Even though for this only obtaining the kernel addressable
page pool virtual address is needed, for completeness a procedure is
provided to map several pages.
2023-06-02 10:50:26 +08:00
chao an 2be18a8b24 makefile: fix libc/mm files can not be compiled incrementally
Use double delim to fix windows native build and give an error:
makefile:132: *** target mode do not include“%”. stop.

In Windows environment DELIM := $(strip \) but \ has two role:
first: \ as directory, and second \ as Escape character, Reference:

https://github.com/apache/nuttx/pull/7572#discussion_r1028219229

Signed-off-by: chao an <anchao@xiaomi.com>
2023-04-24 12:43:10 +03:00
yinshengkai ab2b09e557 Revert "Makefile: fix redundant delimiters when using make V=1"
This reverts commit 64d39a8b7b.
2023-02-01 20:39:52 +08:00
yinshengkai 64d39a8b7b Makefile: fix redundant delimiters when using make V=1
rm-none-eabi-ar rcs  libc.a    bin//lib_assert.o  bin//lib_builtin_getname.o
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2023-01-31 15:12:36 -03:00
Xiang Xiao a6428f4c27 mm: Integrate TLSF manager
can be enabled by CONFIG_MM_TLSF_MANAGER=y

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
2023-01-15 03:43:37 +08:00
Jukka Laitinen 7f8bec7070 Add mm/mm_map virtual memory mapping list
The task_group specific list can be used to store information about
mmappings.

For a driver or filesystem performing mmap can also enable munmap by
adding an item to this list using mm_map_add(). The item is then
returned in the corresponding munmap call.

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2023-01-10 18:34:25 +08:00
zouboan eaea38e0f2 libc and mm/Makefile:Fix an error caused by backslash in Windows native build
libc and mm/Makefile:Fix an error caused by backslash in Windows native build
2022-12-01 01:47:46 +08:00
yinshengkai 85f727f232 tools: replace INCDIR to Makefile variable
In the past, header file paths were generated by the incdir command
Now they are generated by concatenating environment variables

In this way, when executing makefile, no shell command will be executed,
it will improve the speed of executing makfile
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
2022-11-03 19:59:55 +08:00
Huang Qi a06ec54cd0 debug: Introduce portion of UBSan
without UBSan
```
 text    data     bss     dec     hex filename
  85612     208  142258  228078   37aee nuttx
```

with UBSan:
```
   text    data     bss     dec     hex filename
 194290   98164  208634  501088   7a560 nuttx
```

```c
int main(int argc, FAR char *argv[])
{
  uint32_t ptr[32];
  printf("Hello, World!! %lu\n", ptr[64]);
  return 0;
}
```
Try to run this sample:
```
nsh> hello
ubsan_prologue: ================================================================================
ubsan_prologue: UBSAN: array-index-out-of-bounds in hello_main.c:39:37
__ubsan_handle_out_of_bounds: index 64 is out of range for type 'uint32_t [32]'
ubsan_epilogue: ================================================================================
Hello, World!! 1070182368
nsh>
```

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2022-08-22 13:57:29 +08:00
Jiuzhu Dong e3bbbfe4d0 mm/mempool: support memory buffer pool
Signed-off-by: Jiuzhu Dong <dongjiuzhu1@xiaomi.com>
2022-08-09 15:38:57 +08:00
Abdelatif Guettouche 4896623be2 build: Fix dependencies of kernel targets.
Targets build during the kernel phase did not have their dependencies
specified and thus they were not rebuilt after their dependencies have
changed, for example by changing options in menuconfig.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2022-05-24 10:45:39 +08:00
chenwei23 39cdd99d77 mm: Support the kernel address sanitizer
Signed-off-by: chenwei23 <chenwei23@xiaomi.com>
2021-11-02 13:32:47 -03:00
Alin Jerpelea bcee9c391c mm: Author Gregory Nutt: update licenses to Apache
Gregory Nutt has submitted the SGA and we can mograte the licenses
to Apache.

Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2021-02-09 01:21:53 -08:00
Matias N 88f1cdb915 build system: add missing --obj-path to MKDEP 2020-11-28 09:59:56 -06:00
chao.an c56785bd0d style/Makefile: remove unnecessary trailing whitespace
N/A

Signed-off-by: chao.an <anchao@xiaomi.com>
2020-11-28 12:20:30 +01:00
Matias N d5b6ec450f Parallelize depend file generation 2020-11-22 09:02:59 -03:00
dongjiuzhu 23ddeaf3be mm/circbuf: support circular buffer managerment
N/A

Change-Id: Ib1fc009b9ce3af5815920f22221fe8a7262299ef
Signed-off-by: dongjiuzhu <dongjiuzhu1@xiaomi.com>
2020-11-20 05:33:03 -08:00
Matias N 166242c171 use "export" to expose TOPDIR to all child make instead of passing it around every time 2020-09-15 21:11:33 -07:00
SPRESENSE e249a2f82f Makefile: Fix Make.dep not updated by config changes
Make.dep file should be updated by .config changed after first make.
There are 2 cases affected for this problem:

 1) Add source files by config symbol
 2) Include header files in #ifdef directive

These 2 cases may not be included in Make.dep and this may prevent the
differential build from working correctly.
2020-07-28 03:59:45 -05:00
Xiang Xiao 7e5b0f81e9 build: Replace -I with INCDIR
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 20:20:12 +01:00
Xiang Xiao 23668a4b9b build: Remove the empty variable assignment
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-24 08:24:13 -06:00
Xiang Xiao 1a95cce1a3 build: Move .config check to the top Makefile
remove the workaround to handle the inexistence of .config/Make.defs

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-20 17:57:34 +01:00
Xiang Xiao a2f657e4cb build: Move KDEFINE to a common place(tools/Config.mk)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
Xiang Xiao f2aba8d9b7 build: Remove 'u' prefix from userspace library
so user needn't link the different library because the build type change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2020-05-01 15:56:55 -06:00
liuhaitao 459ad99373 Use EXTRAFLAGS instead of EXTRADEFINES to be used by make via command line
So call 'make EXTRAFLAGS=-Wno-cpp' could suppress the warnings with pre-processor
directive #warning in GCC.

Change-Id: Iaa618238924c9969bf91db22117b39e6d2fc9bb6
Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
2020-04-11 08:31:08 -06:00
Gregory Nutt d1a8a803e4 Build system: Get rid of the MOVEOBJ definition
Eliminate the MOVEOBJ definition from tools/Config.mk, Makefiles, and other locations.  The MOVEOBJ definition was used to work around the case where the object output of a compile or assemble is in a different directory than the source file.  The ZDS-II tools have no command line option to perform this move; MOVEOBJ handled the move as a post-compiler operation.

MOVEOBJ is no longer needed because this the ez80 COMPILE and ASSEMBLE definitions now handle all of the object file movement cases.
2020-02-24 22:37:28 +01:00
Xiang Xiao adbff7de81 tools/Config.mk: add DEFINE macro like INCDIR 2020-02-03 15:06:11 -06:00
chao.an c3ba541bd2 Author: Gregory Nutt <gnutt@nuttx.org>
mm/Makefile:  Same change should be applied to mm/Makefile since the mm/ build is identical to the libc/ build.
        libs/libnx/Makefile:  Same change should be applied to libnx/Makefile since the mm/ build is identical to the libc/ build.

    Author: chao.an <anchao@xiaomi.com>

        libs/libc/Makefile:  Correct the dependents path
2020-01-21 08:02:23 -06:00
anchao bb8648e7a0 ibs/libc/Makefile, libs/libnx/Makefile, and mm/Makefile: Remove obj-path MKDEPS option since make dependency target (MT) is not supported by some toolchains. 2019-03-19 10:14:50 -06:00
Gregory Nutt ef89207c8d Build system: Fix CONFIG_BUILD_KERNEL logic directories that have ubin and kbin subdirectories. Conditional logic was fine for CONFIG_BUILD_FLAT and CONFIG_BUILD_PROTECTED but generated useless dependencies if CONFIG_BUILD_KERNEL. 2017-11-15 07:54:09 -06:00
Gregory Nutt 2043e1a114 IOBs: Move from driver/iob to a better location in mm/iob 2017-05-09 07:35:30 -06:00
Gregory Nutt c5a206666d Add a home for forthcoming shared memory logic 2014-09-22 10:58:27 -06:00
Gregory Nutt 3464089542 Move core heap allocator logic from mm/. to mm/mm_heap/. 2014-09-22 10:53:50 -06:00
Gregory Nutt 8b8c134efa Move the user heap allocator front-end from mm/. to mm/umm_heap/. 2014-09-22 10:48:58 -06:00
Gregory Nutt c3a2527e56 Move the kernel heap allocator front-end from mm/. to mm/kmm_heap/. 2014-09-22 10:42:26 -06:00
Gregory Nutt 907e45752b Move granuale allocator and page allocator from mm/. to mm/mm_gran/. 2014-09-22 10:33:23 -06:00
Gregory Nutt 5d9276ed71 More changes so that the KNSH build survives the changes needed for the ELF build 2014-09-16 15:55:21 -06:00
Gregory Nutt 45c31d633c Completes the implementation of sbrk() (untested) 2014-09-01 10:46:51 -06:00
Gregory Nutt f8a8ce4b18 Initial implementatino of sbrk() 2014-09-01 07:37:54 -06:00
Gregory Nutt ecdb5120dd Add low-level memory management hooks that will be needed to support brk() and sbrk() 2014-08-31 14:42:45 -06:00
Gregory Nutt b0246d0b7d mm: Break up mm_user.c and mm_kernel.c into separate files for better symmetry 2014-08-31 11:46:47 -06:00
Gregory Nutt 3c1a70c9dc Remove CONFIG_MM_MULTIHEAP. Non-multiheap operation is no longer supported 2014-08-31 10:54:55 -06:00
Gregory Nutt e3ff0689bb Rename CONFIG_NUTTX_KERNEL to CONFIG_BUILD_PROTECTED; Partially integrate new CONFIG_BUILD_KERNEL 2014-08-29 14:47:22 -06:00
Gregory Nutt b028fb31e9 include/nuttx/pgalloc.h and mm/mm_pgalloc.c: Add a simple page allocator based on the existing NuttX granule allocator. I am not certain if the granule allocator is sufficiently deterministic for long range use, but it gets get a page allocator in place for testing very quickly. 2014-08-23 16:37:16 -06:00
Gregory Nutt 7cd8db9425 gran_reserve(): Add a new function to reserve unallocatable regions in the granule heap 2014-08-23 12:43:21 -06:00
Gregory Nutt 3a1324741a More trailing whilespace removal 2014-04-13 14:32:20 -06:00
Gregory Nutt e10ab85d1d More changes to restore the native Windows build 2014-02-07 10:14:11 -06:00
Gregory Nutt 78936f7260 Changes for ZDS-II ez80 build 2013-11-28 17:47:03 -06:00
Gregory Nutt dc4c6bcb57 When creating kernel dependencies, need to define __KERNEL__ 2013-09-29 15:03:10 -06:00
Gregory Nutt c038f4efe0 Dependency generation fix for directories that keep object files in a sub-directory 2013-09-29 11:46:10 -06:00