projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
x86: qemu: enable CONFIG_SPL_DM_RTC
[oweals/u-boot.git]
/
lib
/
linux_compat.c
diff --git
a/lib/linux_compat.c
b/lib/linux_compat.c
index a3d4675f7ed98cc2d7c05cb460138717abf7c470..6373b4451eb3fdafaed99cfeb7eb40f7821712b0 100644
(file)
--- a/
lib/linux_compat.c
+++ b/
lib/linux_compat.c
@@
-1,5
+1,6
@@
#include <common.h>
#include <common.h>
+#include <memalign.h>
#include <linux/compat.h>
struct p_current cur = {
#include <linux/compat.h>
struct p_current cur = {
@@
-16,19
+17,13
@@
unsigned long copy_from_user(void *dest, const void *src,
void *kmalloc(size_t size, int flags)
{
void *kmalloc(size_t size, int flags)
{
- return memalign(ARCH_DMA_MINALIGN, size);
-}
+ void *p;
-void *kzalloc(size_t size, int flags)
-{
- void *ptr = kmalloc(size, flags);
- memset(ptr, 0, size);
- return ptr;
-}
+ p = malloc_cache_aligned(size);
+ if (flags & __GFP_ZERO)
+ memset(p, 0, size);
-void *vzalloc(unsigned long size)
-{
- return kzalloc(size, 0);
+ return p;
}
struct kmem_cache *get_mem(int element_sz)
}
struct kmem_cache *get_mem(int element_sz)
@@
-43,5
+38,5
@@
struct kmem_cache *get_mem(int element_sz)
void *kmem_cache_alloc(struct kmem_cache *obj, int flag)
{
void *kmem_cache_alloc(struct kmem_cache *obj, int flag)
{
- return m
emalign(ARCH_DMA_MINALIGN,
obj->sz);
+ return m
alloc_cache_aligned(
obj->sz);
}
}