summaryrefslogtreecommitdiff
path: root/firmware/general.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/general.c')
-rw-r--r--firmware/general.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/firmware/general.c b/firmware/general.c
index 1c2abe1256..ff6594086e 100644
--- a/firmware/general.c
+++ b/firmware/general.c
@@ -78,23 +78,3 @@ int make_list_from_caps32(unsigned long src_mask,
78 78
79 return count; 79 return count;
80} /* make_list_from_caps32 */ 80} /* make_list_from_caps32 */
81
82/* Align a buffer and size to a size boundary while remaining within
83 * the original boundaries */
84size_t align_buffer(void **start, size_t size, size_t align)
85{
86 void *newstart = *start;
87 void *newend = newstart + size;
88
89 /* Align the end down and the start up */
90 newend = (void *)ALIGN_DOWN((intptr_t)newend, align);
91 newstart = (void *)ALIGN_UP((intptr_t)newstart, align);
92
93 /* Hmmm - too small for this */
94 if (newend <= newstart)
95 return 0;
96
97 /* Return adjusted pointer and size */
98 *start = newstart;
99 return newend - newstart;
100}