efi_loader: support unaligned u16 strings
[oweals/u-boot.git] / lib / linux_compat.c
index a936a7eac21437fd4ac0d24d32b71e418345ac03..6373b4451eb3fdafaed99cfeb7eb40f7821712b0 100644 (file)
@@ -1,5 +1,6 @@
 
 #include <common.h>
+#include <memalign.h>
 #include <linux/compat.h>
 
 struct p_current cur = {
@@ -18,7 +19,7 @@ void *kmalloc(size_t size, int flags)
 {
        void *p;
 
-       p = memalign(ARCH_DMA_MINALIGN, size);
+       p = malloc_cache_aligned(size);
        if (flags & __GFP_ZERO)
                memset(p, 0, size);
 
@@ -37,5 +38,5 @@ struct kmem_cache *get_mem(int element_sz)
 
 void *kmem_cache_alloc(struct kmem_cache *obj, int flag)
 {
-       return memalign(ARCH_DMA_MINALIGN, obj->sz);
+       return malloc_cache_aligned(obj->sz);
 }