Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/sh
0002 # SPDX-License-Identifier: LGPL-2.1
0003 
0004 if [ $# -ne 1 ] ; then
0005         linux_header_dir=tools/include/uapi/linux
0006 else
0007         linux_header_dir=$1
0008 fi
0009 
0010 linux_mman=${linux_header_dir}/mman.h
0011 
0012 printf "static const char *mremap_flags[] = {\n"
0013 regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MREMAP_([[:alnum:]_]+)[[:space:]]+((0x)?[[:xdigit:]]+)[[:space:]]*.*'
0014 egrep -q $regex ${linux_mman} && \
0015 (egrep $regex ${linux_mman} | \
0016         sed -r "s/$regex/\2 \1 \1 \1 \2/g"      | \
0017         xargs printf "\t[ilog2(%s) + 1] = \"%s\",\n#ifndef MREMAP_%s\n#define MREMAP_%s %s\n#endif\n")
0018 printf "};\n"