include: stdlib: Fix the STACK_BUF_ALIGN macro

with STACK_BUF_ALIGN macro the end address of the buffer is not
gauranteed to be aligned to cache line size. Make sure to allocate the
buffer's start and end address are algined to cache line size.

Change-Id: I3288793558be1571451eae445b78e9902ca52b03
diff --git a/include/stdlib.h b/include/stdlib.h
index 4db77fa..22dcf4c 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 2008 Travis Geiselbrecht
  *
- * Copyright (c) 2013, 2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013, 2014-2015 The Linux Foundation. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files
@@ -51,7 +51,7 @@
 
 /* allocate a buffer on the stack aligned and padded to the cpu's cache line size */
 #define STACKBUF_DMA_ALIGN(var, size) \
-	uint8_t __##var[(size) + CACHE_LINE]; uint8_t *var = (uint8_t *)(ROUNDUP((addr_t)__##var, CACHE_LINE))
+	uint8_t __##var[(size) + CACHE_LINE] __attribute__((aligned(CACHE_LINE))); uint8_t *var = (uint8_t *)(ROUNDUP((addr_t)__##var, CACHE_LINE))
 
 /* Macro to allocate buffer in both local & global space, the STACKBUF_DMA_ALIGN cannot
  * be used for global space.