diff --git a/kernel/ashmem/Makefile b/kernel/ashmem/Makefile index 0411248..9f1a920 100644 --- a/kernel/ashmem/Makefile +++ b/kernel/ashmem/Makefile @@ -1,14 +1,7 @@ -ccflags-y += -I$(src) -Wno-error=implicit-int - -ifneq ($(KERNELRELEASE),) +ccflags-y += -I$(src) -Wno-error=implicit-int -Wno-int-conversion obj-m := ashmem_linux.o ashmem_linux-y := deps.o ashmem.o -$(obj)/deps.o: $(src)/deps.h - -$(obj)/deps.h: $(src)/gen_deps.sh - sudo $(src)/gen_deps.sh > $@ -else KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build all: @@ -19,4 +12,3 @@ install: clean: rm -rf deps.h *.o *.ko *.mod.c *.symvers *.order .*.cmd .tmp_versions -endif diff --git a/kernel/ashmem/deps.c b/kernel/ashmem/deps.c index e8ea6b7..ce6016f 100644 --- a/kernel/ashmem/deps.c +++ b/kernel/ashmem/deps.c @@ -1,10 +1,11 @@ #include +#include -#include "deps.h" - -static int (*shmem_zero_setup_ptr)(struct vm_area_struct *) = SHMEM_ZERO_SETUP; +static int (*shmem_zero_setup_ptr)(struct vm_area_struct *) = NULL; int shmem_zero_setup(struct vm_area_struct *vma) { - return shmem_zero_setup_ptr(vma); + if (!shmem_zero_setup_ptr) + shmem_zero_setup_ptr = kallsyms_lookup_name("shmem_zero_setup"); + return shmem_zero_setup_ptr(vma); } diff --git a/kernel/ashmem/gen_deps.sh b/kernel/ashmem/gen_deps.sh deleted file mode 100755 index a2b8463..0000000 --- a/kernel/ashmem/gen_deps.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -SYMS="shmem_zero_setup" - -for sym in $SYMS; do - addr=`cat /proc/kallsyms | grep -Ee '^[0-9a-f]+ T '$sym'$' | sed -e 's/\s.*$//g'` - if [ a$addr = 'a' ]; then - echo "Error: can't find symbol $sym" - exit 1 - fi - - name=`echo $sym | tr '[:lower:]' '[:upper:]'` - echo "#define $name\t(void *)0x$addr" -done