@@ -21,20 +21,20 @@ printf "static const char *mmap_flags[] = {\n"
21
21
regex=' ^[[:space:]]*#[[:space:]]*define[[:space:]]+MAP_([[:alnum:]_]+)[[:space:]]+(0x[[:xdigit:]]+)[[:space:]]*.*'
22
22
egrep -q $regex ${arch_mman} && \
23
23
(egrep $regex ${arch_mman} | \
24
- sed -r " s/$regex /\2 \1/g" | \
25
- xargs printf " \t[ilog2(%s) + 1] = \" %s\" ,\n" )
24
+ sed -r " s/$regex /\2 \1 \1 \1 \2 /g" | \
25
+ xargs printf " \t[ilog2(%s) + 1] = \" %s\" ,\n#ifndef MAP_%s\n#define MAP_%s %s\n#endif\n " )
26
26
egrep -q $regex ${linux_mman} && \
27
27
(egrep $regex ${linux_mman} | \
28
28
egrep -vw ' MAP_(UNINITIALIZED|TYPE|SHARED_VALIDATE)' | \
29
- sed -r " s/$regex /\2 \1/g" | \
30
- xargs printf " \t[ilog2(%s) + 1] = \" %s\" ,\n" )
29
+ sed -r " s/$regex /\2 \1 \1 \1 \2 /g" | \
30
+ xargs printf " \t[ilog2(%s) + 1] = \" %s\" ,\n#ifndef MAP_%s\n#define MAP_%s %s\n#endif\n " )
31
31
([ ! -f ${arch_mman} ] || egrep -q ' #[[:space:]]*include[[:space:]]+<uapi/asm-generic/mman.*' ${arch_mman} ) &&
32
32
(egrep $regex ${header_dir} /mman-common.h | \
33
33
egrep -vw ' MAP_(UNINITIALIZED|TYPE|SHARED_VALIDATE)' | \
34
- sed -r " s/$regex /\2 \1/g" | \
35
- xargs printf " \t[ilog2(%s) + 1] = \" %s\" ,\n" )
34
+ sed -r " s/$regex /\2 \1 \1 \1 \2 /g" | \
35
+ xargs printf " \t[ilog2(%s) + 1] = \" %s\" ,\n#ifndef MAP_%s\n#define MAP_%s %s\n#endif\n " )
36
36
([ ! -f ${arch_mman} ] || egrep -q ' #[[:space:]]*include[[:space:]]+<uapi/asm-generic/mman.h>.*' ${arch_mman} ) &&
37
37
(egrep $regex ${header_dir} /mman.h | \
38
- sed -r " s/$regex /\2 \1/g" | \
39
- xargs printf " \t[ilog2(%s) + 1] = \" %s\" ,\n" )
38
+ sed -r " s/$regex /\2 \1 \1 \1 \2 /g" | \
39
+ xargs printf " \t[ilog2(%s) + 1] = \" %s\" ,\n#ifndef MAP_%s\n#define MAP_%s %s\n#endif\n " )
40
40
printf " };\n"
0 commit comments