
To prevent using macros before they are defined, enfoce calling them in an appropriate order. Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
40 lines
1020 B
Bash
40 lines
1020 B
Bash
#!/bin/bash
|
|
#
|
|
# Copyright(c) 2012-2019 Intel Corporation
|
|
# SPDX-License-Identifier: BSD-3-Clause-Clear
|
|
#
|
|
|
|
. `dirname $0`/conf_framework
|
|
|
|
if compile_module "vm_munmap(0, 0)" "linux/mm.h"
|
|
then
|
|
add_function "
|
|
#include <uapi/asm-generic/mman-common.h>
|
|
static inline unsigned long cas_vm_mmap(struct file *file,
|
|
unsigned long addr, unsigned long len)
|
|
{
|
|
return vm_mmap(file, addr, len, PROT_READ | PROT_WRITE,
|
|
MAP_ANONYMOUS | MAP_PRIVATE, 0);
|
|
}"
|
|
add_function "
|
|
static inline int cas_vm_munmap(unsigned long start, size_t len)
|
|
{
|
|
return vm_munmap(start, len);
|
|
}"
|
|
elif compile_module "do_munmap(NULL, 0)" "linux/mm.h"
|
|
then
|
|
add_function "
|
|
#include <asm-generic/mman-common.h>
|
|
static inline unsigned long cas_vm_mmap(struct file *file,
|
|
unsigned long addr, unsigned long len)
|
|
{
|
|
return do_mmap_pgoff(file, addr, len, PROT_READ | PROT_WRITE,
|
|
MAP_ANONYMOUS | MAP_PRIVATE, 0);
|
|
}"
|
|
add_function "
|
|
static inline int cas_vm_munmap(unsigned long start, size_t len)
|
|
{
|
|
return do_munmap(current->mm, start, len);
|
|
}"
|
|
fi
|