diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-09-12 15:18:56 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-09-12 15:18:56 +0000 |
commit | 7231abf1a51e65c9147598b665519d3d822f983f (patch) | |
tree | 17de2185cab9be6f29164a2336855a57b8495627 /nuttx/mm/mm_gran.h | |
parent | 14c5c981145991a86366544bc11dbb9d410feecf (diff) | |
download | px4-nuttx-7231abf1a51e65c9147598b665519d3d822f983f.tar.gz px4-nuttx-7231abf1a51e65c9147598b665519d3d822f983f.tar.bz2 px4-nuttx-7231abf1a51e65c9147598b665519d3d822f983f.zip |
Fix MMC/SD support for Wildfire board; Granule allocator can now be used from intrrupt handler
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5134 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/mm/mm_gran.h')
-rw-r--r-- | nuttx/mm/mm_gran.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/nuttx/mm/mm_gran.h b/nuttx/mm/mm_gran.h index 4a76397c8..a4f51490d 100644 --- a/nuttx/mm/mm_gran.h +++ b/nuttx/mm/mm_gran.h @@ -45,6 +45,7 @@ #include <stdint.h> #include <semaphore.h> +#include <arch/types.h> #include <nuttx/gran.h> /**************************************************************************** @@ -88,7 +89,11 @@ 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 */ +#ifdef CONFIG_GRAN_INTR + irqstate_t irqstate; /* For exclusive access to the GAT */ +#else sem_t exclsem; /* For exclusive access to the GAT */ +#endif uintptr_t heapstart; /* The aligned start of the granule heap */ uint32_t gat[1]; /* Start of the granule allocation table */ }; @@ -108,11 +113,10 @@ extern FAR struct gran_s *g_graninfo; ****************************************************************************/ /**************************************************************************** - * Name: gran_semtake and gran_semgive + * Name: gran_enter_critical and gran_leave_critical * * Description: - * Managed semaphore for the granule allocator. gran_semgive is - * implemented as a macro. + * Critical section management for the granule allocator. * * Input Parameters: * priv - Pointer to the gran state @@ -122,7 +126,7 @@ extern FAR struct gran_s *g_graninfo; * ****************************************************************************/ -void gran_semtake(FAR struct gran_s *priv); -#define gran_semgive(p) sem_post(&(p)->exclsem); +void gran_enter_critical(FAR struct gran_s *priv); +void gran_leave_critical(FAR struct gran_s *priv); #endif /* __MM_MM_GRAN_H */ |