summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbernard.xiong <[email protected]>2010-07-13 07:36:37 +0000
committerbernard.xiong <[email protected]>2010-07-13 07:36:37 +0000
commit214e44c3f9d79e34719cd9cef5e2fc596a693d47 (patch)
tree5270f946a824b0d54689953aca65d6039ffaee3b /include
parent69466590ff78faa11ed508d74a5509113b8dace0 (diff)
fix down alignment issue; fix the maximal number of rt_scheduler_lock_nest issue; fix rt_tick_from_millisecond issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@790 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'include')
-rw-r--r--include/rtdef.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/rtdef.h b/include/rtdef.h
index 01667001b5..f2f1266de0 100644
--- a/include/rtdef.h
+++ b/include/rtdef.h
@@ -137,9 +137,14 @@ typedef rt_uint32_t rt_off_t; /* Type for offset. */
/**
* @def RT_ALIGN(size, align)
* Return the most contiguous size aligned at specified width. RT_ALIGN(13, 4)
- * would equal to 16. It is needed in some critical contexts.
+ * would return 16.
+ *
+ * @def RT_ALIGN_DOWN(size, align)
+ * Return the down number of aligned at specified width. RT_ALIGN_DOWN(13, 4)
+ * would return 12.
*/
#define RT_ALIGN(size, align) (((size) + (align) - 1) & ~((align)-1))
+#define RT_ALIGN_DOWN(size, align) ((size) & ~((align) -1))
/**
* @def RT_NULL