Browse Source

qcacmn: Add macros for aligning addresses

Define macros which take in a value and align them on the given boundary.

Change-Id: Icea681b8dd9b678900507c555ee749287fd372ce
CRs-Fixed: 2026493
Pramod Simha 8 years ago
parent
commit
bd46f6f929
2 changed files with 11 additions and 0 deletions
  1. 9 0
      qdf/inc/qdf_mem.h
  2. 2 0
      qdf/linux/src/i_qdf_mem.h

+ 9 - 0
qdf/inc/qdf_mem.h

@@ -37,6 +37,15 @@
 #include <qdf_types.h>
 #include <i_qdf_mem.h>
 
+/**
+ * qdf_align() - align to the given size.
+ * @a: input that needs to be aligned.
+ * @align_size: boundary on which 'a' has to be alinged.
+ *
+ * Return: aligned value.
+ */
+#define qdf_align(a, align_size)   __qdf_align(a, align_size)
+
 /**
  * struct qdf_mem_dma_page_t - Allocated dmaable page
  * @page_v_addr_start: Page start virtual address

+ 2 - 0
qdf/linux/src/i_qdf_mem.h

@@ -97,6 +97,8 @@ typedef struct __qdf_mempool_ctxt {
 
 #endif /* __KERNEL__ */
 
+#define __qdf_align(a, mask) ALIGN(a, mask)
+
 /* typedef for dma_data_direction */
 typedef enum dma_data_direction __dma_data_direction;