summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nuttx/ChangeLog4
-rw-r--r--nuttx/Documentation/README.html4
-rw-r--r--nuttx/README.txt2
-rw-r--r--nuttx/mm/README.txt71
-rw-r--r--nuttx/mm/mm_environment.h6
5 files changed, 84 insertions, 3 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index 68f0933dd..eec1c9669 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -3332,4 +3332,6 @@
Not all features have been verified. The ENC28J60 network
is not yet functional.
* configs/stm3240g-eval/discover: A configuration for testing
- the UDP discovery utility. Contributed by Max Holtzberg. \ No newline at end of file
+ the UDP discovery utility. Contributed by Max Holtzberg.
+ * mm/README.txt: Add a new README file.
+
diff --git a/nuttx/Documentation/README.html b/nuttx/Documentation/README.html
index 5bc3d1d96..a92b99269 100644
--- a/nuttx/Documentation/README.html
+++ b/nuttx/Documentation/README.html
@@ -8,7 +8,7 @@
<tr align="center" bgcolor="#e4e4e4">
<td>
<h1><big><font color="#3c34ec"><i>NuttX README Files</i></font></big></h1>
- <p>Last Updated: August 1, 2012</p>
+ <p>Last Updated: September 12, 2012</p>
</td>
</tr>
</table>
@@ -237,6 +237,8 @@
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/lib/README.txt?view=log"><b><i>README.txt</i></b></a>
| |- libxx/
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/libxx/README.txt?view=log"><b><i>README.txt</i></b></a>
+ | |- mm/
+ | | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/mm/README.txt?view=log"><b><i>README.txt</i></b></a>
| |- syscall/
| | `- <a href="http://nuttx.svn.sourceforge.net/viewvc/nuttx/trunk/nuttx/syscall/README.txt?view=log"><b><i>README.txt</i></b></a>
| `- tools/
diff --git a/nuttx/README.txt b/nuttx/README.txt
index ae33a6e9c..afea4d2e3 100644
--- a/nuttx/README.txt
+++ b/nuttx/README.txt
@@ -806,6 +806,8 @@ nuttx
| `- README.txt
|- libxx/
| `- README.txt
+ |- mm/
+ | `- README.txt
|- syscall/
| `- README.txt
`- tools/
diff --git a/nuttx/mm/README.txt b/nuttx/mm/README.txt
new file mode 100644
index 000000000..b0b80deae
--- /dev/null
+++ b/nuttx/mm/README.txt
@@ -0,0 +1,71 @@
+mm/README.txt
+=============
+
+This directory contains the NuttX memory management logic. This include:
+
+1) The standard memory management functions as prototyped in stdlib.h as
+ specified in the Base definitions volume of IEEE Std 1003.1-2001. This
+ include the files:
+
+ o Standard Interfaces: mm_malloc.c, mm_calloc.c, mm_realloc.c,
+ mm_memalign.c, mm_free.c
+ o Less-Standard Interfaces: mm_zalloc.c, mm_mallinfo.c
+ o Internal Implementation: mm_initialize.c mm_sem.c mm_addfreechunk.c
+ mm_size2ndx.c mm_shrinkchunk.c, mm_internal.h
+ o Build and Configuration files: Kconfig, Makefile
+
+ Memory Models:
+
+ o Small Memory Model. If the MCU supports only 16-bit data addressing
+ then the small memory model is automatically used. The maximum size
+ of the heap is then 64K. The small memory model can also be forced
+ MCUs with wider addressing by defining CONFIG_SMALL_MEMORY in the
+ NuttX configuration file.
+ o Large Memory Model. Otherwise, the allocator uses a model that
+ supports a heap of up to 4G.
+
+ This implementation uses a variable length allocator with the following
+ properties:
+
+ o Overhead: Either 8- or 4-bytes per allocation for large and small
+ models, respectively.
+ o Alignment: All allocations are aligned to 8- or 4-bytes for large
+ and small models, respectively.
+
+2) Test Program. There is also a host-best test program that can be
+ used to verify the memory manager. These are the file:
+
+ Makefile.test, mm_test.c, and mm_environment.h.
+
+ Build instructions:
+
+ make -f Makefile.test
+
+ The executable will be built in the top-level directory as nuttx/mm_text
+ (or mm_test.exe under Cygwin).
+
+3) Granule Allocator. A non-standard granule allocator is also available
+ in this directory The granule allocator allocates memory in units
+ of a fixed sized block ("granule"). All memory is aligned to the size
+ of one granule.
+
+ The granule allocator interfaces are defined in nuttx/include/nuttx/gran.h.
+ The granule allocator consists of these files in this directory:
+
+ mm_gran.h, mm_granalloc.c, mm_grancritical.c, mm_granfree.c
+ mm_graninit.c
+
+ The granule allocator is not used anywhere within the base NuttX code
+ as of this writing. The intent of the granule allocator is to provide
+ a tool to support platform-specific management of aligned DMA memory.
+
+ NOTE: Because each granule is aligned to the granule size and each
+ allocations is in units of the granule size, selection of the granule
+ size is important: Larger granules will give better performance and
+ less overhead but more losses of memory due to alignment and quantization
+ waste.
+
+ The current implementation also restricts the maximum allocation size
+ to 32 granules. That restriction could be eliminated with some
+ additional coding effort, but currently requires larger granule
+ sizes for larger allocations.
diff --git a/nuttx/mm/mm_environment.h b/nuttx/mm/mm_environment.h
index 70e611116..d28fbf1d7 100644
--- a/nuttx/mm/mm_environment.h
+++ b/nuttx/mm/mm_environment.h
@@ -105,12 +105,16 @@ extern void mm_addregion(FAR void *heapstart, size_t heapsize);
/* Debug macros are always on */
-# define CONFIG_DEBUG
+# define CONFIG_DEBUG 1
# undef mdbg
# define mdbg(format, arg...) printf(format, ##arg)
# undef mvdg
# define mvdbg(format, arg...) printf(format, ##arg)
+# undef mlldbg
+# define mlldbg(format, arg...) printf(format, ##arg)
+# undef mllvdg
+# define mllvdbg(format, arg...) printf(format, ##arg)
#else
# define mm_errno get_errno()