diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-10-03 23:36:54 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-10-03 23:36:54 +0000 |
commit | a82d39f9a9a5e47ea25532c55a09fd481649a5b7 (patch) | |
tree | f0f5a2269133af96922976d7d733857228a0d91d /apps/system/free/free.c | |
parent | 948e492aab34e89e3e372066be17eb6a0fbd7ea2 (diff) | |
download | px4-nuttx-a82d39f9a9a5e47ea25532c55a09fd481649a5b7.tar.gz px4-nuttx-a82d39f9a9a5e47ea25532c55a09fd481649a5b7.tar.bz2 px4-nuttx-a82d39f9a9a5e47ea25532c55a09fd481649a5b7.zip |
Delete the apps/vsn directory (moved commands to apps/system)
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5208 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/system/free/free.c')
-rw-r--r-- | apps/system/free/free.c | 80 |
1 files changed, 44 insertions, 36 deletions
diff --git a/apps/system/free/free.c b/apps/system/free/free.c index 3d9698ecb..c44cd5e22 100644 --- a/apps/system/free/free.c +++ b/apps/system/free/free.c @@ -33,57 +33,65 @@ * ****************************************************************************/ +/**************************************************************************** + * Included Files + ****************************************************************************/ + #include <nuttx/config.h> #include <nuttx/progmem.h> #include <stdio.h> #include <stdlib.h> - /**************************************************************************** * Private Functions ****************************************************************************/ - -/* \todo Max block size only works on uniform prog mem */ - -void free_getprogmeminfo(struct mallinfo * mem) + +/* TODO Max block size only works on uniform prog mem */ + +static void free_getprogmeminfo(struct mallinfo * mem) { - uint16_t page = 0, stpage = 0xFFFF; - uint16_t pagesize = 0; - int status; - - mem->arena = 0; - mem->fordblks = 0; - mem->uordblks = 0; - mem->mxordblk = 0; - - for (status=0, page=0; status >= 0; page++) { - - status = up_progmem_ispageerased(page); - pagesize = up_progmem_pagesize(page); - - mem->arena += pagesize; - - /* Is this beginning of new free space section */ - if (status == 0) { - if (stpage == 0xFFFF) stpage = page; - mem->fordblks += pagesize; + uint16_t page = 0, stpage = 0xFFFF; + uint16_t pagesize = 0; + int status; + + mem->arena = 0; + mem->fordblks = 0; + mem->uordblks = 0; + mem->mxordblk = 0; + + for (status=0, page=0; status >= 0; page++) + { + status = up_progmem_ispageerased(page); + pagesize = up_progmem_pagesize(page); + + mem->arena += pagesize; + + /* Is this beginning of new free space section */ + + if (status == 0) + { + if (stpage == 0xFFFF) stpage = page; + mem->fordblks += pagesize; } - else if (status != 0) { - mem->uordblks += pagesize; - - if (stpage != 0xFFFF && up_progmem_isuniform()) { - stpage = page - stpage; - if (stpage > mem->mxordblk) - mem->mxordblk = stpage; - stpage = 0xFFFF; + else if (status != 0) + { + mem->uordblks += pagesize; + + if (stpage != 0xFFFF && up_progmem_isuniform()) + { + stpage = page - stpage; + if (stpage > mem->mxordblk) + { + mem->mxordblk = stpage; + } + stpage = 0xFFFF; } } } - - mem->mxordblk *= pagesize; -} + mem->mxordblk *= pagesize; +} /**************************************************************************** * Public Functions |