cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

madvise_behavior.sh (424B)


      1#!/bin/sh
      2# SPDX-License-Identifier: LGPL-2.1
      3
      4[ $# -eq 1 ] && header_dir=$1 || header_dir=tools/include/uapi/asm-generic/
      5
      6printf "static const char *madvise_advices[] = {\n"
      7regex='^[[:space:]]*#[[:space:]]*define[[:space:]]+MADV_([[:alnum:]_]+)[[:space:]]+([[:digit:]]+)[[:space:]]*.*'
      8egrep $regex ${header_dir}/mman-common.h | \
      9	sed -r "s/$regex/\2 \1/g"	| \
     10	sort -n | xargs printf "\t[%s] = \"%s\",\n"
     11printf "};\n"