aboutsummaryrefslogtreecommitdiff
path: root/nuttx/mm/mm_gran.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-09-11 20:33:58 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-09-11 20:33:58 +0000
commit594b34a3564056f8f003ee9a19aa5837bcb1a4d4 (patch)
tree386d184c161ad982f82fe673bdf69319f84cca6b /nuttx/mm/mm_gran.h
parent3ca467c02936aa967daeabc89b80e84f409f049a (diff)
downloadpx4-firmware-594b34a3564056f8f003ee9a19aa5837bcb1a4d4.tar.gz
px4-firmware-594b34a3564056f8f003ee9a19aa5837bcb1a4d4.tar.bz2
px4-firmware-594b34a3564056f8f003ee9a19aa5837bcb1a4d4.zip
Update to granule allocator; Update to ENC28j60 driver
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5130 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/mm/mm_gran.h')
-rw-r--r--nuttx/mm/mm_gran.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/nuttx/mm/mm_gran.h b/nuttx/mm/mm_gran.h
index 6f5f890ed..d8a334e29 100644
--- a/nuttx/mm/mm_gran.h
+++ b/nuttx/mm/mm_gran.h
@@ -42,17 +42,41 @@
#include <nuttx/config.h>
+#include <stdint.h>
+
#include <nuttx/gran.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
+/* Sizes of things */
+
#define SIZEOF_GAT(n) \
((n + 31) >> 5)
#define SIZEOF_GRAN_S(n) \
(sizeof(struct gran_s) + sizeof(uint32_t) * (SIZEOF_GAT(n) - 1))
+/* Debug */
+
+#ifdef CONFIG_CPP_HAVE_VARARGS
+# ifdef CONFIG_DEBUG_GRAM
+# define gramdbg(format, arg...) dbg(format, ##arg)
+# define gramvdbg(format, arg...) vdbg(format, ##arg)
+# else
+# define gramdbg(format, arg...) mdbg(format, ##arg)
+# define gramvdbg(format, arg...) mvdbg(format, ##arg)
+# endif
+#else
+# ifdef CONFIG_DEBUG_GRAM
+# define gramdbg dbg
+# define gramvdbg vdbg
+# else
+# define gramdbg (void)
+# define gramvdbg (void)
+# endif
+#endif
+
/****************************************************************************
* Public Types
****************************************************************************/
@@ -64,7 +88,7 @@ struct gran_s
uint8_t log2gran; /* Log base 2 of the size of one granule */
uint16_t ngranules; /* The total number of (aligned) granules in the heap */
uintptr_t heapstart; /* The aligned start of the granule heap */
- uint32_t gat[i]; /* Start of the granule allocation table */
+ uint32_t gat[1]; /* Start of the granule allocation table */
};
/****************************************************************************