diff --git a/arch/x86/kernel/interrupt.S b/arch/x86/kernel/interrupt.S index 60f280e1..fc94d16b 100644 --- a/arch/x86/kernel/interrupt.S +++ b/arch/x86/kernel/interrupt.S @@ -198,6 +198,7 @@ nmi: movw %gs,%ax movl %eax,%gs:PANIC_REGS+0xA0 movq $1,%gs:PANICED + call ihk_mc_query_mem_areas 1: hlt jmp 1b diff --git a/arch/x86/kernel/memory.c b/arch/x86/kernel/memory.c index 34b50904..293daff9 100644 --- a/arch/x86/kernel/memory.c +++ b/arch/x86/kernel/memory.c @@ -1094,6 +1094,276 @@ int visit_pte_range(page_table_t pt, void *start0, void *end0, int pgshift, return walk_pte_l4(pt, 0, start, end, &visit_pte_l4, &args); } +static int walk_pte_l1_safe(struct page_table *pt, uint64_t base, uint64_t start, + uint64_t end, walk_pte_fn_t *funcp, void *args) +{ + int six; + int eix; + int ret; + int i; + int error; + uint64_t off; + unsigned long phys; + + if (!pt) + return 0; + + six = (start <= base)? 0: ((start - base) >> PTL1_SHIFT); + eix = ((end == 0) || ((base + PTL2_SIZE) <= end))? PT_ENTRIES + : (((end - base) + (PTL1_SIZE - 1)) >> PTL1_SHIFT); + + ret = -ENOENT; + for (i = six; i < eix; ++i) { + + phys = pte_get_phys(&pt->entry[i]); + if (-1 == ihk_mc_chk_page_address(phys)) + continue; + + off = i * PTL1_SIZE; + error = (*funcp)(args, &pt->entry[i], base+off, start, end); + if (!error) { + ret = 0; + } + else if (error != -ENOENT) { + ret = error; + break; + } + } + + return ret; +} + +static int walk_pte_l2_safe(struct page_table *pt, uint64_t base, uint64_t start, + uint64_t end, walk_pte_fn_t *funcp, void *args) +{ + int six; + int eix; + int ret; + int i; + int error; + uint64_t off; + unsigned long phys; + + if (!pt) + return 0; + + six = (start <= base)? 0: ((start - base) >> PTL2_SHIFT); + eix = ((end == 0) || ((base + PTL3_SIZE) <= end))? PT_ENTRIES + : (((end - base) + (PTL2_SIZE - 1)) >> PTL2_SHIFT); + + ret = -ENOENT; + for (i = six; i < eix; ++i) { + + phys = pte_get_phys(&pt->entry[i]); + if (-1 == ihk_mc_chk_page_address(phys)) + continue; + + off = i * PTL2_SIZE; + error = (*funcp)(args, &pt->entry[i], base+off, start, end); + if (!error) { + ret = 0; + } + else if (error != -ENOENT) { + ret = error; + break; + } + } + + return ret; +} + +static int walk_pte_l3_safe(struct page_table *pt, uint64_t base, uint64_t start, + uint64_t end, walk_pte_fn_t *funcp, void *args) +{ + int six; + int eix; + int ret; + int i; + int error; + uint64_t off; + unsigned long phys; + + if (!pt) + return 0; + + six = (start <= base)? 0: ((start - base) >> PTL3_SHIFT); + eix = ((end == 0) || ((base + PTL4_SIZE) <= end))? PT_ENTRIES + : (((end - base) + (PTL3_SIZE - 1)) >> PTL3_SHIFT); + + ret = -ENOENT; + for (i = six; i < eix; ++i) { + + phys = pte_get_phys(&pt->entry[i]); + if (-1 == ihk_mc_chk_page_address(phys)) + continue; + + off = i * PTL3_SIZE; + error = (*funcp)(args, &pt->entry[i], base+off, start, end); + if (!error) { + ret = 0; + } + else if (error != -ENOENT) { + ret = error; + break; + } + } + + return ret; +} + +static int walk_pte_l4_safe(struct page_table *pt, uint64_t base, uint64_t start, + uint64_t end, walk_pte_fn_t *funcp, void *args) +{ + int six; + int eix; + int ret; + int i; + int error; + uint64_t off; + unsigned long phys; + + if (!pt) + return 0; + + six = (start <= base)? 0: ((start - base) >> PTL4_SHIFT); + eix = (end == 0)? PT_ENTRIES + :(((end - base) + (PTL4_SIZE - 1)) >> PTL4_SHIFT); + + ret = -ENOENT; + for (i = six; i < eix; ++i) { + + phys = pte_get_phys(&pt->entry[i]); + if (-1 == ihk_mc_chk_page_address(phys)) + continue; + + off = i * PTL4_SIZE; + error = (*funcp)(args, &pt->entry[i], base+off, start, end); + if (!error) { + ret = 0; + } + else if (error != -ENOENT) { + ret = error; + break; + } + } + + return ret; +} + +static int visit_pte_l1_safe(void *arg0, pte_t *ptep, uintptr_t base, + uintptr_t start, uintptr_t end) +{ + struct visit_pte_args *args = arg0; + + if (*ptep == PTE_NULL) { + return 0; + } + + return (*args->funcp)(args->arg, args->pt, ptep, (void *)base, + PTL1_SHIFT); +} + +static int visit_pte_l2_safe(void *arg0, pte_t *ptep, uintptr_t base, + uintptr_t start, uintptr_t end) +{ + int error; + struct visit_pte_args *args = arg0; + struct page_table *pt; + + if (*ptep == PTE_NULL) { + return 0; + } + + if ((*ptep & PFL2_SIZE) + && (start <= base) + && (((base + PTL2_SIZE) <= end) + || (end == 0)) + && (!args->pgshift || (args->pgshift == PTL2_SHIFT))) { + error = (*args->funcp)(args->arg, args->pt, ptep, + (void *)base, PTL2_SHIFT); + if (error != -E2BIG) { + return error; + } + } + + if (*ptep & PFL2_SIZE) { + ekprintf("visit_pte_l2:split large page\n"); + return -ENOMEM; + } + + pt = phys_to_virt(*ptep & PT_PHYSMASK); + + error = walk_pte_l1_safe(pt, base, start, end, &visit_pte_l1_safe, arg0); + return error; +} + +static int visit_pte_l3_safe(void *arg0, pte_t *ptep, uintptr_t base, + uintptr_t start, uintptr_t end) +{ + int error; + struct visit_pte_args *args = arg0; + struct page_table *pt; + + if (*ptep == PTE_NULL) { + return 0; + } + + if ((*ptep & PFL3_SIZE) + && (start <= base) + && (((base + PTL3_SIZE) <= end) + || (end == 0)) + && (!args->pgshift || (args->pgshift == PTL3_SHIFT)) + && use_1gb_page) { + error = (*args->funcp)(args->arg, args->pt, ptep, + (void *)base, PTL3_SHIFT); + if (error != -E2BIG) { + return error; + } + } + + if (*ptep & PFL3_SIZE) { + ekprintf("visit_pte_l3:split large page\n"); + return -ENOMEM; + } + + pt = phys_to_virt(*ptep & PT_PHYSMASK); + + error = walk_pte_l2_safe(pt, base, start, end, &visit_pte_l2_safe, arg0); + return error; +} + +static int visit_pte_l4_safe(void *arg0, pte_t *ptep, uintptr_t base, + uintptr_t start, uintptr_t end) +{ + int error; + struct page_table *pt; + + if (*ptep == PTE_NULL) { + return 0; + } + + pt = phys_to_virt(*ptep & PT_PHYSMASK); + + error = walk_pte_l3_safe(pt, base, start, end, &visit_pte_l3_safe, arg0); + return error; +} + +int visit_pte_range_safe(page_table_t pt, void *start0, void *end0, int pgshift, + enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg) +{ + const uintptr_t start = (uintptr_t)start0; + const uintptr_t end = (uintptr_t)end0; + struct visit_pte_args args; + + args.pt = pt; + args.flags = flags; + args.funcp = funcp; + args.arg = arg; + args.pgshift = pgshift; + + return walk_pte_l4_safe(pt, 0, start, end, &visit_pte_l4_safe, &args); +} + struct clear_range_args { int free_physical; struct memobj *memobj; diff --git a/arch/x86/tools/mcreboot-smp-x86.sh.in b/arch/x86/tools/mcreboot-smp-x86.sh.in index 31538fda..bc5d6747 100644 --- a/arch/x86/tools/mcreboot-smp-x86.sh.in +++ b/arch/x86/tools/mcreboot-smp-x86.sh.in @@ -31,6 +31,7 @@ fi INTERVAL=1 LOGMODE=0 +DUMP_LEVEL=24 facility="LOG_LOCAL6" chown_option=`logname 2> /dev/null` @@ -43,7 +44,7 @@ fi turbo="" ihk_irq="" -while getopts :ti:k:c:m:o:f:r:q: OPT +while getopts :ti:k:c:m:o:f:r:q:d: OPT do case ${OPT} in f) facility=${OPTARG} @@ -86,6 +87,8 @@ do ;; t) turbo="turbo" ;; + d) DUMP_LEVEL=${OPTARG} + ;; *) echo "invalid option -${OPT}" >&2 exit 1 esac @@ -214,6 +217,9 @@ if [ "${ENABLE_MCOVERLAYFS}" == "yes" ]; then if [ ${linux_version_code} -eq 199168 -a ${rhel_release} -ge 327 ]; then enable_mcoverlay="yes" fi + if [ ${linux_version_code} -ge 262144 -a ${linux_version_code} -lt 262400 ]; then + enable_mcoverlay="yes" + fi fi fi @@ -395,7 +401,7 @@ if ! ${SBINDIR}/ihkosctl 0 load ${KERNDIR}/mckernel.img; then fi # Set kernel arguments -if ! ${SBINDIR}/ihkosctl 0 kargs "hidos ksyslogd=${LOGMODE} $turbo"; then +if ! ${SBINDIR}/ihkosctl 0 kargs "hidos ksyslogd=${LOGMODE} $turbo dump_level=${DUMP_LEVEL}"; then echo "error: setting kernel arguments" >&2 error_exit "os_created" fi diff --git a/configure b/configure index fddca34f..d5de9813 100755 --- a/configure +++ b/configure @@ -1,21 +1,18 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for mckernel 0.9.0. -# -# -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. -# +# Generated by GNU Autoconf 2.63 for mckernel 0.9.0. # +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## -# configure COPYRIGHT FUJITSU LIMITED 2015-2017 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -23,15 +20,23 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; esac + fi + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + as_nl=' ' export as_nl @@ -39,13 +44,7 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -56,7 +55,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in #( + case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -79,6 +78,13 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -88,16 +94,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( +case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -109,16 +114,12 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' @@ -130,293 +131,7 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# Use a proper internal environment variable to ensure we don't fall - # into an infinite loop, continuously re-executing ourselves. - if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then - _as_can_reexec=no; export _as_can_reexec; - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 - fi - # We don't want this to propagate to other subprocesses. - { _as_can_reexec=; unset _as_can_reexec;} -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1 -test -x / || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - export CONFIG_SHELL - # We cannot yet assume a decent shell, so we have to provide a -# neutralization value for shells without unset; and this also -# works around shells that cannot unset nonexistent variables. -# Preserve -v and -x to the replacement shell. -BASH_ENV=/dev/null -ENV=/dev/null -(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; -esac -exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} -# Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -exit 255 -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - +# Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -430,12 +145,8 @@ else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -455,19 +166,295 @@ $as_echo X/"$0" | } s/.*/./; q'` -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= @@ -484,12 +471,9 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } - # If we had to re-execute with $CONFIG_SHELL, we're ensured to have - # already done that, so ensure we don't try to do so again and fall - # in an infinite loop. This has already happened in practice. - _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -498,18 +482,29 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits exit } + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( +case `echo -n x` in -n*) - case `echo 'xy\c'` in + case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; + *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -524,29 +519,49 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' + as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_test_x='test -x' -as_executable_p=as_fn_executable_p +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -555,11 +570,11 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -test -n "$DJDIR" || exec 7<&0 &1 + +exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -574,6 +589,7 @@ cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='mckernel' @@ -581,7 +597,6 @@ PACKAGE_TARNAME='mckernel' PACKAGE_VERSION='0.9.0' PACKAGE_STRING='mckernel 0.9.0' PACKAGE_BUGREPORT='' -PACKAGE_URL='' ac_default_prefix=/opt/ppos # Factoring default headers for most tests. @@ -687,7 +702,6 @@ bindir program_transform_name prefix exec_prefix -PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION @@ -782,9 +796,8 @@ do fi case $ac_option in - *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *=) ac_optarg= ;; - *) ac_optarg=yes ;; + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -829,7 +842,8 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -855,7 +869,8 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1059,7 +1074,8 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1075,7 +1091,8 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1105,17 +1122,17 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1124,7 +1141,7 @@ Try \`$0 --help' for more information" $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac @@ -1132,13 +1149,15 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1161,7 +1180,8 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -1175,6 +1195,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1189,9 +1211,11 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } # Find the source files, if location was not specified. @@ -1230,11 +1254,13 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1274,7 +1300,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1358,14 +1384,13 @@ Some influential environment variables: LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to the package provider. _ACEOF ac_status=$? fi @@ -1429,305 +1454,21 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF mckernel configure 0.9.0 -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.63 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - test -x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by mckernel $as_me 0.9.0, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1763,8 +1504,8 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done + $as_echo "PATH: $as_dir" +done IFS=$as_save_IFS } >&5 @@ -1801,9 +1542,9 @@ do ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) - as_fn_append ac_configure_args1 " '$ac_arg'" + ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1819,13 +1560,13 @@ do -* ) ac_must_keep_next=true ;; esac fi - as_fn_append ac_configure_args " '$ac_arg'" + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there @@ -1837,9 +1578,11 @@ trap 'exit_status=$? { echo - $as_echo "## ---------------- ## + cat <<\_ASBOX +## ---------------- ## ## Cache variables. ## -## ---------------- ##" +## ---------------- ## +_ASBOX echo # The following way of writing the cache mishandles newlines in values, ( @@ -1848,13 +1591,13 @@ trap 'exit_status=$? case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; + *) $as_unset $ac_var ;; esac ;; esac done @@ -1873,9 +1616,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - $as_echo "## ----------------- ## + cat <<\_ASBOX +## ----------------- ## ## Output variables. ## -## ----------------- ##" +## ----------------- ## +_ASBOX echo for ac_var in $ac_subst_vars do @@ -1888,9 +1633,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + cat <<\_ASBOX +## ------------------- ## ## File substitutions. ## -## ------------------- ##" +## ------------------- ## +_ASBOX echo for ac_var in $ac_subst_files do @@ -1904,9 +1651,11 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; fi if test -s confdefs.h; then - $as_echo "## ----------- ## + cat <<\_ASBOX +## ----------- ## ## confdefs.h. ## -## ----------- ##" +## ----------- ## +_ASBOX echo cat confdefs.h echo @@ -1920,39 +1669,37 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; exit $exit_status ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h - # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF @@ -1961,12 +1708,7 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -1977,23 +1719,19 @@ fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 + if test -r "$ac_site_file"; then + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } + . "$ac_site_file" fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; @@ -2001,7 +1739,7 @@ $as_echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -2016,11 +1754,11 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; @@ -2030,17 +1768,17 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac @@ -2052,20 +1790,43 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## + + + + + + + + + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2096,9 +1857,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2109,24 +1870,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2136,9 +1897,9 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2149,24 +1910,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2175,7 +1936,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -2189,9 +1950,9 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2202,24 +1963,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2229,9 +1990,9 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2243,18 +2004,18 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -2273,10 +2034,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2288,9 +2049,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2301,24 +2062,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2332,9 +2093,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2345,24 +2106,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -2375,7 +2136,7 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -2386,37 +2147,57 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" +{ (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2432,8 +2213,8 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: @@ -2449,17 +2230,17 @@ do done rm -f $ac_rmfiles -if { { ac_try="$ac_link_default" +if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -2476,7 +2257,7 @@ do # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -2495,41 +2276,84 @@ test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } + ac_exeext=$ac_cv_exeext +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } + fi + fi +fi +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -2544,83 +2368,32 @@ for ac_file in conftest.exe conftest conftest.*; do esac done else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 + +rm -f conftest$ac_cv_exeext +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : +if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2632,17 +2405,17 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" +if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -2655,23 +2428,31 @@ else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2685,16 +2466,37 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - ac_compiler_gnu=no + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -2703,16 +2505,20 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2723,11 +2529,35 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2738,12 +2568,36 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else - ac_c_werror_flag=$ac_save_c_werror_flag + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -2754,17 +2608,42 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -2781,18 +2660,23 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include -struct stat; +#include +#include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -2844,9 +2728,32 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -2857,19 +2764,17 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 + { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac -if test "x$ac_cv_prog_cc_c89" != xno; then : -fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -2883,14 +2788,14 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : + if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -2905,7 +2810,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -2914,34 +2823,78 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.i conftest.$ac_ext + +rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.i conftest.$ac_ext + +rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then break fi @@ -2953,7 +2906,7 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -2964,7 +2917,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -2973,40 +2930,87 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.i conftest.$ac_ext + +rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break fi -rm -f conftest.err conftest.i conftest.$ac_ext + +rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3016,9 +3020,9 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : +if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then @@ -3029,10 +3033,10 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -3049,7 +3053,7 @@ case `"$ac_path_GREP" --version 2>&1` in $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val + ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" @@ -3064,24 +3068,26 @@ esac $ac_path_GREP_found && break 3 done done - done +done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : +if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 @@ -3095,10 +3101,10 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -3115,7 +3121,7 @@ case `"$ac_path_EGREP" --version 2>&1` in $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val + ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" @@ -3130,10 +3136,12 @@ esac $ac_path_EGREP_found && break 3 done done - done +done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP @@ -3141,17 +3149,21 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : +if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -3166,23 +3178,48 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - ac_cv_header_stdc=no + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - + $EGREP "memchr" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -3192,14 +3229,18 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - + $EGREP "free" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -3209,10 +3250,14 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes; then : else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -3239,33 +3284,118 @@ main () return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - ac_cv_header_stdc=no + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -3275,23 +3405,156 @@ fi done -ac_fn_c_check_header_mongrel "$LINENO" "numa.h" "ac_cv_header_numa_h" "$ac_includes_default" -if test "x$ac_cv_header_numa_h" = xyes; then : +if test "${ac_cv_header_numa_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for numa.h" >&5 +$as_echo_n "checking for numa.h... " >&6; } +if test "${ac_cv_header_numa_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_numa_h" >&5 +$as_echo "$ac_cv_header_numa_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking numa.h usability" >&5 +$as_echo_n "checking numa.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking numa.h presence" >&5 +$as_echo_n "checking numa.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: numa.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: numa.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: numa.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: numa.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: numa.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: numa.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: numa.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: numa.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: numa.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: numa.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: numa.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: numa.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: numa.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: numa.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: numa.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: numa.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for numa.h" >&5 +$as_echo_n "checking for numa.h... " >&6; } +if test "${ac_cv_header_numa_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_numa_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_numa_h" >&5 +$as_echo "$ac_cv_header_numa_h" >&6; } + +fi +if test "x$ac_cv_header_numa_h" = x""yes; then numa_header_found=yes fi -if test "x$numa_header_found" != "xyes"; then : - as_fn_error $? "Unable to find numa.h header file, missing numactl-devel?" "$LINENO" 5 +if test "x$numa_header_found" != "xyes"; then + { { $as_echo "$as_me:$LINENO: error: Unable to find numa.h header file, missing numactl-devel?" >&5 +$as_echo "$as_me: error: Unable to find numa.h header file, missing numactl-devel?" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for numa_run_on_node in -lnuma" >&5 + +{ $as_echo "$as_me:$LINENO: checking for numa_run_on_node in -lnuma" >&5 $as_echo_n "checking for numa_run_on_node in -lnuma... " >&6; } -if ${ac_cv_lib_numa_numa_run_on_node+:} false; then : +if test "${ac_cv_lib_numa_numa_run_on_node+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnuma $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -3309,28 +3572,56 @@ return numa_run_on_node (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_numa_numa_run_on_node=yes else - ac_cv_lib_numa_numa_run_on_node=no + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_numa_numa_run_on_node=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_numa_numa_run_on_node" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_numa_numa_run_on_node" >&5 $as_echo "$ac_cv_lib_numa_numa_run_on_node" >&6; } -if test "x$ac_cv_lib_numa_numa_run_on_node" = xyes; then : +if test "x$ac_cv_lib_numa_numa_run_on_node" = x""yes; then numa_lib_found=yes fi -if test "x$numa_lib_found" != "xyes"; then : - as_fn_error $? "Unable to find NUMA library, missing numactl-devel?" "$LINENO" 5 +if test "x$numa_lib_found" != "xyes"; then + { { $as_echo "$as_me:$LINENO: error: Unable to find NUMA library, missing numactl-devel?" >&5 +$as_echo "$as_me: error: Unable to find NUMA library, missing numactl-devel?" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 + +{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : +if test "${ac_cv_path_FGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 @@ -3344,10 +3635,10 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_FGREP" || continue + { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -3364,7 +3655,7 @@ case `"$ac_path_FGREP" --version 2>&1` in $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val + ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" @@ -3379,10 +3670,12 @@ esac $ac_path_FGREP_found && break 3 done done - done +done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP @@ -3390,7 +3683,7 @@ fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -3398,43 +3691,37 @@ $as_echo "$ac_cv_path_FGREP" >&6; } # Check whether --with-mpi was given. -if test "${with_mpi+set}" = set; then : - withval=$with_mpi; case "$withval" in #( - yes|no|'') : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --without-mpi=PATH expects a valid PATH" >&5 +if test "${with_mpi+set}" = set; then + withval=$with_mpi; case "$withval" in + yes|no|'') { $as_echo "$as_me:$LINENO: WARNING: --without-mpi=PATH expects a valid PATH" >&5 $as_echo "$as_me: WARNING: --without-mpi=PATH expects a valid PATH" >&2;} - with_mpi="" ;; #( - *) : - ;; + with_mpi="" ;; esac + else with_mpi= fi # Check whether --with-mpi-include was given. -if test "${with_mpi_include+set}" = set; then : - withval=$with_mpi_include; case "$withval" in #( - yes|no|'') : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --without-mpi-include=PATH expects a valid PATH" >&5 +if test "${with_mpi_include+set}" = set; then + withval=$with_mpi_include; case "$withval" in + yes|no|'') { $as_echo "$as_me:$LINENO: WARNING: --without-mpi-include=PATH expects a valid PATH" >&5 $as_echo "$as_me: WARNING: --without-mpi-include=PATH expects a valid PATH" >&2;} - with_mpi_include="" ;; #( - *) : - ;; + with_mpi_include="" ;; esac + fi # Check whether --with-mpi-lib was given. -if test "${with_mpi_lib+set}" = set; then : - withval=$with_mpi_lib; case "$withval" in #( - yes|no|'') : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --without-mpi-lib=PATH expects a valid PATH" >&5 +if test "${with_mpi_lib+set}" = set; then + withval=$with_mpi_lib; case "$withval" in + yes|no|'') { $as_echo "$as_me:$LINENO: WARNING: --without-mpi-lib=PATH expects a valid PATH" >&5 $as_echo "$as_me: WARNING: --without-mpi-lib=PATH expects a valid PATH" >&2;} - with_mpi_lib="" ;; #( - *) : - ;; + with_mpi_lib="" ;; esac + fi @@ -3442,10 +3729,10 @@ fi # Now append -I/-L args to CPPFLAGS/LDFLAGS, with more specific options # taking priority - if test -n "${with_mpi_include}"; then : + if test -n "${with_mpi_include}"; then - if echo "$CPPFLAGS" | $FGREP -e "\<-I${with_mpi_include}\>" >/dev/null 2>&1; then : + if echo "$CPPFLAGS" | $FGREP -e "\<-I${with_mpi_include}\>" >/dev/null 2>&1; then echo "CPPFLAGS(='$CPPFLAGS') contains '-I${with_mpi_include}', not appending" >&5 else echo "CPPFLAGS(='$CPPFLAGS') does not contain '-I${with_mpi_include}', appending" >&5 @@ -3453,11 +3740,12 @@ else fi + else - if test -n "${with_mpi}"; then : + if test -n "${with_mpi}"; then - if echo "$CPPFLAGS" | $FGREP -e "\<-I${with_mpi}/include\>" >/dev/null 2>&1; then : + if echo "$CPPFLAGS" | $FGREP -e "\<-I${with_mpi}/include\>" >/dev/null 2>&1; then echo "CPPFLAGS(='$CPPFLAGS') contains '-I${with_mpi}/include', not appending" >&5 else echo "CPPFLAGS(='$CPPFLAGS') does not contain '-I${with_mpi}/include', appending" >&5 @@ -3465,13 +3753,16 @@ else fi -fi + fi - if test -n "${with_mpi_lib}"; then : +fi - if echo "$LDFLAGS" | $FGREP -e "\<-L${with_mpi_lib}\>" >/dev/null 2>&1; then : + if test -n "${with_mpi_lib}"; then + + + if echo "$LDFLAGS" | $FGREP -e "\<-L${with_mpi_lib}\>" >/dev/null 2>&1; then echo "LDFLAGS(='$LDFLAGS') contains '-L${with_mpi_lib}', not appending" >&5 else echo "LDFLAGS(='$LDFLAGS') does not contain '-L${with_mpi_lib}', appending" >&5 @@ -3479,11 +3770,12 @@ else fi + else - if test -n "${with_mpi}"; then : + if test -n "${with_mpi}"; then - if echo "$LDFLAGS" | $FGREP -e "\<-L${with_mpi}/lib\>" >/dev/null 2>&1; then : + if echo "$LDFLAGS" | $FGREP -e "\<-L${with_mpi}/lib\>" >/dev/null 2>&1; then echo "LDFLAGS(='$LDFLAGS') contains '-L${with_mpi}/lib', not appending" >&5 else echo "LDFLAGS(='$LDFLAGS') does not contain '-L${with_mpi}/lib', appending" >&5 @@ -3491,10 +3783,11 @@ else fi - if test -d "${with_mpi}/lib64"; then : + + if test -d "${with_mpi}/lib64"; then - if echo "$LDFLAGS" | $FGREP -e "\<-L${with_mpi}/lib64\>" >/dev/null 2>&1; then : + if echo "$LDFLAGS" | $FGREP -e "\<-L${with_mpi}/lib64\>" >/dev/null 2>&1; then echo "LDFLAGS(='$LDFLAGS') contains '-L${with_mpi}/lib64', not appending" >&5 else echo "LDFLAGS(='$LDFLAGS') does not contain '-L${with_mpi}/lib64', appending" >&5 @@ -3502,16 +3795,20 @@ else fi -fi fi + fi +fi + + + # Check whether --with-kernelsrc was given. -if test "${with_kernelsrc+set}" = set; then : +if test "${with_kernelsrc+set}" = set; then withval=$with_kernelsrc; WITH_KERNELSRC=$withval else WITH_KERNELSRC=yes @@ -3520,7 +3817,7 @@ fi # Check whether --with-target was given. -if test "${with_target+set}" = set; then : +if test "${with_target+set}" = set; then withval=$with_target; WITH_TARGET=$withval else WITH_TARGET=yes @@ -3529,7 +3826,7 @@ fi # Check whether --with-system_map was given. -if test "${with_system_map+set}" = set; then : +if test "${with_system_map+set}" = set; then withval=$with_system_map; WITH_SYSTEM_MAP=$withval else WITH_SYSTEM_MAP=yes @@ -3537,7 +3834,7 @@ fi # Check whether --enable-dcfa was given. -if test "${enable_dcfa+set}" = set; then : +if test "${enable_dcfa+set}" = set; then enableval=$enable_dcfa; else enable_dcfa=no @@ -3545,7 +3842,7 @@ fi # Check whether --enable-memdump was given. -if test "${enable_memdump+set}" = set; then : +if test "${enable_memdump+set}" = set; then enableval=$enable_memdump; ENABLE_MEMDUMP=$enableval else ENABLE_MEMDUMP=default @@ -3553,7 +3850,7 @@ fi # Check whether --enable-mcoverlayfs was given. -if test "${enable_mcoverlayfs+set}" = set; then : +if test "${enable_mcoverlayfs+set}" = set; then enableval=$enable_mcoverlayfs; ENABLE_MCOVERLAYFS=$enableval else ENABLE_MCOVERLAYFS=yes @@ -3561,7 +3858,7 @@ fi # Check whether --enable-rusage was given. -if test "${enable_rusage+set}" = set; then : +if test "${enable_rusage+set}" = set; then enableval=$enable_rusage; ENABLE_RUSAGE=$enableval else ENABLE_RUSAGE=yes @@ -3569,7 +3866,7 @@ fi # Check whether --enable-qlmpi was given. -if test "${enable_qlmpi+set}" = set; then : +if test "${enable_qlmpi+set}" = set; then enableval=$enable_qlmpi; ENABLE_QLMPI=$enableval else ENABLE_QLMPI=no @@ -3578,7 +3875,7 @@ fi # Check whether --with-uname_r was given. -if test "${with_uname_r+set}" = set; then : +if test "${with_uname_r+set}" = set; then withval=$with_uname_r; WITH_UNAME_R=$withval else WITH_UNAME_R=yes @@ -3637,9 +3934,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3650,24 +3947,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -3677,9 +3974,9 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3690,24 +3987,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -3716,7 +4013,7 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -3730,9 +4027,9 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3743,24 +4040,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -3770,9 +4067,9 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3784,18 +4081,18 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then @@ -3814,10 +4111,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -3829,9 +4126,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -3842,24 +4139,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -3873,9 +4170,9 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -3886,24 +4183,24 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -3916,7 +4213,7 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac @@ -3927,42 +4224,62 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" +{ (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : +if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -3976,16 +4293,37 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - ac_compiler_gnu=no + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes @@ -3994,16 +4332,20 @@ else fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : +if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -4014,11 +4356,35 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -4029,12 +4395,36 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else - ac_c_werror_flag=$ac_save_c_werror_flag + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -4045,17 +4435,42 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi + rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -4072,18 +4487,23 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : +if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include -struct stat; +#include +#include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -4135,9 +4555,32 @@ for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done @@ -4148,19 +4591,17 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 + { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac -if test "x$ac_cv_prog_cc_c89" != xno; then : -fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4175,9 +4616,9 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ARCH=k1om # Extract the first word of "x86_64-$ARCH-linux-gcc", so it can be a program name with args. set dummy x86_64-$ARCH-linux-gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_XCC+:} false; then : +if test "${ac_cv_prog_XCC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$XCC"; then @@ -4188,14 +4629,14 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XCC="x86_64-$ARCH-linux-gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS test -z "$ac_cv_prog_XCC" && ac_cv_prog_XCC="no" @@ -4203,10 +4644,10 @@ fi fi XCC=$ac_cv_prog_XCC if test -n "$XCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCC" >&5 + { $as_echo "$as_me:$LINENO: result: $XCC" >&5 $as_echo "$XCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -4217,9 +4658,9 @@ fi ARCH=arm64 # Extract the first word of "${CROSS_COMPILE}gcc", so it can be a program name with args. set dummy ${CROSS_COMPILE}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_XCC+:} false; then : +if test "${ac_cv_prog_XCC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$XCC"; then @@ -4230,14 +4671,14 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XCC="${CROSS_COMPILE}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done +done IFS=$as_save_IFS test -z "$ac_cv_prog_XCC" && ac_cv_prog_XCC="no" @@ -4245,10 +4686,10 @@ fi fi XCC=$ac_cv_prog_XCC if test -n "$XCC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XCC" >&5 + { $as_echo "$as_me:$LINENO: result: $XCC" >&5 $as_echo "$XCC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi @@ -4256,7 +4697,9 @@ fi CC=$XCC ;; *) - as_fn_error $? "target $WITH_TARGET is unknwon" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: target $WITH_TARGET is unknwon" >&5 +$as_echo "$as_me: error: target $WITH_TARGET is unknwon" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -4371,7 +4814,9 @@ case $WITH_TARGET in fi ;; *) - as_fn_error $? "target $WITH_TARGET is unknwon" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: target $WITH_TARGET is unknwon" >&5 +$as_echo "$as_me: error: target $WITH_TARGET is unknwon" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -4389,7 +4834,7 @@ case "X$WITH_SYSTEM_MAP" in ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for System.map" >&5 +{ $as_echo "$as_me:$LINENO: checking for System.map" >&5 $as_echo_n "checking for System.map... " >&6; } if test -f "$MCCTRL_LINUX_SYMTAB"; then MCCTRL_LINUX_SYMTAB="$MCCTRL_LINUX_SYMTAB" @@ -4400,13 +4845,17 @@ elif test -f "$KDIR/System.map"; then fi if test "$MCCTRL_LINUX_SYMTAB" == ""; then - as_fn_error $? "could not find" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not find" >&5 +$as_echo "$as_me: error: could not find" >&2;} + { (exit 1); exit 1; }; } fi if test -z "`eval cat $MCCTRL_LINUX_SYMTAB`"; then - as_fn_error $? "could not read System.map file, no read permission?" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not read System.map file, no read permission?" >&5 +$as_echo "$as_me: error: could not read System.map file, no read permission?" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MCCTRL_LINUX_SYMTAB" >&5 +{ $as_echo "$as_me:$LINENO: result: $MCCTRL_LINUX_SYMTAB" >&5 $as_echo "$MCCTRL_LINUX_SYMTAB" >&6; } MCCTRL_LINUX_SYMTAB_CMD="cat $MCCTRL_LINUX_SYMTAB" @@ -4421,11 +4870,11 @@ MCCTRL_LINUX_SYMTAB_CMD="cat $MCCTRL_LINUX_SYMTAB" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol sys_mount" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol sys_mount" >&5 $as_echo_n "checking System.map for symbol sys_mount... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " sys_mount\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4436,7 +4885,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4446,11 +4895,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol sys_umount" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol sys_umount" >&5 $as_echo_n "checking System.map for symbol sys_umount... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " sys_umount\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4461,7 +4910,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4471,11 +4920,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol sys_unshare" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol sys_unshare" >&5 $as_echo_n "checking System.map for symbol sys_unshare... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " sys_unshare\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4486,7 +4935,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4496,11 +4945,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol zap_page_range" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol zap_page_range" >&5 $as_echo_n "checking System.map for symbol zap_page_range... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " zap_page_range\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4511,7 +4960,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4521,11 +4970,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol vdso_image_64" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol vdso_image_64" >&5 $as_echo_n "checking System.map for symbol vdso_image_64... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " vdso_image_64\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4536,7 +4985,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4546,11 +4995,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol vdso_start" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol vdso_start" >&5 $as_echo_n "checking System.map for symbol vdso_start... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " vdso_start\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4561,7 +5010,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4571,11 +5020,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol vdso_end" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol vdso_end" >&5 $as_echo_n "checking System.map for symbol vdso_end... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " vdso_end\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4586,7 +5035,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4596,11 +5045,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol vdso_pages" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol vdso_pages" >&5 $as_echo_n "checking System.map for symbol vdso_pages... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " vdso_pages\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4611,7 +5060,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4621,11 +5070,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol __vvar_page" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol __vvar_page" >&5 $as_echo_n "checking System.map for symbol __vvar_page... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " __vvar_page\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4636,7 +5085,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4646,11 +5095,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol hpet_address" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol hpet_address" >&5 $as_echo_n "checking System.map for symbol hpet_address... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " hpet_address\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4661,7 +5110,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4672,11 +5121,11 @@ _ACEOF # POSTK_DEBUG_ARCH_DEP_50, add:find kernel symbol. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol vdso_spec" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol vdso_spec" >&5 $as_echo_n "checking System.map for symbol vdso_spec... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " vdso_spec\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4687,7 +5136,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4697,11 +5146,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol hv_clock" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol hv_clock" >&5 $as_echo_n "checking System.map for symbol hv_clock... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " hv_clock\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4712,7 +5161,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4722,11 +5171,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol sys_readlink" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol sys_readlink" >&5 $as_echo_n "checking System.map for symbol sys_readlink... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " sys_readlink\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4737,7 +5186,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4747,11 +5196,11 @@ _ACEOF fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking System.map for symbol walk_page_range" >&5 + { $as_echo "$as_me:$LINENO: checking System.map for symbol walk_page_range" >&5 $as_echo_n "checking System.map for symbol walk_page_range... " >&6; } mcctrl_addr=`eval $MCCTRL_LINUX_SYMTAB_CMD | grep " walk_page_range\$" | cut -d\ -f1` if test -z $mcctrl_addr; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 + { $as_echo "$as_me:$LINENO: result: not found" >&5 $as_echo "not found" >&6; } else mcctrl_result=$mcctrl_addr @@ -4762,7 +5211,7 @@ $as_echo "not found" >&6; } mcctrl_addr="0" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mcctrl_result" >&5 + { $as_echo "$as_me:$LINENO: result: $mcctrl_result" >&5 $as_echo "$mcctrl_result" >&6; } cat >>confdefs.h <<_ACEOF @@ -4785,21 +5234,28 @@ case $ENABLE_MEMDUMP in fi ;; *) - as_fn_error $? "unknown memdump argument: $ENABLE_MEMDUMP" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: unknown memdump argument: $ENABLE_MEMDUMP" >&5 +$as_echo "$as_me: error: unknown memdump argument: $ENABLE_MEMDUMP" >&2;} + { (exit 1); exit 1; }; } ;; esac if test "x$ENABLE_MEMDUMP" != "xno" ; then enableval=yes # POSTK_DEBUG_ARCH_DEP_32, AC_CHECK_LIB for libiberty - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hex_init in -liberty" >&5 + +{ $as_echo "$as_me:$LINENO: checking for hex_init in -liberty" >&5 $as_echo_n "checking for hex_init in -liberty... " >&6; } -if ${ac_cv_lib_iberty_hex_init+:} false; then : +if test "${ac_cv_lib_iberty_hex_init+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-liberty $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -4817,18 +5273,43 @@ return hex_init (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_iberty_hex_init=yes else - ac_cv_lib_iberty_hex_init=no + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_iberty_hex_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iberty_hex_init" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_iberty_hex_init" >&5 $as_echo "$ac_cv_lib_iberty_hex_init" >&6; } -if test "x$ac_cv_lib_iberty_hex_init" = xyes; then : +if test "x$ac_cv_lib_iberty_hex_init" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIBERTY 1 _ACEOF @@ -4839,14 +5320,19 @@ else enableval=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bfd_init in -lbfd" >&5 + +{ $as_echo "$as_me:$LINENO: checking for bfd_init in -lbfd" >&5 $as_echo_n "checking for bfd_init in -lbfd... " >&6; } -if ${ac_cv_lib_bfd_bfd_init+:} false; then : +if test "${ac_cv_lib_bfd_bfd_init+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbfd $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. @@ -4864,18 +5350,43 @@ return bfd_init (); return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bfd_bfd_init=yes else - ac_cv_lib_bfd_bfd_init=no + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_bfd_bfd_init=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bfd_bfd_init" >&5 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bfd_bfd_init" >&5 $as_echo "$ac_cv_lib_bfd_bfd_init" >&6; } -if test "x$ac_cv_lib_bfd_bfd_init" = xyes; then : +if test "x$ac_cv_lib_bfd_bfd_init" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBBFD 1 _ACEOF @@ -4886,9 +5397,135 @@ else enableval=no fi - ac_fn_c_check_header_mongrel "$LINENO" "bfd.h" "ac_cv_header_bfd_h" "$ac_includes_default" -if test "x$ac_cv_header_bfd_h" = xyes; then : + if test "${ac_cv_header_bfd_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for bfd.h" >&5 +$as_echo_n "checking for bfd.h... " >&6; } +if test "${ac_cv_header_bfd_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_bfd_h" >&5 +$as_echo "$ac_cv_header_bfd_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking bfd.h usability" >&5 +$as_echo_n "checking bfd.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking bfd.h presence" >&5 +$as_echo_n "checking bfd.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: bfd.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: bfd.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: bfd.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: bfd.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: bfd.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: bfd.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: bfd.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: bfd.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: bfd.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: bfd.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: bfd.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: bfd.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: bfd.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: bfd.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: bfd.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: bfd.h: in the future, the compiler will take precedence" >&2;} + + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for bfd.h" >&5 +$as_echo_n "checking for bfd.h... " >&6; } +if test "${ac_cv_header_bfd_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_bfd_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_bfd_h" >&5 +$as_echo "$ac_cv_header_bfd_h" >&6; } + +fi +if test "x$ac_cv_header_bfd_h" = x""yes; then + : else enableval=no fi @@ -4896,43 +5533,51 @@ fi if test "x$ENABLE_MEMDUMP" = "xyes" -a "x$enableval" = "xno" ; then - as_fn_error $? "memdump feature needs bfd.h and libbfd a.k.a bunutils-devel" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: memdump feature needs bfd.h and libbfd a.k.a bunutils-devel" >&5 +$as_echo "$as_me: error: memdump feature needs bfd.h and libbfd a.k.a bunutils-devel" >&2;} + { (exit 1); exit 1; }; } fi ENABLE_MEMDUMP=$enableval fi if test "x$ENABLE_MEMDUMP" = "xyes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: memdump feature is enabled" >&5 + { $as_echo "$as_me:$LINENO: memdump feature is enabled" >&5 $as_echo "$as_me: memdump feature is enabled" >&6;} -$as_echo "#define ENABLE_MEMDUMP 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define ENABLE_MEMDUMP 1 +_ACEOF uncomment_if_ENABLE_MEMDUMP='' else - { $as_echo "$as_me:${as_lineno-$LINENO}: memdump feature is disabled" >&5 + { $as_echo "$as_me:$LINENO: memdump feature is disabled" >&5 $as_echo "$as_me: memdump feature is disabled" >&6;} uncomment_if_ENABLE_MEMDUMP='#' fi if test "x$ENABLE_MCOVERLAYFS" = "xyes" ; then -$as_echo "#define ENABLE_MCOVERLAYFS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define ENABLE_MCOVERLAYFS 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: mcoverlayfs is enabled" >&5 + { $as_echo "$as_me:$LINENO: mcoverlayfs is enabled" >&5 $as_echo "$as_me: mcoverlayfs is enabled" >&6;} else - { $as_echo "$as_me:${as_lineno-$LINENO}: mcoverlayfs is disabled" >&5 + { $as_echo "$as_me:$LINENO: mcoverlayfs is disabled" >&5 $as_echo "$as_me: mcoverlayfs is disabled" >&6;} fi if test "x$ENABLE_QLMPI" = "xyes" ; then -$as_echo "#define ENABLE_QLMPI 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define ENABLE_QLMPI 1 +_ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: qlmpi is enabled" >&5 + { $as_echo "$as_me:$LINENO: qlmpi is enabled" >&5 $as_echo "$as_me: qlmpi is enabled" >&6;} else - { $as_echo "$as_me:${as_lineno-$LINENO}: qlmpi is disabled" >&5 + { $as_echo "$as_me:$LINENO: qlmpi is disabled" >&5 $as_echo "$as_me: qlmpi is disabled" >&6;} fi @@ -4943,18 +5588,22 @@ case $ENABLE_RUSAGE in ENABLE_RUSAGE=yes ;; *) - as_fn_error $? "unknown rusage argument: $ENABLE_RUSAGE" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: unknown rusage argument: $ENABLE_RUSAGE" >&5 +$as_echo "$as_me: error: unknown rusage argument: $ENABLE_RUSAGE" >&2;} + { (exit 1); exit 1; }; } ;; esac if test "x$ENABLE_RUSAGE" = "xyes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: rusage is enabled" >&5 + { $as_echo "$as_me:$LINENO: rusage is enabled" >&5 $as_echo "$as_me: rusage is enabled" >&6;} -$as_echo "#define ENABLE_RUSAGE 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define ENABLE_RUSAGE 1 +_ACEOF else - { $as_echo "$as_me:${as_lineno-$LINENO}: rusage is disabled" >&5 + { $as_echo "$as_me:$LINENO: rusage is disabled" >&5 $as_echo "$as_me: rusage is disabled" >&6;} fi @@ -5017,7 +5666,7 @@ ac_config_headers="$ac_config_headers config.h" # POSTK_DEBUG_ARCH_DEP_37 # AC_CONFIG_FILES arch dependfiles separate -ac_config_files="$ac_config_files Makefile executer/user/Makefile executer/user/arch/$ARCH/Makefile executer/kernel/mcctrl/Makefile executer/kernel/mcctrl/arch/$ARCH/Makefile executer/kernel/mcoverlayfs/Makefile executer/kernel/mcoverlayfs/linux-3.10.0-327.36.1.el7/Makefile executer/kernel/mcoverlayfs/linux-4.0.9/Makefile executer/kernel/mcoverlayfs/linux-4.6.7/Makefile executer/include/qlmpilib.h kernel/Makefile kernel/Makefile.build kernel/include/swapfmt.h arch/x86/tools/mcreboot-attached-mic.sh arch/x86/tools/mcshutdown-attached-mic.sh arch/x86/tools/mcreboot-builtin-x86.sh arch/x86/tools/mcreboot-smp-x86.sh arch/x86/tools/mcstop+release-smp-x86.sh arch/x86/tools/eclair-dump-backtrace.exp arch/x86/tools/mcshutdown-builtin-x86.sh arch/x86/tools/mcreboot.1:arch/x86/tools/mcreboot.1in arch/x86/tools/irqbalance_mck.service arch/x86/tools/irqbalance_mck.in" +ac_config_files="$ac_config_files Makefile executer/user/Makefile executer/user/arch/$ARCH/Makefile executer/user/arch/x86_64/Makefile executer/user/vmcore2mckdump executer/kernel/mcctrl/Makefile executer/kernel/mcctrl/arch/$ARCH/Makefile executer/kernel/mcoverlayfs/Makefile executer/kernel/mcoverlayfs/linux-3.10.0-327.36.1.el7/Makefile executer/kernel/mcoverlayfs/linux-4.0.9/Makefile executer/kernel/mcoverlayfs/linux-4.6.7/Makefile executer/include/qlmpilib.h kernel/Makefile kernel/Makefile.build kernel/include/swapfmt.h arch/x86/tools/mcreboot-attached-mic.sh arch/x86/tools/mcshutdown-attached-mic.sh arch/x86/tools/mcreboot-builtin-x86.sh arch/x86/tools/mcreboot-smp-x86.sh arch/x86/tools/mcstop+release-smp-x86.sh arch/x86/tools/eclair-dump-backtrace.exp arch/x86/tools/mcshutdown-builtin-x86.sh arch/x86/tools/mcreboot.1:arch/x86/tools/mcreboot.1in arch/x86/tools/irqbalance_mck.service arch/x86/tools/irqbalance_mck.in" if test "$TARGET" = "smp-arm64"; then @@ -5025,12 +5674,13 @@ ac_config_files="$ac_config_files kernel/config/config.smp-arm64 arch/arm64/kern fi -if test "x$enable_dcfa" = xyes; then : +if test "x$enable_dcfa" = xyes; then ac_config_files="$ac_config_files kernel/Makefile.dcfa" fi + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -5058,13 +5708,13 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; + *) $as_unset $ac_var ;; esac ;; esac done @@ -5072,8 +5722,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" @@ -5095,23 +5745,12 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - if test ! -f "$cache_file" || test -h "$cache_file"; then - cat confcache >"$cache_file" - else - case $cache_file in #( - */* | ?:*) - mv -f confcache "$cache_file"$$ && - mv -f "$cache_file"$$ "$cache_file" ;; #( - *) - mv -f confcache "$cache_file" ;; - esac - fi - fi + cat confcache >$cache_file else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi @@ -5125,15 +5764,14 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= -U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -5141,14 +5779,13 @@ LTLIBOBJS=$ac_ltlibobjs -: "${CONFIG_STATUS=./config.status}" +: ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -5158,18 +5795,17 @@ cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false - SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which @@ -5177,15 +5813,23 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; esac + fi + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + as_nl=' ' export as_nl @@ -5193,13 +5837,7 @@ export as_nl as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else @@ -5210,7 +5848,7 @@ else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; - case $arg in #( + case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; @@ -5233,6 +5871,13 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + # IFS # We need space, tab and new line, in precisely that order. Quoting is @@ -5242,16 +5887,15 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. -as_myself= -case $0 in #(( +case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done IFS=$as_save_IFS ;; @@ -5263,16 +5907,12 @@ if test "x$as_myself" = x; then fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 + { (exit 1); exit 1; } fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' @@ -5284,89 +5924,7 @@ export LC_ALL LANGUAGE=C export LANGUAGE -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - +# Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -5380,12 +5938,8 @@ else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ @@ -5405,25 +5959,76 @@ $as_echo X/"$0" | } s/.*/./; q'` -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( +case `echo -n x` in -n*) - case `echo 'xy\c'` in + case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; + *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then @@ -5438,85 +6043,49 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -pR' + as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi else - as_ln_s='cp -pR' + as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi - -# as_fn_executable_p FILE -# ----------------------- -# Test if FILE is an executable regular file. -as_fn_executable_p () -{ - test -f "$1" && test -x "$1" -} # as_fn_executable_p -as_test_x='test -x' -as_executable_p=as_fn_executable_p +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -5526,19 +6095,13 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by mckernel $as_me 0.9.0, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -5569,15 +6132,13 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. +\`$as_me' instantiates files from templates according to the +current configuration. -Usage: $0 [OPTION]... [TAG]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -5593,17 +6154,16 @@ $config_files Configuration headers: $config_headers -Report bugs to the package provider." +Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ mckernel config.status 0.9.0 -configured by $0, generated by GNU Autoconf 2.69, - with options \\"\$ac_cs_config\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -5618,16 +6178,11 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=?*) + --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - --*=) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg= - ac_shift=: - ;; *) ac_option=$1 ac_optarg=$2 @@ -5641,29 +6196,27 @@ do ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - '') as_fn_error $? "missing file argument" ;; esac - as_fn_append CONFIG_FILES " '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + { $as_echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -5671,10 +6224,11 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) { $as_echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; - *) as_fn_append ac_config_targets " $1" + *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac @@ -5691,7 +6245,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -5724,6 +6278,8 @@ do "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "executer/user/Makefile") CONFIG_FILES="$CONFIG_FILES executer/user/Makefile" ;; "executer/user/arch/$ARCH/Makefile") CONFIG_FILES="$CONFIG_FILES executer/user/arch/$ARCH/Makefile" ;; + "executer/user/arch/x86_64/Makefile") CONFIG_FILES="$CONFIG_FILES executer/user/arch/x86_64/Makefile" ;; + "executer/user/vmcore2mckdump") CONFIG_FILES="$CONFIG_FILES executer/user/vmcore2mckdump" ;; "executer/kernel/mcctrl/Makefile") CONFIG_FILES="$CONFIG_FILES executer/kernel/mcctrl/Makefile" ;; "executer/kernel/mcctrl/arch/$ARCH/Makefile") CONFIG_FILES="$CONFIG_FILES executer/kernel/mcctrl/arch/$ARCH/Makefile" ;; "executer/kernel/mcoverlayfs/Makefile") CONFIG_FILES="$CONFIG_FILES executer/kernel/mcoverlayfs/Makefile" ;; @@ -5749,7 +6305,9 @@ do "arch/arm64/kernel/Makefile.arch") CONFIG_FILES="$CONFIG_FILES arch/arm64/kernel/Makefile.arch" ;; "kernel/Makefile.dcfa") CONFIG_FILES="$CONFIG_FILES kernel/Makefile.dcfa" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; esac done @@ -5771,24 +6329,26 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= ac_tmp= + tmp= trap 'exit_status=$? - : "${ac_tmp:=$tmp}" - { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 - trap 'as_fn_exit 1' 1 2 13 15 + trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -d "$tmp" + test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -ac_tmp=$tmp +} || +{ + $as_echo "$as_me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -5796,13 +6356,7 @@ ac_tmp=$tmp if test -n "$CONFIG_FILES"; then -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi +ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' @@ -5810,7 +6364,7 @@ else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$ac_tmp/subs1.awk" && +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF @@ -5819,18 +6373,24 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -5838,7 +6398,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -5852,7 +6412,7 @@ s/'"$ac_delim"'$// t delim :nl h -s/\(.\{148\}\)..*/\1/ +s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -5866,7 +6426,7 @@ s/.\{148\}// t nl :delim h -s/\(.\{148\}\)..*/\1/ +s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p @@ -5886,7 +6446,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && +cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -5918,29 +6478,23 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ - || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } _ACEOF -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// s/^[^=]*=[ ]*$// }' fi @@ -5952,7 +6506,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$ac_tmp/defines.awk" <<\_ACAWK || +cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -5964,11 +6518,13 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_tt=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_tt"; then + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then break elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -6053,7 +6609,9 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" @@ -6066,7 +6624,9 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -6085,7 +6645,7 @@ do for ac_f do case $ac_f in - -) ac_f="$ac_tmp/stdin";; + -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -6094,10 +6654,12 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't @@ -6108,7 +6670,7 @@ do `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. @@ -6120,8 +6682,10 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$ac_tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -6149,7 +6713,47 @@ $as_echo X"$ac_file" | q } s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in @@ -6197,6 +6801,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= + ac_sed_dataroot=' /datarootdir/ { p @@ -6206,11 +6811,12 @@ ac_sed_dataroot=' /@docdir@/p /@infodir@/p /@localedir@/p -/@mandir@/p' +/@mandir@/p +' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -6220,7 +6826,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; + s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF @@ -6246,24 +6852,27 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ - >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ - "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} +which seems to be undefined. Please make sure it is defined." >&2;} - rm -f "$ac_tmp/stdin" + rm -f "$tmp/stdin" case $ac_file in - -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; - *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # @@ -6272,21 +6881,27 @@ which seems to be undefined. Please make sure it is defined" >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" - } >"$ac_tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$ac_tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi ;; @@ -6296,12 +6911,15 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;} done # for ac_tag -as_fn_exit 0 +{ (exit 0); exit 0; } _ACEOF +chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. @@ -6322,10 +6940,10 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 + $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff --git a/configure.ac b/configure.ac index bf1e4561..c858ca2b 100644 --- a/configure.ac +++ b/configure.ac @@ -518,6 +518,8 @@ AC_CONFIG_FILES([ Makefile executer/user/Makefile executer/user/arch/$ARCH/Makefile + executer/user/arch/x86_64/Makefile + executer/user/vmcore2mckdump executer/kernel/mcctrl/Makefile executer/kernel/mcctrl/arch/$ARCH/Makefile executer/kernel/mcoverlayfs/Makefile diff --git a/executer/include/defs.h b/executer/include/defs.h new file mode 100755 index 00000000..edccdc70 --- /dev/null +++ b/executer/include/defs.h @@ -0,0 +1,6671 @@ +/* defs.h - core analysis suite + * + * Copyright (C) 1999, 2000, 2001, 2002 Mission Critical Linux, Inc. + * Copyright (C) 2002-2017 David Anderson + * Copyright (C) 2002-2017 Red Hat, Inc. All rights reserved. + * Copyright (C) 2002 Silicon Graphics, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef GDB_COMMON + +#include +#include +#include +#include +#include +#include +#include +#undef basename +#if !defined(__USE_GNU) +#define __USE_GNU +#include +#undef __USE_GNU +#else +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* backtrace() */ +#include +#ifdef LZO +#include +#endif +#ifdef SNAPPY +#include +#endif + +#ifndef ATTRIBUTE_UNUSED +#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + +#undef TRUE +#undef FALSE + +#define TRUE (1) +#define FALSE (0) +#define STR(x) #x +#ifndef offsetof +# define offsetof(TYPE, MEMBER) ((ulong)&((TYPE *)0)->MEMBER) +#endif + +#if !defined(X86) && !defined(X86_64) && !defined(ALPHA) && !defined(PPC) && \ + !defined(IA64) && !defined(PPC64) && !defined(S390) && !defined(S390X) && \ + !defined(ARM) && !defined(ARM64) && !defined(MIPS) && !defined(SPARC64) +#ifdef __alpha__ +#define ALPHA +#endif +#ifdef __i386__ +#define X86 +#endif +#ifdef __powerpc64__ +#define PPC64 +#else +#ifdef __powerpc__ +#define PPC +#endif +#endif +#ifdef __ia64__ +#define IA64 +#endif +#ifdef __s390__ +#define S390 +#endif +#ifdef __s390x__ +#define S390X +#endif +#ifdef __x86_64__ +#define X86_64 +#endif +#ifdef __arm__ +#define ARM +#endif +#ifdef __aarch64__ +#define ARM64 +#endif +#ifdef __mipsel__ +#define MIPS +#endif +#ifdef __sparc_v9__ +#define SPARC64 +#endif +#endif + +#ifdef X86 +#define NR_CPUS (256) +#endif +#ifdef X86_64 +#define NR_CPUS (8192) +#endif +#ifdef ALPHA +#define NR_CPUS (64) +#endif +#ifdef PPC +#define NR_CPUS (32) +#endif +#ifdef IA64 +#define NR_CPUS (4096) +#endif +#ifdef PPC64 +#define NR_CPUS (2048) +#endif +#ifdef S390 +#define NR_CPUS (512) +#endif +#ifdef S390X +#define NR_CPUS (512) +#endif +#ifdef ARM +#define NR_CPUS (32) +#endif +#ifdef ARM64 +#define NR_CPUS (4096) /* TBD */ +#endif +#ifdef MIPS +#define NR_CPUS (32) +#endif +#ifdef SPARC64 +#define NR_CPUS (4096) +#endif + +/* Some architectures require memory accesses to be aligned. */ +#if defined(SPARC64) +#define NEED_ALIGNED_MEM_ACCESS +#endif + +#define BUFSIZE (1500) +#define NULLCHAR ('\0') + +#define MAXARGS (100) /* max number of arguments to one function */ +#define MAXARGLEN (40) /* max length of argument */ + +#define HIST_BLKSIZE (4096) + +static inline int string_exists(char *s) { return (s ? TRUE : FALSE); } +#define STREQ(A, B) (string_exists((char *)A) && string_exists((char *)B) && \ + (strcmp((char *)(A), (char *)(B)) == 0)) +#define STRNEQ(A, B) (string_exists((char *)A) && string_exists((char *)B) && \ + (strncmp((char *)(A), (char *)(B), strlen((char *)(B))) == 0)) +#define BZERO(S, N) (memset(S, NULLCHAR, N)) +#define BCOPY(S, D, C) (memcpy(D, S, C)) +#define BNEG(S, N) (memset(S, 0xff, N)) +#define BEEP() fprintf(stderr, "%c", 0x7) +#define LASTCHAR(s) (s[strlen(s)-1]) +#define FIRSTCHAR(s) (s[0]) +#define QUOTED_STRING(s) ((FIRSTCHAR(s) == '"') && (LASTCHAR(s) == '"')) +#define SINGLE_QUOTED_STRING(s) ((FIRSTCHAR(s) == '\'') && (LASTCHAR(s) == '\'')) +#define PATHEQ(A, B) ((A) && (B) && (pathcmp((char *)(A), (char *)(B)) == 0)) + +#ifdef roundup +#undef roundup +#endif +#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) + +typedef uint64_t physaddr_t; + +#define PADDR_NOT_AVAILABLE (0x1ULL) + +typedef unsigned long long int ulonglong; +struct number_option { + ulong num; + ulonglong ll_num; + ulong retflags; +}; + +/* + * program_context flags + */ +#define LIVE_SYSTEM (0x1ULL) +#define TTY (0x2ULL) +#define RUNTIME (0x4ULL) +#define IN_FOREACH (0x8ULL) +#define MCLXCD (0x10ULL) +#define CMDLINE_IFILE (0x20ULL) +#define MFD_RDWR (0x40ULL) +#define KVMDUMP (0x80ULL) +#define SILENT (0x100ULL) +#define SADUMP (0x200ULL) +#define HASH (0x400ULL) +#define SCROLL (0x800ULL) +#define NO_CONSOLE (0x1000ULL) +#define RUNTIME_IFILE (0x2000ULL) +#define DROP_CORE (0x4000ULL) +#define LKCD (0x8000ULL) +#define GDB_INIT (0x10000ULL) +#define IN_GDB (0x20000ULL) +#define RCLOCAL_IFILE (0x40000ULL) +#define RCHOME_IFILE (0x80000ULL) +#define VMWARE_VMSS (0x100000ULL) +#define READLINE (0x200000ULL) +#define _SIGINT_ (0x400000ULL) +#define IN_RESTART (0x800000ULL) +#define KERNEL_DEBUG_QUERY (0x1000000ULL) +#define DEVMEM (0x2000000ULL) +#define REM_LIVE_SYSTEM (0x4000000ULL) +#define NAMELIST_LOCAL (0x8000000ULL) +#define LIVE_RAMDUMP (0x10000000ULL) +#define NAMELIST_SAVED (0x20000000ULL) +#define DUMPFILE_SAVED (0x40000000ULL) +#define UNLINK_NAMELIST (0x80000000ULL) +#define NAMELIST_UNLINKED (0x100000000ULL) +#define REM_MCLXCD (0x200000000ULL) +#define REM_LKCD (0x400000000ULL) +#define NAMELIST_NO_GZIP (0x800000000ULL) +#define UNLINK_MODULES (0x1000000000ULL) +#define S390D (0x2000000000ULL) +#define REM_S390D (0x4000000000ULL) +#define SYSRQ (0x8000000000ULL) +#define KDUMP (0x10000000000ULL) +#define NETDUMP (0x20000000000ULL) +#define REM_NETDUMP (0x40000000000ULL) +#define SYSMAP (0x80000000000ULL) +#define SYSMAP_ARG (0x100000000000ULL) +#define MEMMOD (0x200000000000ULL) +#define MODPRELOAD (0x400000000000ULL) +#define DISKDUMP (0x800000000000ULL) +#define DATADEBUG (0x1000000000000ULL) +#define FINDKERNEL (0x2000000000000ULL) +#define VERSION_QUERY (0x4000000000000ULL) +#define READNOW (0x8000000000000ULL) +#define NOCRASHRC (0x10000000000000ULL) +#define INIT_IFILE (0x20000000000000ULL) +#define XENDUMP (0x40000000000000ULL) +#define XEN_HYPER (0x80000000000000ULL) +#define XEN_CORE (0x100000000000000ULL) +#define PLEASE_WAIT (0x200000000000000ULL) +#define IFILE_ERROR (0x400000000000000ULL) +#define KERNTYPES (0x800000000000000ULL) +#define MINIMAL_MODE (0x1000000000000000ULL) +#define CRASHBUILTIN (0x2000000000000000ULL) +#define PRELOAD_EXTENSIONS \ + (0x4000000000000000ULL) +#define PROC_KCORE (0x8000000000000000ULL) + +#define ACTIVE() (pc->flags & LIVE_SYSTEM) +#define LOCAL_ACTIVE() ((pc->flags & (LIVE_SYSTEM|LIVE_RAMDUMP)) == LIVE_SYSTEM) +#define DUMPFILE() (!(pc->flags & LIVE_SYSTEM)) +#define LIVE() (pc->flags2 & LIVE_DUMP || pc->flags & LIVE_SYSTEM) +#define MEMORY_SOURCES (NETDUMP|KDUMP|MCLXCD|LKCD|DEVMEM|S390D|MEMMOD|DISKDUMP|XENDUMP|CRASHBUILTIN|KVMDUMP|PROC_KCORE|SADUMP|VMWARE_VMSS|LIVE_RAMDUMP) +#define DUMPFILE_TYPES (DISKDUMP|NETDUMP|KDUMP|MCLXCD|LKCD|S390D|XENDUMP|KVMDUMP|SADUMP|VMWARE_VMSS|LIVE_RAMDUMP) +#define REMOTE() (pc->flags2 & REMOTE_DAEMON) +#define REMOTE_ACTIVE() (pc->flags & REM_LIVE_SYSTEM) +#define REMOTE_DUMPFILE() \ + (pc->flags & (REM_NETDUMP|REM_MCLXCD|REM_LKCD|REM_S390D)) +#define REMOTE_MEMSRC() (REMOTE_ACTIVE() || REMOTE_PAUSED() || REMOTE_DUMPFILE()) +#define LKCD_DUMPFILE() (pc->flags & (LKCD|REM_LKCD)) +#define NETDUMP_DUMPFILE() (pc->flags & (NETDUMP|REM_NETDUMP)) +#define DISKDUMP_DUMPFILE() (pc->flags & DISKDUMP) +#define KDUMP_DUMPFILE() (pc->flags & KDUMP) +#define XENDUMP_DUMPFILE() (pc->flags & XENDUMP) +#define XEN_HYPER_MODE() (pc->flags & XEN_HYPER) +#define SYSRQ_TASK(X) ((pc->flags & SYSRQ) && is_task_active(X)) +#define XEN_CORE_DUMPFILE() (pc->flags & XEN_CORE) +#define LKCD_KERNTYPES() (pc->flags & KERNTYPES) +#define KVMDUMP_DUMPFILE() (pc->flags & KVMDUMP) +#define SADUMP_DUMPFILE() (pc->flags & SADUMP) + +#define NETDUMP_LOCAL (0x1) /* netdump_data flags */ +#define NETDUMP_REMOTE (0x2) +#define VMCORE_VALID() (nd->flags & (NETDUMP_LOCAL|NETDUMP_REMOTE|KDUMP_LOCAL)) +#define NETDUMP_ELF32 (0x4) +#define NETDUMP_ELF64 (0x8) +#define PARTIAL_DUMP (0x10) /* netdump or diskdump */ +#define KDUMP_ELF32 (0x20) +#define KDUMP_ELF64 (0x40) +#define KDUMP_LOCAL (0x80) +#define KCORE_LOCAL (0x100) +#define KCORE_ELF32 (0x200) +#define KCORE_ELF64 (0x400) +#define QEMU_MEM_DUMP_KDUMP_BACKUP \ + (0x800) +#define KVMDUMP_LOCAL (0x1) +#define KVMDUMP_VALID() (kvm->flags & (KVMDUMP_LOCAL)) + +#define DUMPFILE_FORMAT(flags) ((flags) & \ + (NETDUMP_ELF32|NETDUMP_ELF64|KDUMP_ELF32|KDUMP_ELF64)) + +#define DISKDUMP_LOCAL (0x1) +#define KDUMP_CMPRS_LOCAL (0x2) +#define ERROR_EXCLUDED (0x4) +#define ZERO_EXCLUDED (0x8) +#define DUMPFILE_SPLIT (0x10) +#define NO_ELF_NOTES (0x20) +#define LZO_SUPPORTED (0x40) +#define SNAPPY_SUPPORTED (0x80) +#define DISKDUMP_VALID() (dd->flags & DISKDUMP_LOCAL) +#define KDUMP_CMPRS_VALID() (dd->flags & KDUMP_CMPRS_LOCAL) +#define KDUMP_SPLIT() (dd->flags & DUMPFILE_SPLIT) + +#define XENDUMP_LOCAL (0x1) +#define XENDUMP_VALID() (xd->flags & XENDUMP_LOCAL) + +#define SADUMP_LOCAL (0x1) +#define SADUMP_DISKSET (0x2) +#define SADUMP_MEDIA (0x4) +#define SADUMP_ZERO_EXCLUDED (0x8) +#define SADUMP_KDUMP_BACKUP (0x10) +#define SADUMP_VALID() (sd->flags & SADUMP_LOCAL) + +#define CRASHDEBUG(x) (pc->debug >= (x)) + +#define CRASHDEBUG_SUSPEND(X) { pc->debug_save = pc->debug; pc->debug = X; } +#define CRASHDEBUG_RESTORE() { pc->debug = pc->debug_save; } + +#define VERBOSE (0x1) +#define ADDRESS_SPECIFIED (0x2) + +#define FAULT_ON_ERROR (0x1) +#define RETURN_ON_ERROR (0x2) +#define QUIET (0x4) +#define HEX_BIAS (0x8) +#define LONG_LONG (0x10) +#define RETURN_PARTIAL (0x20) +#define NO_DEVMEM_SWITCH (0x40) + +#define SEEK_ERROR (-1) +#define READ_ERROR (-2) +#define WRITE_ERROR (-3) +#define PAGE_EXCLUDED (-4) + +#define RESTART() (longjmp(pc->main_loop_env, 1)) +#define RESUME_FOREACH() (longjmp(pc->foreach_loop_env, 1)) + +#define INFO (1) +#define FATAL (2) +#define FATAL_RESTART (3) +#define WARNING (4) +#define NOTE (5) +#define CONT (6) +#define FATAL_ERROR(x) (((x) == FATAL) || ((x) == FATAL_RESTART)) + +#define CONSOLE_OFF(x) ((x) = console_off()) +#define CONSOLE_ON(x) (console_on(x)) + +#define RADIX(X) (X) + +#define NUM_HEX (0x1) +#define NUM_DEC (0x2) +#define NUM_EXPR (0x4) +#define NUM_ANY (NUM_HEX|NUM_DEC|NUM_EXPR) + +/* + * program context redirect flags + */ +#define FROM_COMMAND_LINE (0x1) +#define FROM_INPUT_FILE (0x2) +#define REDIRECT_NOT_DONE (0x4) +#define REDIRECT_TO_PIPE (0x8) +#define REDIRECT_TO_STDPIPE (0x10) +#define REDIRECT_TO_FILE (0x20) +#define REDIRECT_FAILURE (0x40) +#define REDIRECT_SHELL_ESCAPE (0x80) +#define REDIRECT_SHELL_COMMAND (0x100) +#define REDIRECT_PID_KNOWN (0x200) +#define REDIRECT_MULTI_PIPE (0x400) + +#define PIPE_OPTIONS (FROM_COMMAND_LINE | FROM_INPUT_FILE | REDIRECT_TO_PIPE | \ + REDIRECT_TO_STDPIPE | REDIRECT_TO_FILE) + +#define DEFAULT_REDHAT_DEBUG_LOCATION "/usr/lib/debug/lib/modules" + +#define MEMORY_DRIVER_MODULE "crash" +#define MEMORY_DRIVER_DEVICE "/dev/crash" +#define MEMORY_DRIVER_DEVICE_MODE (S_IFCHR|S_IRUSR) + +/* + * structure definitions + */ +struct program_context { + char *program_name; /* this program's name */ + char *program_path; /* unadulterated argv[0] */ + char *program_version; /* this program's version */ + char *gdb_version; /* embedded gdb version */ + char *prompt; /* this program's prompt */ + unsigned long long flags; /* flags from above */ + char *namelist; /* linux namelist */ + char *dumpfile; /* dumpfile or /dev/kmem */ + char *live_memsrc; /* live memory driver */ + char *system_map; /* get symbol values from System.map */ + char *namelist_debug; /* namelist containing debug data */ + char *debuginfo_file; /* separate debuginfo file */ + char *memory_module; /* alternative to mem.c driver */ + char *memory_device; /* alternative to /dev/[k]mem device */ + char *machine_type; /* machine's processor type */ + char *editing_mode; /* readline vi or emacs */ + char *server; /* network daemon */ + char *server_memsrc; /* memory source on server */ + char *server_namelist; /* kernel namelist on server */ + int nfd; /* linux namelist fd */ + int mfd; /* /dev/mem fd */ + int kfd; /* /dev/kmem fd */ + int dfd; /* dumpfile fd */ + int confd; /* console fd */ + int sockfd; /* network daemon socket */ + ushort port; /* network daemon port */ + int rmfd; /* remote server memory source fd */ + int rkfd; /* remote server /dev/kmem fd */ + ulong program_pid; /* program pid */ + ulong server_pid; /* server pid */ + ulong rcvbufsize; /* client-side receive buffer size */ + char *home; /* user's home directory */ + char command_line[BUFSIZE]; /* possibly parsed input command line */ + char orig_line[BUFSIZE]; /* original input line */ + char *readline; /* pointer to last readline() return */ + char my_tty[10]; /* real tty name (shown by ps -ef) */ + ulong debug; /* level of debug */ + ulong debug_save; /* saved level for debug-suspend */ + char *console; /* current debug console device */ + char *redhat_debug_loc; /* location of matching debug objects */ + int pipefd[2]; /* output pipe file descriptors */ + FILE *nullfp; /* bitbucket */ + FILE *stdpipe; /* standard pipe for output */ + FILE *pipe; /* command line specified pipe */ + FILE *ofile; /* command line specified output file */ + FILE *ifile; /* command line specified input file */ + FILE *ifile_pipe; /* output pipe specified from file */ + FILE *ifile_ofile; /* output file specified from file */ + FILE *symfile; /* symbol table data file */ + FILE *symfile2; /* alternate access to above */ + FILE *tmpfile; /* tmpfile for selective data output */ + FILE *saved_fp; /* for printing while parsing tmpfile */ + FILE *tmp_fp; /* stored tmpfile pointer */ + char *input_file; /* input file specified at invocation */ + FILE *tmpfile2; /* tmpfile2 does not use save_fp! */ + int eoc_index; /* end of redirected command index */ + int scroll_command; /* default scroll command for output */ +#define SCROLL_NONE 0 +#define SCROLL_LESS 1 +#define SCROLL_MORE 2 +#define SCROLL_CRASHPAGER 3 + ulong redirect; /* per-cmd origin and output flags */ + pid_t stdpipe_pid; /* per-cmd standard output pipe's pid */ + pid_t pipe_pid; /* per-cmd output pipe's pid */ + pid_t pipe_shell_pid; /* per-cmd output pipe's shell pid */ + char pipe_command[BUFSIZE]; /* pipe command line */ + struct command_table_entry *cmd_table; /* linux/xen command table */ + char *curcmd; /* currently-executing command */ + char *lastcmd; /* previously-executed command */ + ulong cmdgencur; /* current command generation number */ + ulong curcmd_flags; /* general purpose per-command flag */ +#define XEN_MACHINE_ADDR (0x1) +#define REPEAT (0x2) +#define IDLE_TASK_SHOWN (0x4) +#define TASK_SPECIFIED (0x8) +#define MEMTYPE_UVADDR (0x10) +#define MEMTYPE_FILEADDR (0x20) +#define HEADER_PRINTED (0x40) +#define BAD_INSTRUCTION (0x80) +#define UD2A_INSTRUCTION (0x100) +#define IRQ_IN_USE (0x200) +#define NO_MODIFY (0x400) +#define IGNORE_ERRORS (0x800) +#define FROM_RCFILE (0x1000) +#define MEMTYPE_KVADDR (0x2000) +#define MOD_SECTIONS (0x4000) +#define MOD_READNOW (0x8000) +#define MM_STRUCT_FORCE (0x10000) +#define CPUMASK (0x20000) +#define PARTIAL_READ_OK (0x40000) + ulonglong curcmd_private; /* general purpose per-command info */ + int cur_gdb_cmd; /* current gdb command */ + int last_gdb_cmd; /* previously-executed gdb command */ + int sigint_cnt; /* number of ignored SIGINTs */ + struct gnu_request *cur_req; /* current gdb gnu_request */ + struct sigaction sigaction; /* general usage sigaction. */ + struct sigaction gdb_sigaction; /* gdb's SIGINT sigaction. */ + jmp_buf main_loop_env; /* longjmp target default */ + jmp_buf foreach_loop_env; /* longjmp target within foreach */ + jmp_buf gdb_interface_env; /* longjmp target for gdb error catch */ + struct termios termios_orig; /* non-raw settings */ + struct termios termios_raw; /* while gathering command input */ + int ncmds; /* number of commands in menu */ + char **cmdlist; /* current list of available commands */ + int cmdlistsz; /* space available in cmdlist */ + unsigned output_radix; /* current gdb output_radix */ + void *sbrk; /* current sbrk value */ + struct extension_table *curext; /* extension being loaded */ + int (*readmem)(int, void *, int, ulong, physaddr_t); /* memory access */ + int (*writemem)(int, void *, int, ulong, physaddr_t);/* memory access */ + ulong ifile_in_progress; /* original xxx_IFILE flags */ + off_t ifile_offset; /* current offset into input file */ + char *runtime_ifile_cmd; /* runtime command using input file */ + char *kvmdump_mapfile; /* storage of physical to file offsets */ + ulonglong flags2; /* flags overrun */ +#define FLAT (0x01ULL) +#define ELF_NOTES (0x02ULL) +#define GET_OSRELEASE (0x04ULL) +#define REMOTE_DAEMON (0x08ULL) +#define ERASEINFO_DATA (0x10ULL) +#define GDB_CMD_MODE (0x20ULL) +#define LIVE_DUMP (0x40ULL) +#define FLAT_FORMAT() (pc->flags2 & FLAT) +#define ELF_NOTES_VALID() (pc->flags2 & ELF_NOTES) +#define RADIX_OVERRIDE (0x80ULL) +#define QEMU_MEM_DUMP_ELF (0x100ULL) +#define GET_LOG (0x200ULL) +#define VMCOREINFO (0x400ULL) +#define ALLOW_FP (0x800ULL) +#define REM_PAUSED_F (0x1000ULL) +#define RAMDUMP (0x2000ULL) +#define REMOTE_PAUSED() (pc->flags2 & REM_PAUSED_F) +#define OFFLINE_HIDE (0x4000ULL) +#define INCOMPLETE_DUMP (0x8000ULL) +#define is_incomplete_dump() (pc->flags2 & INCOMPLETE_DUMP) +#define QEMU_MEM_DUMP_COMPRESSED (0x10000ULL) +#define SNAP (0x20000ULL) +#define EXCLUDED_VMEMMAP (0x40000ULL) +#define is_excluded_vmemmap() (pc->flags2 & EXCLUDED_VMEMMAP) +#define MEMSRC_LOCAL (0x80000ULL) +#define REDZONE (0x100000ULL) + char *cleanup; + char *namelist_orig; + char *namelist_debug_orig; + FILE *args_ifile; /* per-command args input file */ + void (*cmd_cleanup)(void *); /* per-command cleanup function */ + void *cmd_cleanup_arg; /* optional cleanup function argument */ + ulong scope; /* optional text context address */ + ulong nr_hash_queues; /* hash queue head count */ + char *(*read_vmcoreinfo)(const char *); +}; + +#define READMEM pc->readmem + +typedef void (*cmd_func_t)(void); + +struct command_table_entry { /* one for each command in menu */ + char *name; + cmd_func_t func; + char **help_data; + ulong flags; +}; + +struct args_input_file { + int index; + int args_used; + int is_gdb_cmd; + int in_expression; + int start; + int resume; + char *fileptr; +}; + +#define REFRESH_TASK_TABLE (0x1) /* command_table_entry flags */ +#define HIDDEN_COMMAND (0x2) +#define CLEANUP (0x4) /* for extensions only */ +#define MINIMAL (0x8) + +/* + * A linked list of extension table structures keeps track of the current + * set of shared library extensions. + */ +struct extension_table { + void *handle; /* handle from dlopen() */ + char *filename; /* name of shared library */ + struct command_table_entry *command_table; /* list of commands */ + ulong flags; /* registration flags */ + struct extension_table *next, *prev; /* bookkeeping */ +}; + +#define REGISTERED (0x1) /* extension_table flags */ +#define DUPLICATE_COMMAND_NAME (0x2) +#define NO_MINIMAL_COMMANDS (0x4) + +struct new_utsname { + char sysname[65]; + char nodename[65]; + char release[65]; + char version[65]; + char machine[65]; + char domainname[65]; +}; + +#define NO_MODULE_ACCESS (0x1) +#define TVEC_BASES_V1 (0x2) +#define GCC_3_2 (0x4) +#define GCC_3_2_3 (0x8) +#define GCC_2_96 (0x10) +#define RA_SEEK (0x20) +#define NO_RA_SEEK (0x40) +#define KALLSYMS_V1 (0x80) +#define NO_KALLSYMS (0x100) +#define PER_CPU_OFF (0x200) +#define SMP (0x400) +#define GCC_3_3_2 (0x800) +#define KMOD_V1 (0x1000) +#define KMOD_V2 (0x2000) +#define KALLSYMS_V2 (0x2000) +#define TVEC_BASES_V2 (0x4000) +#define GCC_3_3_3 (0x8000) +#define USE_OLD_BT (0x10000) +#define USE_OPT_BT (0x10000) +#define ARCH_XEN (0x20000) +#define NO_IKCONFIG (0x40000) +#define DWARF_UNWIND (0x80000) +#define NO_DWARF_UNWIND (0x100000) +#define DWARF_UNWIND_MEMORY (0x200000) +#define DWARF_UNWIND_EH_FRAME (0x400000) +#define DWARF_UNWIND_CAPABLE (DWARF_UNWIND_MEMORY|DWARF_UNWIND_EH_FRAME) +#define DWARF_UNWIND_MODULES (0x800000) +#define BUGVERBOSE_OFF (0x1000000) +#define RELOC_SET (0x2000000) +#define RELOC_FORCE (0x4000000) +#define ARCH_OPENVZ (0x8000000) +#define ARCH_PVOPS (0x10000000) +#define PRE_KERNEL_INIT (0x20000000) +#define ARCH_PVOPS_XEN (0x40000000) +#define IRQ_DESC_TREE (0x80000000) + +#define GCC_VERSION_DEPRECATED (GCC_3_2|GCC_3_2_3|GCC_2_96|GCC_3_3_2|GCC_3_3_3) + +/* flags2 */ +#define RELOC_AUTO (0x1ULL) +#define KASLR (0x2ULL) +#define KASLR_CHECK (0x4ULL) +#define GET_TIMESTAMP (0x8ULL) +#define TVEC_BASES_V3 (0x10ULL) +#define TIMER_BASES (0x20ULL) + +#define XEN() (kt->flags & ARCH_XEN) +#define OPENVZ() (kt->flags & ARCH_OPENVZ) +#define PVOPS() (kt->flags & ARCH_PVOPS) +#define PVOPS_XEN() (kt->flags & ARCH_PVOPS_XEN) + +#define XEN_MACHINE_TO_MFN(m) ((ulonglong)(m) >> PAGESHIFT()) +#define XEN_PFN_TO_PSEUDO(p) ((ulonglong)(p) << PAGESHIFT()) + +#define XEN_MFN_NOT_FOUND (~0UL) +#define XEN_PFNS_PER_PAGE (PAGESIZE()/sizeof(ulong)) +#define XEN_FOREIGN_FRAME (1UL << (BITS()-1)) + +#define XEN_MACHADDR_NOT_FOUND (~0ULL) + +#define XEN_P2M_PER_PAGE (PAGESIZE() / sizeof(unsigned long)) +#define XEN_P2M_MID_PER_PAGE (PAGESIZE() / sizeof(unsigned long *)) +#define XEN_P2M_TOP_PER_PAGE (PAGESIZE() / sizeof(unsigned long **)) + +struct kernel_table { /* kernel data */ + ulong flags; + ulong stext; + ulong etext; + ulong stext_init; + ulong etext_init; + ulong init_begin; + ulong init_end; + ulong end; + int cpus; + char *cpus_override; + void (*display_bh)(void); + ulong module_list; + ulong kernel_module; + int mods_installed; + struct timespec date; + char proc_version[BUFSIZE]; + struct new_utsname utsname; + uint kernel_version[3]; + uint gcc_version[3]; + int runq_siblings; + int kernel_NR_CPUS; + long __per_cpu_offset[NR_CPUS]; + long *__rq_idx; + long *__cpu_idx; + ulong *cpu_flags; +#define POSSIBLE (0x1) +#define PRESENT (0x2) +#define ONLINE (0x4) +#define NMI (0x8) +#define POSSIBLE_MAP (POSSIBLE) +#define PRESENT_MAP (PRESENT) +#define ONLINE_MAP (ONLINE) +#define ACTIVE_MAP (0x10) + int BUG_bytes; + ulong xen_flags; +#define WRITABLE_PAGE_TABLES (0x1) +#define SHADOW_PAGE_TABLES (0x2) +#define CANONICAL_PAGE_TABLES (0x4) +#define XEN_SUSPEND (0x8) + char *m2p_page; + ulong phys_to_machine_mapping; + ulong p2m_table_size; +#define P2M_MAPPING_CACHE (512) + struct p2m_mapping_cache { + ulong mapping; + ulong pfn; + ulong start; + ulong end; + } p2m_mapping_cache[P2M_MAPPING_CACHE]; +#define P2M_MAPPING_PAGE_PFN(c) \ + (PVOPS_XEN() ? kt->p2m_mapping_cache[c].pfn : \ + (((kt->p2m_mapping_cache[c].mapping - kt->phys_to_machine_mapping)/PAGESIZE()) \ + * XEN_PFNS_PER_PAGE)) + ulong last_mapping_read; + ulong p2m_cache_index; + ulong p2m_pages_searched; + ulong p2m_mfn_cache_hits; + ulong p2m_page_cache_hits; + ulong relocate; + char *module_tree; + struct pvops_xen_info { + int p2m_top_entries; + ulong p2m_top; + ulong p2m_mid_missing; + ulong p2m_missing; + } pvops_xen; + int highest_irq; +#define IKCONFIG_AVAIL 0x1 /* kernel contains ikconfig data */ +#define IKCONFIG_LOADED 0x2 /* ikconfig data is currently loaded */ + int ikconfig_flags; + int ikconfig_ents; + char *hypervisor; + struct vmcoreinfo_data { + ulong log_buf_SYMBOL; + ulong log_end_SYMBOL; + ulong log_buf_len_SYMBOL; + ulong logged_chars_SYMBOL; + ulong log_first_idx_SYMBOL; + ulong log_next_idx_SYMBOL; + long log_SIZE; + long log_ts_nsec_OFFSET; + long log_len_OFFSET; + long log_text_len_OFFSET; + long log_dict_len_OFFSET; + ulong phys_base_SYMBOL; + ulong _stext_SYMBOL; + } vmcoreinfo; + ulonglong flags2; + char *source_tree; +}; + +/* + * Aid for the two versions of the kernel's module list linkage. + */ +#define NEXT_MODULE(next_module, modbuf) \ +{ \ + switch (kt->flags & (KMOD_V1|KMOD_V2)) \ + { \ + case KMOD_V1: \ + next_module = ULONG(modbuf + OFFSET(module_next)); \ + break; \ + case KMOD_V2: \ + next_module = ULONG(modbuf + OFFSET(module_list)); \ + if (next_module != kt->kernel_module) \ + next_module -= OFFSET(module_list); \ + break; \ + } \ +} + +#define THIS_KERNEL_VERSION ((kt->kernel_version[0] << 16) + \ + (kt->kernel_version[1] << 8) + \ + (kt->kernel_version[2])) +#define LINUX(x,y,z) (((uint)(x) << 16) + ((uint)(y) << 8) + (uint)(z)) + +#define THIS_GCC_VERSION ((kt->gcc_version[0] << 16) + \ + (kt->gcc_version[1] << 8) + \ + (kt->gcc_version[2])) +#define GCC(x,y,z) (((uint)(x) << 16) + ((uint)(y) << 8) + (uint)(z)) + +#define IS_KERNEL_STATIC_TEXT(x) (((ulong)(x) >= kt->stext) && \ + ((ulong)(x) < kt->etext)) + +#define TASK_COMM_LEN 16 /* task command name length including NULL */ + +struct task_context { /* context stored for each task */ + ulong task; + ulong thread_info; + ulong pid; + char comm[TASK_COMM_LEN+1]; + int processor; + ulong ptask; + ulong mm_struct; + struct task_context *tc_next; +}; + +struct tgid_context { /* tgid and task stored for each task */ + ulong tgid; + ulong task; +}; + +struct task_table { /* kernel/local task table data */ + struct task_context *current; + struct task_context *context_array; + void (*refresh_task_table)(void); + ulong flags; + ulong task_start; + ulong task_end; + void *task_local; + int max_tasks; + int nr_threads; + ulong running_tasks; + ulong retries; + ulong panicmsg; + int panic_processor; + ulong *idle_threads; + ulong *panic_threads; + ulong *active_set; + ulong *panic_ksp; + ulong *hardirq_ctx; + ulong *hardirq_tasks; + ulong *softirq_ctx; + ulong *softirq_tasks; + ulong panic_task; + ulong this_task; + int pidhash_len; + ulong pidhash_addr; + ulong last_task_read; + ulong last_thread_info_read; + ulong last_mm_read; + char *task_struct; + char *thread_info; + char *mm_struct; + ulong init_pid_ns; + struct tgid_context *tgid_array; + struct tgid_context *last_tgid; + ulong tgid_searches; + ulong tgid_cache_hits; + long filepages; + long anonpages; + ulong stack_end_magic; + ulong pf_kthread; +}; + +#define TASK_INIT_DONE (0x1) +#define TASK_ARRAY_EXISTS (0x2) +#define PANIC_TASK_NOT_FOUND (0x4) +#define TASK_REFRESH (0x8) +#define TASK_REFRESH_OFF (0x10) +#define PANIC_KSP (0x20) +#define ACTIVE_SET (0x40) +#define POPULATE_PANIC (0x80) +#define PIDHASH (0x100) +#define PID_HASH (0x200) +#define THREAD_INFO (0x400) +#define IRQSTACKS (0x800) +#define TIMESPEC (0x1000) +#define NO_TIMESPEC (0x2000) +#define ACTIVE_ONLY (0x4000) +#define START_TIME_NSECS (0x8000) +#define THREAD_INFO_IN_TASK (0x10000) + +#define TASK_SLUSH (20) + +#define NO_PROC_ID 0xFF /* No processor magic marker (from kernel) */ + +/* + * Global "tt" points to task_table + */ +#define CURRENT_CONTEXT() (tt->current) +#define CURRENT_TASK() (tt->current->task) +#define CURRENT_PID() (tt->current->pid) +#define CURRENT_COMM() (tt->current->comm) +#define RUNNING_TASKS() (tt->running_tasks) +#define FIRST_CONTEXT() (tt->context_array) + +#define NO_PID ((ulong)-1) +#define NO_TASK (0) + +#define IS_TASK_ADDR(X) (machdep->is_task_addr(X)) +#define GET_STACKBASE(X) (machdep->get_stackbase(X)) +#define GET_STACKTOP(X) (machdep->get_stacktop(X)) +#define STACKSIZE() (machdep->stacksize) +#define LONGS_PER_STACK (machdep->stacksize/sizeof(ulong)) + +#define INSTACK(X,BT) \ + (((ulong)(X) >= (BT)->stackbase) && ((ulong)(X) < (BT)->stacktop)) + +#define ALIGNED_STACK_OFFSET(task) ((ulong)(task) & (STACKSIZE()-1)) + +#define BITS() (machdep->bits) +#define BITS32() (machdep->bits == 32) +#define BITS64() (machdep->bits == 64) +#define IS_KVADDR(X) (machdep->is_kvaddr(X)) +#define IS_UVADDR(X,C) (machdep->is_uvaddr(X,C)) + +#define PID_ALIVE(x) (kill(x, 0) == 0) + +struct kernel_list_head { + struct kernel_list_head *next, *prev; +}; + +struct stack_hook { + ulong esp; + ulong eip; +}; + +struct bt_info { + ulong task; + ulonglong flags; + ulong instptr; + ulong stkptr; + ulong bptr; + ulong stackbase; + ulong stacktop; + char *stackbuf; + struct task_context *tc; + struct stack_hook *hp; + struct stack_hook *textlist; + struct reference *ref; + ulong frameptr; + char *call_target; + void *machdep; + ulong debug; + ulong eframe_ip; + ulong radix; + ulong *cpumask; +}; + +#define STACK_OFFSET_TYPE(OFF) \ + (((ulong)(OFF) > STACKSIZE()) ? \ + (ulong)((ulong)(OFF) - (ulong)(bt->stackbase)) : (ulong)(OFF)) + +#define GET_STACK_ULONG(OFF) \ + *((ulong *)((char *)(&bt->stackbuf[(ulong)(STACK_OFFSET_TYPE(OFF))]))) + +#define GET_STACK_DATA(OFF, LOC, SZ) memcpy((void *)(LOC), \ + (void *)(&bt->stackbuf[(ulong)STACK_OFFSET_TYPE(OFF)]), (size_t)(SZ)) + +struct machine_specific; /* uniquely defined below each machine's area */ +struct xendump_data; +struct xen_kdump_data; + +struct vaddr_range { + ulong start; + ulong end; + ulong type; +#define KVADDR_UNITY_MAP (1) +#define KVADDR_VMALLOC (2) +#define KVADDR_VMEMMAP (3) +#define KVADDR_START_MAP (4) +#define KVADDR_MODULES (5) +#define MAX_KVADDR_RANGES KVADDR_MODULES +}; + +#define MAX_MACHDEP_ARGS 5 /* for --machdep/-m machine-specific args */ + +struct machdep_table { + ulong flags; + ulong kvbase; + ulong identity_map_base; + uint pagesize; + uint pageshift; + ulonglong pagemask; + ulong pageoffset; + ulong stacksize; + uint hz; + ulong mhz; + int bits; + int nr_irqs; + uint64_t memsize; + int (*eframe_search)(struct bt_info *); + void (*back_trace)(struct bt_info *); + ulong (*processor_speed)(void); + int (*uvtop)(struct task_context *, ulong, physaddr_t *, int); + int (*kvtop)(struct task_context *, ulong, physaddr_t *, int); + ulong (*get_task_pgd)(ulong); + void (*dump_irq)(int); + void (*get_stack_frame)(struct bt_info *, ulong *, ulong *); + ulong (*get_stackbase)(ulong); + ulong (*get_stacktop)(ulong); + int (*translate_pte)(ulong, void *, ulonglong); + uint64_t (*memory_size)(void); + ulong (*vmalloc_start)(void); + int (*is_task_addr)(ulong); + int (*verify_symbol)(const char *, ulong, char); + int (*dis_filter)(ulong, char *, unsigned int); + int (*get_smp_cpus)(void); + int (*is_kvaddr)(ulong); + int (*is_uvaddr)(ulong, struct task_context *); + int (*verify_paddr)(uint64_t); + void (*cmd_mach)(void); + void (*init_kernel_pgd)(void); + struct syment *(*value_to_symbol)(ulong, ulong *); + struct line_number_hook { + char *func; + char **file; + } *line_number_hooks; + ulong last_pgd_read; + ulong last_pud_read; + ulong last_pmd_read; + ulong last_ptbl_read; + char *pgd; + char *pud; + char *pmd; + char *ptbl; + int ptrs_per_pgd; + char *cmdline_args[MAX_MACHDEP_ARGS]; + struct machine_specific *machspec; + ulong section_size_bits; + ulong max_physmem_bits; + ulong sections_per_root; + int (*xendump_p2m_create)(struct xendump_data *); + ulong (*xendump_panic_task)(struct xendump_data *); + void (*get_xendump_regs)(struct xendump_data *, struct bt_info *, ulong *, ulong *); + void (*clear_machdep_cache)(void); + int (*xen_kdump_p2m_create)(struct xen_kdump_data *); + int (*in_alternate_stack)(int, ulong); + void (*dumpfile_init)(int, void *); + void (*process_elf_notes)(void *, unsigned long); + int (*get_kvaddr_ranges)(struct vaddr_range *); + int (*verify_line_number)(ulong, ulong, ulong); + void (*get_irq_affinity)(int); + void (*show_interrupts)(int, ulong *); +}; + +/* + * Processor-common flags; processor-specific flags use the lower bits + * as defined in their processor-specific files below. (see KSYMS_START defs). + */ +#define HWRESET (0x80000000) +#define OMIT_FRAME_PTR (0x40000000) +#define FRAMESIZE_DEBUG (0x20000000) +#define MACHDEP_BT_TEXT (0x10000000) +#define DEVMEMRD (0x8000000) +#define INIT (0x4000000) +#define VM_4_LEVEL (0x2000000) +#define MCA (0x1000000) +#define PAE (0x800000) +#define VMEMMAP (0x400000) + +extern struct machdep_table *machdep; + +#ifndef HZ +#define HZ sysconf(_SC_CLK_TCK) +#endif + +#define IS_LAST_PGD_READ(pgd) ((ulong)(pgd) == machdep->last_pgd_read) +#define IS_LAST_PMD_READ(pmd) ((ulong)(pmd) == machdep->last_pmd_read) +#define IS_LAST_PTBL_READ(ptbl) ((ulong)(ptbl) == machdep->last_ptbl_read) +#define IS_LAST_PUD_READ(pud) ((ulong)(pud) == machdep->last_pud_read) + +#define FILL_PGD(PGD, TYPE, SIZE) \ + if (!IS_LAST_PGD_READ(PGD)) { \ + readmem((ulonglong)((ulong)(PGD)), TYPE, machdep->pgd, \ + SIZE, "pgd page", FAULT_ON_ERROR); \ + machdep->last_pgd_read = (ulong)(PGD); \ + } + +#define FILL_PUD(PUD, TYPE, SIZE) \ + if (!IS_LAST_PUD_READ(PUD)) { \ + readmem((ulonglong)((ulong)(PUD)), TYPE, machdep->pud, \ + SIZE, "pud page", FAULT_ON_ERROR); \ + machdep->last_pud_read = (ulong)(PUD); \ + } + +#define FILL_PMD(PMD, TYPE, SIZE) \ + if (!IS_LAST_PMD_READ(PMD)) { \ + readmem((ulonglong)(PMD), TYPE, machdep->pmd, \ + SIZE, "pmd page", FAULT_ON_ERROR); \ + machdep->last_pmd_read = (ulong)(PMD); \ + } + +#define FILL_PTBL(PTBL, TYPE, SIZE) \ + if (!IS_LAST_PTBL_READ(PTBL)) { \ + readmem((ulonglong)(PTBL), TYPE, machdep->ptbl, \ + SIZE, "page table", FAULT_ON_ERROR); \ + machdep->last_ptbl_read = (ulong)(PTBL); \ + } + +#define SETUP_ENV (0) +#define PRE_SYMTAB (1) +#define PRE_GDB (2) +#define POST_GDB (3) +#define POST_INIT (4) +#define POST_VM (5) +#define LOG_ONLY (6) +#define POST_RELOC (7) + +#define FOREACH_BT (1) +#define FOREACH_VM (2) +#define FOREACH_TASK (3) +#define FOREACH_SET (4) +#define FOREACH_FILES (5) +#define FOREACH_NET (6) +#define FOREACH_TEST (7) +#define FOREACH_VTOP (8) +#define FOREACH_SIG (9) +#define FOREACH_PS (10) + +#define MAX_FOREACH_KEYWORDS (10) +#define MAX_FOREACH_TASKS (50) +#define MAX_FOREACH_PIDS (50) +#define MAX_FOREACH_COMMS (50) +#define MAX_FOREACH_ARGS (50) +#define MAX_REGEX_ARGS (10) + +#define FOREACH_CMD (0x1) +#define FOREACH_r_FLAG (0x2) +#define FOREACH_s_FLAG (0x4) +#define FOREACH_S_FLAG (0x8) +#define FOREACH_i_FLAG (0x10) +#define FOREACH_e_FLAG (0x20) +#define FOREACH_g_FLAG (0x40) +#define FOREACH_l_FLAG (0x80) +#define FOREACH_p_FLAG (0x100) +#define FOREACH_t_FLAG (0x200) +#define FOREACH_u_FLAG (0x400) +#define FOREACH_m_FLAG (0x800) +#define FOREACH_v_FLAG (0x1000) +#define FOREACH_KERNEL (0x2000) +#define FOREACH_USER (0x4000) +#define FOREACH_SPECIFIED (0x8000) +#define FOREACH_ACTIVE (0x10000) +#define FOREACH_k_FLAG (0x20000) +#define FOREACH_c_FLAG (0x40000) +#define FOREACH_f_FLAG (0x80000) +#define FOREACH_o_FLAG (0x100000) +#define FOREACH_T_FLAG (0x200000) +#define FOREACH_F_FLAG (0x400000) +#define FOREACH_x_FLAG (0x800000) +#define FOREACH_d_FLAG (0x1000000) +#define FOREACH_STATE (0x2000000) +#define FOREACH_a_FLAG (0x4000000) +#define FOREACH_G_FLAG (0x8000000) +#define FOREACH_F_FLAG2 (0x10000000) + +#define FOREACH_PS_EXCLUSIVE \ + (FOREACH_g_FLAG|FOREACH_a_FLAG|FOREACH_t_FLAG|FOREACH_c_FLAG|FOREACH_p_FLAG|FOREACH_l_FLAG|FOREACH_r_FLAG|FOREACH_m_FLAG) + +struct foreach_data { + ulong flags; + int keyword_array[MAX_FOREACH_KEYWORDS]; + ulong task_array[MAX_FOREACH_TASKS]; + char *comm_array[MAX_FOREACH_COMMS]; + ulong pid_array[MAX_FOREACH_PIDS]; + ulong arg_array[MAX_FOREACH_ARGS]; + struct regex_info { + char *pattern; + regex_t regex; + } regex_info[MAX_REGEX_ARGS]; + ulong state; + char *reference; + int keys; + int pids; + int tasks; + int comms; + int args; + int regexs; +}; + +struct reference { + char *str; + ulong cmdflags; + ulong hexval; + ulong decval; + ulong ref1; + ulong ref2; + void *refp; +}; + +struct offset_table { /* stash of commonly-used offsets */ + long list_head_next; /* add new entries to end of table */ + long list_head_prev; + long task_struct_pid; + long task_struct_state; + long task_struct_comm; + long task_struct_mm; + long task_struct_tss; + long task_struct_thread; + long task_struct_active_mm; + long task_struct_tss_eip; + long task_struct_tss_esp; + long task_struct_tss_ksp; + long task_struct_processor; + long task_struct_p_pptr; + long task_struct_parent; + long task_struct_has_cpu; + long task_struct_cpus_runnable; + long task_struct_thread_eip; + long task_struct_thread_esp; + long task_struct_thread_ksp; + long task_struct_next_task; + long task_struct_files; + long task_struct_fs; + long task_struct_pidhash_next; + long task_struct_next_run; + long task_struct_flags; + long task_struct_sig; + long task_struct_signal; + long task_struct_blocked; + long task_struct_sigpending; + long task_struct_pending; + long task_struct_sigqueue; + long task_struct_sighand; + long task_struct_start_time; + long task_struct_times; + long task_struct_utime; + long task_struct_stime; + long task_struct_cpu; + long task_struct_run_list; + long task_struct_pgrp; + long task_struct_tgid; + long task_struct_namespace; + long task_struct_pids; + long task_struct_last_run; + long task_struct_timestamp; + long task_struct_thread_info; + long task_struct_nsproxy; + long task_struct_rlim; + long thread_info_task; + long thread_info_cpu; + long thread_info_previous_esp; + long thread_info_flags; + long nsproxy_mnt_ns; + long mnt_namespace_root; + long mnt_namespace_list; + long pid_link_pid; + long pid_hash_chain; + long hlist_node_next; + long hlist_node_pprev; + long pid_pid_chain; + long thread_struct_eip; + long thread_struct_esp; + long thread_struct_ksp; + long thread_struct_fph; + long thread_struct_rip; + long thread_struct_rsp; + long thread_struct_rsp0; + long tms_tms_utime; + long tms_tms_stime; + long signal_struct_count; + long signal_struct_action; + long signal_struct_shared_pending; + long signal_struct_rlim; + long k_sigaction_sa; + long sigaction_sa_handler; + long sigaction_sa_flags; + long sigaction_sa_mask; + long sigpending_head; + long sigpending_list; + long sigpending_signal; + long signal_queue_next; + long signal_queue_info; + long sigqueue_next; + long sigqueue_list; + long sigqueue_info; + long sighand_struct_action; + long siginfo_si_signo; + long thread_struct_cr3; + long thread_struct_ptbr; + long thread_struct_pg_tables; + long switch_stack_r26; + long switch_stack_b0; + long switch_stack_ar_bspstore; + long switch_stack_ar_pfs; + long switch_stack_ar_rnat; + long switch_stack_pr; + long cpuinfo_ia64_proc_freq; + long cpuinfo_ia64_unimpl_va_mask; + long cpuinfo_ia64_unimpl_pa_mask; + long device_node_type; + long device_node_allnext; + long device_node_properties; + long property_name; + long property_value; + long property_next; + long machdep_calls_setup_residual; + long RESIDUAL_VitalProductData; + long VPD_ProcessorHz; + long bd_info_bi_intfreq; + long hwrpb_struct_cycle_freq; + long hwrpb_struct_processor_offset; + long hwrpb_struct_processor_size; + long percpu_struct_halt_PC; + long percpu_struct_halt_ra; + long percpu_struct_halt_pv; + long mm_struct_mmap; + long mm_struct_pgd; + long mm_struct_rss; + long mm_struct_anon_rss; + long mm_struct_file_rss; + long mm_struct_total_vm; + long mm_struct_start_code; + long mm_struct_arg_start; + long mm_struct_arg_end; + long mm_struct_env_start; + long mm_struct_env_end; + long vm_area_struct_vm_mm; + long vm_area_struct_vm_next; + long vm_area_struct_vm_end; + long vm_area_struct_vm_start; + long vm_area_struct_vm_flags; + long vm_area_struct_vm_file; + long vm_area_struct_vm_offset; + long vm_area_struct_vm_pgoff; + long vm_struct_addr; + long vm_struct_size; + long vm_struct_next; + long module_size_of_struct; + long module_next; + long module_size; + long module_name; + long module_nsyms; + long module_syms; + long module_flags; + long module_num_syms; + long module_list; + long module_gpl_syms; + long module_num_gpl_syms; + long module_module_core; + long module_core_size; + long module_core_text_size; + long module_num_symtab; + long module_symtab; + long module_strtab; + + long module_kallsyms_start; + long kallsyms_header_sections; + long kallsyms_header_section_off; + long kallsyms_header_symbols; + long kallsyms_header_symbol_off; + long kallsyms_header_string_off; + long kallsyms_symbol_section_off; + long kallsyms_symbol_symbol_addr; + long kallsyms_symbol_name_off; + long kallsyms_section_start; + long kallsyms_section_size; + long kallsyms_section_name_off; + + long page_next; + long page_prev; + long page_next_hash; + long page_list; + long page_list_next; + long page_list_prev; + long page_inode; + long page_offset; + long page_count; + long page_flags; + long page_mapping; + long page_index; + long page_buffers; + long page_lru; + long page_pte; + long swap_info_struct_swap_file; + long swap_info_struct_swap_vfsmnt; + long swap_info_struct_flags; + long swap_info_struct_swap_map; + long swap_info_struct_swap_device; + long swap_info_struct_prio; + long swap_info_struct_max; + long swap_info_struct_pages; + long swap_info_struct_old_block_size; + long block_device_bd_inode; + long block_device_bd_list; + long block_device_bd_disk; + long irq_desc_t_status; + long irq_desc_t_handler; + long irq_desc_t_chip; + long irq_desc_t_action; + long irq_desc_t_depth; + long irqdesc_action; + long irqdesc_ctl; + long irqdesc_level; + long irqaction_handler; + long irqaction_flags; + long irqaction_mask; + long irqaction_name; + long irqaction_dev_id; + long irqaction_next; + long hw_interrupt_type_typename; + long hw_interrupt_type_startup; + long hw_interrupt_type_shutdown; + long hw_interrupt_type_handle; + long hw_interrupt_type_enable; + long hw_interrupt_type_disable; + long hw_interrupt_type_ack; + long hw_interrupt_type_end; + long hw_interrupt_type_set_affinity; + long irq_chip_typename; + long irq_chip_startup; + long irq_chip_shutdown; + long irq_chip_enable; + long irq_chip_disable; + long irq_chip_ack; + long irq_chip_end; + long irq_chip_set_affinity; + long irq_chip_mask; + long irq_chip_mask_ack; + long irq_chip_unmask; + long irq_chip_eoi; + long irq_chip_retrigger; + long irq_chip_set_type; + long irq_chip_set_wake; + long irq_cpustat_t___softirq_active; + long irq_cpustat_t___softirq_mask; + long fdtable_max_fds; + long fdtable_max_fdset; + long fdtable_open_fds; + long fdtable_fd; + long files_struct_fdt; + long files_struct_max_fds; + long files_struct_max_fdset; + long files_struct_open_fds; + long files_struct_fd; + long files_struct_open_fds_init; + long file_f_dentry; + long file_f_vfsmnt; + long file_f_count; + long file_f_path; + long path_mnt; + long path_dentry; + long fs_struct_root; + long fs_struct_pwd; + long fs_struct_rootmnt; + long fs_struct_pwdmnt; + long dentry_d_inode; + long dentry_d_parent; + long dentry_d_name; + long dentry_d_covers; + long dentry_d_iname; + long qstr_len; + long qstr_name; + long inode_i_mode; + long inode_i_op; + long inode_i_sb; + long inode_u; + long inode_i_flock; + long inode_i_fop; + long inode_i_mapping; + long address_space_nrpages; + long vfsmount_mnt_next; + long vfsmount_mnt_devname; + long vfsmount_mnt_dirname; + long vfsmount_mnt_sb; + long vfsmount_mnt_list; + long vfsmount_mnt_mountpoint; + long vfsmount_mnt_parent; + long namespace_root; + long namespace_list; + long super_block_s_dirty; + long super_block_s_type; + long super_block_s_files; + long file_system_type_name; + long nlm_file_f_file; + long file_lock_fl_owner; + long nlm_host_h_exportent; + long svc_client_cl_ident; + long kmem_cache_s_c_nextp; + long kmem_cache_s_c_name; + long kmem_cache_s_c_num; + long kmem_cache_s_c_org_size; + long kmem_cache_s_c_flags; + long kmem_cache_s_c_offset; + long kmem_cache_s_c_firstp; + long kmem_cache_s_c_gfporder; + long kmem_cache_s_c_magic; + long kmem_cache_s_num; + long kmem_cache_s_next; + long kmem_cache_s_name; + long kmem_cache_s_objsize; + long kmem_cache_s_flags; + long kmem_cache_s_gfporder; + long kmem_cache_s_slabs; + long kmem_cache_s_slabs_full; + long kmem_cache_s_slabs_partial; + long kmem_cache_s_slabs_free; + long kmem_cache_s_cpudata; + long kmem_cache_s_c_align; + long kmem_cache_s_colour_off; + long cpucache_s_avail; + long cpucache_s_limit; + long kmem_cache_s_array; + long array_cache_avail; + long array_cache_limit; + long kmem_cache_s_lists; + long kmem_list3_slabs_partial; + long kmem_list3_slabs_full; + long kmem_list3_slabs_free; + long kmem_list3_free_objects; + long kmem_list3_shared; + long kmem_slab_s_s_nextp; + long kmem_slab_s_s_freep; + long kmem_slab_s_s_inuse; + long kmem_slab_s_s_mem; + long kmem_slab_s_s_index; + long kmem_slab_s_s_offset; + long kmem_slab_s_s_magic; + long slab_s_list; + long slab_s_s_mem; + long slab_s_inuse; + long slab_s_free; + long slab_list; + long slab_s_mem; + long slab_inuse; + long slab_free; + long net_device_next; + long net_device_name; + long net_device_type; + long net_device_addr_len; + long net_device_ip_ptr; + long net_device_dev_list; + long net_dev_base_head; + long device_next; + long device_name; + long device_type; + long device_ip_ptr; + long device_addr_len; + long socket_sk; + long sock_daddr; + long sock_rcv_saddr; + long sock_dport; + long sock_sport; + long sock_num; + long sock_type; + long sock_family; + long sock_common_skc_family; + long sock_sk_type; + long inet_sock_inet; + long inet_opt_daddr; + long inet_opt_rcv_saddr; + long inet_opt_dport; + long inet_opt_sport; + long inet_opt_num; + long ipv6_pinfo_rcv_saddr; + long ipv6_pinfo_daddr; + long timer_list_list; + long timer_list_next; + long timer_list_entry; + long timer_list_expires; + long timer_list_function; + long timer_vec_root_vec; + long timer_vec_vec; + long tvec_root_s_vec; + long tvec_s_vec; + long tvec_t_base_s_tv1; + long wait_queue_task; + long wait_queue_next; + long __wait_queue_task; + long __wait_queue_head_task_list; + long __wait_queue_task_list; + long pglist_data_node_zones; + long pglist_data_node_mem_map; + long pglist_data_node_start_paddr; + long pglist_data_node_start_mapnr; + long pglist_data_node_size; + long pglist_data_node_id; + long pglist_data_node_next; + long pglist_data_nr_zones; + long pglist_data_node_start_pfn; + long pglist_data_pgdat_next; + long pglist_data_node_present_pages; + long pglist_data_node_spanned_pages; + long pglist_data_bdata; + long page_cache_bucket_chain; + long zone_struct_free_pages; + long zone_struct_free_area; + long zone_struct_zone_pgdat; + long zone_struct_name; + long zone_struct_size; + long zone_struct_memsize; + long zone_struct_zone_start_pfn; + long zone_struct_zone_start_paddr; + long zone_struct_zone_start_mapnr; + long zone_struct_zone_mem_map; + long zone_struct_inactive_clean_pages; + long zone_struct_inactive_clean_list; + long zone_struct_inactive_dirty_pages; + long zone_struct_active_pages; + long zone_struct_pages_min; + long zone_struct_pages_low; + long zone_struct_pages_high; + long zone_free_pages; + long zone_free_area; + long zone_zone_pgdat; + long zone_zone_mem_map; + long zone_name; + long zone_spanned_pages; + long zone_zone_start_pfn; + long zone_pages_min; + long zone_pages_low; + long zone_pages_high; + long zone_vm_stat; + long neighbour_next; + long neighbour_primary_key; + long neighbour_ha; + long neighbour_dev; + long neighbour_nud_state; + long neigh_table_hash_buckets; + long neigh_table_key_len; + long in_device_ifa_list; + long in_ifaddr_ifa_next; + long in_ifaddr_ifa_address; + long pci_dev_global_list; + long pci_dev_next; + long pci_dev_bus; + long pci_dev_devfn; + long pci_dev_class; + long pci_dev_device; + long pci_dev_vendor; + long pci_bus_number; + long resource_entry_t_from; + long resource_entry_t_num; + long resource_entry_t_name; + long resource_entry_t_next; + long resource_name; + long resource_start; + long resource_end; + long resource_sibling; + long resource_child; + long runqueue_curr; + long runqueue_idle; + long runqueue_active; + long runqueue_expired; + long runqueue_arrays; + long runqueue_cpu; + long cpu_s_idle; + long cpu_s_curr; + long prio_array_nr_active; + long prio_array_queue; + long user_regs_struct_ebp; + long user_regs_struct_esp; + long user_regs_struct_rip; + long user_regs_struct_cs; + long user_regs_struct_eflags; + long user_regs_struct_rsp; + long user_regs_struct_ss; + long e820map_nr_map; + long e820entry_addr; + long e820entry_size; + long e820entry_type; + long char_device_struct_next; + long char_device_struct_name; + long char_device_struct_fops; + long char_device_struct_major; + long gendisk_major; + long gendisk_disk_name; + long gendisk_fops; + long blk_major_name_next; + long blk_major_name_major; + long blk_major_name_name; + long radix_tree_root_height; + long radix_tree_root_rnode; + long x8664_pda_pcurrent; + long x8664_pda_data_offset; + long x8664_pda_kernelstack; + long x8664_pda_irqrsp; + long x8664_pda_irqstackptr; + long x8664_pda_level4_pgt; + long x8664_pda_cpunumber; + long x8664_pda_me; + long tss_struct_ist; + long mem_section_section_mem_map; + long vcpu_guest_context_user_regs; + long cpu_user_regs_eip; + long cpu_user_regs_esp; + long cpu_user_regs_rip; + long cpu_user_regs_rsp; + long unwind_table_core; + long unwind_table_init; + long unwind_table_address; + long unwind_table_size; + long unwind_table_link; + long unwind_table_name; + long rq_cfs; + long rq_rt; + long rq_nr_running; + long cfs_rq_rb_leftmost; + long cfs_rq_nr_running; + long cfs_rq_tasks_timeline; + long task_struct_se; + long sched_entity_run_node; + long rt_rq_active; + long kmem_cache_size; + long kmem_cache_objsize; + long kmem_cache_offset; + long kmem_cache_order; + long kmem_cache_local_node; + long kmem_cache_objects; + long kmem_cache_inuse; + long kmem_cache_align; + long kmem_cache_name; + long kmem_cache_list; + long kmem_cache_node; + long kmem_cache_cpu_slab; + long page_inuse; +/* long page_offset; use "old" page->offset */ + long page_slab; + long page_first_page; + long page_freelist; + long kmem_cache_node_nr_partial; + long kmem_cache_node_nr_slabs; + long kmem_cache_node_partial; + long kmem_cache_node_full; + long pid_numbers; + long upid_nr; + long upid_ns; + long upid_pid_chain; + long pid_tasks; + long kmem_cache_cpu_freelist; + long kmem_cache_cpu_page; + long kmem_cache_cpu_node; + long kmem_cache_flags; + long zone_nr_active; + long zone_nr_inactive; + long zone_all_unreclaimable; + long zone_present_pages; + long zone_flags; + long zone_pages_scanned; + long pcpu_info_vcpu; + long pcpu_info_idle; + long vcpu_struct_rq; + long task_struct_sched_info; + long sched_info_last_arrival; + long page_objects; + long kmem_cache_oo; + long char_device_struct_cdev; + long char_device_struct_baseminor; + long cdev_ops; + long probe_next; + long probe_dev; + long probe_data; + long kobj_map_probes; + long task_struct_prio; + long zone_watermark; + long module_sect_attrs; + long module_sect_attrs_attrs; + long module_sect_attrs_nsections; + long module_sect_attr_mattr; + long module_sect_attr_name; + long module_sect_attr_address; + long module_attribute_attr; + long attribute_owner; + long module_sect_attr_attr; + long module_sections_attrs; + long swap_info_struct_inuse_pages; + long s390_lowcore_psw_save_area; + long mm_struct_rss_stat; + long mm_rss_stat_count; + long module_module_init; + long module_init_text_size; + long cpu_context_save_fp; + long cpu_context_save_sp; + long cpu_context_save_pc; + long elf_prstatus_pr_pid; + long elf_prstatus_pr_reg; + long irq_desc_t_name; + long thread_info_cpu_context; + long unwind_table_list; + long unwind_table_start; + long unwind_table_stop; + long unwind_table_begin_addr; + long unwind_table_end_addr; + long unwind_idx_addr; + long unwind_idx_insn; + long signal_struct_nr_threads; + long module_init_size; + long module_percpu; + long radix_tree_node_slots; + long s390_stack_frame_back_chain; + long s390_stack_frame_r14; + long user_regs_struct_eip; + long user_regs_struct_rax; + long user_regs_struct_eax; + long user_regs_struct_rbx; + long user_regs_struct_ebx; + long user_regs_struct_rcx; + long user_regs_struct_ecx; + long user_regs_struct_rdx; + long user_regs_struct_edx; + long user_regs_struct_rsi; + long user_regs_struct_esi; + long user_regs_struct_rdi; + long user_regs_struct_edi; + long user_regs_struct_ds; + long user_regs_struct_es; + long user_regs_struct_fs; + long user_regs_struct_gs; + long user_regs_struct_rbp; + long user_regs_struct_r8; + long user_regs_struct_r9; + long user_regs_struct_r10; + long user_regs_struct_r11; + long user_regs_struct_r12; + long user_regs_struct_r13; + long user_regs_struct_r14; + long user_regs_struct_r15; + long sched_entity_cfs_rq; + long sched_entity_my_q; + long sched_entity_on_rq; + long task_struct_on_rq; + long cfs_rq_curr; + long irq_desc_t_irq_data; + long irq_desc_t_kstat_irqs; + long irq_desc_t_affinity; + long irq_data_chip; + long irq_data_affinity; + long kernel_stat_irqs; + long socket_alloc_vfs_inode; + long class_devices; + long class_p; + long class_private_devices; + long device_knode_class; + long device_node; + long gendisk_dev; + long gendisk_kobj; + long gendisk_part0; + long gendisk_queue; + long hd_struct_dev; + long klist_k_list; + long klist_node_n_klist; + long klist_node_n_node; + long kobject_entry; + long kset_list; + long request_list_count; + long request_queue_in_flight; + long request_queue_rq; + long subsys_private_klist_devices; + long subsystem_kset; + long mount_mnt_parent; + long mount_mnt_mountpoint; + long mount_mnt_list; + long mount_mnt_devname; + long mount_mnt; + long task_struct_exit_state; + long timekeeper_xtime; + long file_f_op; + long file_private_data; + long hstate_order; + long hugetlbfs_sb_info_hstate; + long idr_layer_ary; + long idr_layer_layer; + long idr_layers; + long idr_top; + long ipc_id_ary_p; + long ipc_ids_entries; + long ipc_ids_max_id; + long ipc_ids_ipcs_idr; + long ipc_ids_in_use; + long ipc_namespace_ids; + long kern_ipc_perm_deleted; + long kern_ipc_perm_key; + long kern_ipc_perm_mode; + long kern_ipc_perm_uid; + long kern_ipc_perm_id; + long kern_ipc_perm_seq; + long nsproxy_ipc_ns; + long shmem_inode_info_swapped; + long shmem_inode_info_vfs_inode; + long shm_file_data_file; + long shmid_kernel_shm_file; + long shmid_kernel_shm_nattch; + long shmid_kernel_shm_perm; + long shmid_kernel_shm_segsz; + long shmid_kernel_id; + long sem_array_sem_perm; + long sem_array_sem_id; + long sem_array_sem_nsems; + long msg_queue_q_perm; + long msg_queue_q_id; + long msg_queue_q_cbytes; + long msg_queue_q_qnum; + long super_block_s_fs_info; + long rq_timestamp; + long radix_tree_node_height; + long rb_root_rb_node; + long rb_node_rb_left; + long rb_node_rb_right; + long rt_prio_array_queue; + long task_struct_rt; + long sched_rt_entity_run_list; + long log_ts_nsec; + long log_len; + long log_text_len; + long log_dict_len; + long log_level; + long log_flags_level; + long timekeeper_xtime_sec; + long neigh_table_hash_mask; + long sched_rt_entity_my_q; + long neigh_table_hash_shift; + long neigh_table_nht_ptr; + long task_group_parent; + long task_group_css; + long cgroup_subsys_state_cgroup; + long cgroup_dentry; + long task_group_rt_rq; + long rt_rq_tg; + long task_group_cfs_rq; + long cfs_rq_tg; + long task_group_siblings; + long task_group_children; + long task_group_cfs_bandwidth; + long cfs_rq_throttled; + long task_group_rt_bandwidth; + long rt_rq_rt_throttled; + long rt_rq_highest_prio; + long rt_rq_rt_nr_running; + long vmap_area_va_start; + long vmap_area_va_end; + long vmap_area_list; + long vmap_area_flags; + long vmap_area_vm; + long hrtimer_cpu_base_clock_base; + long hrtimer_clock_base_offset; + long hrtimer_clock_base_active; + long hrtimer_clock_base_first; + long hrtimer_clock_base_get_time; + long hrtimer_base_first; + long hrtimer_base_pending; + long hrtimer_base_get_time; + long hrtimer_node; + long hrtimer_list; + long hrtimer_softexpires; + long hrtimer_expires; + long hrtimer_function; + long timerqueue_head_next; + long timerqueue_node_expires; + long timerqueue_node_node; + long ktime_t_tv64; + long ktime_t_sec; + long ktime_t_nsec; + long module_taints; + long module_gpgsig_ok; + long module_license_gplok; + long tnt_bit; + long tnt_true; + long tnt_false; + long task_struct_thread_context_fp; + long task_struct_thread_context_sp; + long task_struct_thread_context_pc; + long page_slab_page; + long trace_print_flags_mask; + long trace_print_flags_name; + long task_struct_rss_stat; + long task_rss_stat_count; + long page_s_mem; + long page_active; + long hstate_nr_huge_pages; + long hstate_free_huge_pages; + long hstate_name; + long cgroup_kn; + long kernfs_node_name; + long kernfs_node_parent; + long kmem_cache_cpu_partial; + long kmem_cache_cpu_cache; + long nsproxy_net_ns; + long atomic_t_counter; + long percpu_counter_count; + long mm_struct_mm_count; + long task_struct_thread_reg29; + long task_struct_thread_reg31; + long pt_regs_regs; + long pt_regs_cp0_badvaddr; + long address_space_page_tree; + long page_compound_head; + long irq_desc_irq_data; + long kmem_cache_node_total_objects; + long timer_base_vectors; + long request_queue_mq_ops; + long request_queue_queue_ctx; + long blk_mq_ctx_rq_dispatched; + long blk_mq_ctx_rq_completed; + long task_struct_stack; + long tnt_mod; + long radix_tree_node_shift; + long kmem_cache_red_left_pad; + long inactive_task_frame_ret_addr; +}; + +struct size_table { /* stash of commonly-used sizes */ + long page; + long free_area_struct; + long zone_struct; + long free_area; + long zone; + long kmem_slab_s; + long kmem_cache_s; + long kmem_bufctl_t; + long slab_s; + long slab; + long cpucache_s; + long array_cache; + long swap_info_struct; + long mm_struct; + long vm_area_struct; + long pglist_data; + long page_cache_bucket; + long pt_regs; + long task_struct; + long thread_info; + long softirq_state; + long desc_struct; + long umode_t; + long dentry; + long files_struct; + long fdtable; + long fs_struct; + long file; + long inode; + long vfsmount; + long super_block; + long irqdesc; + long module; + long list_head; + long hlist_node; + long hlist_head; + long irq_cpustat_t; + long cpuinfo_x86; + long cpuinfo_ia64; + long timer_list; + long timer_vec_root; + long timer_vec; + long tvec_root_s; + long tvec_s; + long tvec_t_base_s; + long wait_queue; + long __wait_queue; + long device; + long net_device; + long sock; + long signal_struct; + long sigpending_signal; + long signal_queue; + long sighand_struct; + long sigqueue; + long k_sigaction; + long resource_entry_t; + long resource; + long runqueue; + long irq_desc_t; + long task_union; + long thread_union; + long prio_array; + long user_regs_struct; + long switch_stack; + long vm_area_struct_vm_flags; + long e820map; + long e820entry; + long cpu_s; + long pgd_t; + long kallsyms_header; + long kallsyms_symbol; + long kallsyms_section; + long irq_ctx; + long block_device; + long blk_major_name; + long gendisk; + long address_space; + long char_device_struct; + long inet_sock; + long in6_addr; + long socket; + long spinlock_t; + long radix_tree_root; + long radix_tree_node; + long x8664_pda; + long ppc64_paca; + long gate_struct; + long tss_struct; + long task_struct_start_time; + long cputime_t; + long mem_section; + long pid_link; + long unwind_table; + long rlimit; + long kmem_cache; + long kmem_cache_node; + long upid; + long kmem_cache_cpu; + long cfs_rq; + long pcpu_info; + long vcpu_struct; + long cdev; + long probe; + long kobj_map; + long page_flags; + long module_sect_attr; + long task_struct_utime; + long task_struct_stime; + long cpu_context_save; + long elf_prstatus; + long note_buf; + long unwind_idx; + long softirq_action; + long irq_data; + long s390_stack_frame; + long percpu_data; + long sched_entity; + long kernel_stat; + long subsystem; + long class_private; + long rq_in_flight; + long class_private_devices; + long mount; + long hstate; + long ipc_ids; + long shmid_kernel; + long sem_array; + long msg_queue; + long log; + long log_level; + long rt_rq; + long task_group; + long vmap_area; + long hrtimer_clock_base; + long hrtimer_base; + long tnt; + long trace_print_flags; + long task_struct_flags; + long timer_base; + long taint_flag; +}; + +struct array_table { + int kmem_cache_s_name; + int kmem_cache_s_c_name; + int kmem_cache_s_array; + int kmem_cache_s_cpudata; + int irq_desc; + int irq_action; + int log_buf; + int timer_vec_vec; + int timer_vec_root_vec; + int tvec_s_vec; + int tvec_root_s_vec; + int page_hash_table; + int net_device_name; + int neigh_table_hash_buckets; + int neighbour_ha; + int swap_info; + int pglist_data_node_zones; + int zone_struct_free_area; + int zone_free_area; + int free_area; + int free_area_DIMENSION; + int prio_array_queue; + int height_to_maxindex; + int pid_hash; + int kmem_cache_node; + int kmem_cache_cpu_slab; + int rt_prio_array_queue; + int height_to_maxnodes; +}; + +/* + * The following set of macros use gdb to determine structure, union, + * or member sizes/offsets. They should be used only during initialization + * of the offset_table or size_table, or with data structures whose names + * or members are only known/specified during runtime. + */ +#define MEMBER_SIZE_REQUEST ((struct datatype_member *)(-1)) +#define ANON_MEMBER_OFFSET_REQUEST ((struct datatype_member *)(-2)) +#define MEMBER_TYPE_REQUEST ((struct datatype_member *)(-3)) +#define STRUCT_SIZE_REQUEST ((struct datatype_member *)(-4)) + +#define STRUCT_SIZE(X) datatype_info((X), NULL, STRUCT_SIZE_REQUEST) +#define UNION_SIZE(X) datatype_info((X), NULL, STRUCT_SIZE_REQUEST) +#define STRUCT_EXISTS(X) (datatype_info((X), NULL, STRUCT_SIZE_REQUEST) >= 0) +#define DATATYPE_SIZE(X) datatype_info((X)->name, NULL, (X)) +#define MEMBER_OFFSET(X,Y) datatype_info((X), (Y), NULL) +#define MEMBER_EXISTS(X,Y) (datatype_info((X), (Y), NULL) >= 0) +#define MEMBER_SIZE(X,Y) datatype_info((X), (Y), MEMBER_SIZE_REQUEST) +#define MEMBER_TYPE(X,Y) datatype_info((X), (Y), MEMBER_TYPE_REQUEST) +#define ANON_MEMBER_OFFSET(X,Y) datatype_info((X), (Y), ANON_MEMBER_OFFSET_REQUEST) + +/* + * The following set of macros can only be used with pre-intialized fields + * in the offset table, size table or array_table. + */ +#define OFFSET(X) (OFFSET_verify(offset_table.X, (char *)__FUNCTION__, __FILE__, __LINE__, #X)) +#define SIZE(X) (SIZE_verify(size_table.X, (char *)__FUNCTION__, __FILE__, __LINE__, #X)) +#define INVALID_OFFSET (-1) +#define INVALID_MEMBER(X) (offset_table.X == INVALID_OFFSET) +#define INVALID_SIZE(X) (size_table.X == -1) +#define VALID_SIZE(X) (size_table.X >= 0) +#define VALID_STRUCT(X) (size_table.X >= 0) +#define VALID_MEMBER(X) (offset_table.X >= 0) +#define ARRAY_LENGTH(X) (array_table.X) +#define ASSIGN_OFFSET(X) (offset_table.X) +#define ASSIGN_SIZE(X) (size_table.X) +#define OFFSET_OPTION(X,Y) (OFFSET_option(offset_table.X, offset_table.Y, (char *)__FUNCTION__, __FILE__, __LINE__, #X, #Y)) +#define SIZE_OPTION(X,Y) (SIZE_option(size_table.X, size_table.Y, (char *)__FUNCTION__, __FILE__, __LINE__, #X, #Y)) + +#define MEMBER_OFFSET_INIT(X, Y, Z) (ASSIGN_OFFSET(X) = MEMBER_OFFSET(Y, Z)) +#define STRUCT_SIZE_INIT(X, Y) (ASSIGN_SIZE(X) = STRUCT_SIZE(Y)) +#define ARRAY_LENGTH_INIT(A, B, C, D, E) ((A) = get_array_length(C, D, E)) +#define ARRAY_LENGTH_INIT_ALT(A, B, C, D, E) ((A) = get_array_length_alt(B, C, D, E)) +#define MEMBER_SIZE_INIT(X, Y, Z) (ASSIGN_SIZE(X) = MEMBER_SIZE(Y, Z)) +#define ANON_MEMBER_OFFSET_INIT(X, Y, Z) (ASSIGN_OFFSET(X) = ANON_MEMBER_OFFSET(Y, Z)) + +/* + * For use with non-debug kernels. + */ +struct builtin_debug_table { + char *release; + char *machine_type; + struct offset_table *offset_table; + struct size_table *size_table; + struct array_table *array_table; +}; + +/* + * Facilitators for pulling correctly-sized data out of a buffer at a + * known address. + */ + +#ifdef NEED_ALIGNED_MEM_ACCESS + +#define DEF_LOADER(TYPE) \ +static inline TYPE \ +load_##TYPE (char *addr) \ +{ \ + TYPE ret; \ + size_t i = sizeof(TYPE); \ + while (i--) \ + ((char *)&ret)[i] = addr[i]; \ + return ret; \ +} + +DEF_LOADER(int); +DEF_LOADER(uint); +DEF_LOADER(long); +DEF_LOADER(ulong); +DEF_LOADER(ulonglong); +DEF_LOADER(ushort); +DEF_LOADER(short); +typedef void *pointer_t; +DEF_LOADER(pointer_t); + +#define LOADER(TYPE) load_##TYPE + +#define INT(ADDR) LOADER(int) ((char *)(ADDR)) +#define UINT(ADDR) LOADER(uint) ((char *)(ADDR)) +#define LONG(ADDR) LOADER(long) ((char *)(ADDR)) +#define ULONG(ADDR) LOADER(ulong) ((char *)(ADDR)) +#define ULONGLONG(ADDR) LOADER(ulonglong) ((char *)(ADDR)) +#define ULONG_PTR(ADDR) ((ulong *) (LOADER(pointer_t) ((char *)(ADDR)))) +#define USHORT(ADDR) LOADER(ushort) ((char *)(ADDR)) +#define SHORT(ADDR) LOADER(short) ((char *)(ADDR)) +#define UCHAR(ADDR) *((unsigned char *)((char *)(ADDR))) +#define VOID_PTR(ADDR) ((void *) (LOADER(pointer_t) ((char *)(ADDR)))) + +#else + +#define INT(ADDR) *((int *)((char *)(ADDR))) +#define UINT(ADDR) *((uint *)((char *)(ADDR))) +#define LONG(ADDR) *((long *)((char *)(ADDR))) +#define ULONG(ADDR) *((ulong *)((char *)(ADDR))) +#define ULONGLONG(ADDR) *((ulonglong *)((char *)(ADDR))) +#define ULONG_PTR(ADDR) *((ulong **)((char *)(ADDR))) +#define USHORT(ADDR) *((ushort *)((char *)(ADDR))) +#define SHORT(ADDR) *((short *)((char *)(ADDR))) +#define UCHAR(ADDR) *((unsigned char *)((char *)(ADDR))) +#define VOID_PTR(ADDR) *((void **)((char *)(ADDR))) + +#endif /* NEED_ALIGNED_MEM_ACCESS */ + +struct node_table { + int node_id; + ulong pgdat; + ulong mem_map; + ulong size; + ulong present; + ulonglong start_paddr; + ulong start_mapnr; +}; + +struct meminfo; +struct slab_data; + +#define VMA_CACHE (20) + +struct vm_table { /* kernel VM-related data */ + ulong flags; + ulong kernel_pgd[NR_CPUS]; + ulong high_memory; + ulong vmalloc_start; + ulong mem_map; + long total_pages; + ulong totalram_pages; + ulong totalhigh_pages; + ulong num_physpages; + ulong max_mapnr; + ulong kmem_max_c_num; + ulong kmem_max_limit; + ulong kmem_max_cpus; + ulong kmem_cache_count; + ulong kmem_cache_len_nodes; + ulong PG_reserved; + ulong PG_slab; + ulong PG_head_tail_mask; + int kmem_cache_namelen; + ulong page_hash_table; + int page_hash_table_len; + int paddr_prlen; + int numnodes; + int nr_zones; + int nr_free_areas; + struct node_table *node_table; + void (*dump_free_pages)(struct meminfo *); + void (*dump_kmem_cache)(struct meminfo *); + struct slab_data *slab_data; + uint nr_swapfiles; + ulong last_swap_read; + char *swap_info_struct; + char *vma_cache; + ulong cached_vma[VMA_CACHE]; + ulong cached_vma_hits[VMA_CACHE]; + int vma_cache_index; + ulong vma_cache_fills; + void *mem_sec; + char *mem_section; + int ZONE_HIGHMEM; + ulong *node_online_map; + int node_online_map_len; + int nr_vm_stat_items; + char **vm_stat_items; + int cpu_slab_type; + int nr_vm_event_items; + char **vm_event_items; + int nr_bad_slab_caches; + ulong *bad_slab_caches; + int nr_pageflags; + struct pageflags_data { + ulong mask; + char *name; + } *pageflags_data; +}; + +#define NODES (0x1) +#define ZONES (0x2) +#define PERCPU_KMALLOC_V1 (0x4) +#define COMMON_VADDR (0x8) +#define KMEM_CACHE_INIT (0x10) +#define V_MEM_MAP (0x20) +#define PERCPU_KMALLOC_V2 (0x40) +#define KMEM_CACHE_UNAVAIL (0x80) +#define FLATMEM (0x100) +#define DISCONTIGMEM (0x200) +#define SPARSEMEM (0x400) +#define SPARSEMEM_EX (0x800) +#define PERCPU_KMALLOC_V2_NODES (0x1000) +#define KMEM_CACHE_DELAY (0x2000) +#define NODES_ONLINE (0x4000) +#define VM_STAT (0x8000) +#define KMALLOC_SLUB (0x10000) +#define CONFIG_NUMA (0x20000) +#define VM_EVENT (0x40000) +#define PGCNT_ADJ (0x80000) +#define VM_INIT (0x100000) +#define SWAPINFO_V1 (0x200000) +#define SWAPINFO_V2 (0x400000) +#define NODELISTS_IS_PTR (0x800000) +#define KMALLOC_COMMON (0x1000000) +#define USE_VMAP_AREA (0x2000000) +#define PAGEFLAGS (0x4000000) +#define SLAB_OVERLOAD_PAGE (0x8000000) +#define SLAB_CPU_CACHE (0x10000000) + +#define IS_FLATMEM() (vt->flags & FLATMEM) +#define IS_DISCONTIGMEM() (vt->flags & DISCONTIGMEM) +#define IS_SPARSEMEM() (vt->flags & SPARSEMEM) +#define IS_SPARSEMEM_EX() (vt->flags & SPARSEMEM_EX) + +#define COMMON_VADDR_SPACE() (vt->flags & COMMON_VADDR) +#define PADDR_PRLEN (vt->paddr_prlen) + +struct datatype_member { /* minimal definition of a structure/union */ + char *name; /* and possibly a member within it */ + char *member; + ulong type; + long size; + long member_offset; + long member_size; + int member_typecode; + ulong flags; + char *tagname; /* tagname and value for enums */ + long value; + ulong vaddr; +}; + +#define union_name struct_name + +struct list_data { /* generic structure used by do_list() to walk */ + ulong flags; /* through linked lists in the kernel */ + ulong start; + long member_offset; + long list_head_offset; + ulong end; + ulong searchfor; + char **structname; + int structname_args; + char *header; + ulong *list_ptr; + int (*callback_func)(void *, void *); + void *callback_data; + long struct_list_offset; +}; +#define LIST_OFFSET_ENTERED (VERBOSE << 1) +#define LIST_START_ENTERED (VERBOSE << 2) +#define LIST_HEAD_FORMAT (VERBOSE << 3) +#define LIST_HEAD_POINTER (VERBOSE << 4) +#define RETURN_ON_DUPLICATE (VERBOSE << 5) +#define RETURN_ON_LIST_ERROR (VERBOSE << 6) +#define LIST_STRUCT_RADIX_10 (VERBOSE << 7) +#define LIST_STRUCT_RADIX_16 (VERBOSE << 8) +#define LIST_HEAD_REVERSE (VERBOSE << 9) +#define LIST_ALLOCATE (VERBOSE << 10) +#define LIST_CALLBACK (VERBOSE << 11) +#define CALLBACK_RETURN (VERBOSE << 12) +#define LIST_PARSE_MEMBER (VERBOSE << 13) +#define LIST_READ_MEMBER (VERBOSE << 14) + +struct tree_data { + ulong flags; + ulong start; + long node_member_offset; + char **structname; + int structname_args; + int count; +}; + +#define TREE_ROOT_OFFSET_ENTERED (VERBOSE << 1) +#define TREE_NODE_OFFSET_ENTERED (VERBOSE << 2) +#define TREE_NODE_POINTER (VERBOSE << 3) +#define TREE_POSITION_DISPLAY (VERBOSE << 4) +#define TREE_STRUCT_RADIX_10 (VERBOSE << 5) +#define TREE_STRUCT_RADIX_16 (VERBOSE << 6) +#define TREE_PARSE_MEMBER (VERBOSE << 7) +#define TREE_READ_MEMBER (VERBOSE << 8) + +#define ALIAS_RUNTIME (1) +#define ALIAS_RCLOCAL (2) +#define ALIAS_RCHOME (3) +#define ALIAS_BUILTIN (4) + +struct alias_data { /* command alias storage */ + struct alias_data *next; + char *alias; + int argcnt; + int size; + int origin; + char *args[MAXARGS]; + char argbuf[1]; +}; + +struct rb_node +{ + unsigned long rb_parent_color; +#define RB_RED 0 +#define RB_BLACK 1 + struct rb_node *rb_right; + struct rb_node *rb_left; +}; + +struct rb_root +{ + struct rb_node *rb_node; +}; + +#define NUMBER_STACKFRAMES 4 + +#define SAVE_RETURN_ADDRESS(retaddr) \ +{ \ + int i; \ + int saved_stacks; \ + \ + saved_stacks = backtrace((void **)retaddr, NUMBER_STACKFRAMES); \ + \ + /* explicitely zero out the invalid addresses */ \ + for (i = saved_stacks; i < NUMBER_STACKFRAMES; i++) \ + retaddr[i] = 0; \ +} + +#endif /* !GDB_COMMON */ + + +#define SYMBOL_NAME_USED (0x1) +#define MODULE_SYMBOL (0x2) +#define IS_MODULE_SYMBOL(SYM) ((SYM)->flags & MODULE_SYMBOL) + +struct syment { + ulong value; + char *name; + struct syment *val_hash_next; + struct syment *name_hash_next; + char type; + unsigned char cnt; + unsigned char flags; + unsigned char pad2; +}; + +#define NAMESPACE_INIT (1) +#define NAMESPACE_REUSE (2) +#define NAMESPACE_FREE (3) +#define NAMESPACE_INSTALL (4) +#define NAMESPACE_COMPLETE (5) + +struct symbol_namespace { + char *address; + size_t size; + long index; + long cnt; +}; + +struct downsized { + char *name; + struct downsized *next; +}; + +#define SYMVAL_HASH (512) +#define SYMVAL_HASH_INDEX(vaddr) \ + (((vaddr) >> machdep->pageshift) % SYMVAL_HASH) + +#define SYMNAME_HASH (512) +#define SYMNAME_HASH_INDEX(name) \ + ((name[0] ^ (name[strlen(name)-1] * name[strlen(name)/2])) % SYMNAME_HASH) + +#define PATCH_KERNEL_SYMBOLS_START ((char *)(1)) +#define PATCH_KERNEL_SYMBOLS_STOP ((char *)(2)) + +#ifndef GDB_COMMON + +struct symbol_table_data { + ulong flags; +#ifdef GDB_5_3 + struct _bfd *bfd; +#else + struct bfd *bfd; +#endif + struct sec *sections; + struct syment *symtable; + struct syment *symend; + long symcnt; + ulong syment_size; + struct symval_hash_chain { + struct syment *val_hash_head; + struct syment *val_hash_last; + } symval_hash[SYMVAL_HASH]; + double val_hash_searches; + double val_hash_iterations; + struct syment *symname_hash[SYMNAME_HASH]; + struct symbol_namespace kernel_namespace; + struct syment *ext_module_symtable; + struct syment *ext_module_symend; + long ext_module_symcnt; + struct symbol_namespace ext_module_namespace; + int mods_installed; + struct load_module *current; + struct load_module *load_modules; + off_t dwarf_eh_frame_file_offset; + ulong dwarf_eh_frame_size; + ulong first_ksymbol; + ulong __per_cpu_start; + ulong __per_cpu_end; + off_t dwarf_debug_frame_file_offset; + ulong dwarf_debug_frame_size; + ulong first_section_start; + ulong last_section_end; + ulong _stext_vmlinux; + struct downsized downsized; +}; + +/* flags for st */ +#define KERNEL_SYMS (0x1) +#define MODULE_SYMS (0x2) +#define LOAD_MODULE_SYMS (0x4) +#define INSMOD_BUILTIN (0x8) +#define GDB_SYMS_PATCHED (0x10) +#define GDB_PATCHED() (st->flags & GDB_SYMS_PATCHED) +#define NO_SEC_LOAD (0x20) +#define NO_SEC_CONTENTS (0x40) +#define FORCE_DEBUGINFO (0x80) +#define CRC_MATCHES (0x100) +#define ADD_SYMBOL_FILE (0x200) +#define USE_OLD_ADD_SYM (0x400) +#define PERCPU_SYMS (0x800) +#define MODSECT_UNKNOWN (0x1000) +#define MODSECT_V1 (0x2000) +#define MODSECT_V2 (0x4000) +#define MODSECT_V3 (0x8000) +#define MODSECT_VMASK (MODSECT_V1|MODSECT_V2|MODSECT_V3) +#define NO_STRIP (0x10000) + +#define NO_LINE_NUMBERS() ((st->flags & GDB_SYMS_PATCHED) && !(kt->flags2 & KASLR)) + +#endif /* !GDB_COMMON */ + +#define ALL_MODULES (0) + +#define MAX_MOD_NAMELIST (256) +#define MAX_MOD_NAME (64) +#define MAX_MOD_SEC_NAME (64) + +#define MOD_EXT_SYMS (0x1) +#define MOD_LOAD_SYMS (0x2) +#define MOD_REMOTE (0x4) +#define MOD_KALLSYMS (0x8) +#define MOD_INITRD (0x10) +#define MOD_NOPATCH (0x20) +#define MOD_INIT (0x40) +#define MOD_DO_READNOW (0x80) + +#define SEC_FOUND (0x10000) + +struct mod_section_data { +#if defined(GDB_5_3) || defined(GDB_6_0) + struct sec *section; +#else + struct bfd_section *section; +#endif + char name[MAX_MOD_SEC_NAME]; + ulong offset; + ulong size; + int priority; + int flags; +}; + +struct load_module { + ulong mod_base; + ulong module_struct; + long mod_size; + char mod_namelist[MAX_MOD_NAMELIST]; + char mod_name[MAX_MOD_NAME]; + ulong mod_flags; + struct syment *mod_symtable; + struct syment *mod_symend; + long mod_ext_symcnt; + struct syment *mod_ext_symtable; + struct syment *mod_ext_symend; + long mod_load_symcnt; + struct syment *mod_load_symtable; + struct syment *mod_load_symend; + long mod_symalloc; + struct symbol_namespace mod_load_namespace; + ulong mod_size_of_struct; + ulong mod_text_start; + ulong mod_etext_guess; + ulong mod_rodata_start; + ulong mod_data_start; + ulong mod_bss_start; + int mod_sections; + struct mod_section_data *mod_section_data; + ulong mod_init_text_size; + ulong mod_init_module_ptr; + ulong mod_init_size; + struct syment *mod_init_symtable; + struct syment *mod_init_symend; + ulong mod_percpu; + ulong mod_percpu_size; +}; + +#define IN_MODULE(A,L) \ + (((ulong)(A) >= (L)->mod_base) && ((ulong)(A) < ((L)->mod_base+(L)->mod_size))) + +#define IN_MODULE_INIT(A,L) \ + (((ulong)(A) >= (L)->mod_init_module_ptr) && ((ulong)(A) < ((L)->mod_init_module_ptr+(L)->mod_init_size))) + +#define IN_MODULE_PERCPU(A,L) \ + (((ulong)(A) >= (L)->mod_percpu) && ((ulong)(A) < ((L)->mod_percpu+(L)->mod_percpu_size))) + +#define MODULE_PERCPU_SYMS_LOADED(L) ((L)->mod_percpu && (L)->mod_percpu_size) + +#ifndef GDB_COMMON + +#define KVADDR (0x1) +#define UVADDR (0x2) +#define PHYSADDR (0x4) +#define XENMACHADDR (0x8) +#define FILEADDR (0x10) +#define AMBIGUOUS (~0) + +#define USE_USER_PGD (UVADDR << 2) + +#define VERIFY_ADDR (0x8) /* vm_area_dump() flags -- must follow */ +#define PRINT_INODES (0x10) /* KVADDR, UVADDR, and PHYSADDR */ +#define PRINT_MM_STRUCT (0x20) +#define PRINT_VMA_STRUCTS (0x40) +#define PRINT_SINGLE_VMA (0x80) +#define PRINT_RADIX_10 (0x100) +#define PRINT_RADIX_16 (0x200) +#define PRINT_NRPAGES (0x400) + +#define MIN_PAGE_SIZE (4096) + +#define PTOB(X) ((ulonglong)(X) << machdep->pageshift) +#define BTOP(X) ((ulonglong)(X) >> machdep->pageshift) + +#define PAGESIZE() (machdep->pagesize) +#define PAGESHIFT() (machdep->pageshift) + +#define PAGEOFFSET(X) (((ulong)(X)) & machdep->pageoffset) +#define VIRTPAGEBASE(X) (((ulong)(X)) & (ulong)machdep->pagemask) +#define PHYSPAGEBASE(X) (((physaddr_t)(X)) & (physaddr_t)machdep->pagemask) + +/* + * Sparse memory stuff + * These must follow the definitions in the kernel mmzone.h + */ +#define SECTION_SIZE_BITS() (machdep->section_size_bits) +#define MAX_PHYSMEM_BITS() (machdep->max_physmem_bits) +#define SECTIONS_SHIFT() (MAX_PHYSMEM_BITS() - SECTION_SIZE_BITS()) +#define PA_SECTION_SHIFT() (SECTION_SIZE_BITS()) +#define PFN_SECTION_SHIFT() (SECTION_SIZE_BITS() - PAGESHIFT()) +#define NR_MEM_SECTIONS() (1UL << SECTIONS_SHIFT()) +#define PAGES_PER_SECTION() (1UL << PFN_SECTION_SHIFT()) +#define PAGE_SECTION_MASK() (~(PAGES_PER_SECTION()-1)) + +#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT()) +#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT()) + +#define SECTIONS_PER_ROOT() (machdep->sections_per_root) + +/* CONFIG_SPARSEMEM_EXTREME */ +#define _SECTIONS_PER_ROOT_EXTREME() (PAGESIZE() / SIZE(mem_section)) +/* !CONFIG_SPARSEMEM_EXTREME */ +#define _SECTIONS_PER_ROOT() (1) + +#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT()) +#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define NR_SECTION_ROOTS() (DIV_ROUND_UP(NR_MEM_SECTIONS(), SECTIONS_PER_ROOT())) +#define SECTION_ROOT_MASK() (SECTIONS_PER_ROOT() - 1) + +/* + * Machine specific stuff + */ + +#ifdef ARM +#define _32BIT_ +#define MACHINE_TYPE "ARM" + +#define PAGEBASE(X) (((ulong)(X)) & (ulong)machdep->pagemask) + +#define PTOV(X) \ + ((unsigned long)(X)-(machdep->machspec->phys_base)+(machdep->kvbase)) +#define VTOP(X) \ + ((unsigned long)(X)-(machdep->kvbase)+(machdep->machspec->phys_base)) + +#define IS_VMALLOC_ADDR(X) arm_is_vmalloc_addr((ulong)(X)) + +#define DEFAULT_MODULES_VADDR (machdep->kvbase - 16 * 1024 * 1024) +#define MODULES_VADDR (machdep->machspec->modules_vaddr) +#define MODULES_END (machdep->machspec->modules_end) +#define VMALLOC_START (machdep->machspec->vmalloc_start_addr) +#define VMALLOC_END (machdep->machspec->vmalloc_end) + +#define PGDIR_SHIFT (21) +#define PTRS_PER_PTE (512) +#define PTRS_PER_PGD (2048) + +#define PGD_OFFSET(vaddr) ((vaddr) >> PGDIR_SHIFT) +#define PTE_OFFSET(vaddr) (((vaddr) >> PAGESHIFT()) & (PTRS_PER_PTE - 1)) + +#define __SWP_TYPE_SHIFT 3 +#define __SWP_TYPE_BITS 6 +#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1) +#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT) + +#define SWP_TYPE(entry) (((entry) >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK) +#define SWP_OFFSET(entry) ((entry) >> __SWP_OFFSET_SHIFT) + +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#define TIF_SIGPENDING (2) + +#define _SECTION_SIZE_BITS 28 +#define _MAX_PHYSMEM_BITS 32 + +/*add for LPAE*/ +typedef unsigned long long u64; +typedef signed int s32; +typedef u64 pgd_t; +typedef u64 pmd_t; +typedef u64 pte_t; + +#define PMDSIZE() (PAGESIZE()) +#define LPAE_PGDIR_SHIFT (30) +#define LPAE_PMDIR_SHIFT (21) + +#define LPAE_PGD_OFFSET(vaddr) ((vaddr) >> LPAE_PGDIR_SHIFT) +#define LPAE_PMD_OFFSET(vaddr) (((vaddr) >> LPAE_PMDIR_SHIFT) & \ + ((1<<(LPAE_PGDIR_SHIFT-LPAE_PMDIR_SHIFT))-1)) + +#define _SECTION_SIZE_BITS_LPAE 28 +#define _MAX_PHYSMEM_BITS_LPAE 36 + +/* + * #define PTRS_PER_PTE 512 + * #define PTRS_PER_PMD 512 + * #define PTRS_PER_PGD 4 + * + */ + +#define LPAE_PGDIR_SIZE() 32 +#define LPAE_PGDIR_OFFSET(X) (((ulong)(X)) & (LPAE_PGDIR_SIZE() - 1)) + +#define LPAE_PMDIR_SIZE() 4096 +#define LPAE_PMDIR_OFFSET(X) (((ulong)(X)) & (LPAE_PMDIR_SIZE() - 1)) + +#define LPAE_PTEDIR_SIZE() 4096 +#define LPAE_PTEDIR_OFFSET(X) (((ulong)(X)) & (LPAE_PTEDIR_SIZE() - 1)) + +/*section size for LPAE is 2MiB*/ +#define LPAE_SECTION_PAGE_MASK (~((MEGABYTES(2))-1)) + +#define _PHYSICAL_MASK_LPAE ((1ULL << _MAX_PHYSMEM_BITS_LPAE) - 1) +#define PAGE_BASE_MASK ((u64)((s32)machdep->pagemask & _PHYSICAL_MASK_LPAE)) +#define LPAE_PAGEBASE(X) (((ulonglong)(X)) & PAGE_BASE_MASK) + +#define LPAE_VTOP(X) \ + ((unsigned long long)(unsigned long)(X) - \ + (machdep->kvbase) + (machdep->machspec->phys_base)) + +#define IS_LAST_PGD_READ_LPAE(pgd) ((pgd) == \ + machdep->machspec->last_pgd_read_lpae) +#define IS_LAST_PMD_READ_LPAE(pmd) ((pmd) == \ + machdep->machspec->last_pmd_read_lpae) +#define IS_LAST_PTBL_READ_LPAE(ptbl) ((ptbl) == \ + machdep->machspec->last_ptbl_read_lpae) + +#define FILL_PGD_LPAE(PGD, TYPE, SIZE) \ + if (!IS_LAST_PGD_READ_LPAE(PGD)) { \ + readmem((ulonglong)(PGD), TYPE, machdep->pgd, \ + SIZE, "pmd page", FAULT_ON_ERROR); \ + machdep->machspec->last_pgd_read_lpae \ + = (ulonglong)(PGD); \ + } +#define FILL_PMD_LPAE(PMD, TYPE, SIZE) \ + if (!IS_LAST_PMD_READ_LPAE(PMD)) { \ + readmem((ulonglong)(PMD), TYPE, machdep->pmd, \ + SIZE, "pmd page", FAULT_ON_ERROR); \ + machdep->machspec->last_pmd_read_lpae \ + = (ulonglong)(PMD); \ + } + +#define FILL_PTBL_LPAE(PTBL, TYPE, SIZE) \ + if (!IS_LAST_PTBL_READ_LPAE(PTBL)) { \ + readmem((ulonglong)(PTBL), TYPE, machdep->ptbl, \ + SIZE, "page table", FAULT_ON_ERROR); \ + machdep->machspec->last_ptbl_read_lpae \ + = (ulonglong)(PTBL); \ + } +#endif /* ARM */ + +#ifndef EM_AARCH64 +#define EM_AARCH64 183 +#endif + +#ifdef ARM64 +#define _64BIT_ +#define MACHINE_TYPE "ARM64" + +#define PTOV(X) \ + ((unsigned long)(X)-(machdep->machspec->phys_offset)+(machdep->machspec->page_offset)) + +#define VTOP(X) arm64_VTOP((ulong)(X)) + +#define USERSPACE_TOP (machdep->machspec->userspace_top) +#define PAGE_OFFSET (machdep->machspec->page_offset) +#define VMALLOC_START (machdep->machspec->vmalloc_start_addr) +#define VMALLOC_END (machdep->machspec->vmalloc_end) +#define VMEMMAP_VADDR (machdep->machspec->vmemmap_vaddr) +#define VMEMMAP_END (machdep->machspec->vmemmap_end) +#define MODULES_VADDR (machdep->machspec->modules_vaddr) +#define MODULES_END (machdep->machspec->modules_end) + +#define IS_VMALLOC_ADDR(X) arm64_IS_VMALLOC_ADDR((ulong)(X)) + +#define PAGEBASE(X) (((ulong)(X)) & (ulong)machdep->pagemask) + +/* + * 48-bit physical address supported. + */ +#define PHYS_MASK_SHIFT (48) +#define PHYS_MASK (((1UL) << PHYS_MASK_SHIFT) - 1) + +typedef signed int s32; + +/* + * 3-levels / 4K pages + */ +#define PTRS_PER_PGD_L3_4K (512) +#define PTRS_PER_PMD_L3_4K (512) +#define PTRS_PER_PTE_L3_4K (512) +#define PGDIR_SHIFT_L3_4K (30) +#define PGDIR_SIZE_L3_4K ((1UL) << PGDIR_SHIFT_L3_4K) +#define PGDIR_MASK_L3_4K (~(PGDIR_SIZE_L3_4K-1)) +#define PMD_SHIFT_L3_4K (21) +#define PMD_SIZE_L3_4K (1UL << PMD_SHIFT_L3_4K) +#define PMD_MASK_L3_4K (~(PMD_SIZE_L3_4K-1)) + +/* + * 4-levels / 4K pages + * 48-bit VA + */ +#define PTRS_PER_PGD_L4_4K ((1UL) << (48 - 39)) +#define PTRS_PER_PUD_L4_4K (512) +#define PTRS_PER_PMD_L4_4K (512) +#define PTRS_PER_PTE_L4_4K (512) +#define PGDIR_SHIFT_L4_4K (39) +#define PGDIR_SIZE_L4_4K ((1UL) << PGDIR_SHIFT_L4_4K) +#define PGDIR_MASK_L4_4K (~(PGDIR_SIZE_L4_4K-1)) +#define PUD_SHIFT_L4_4K (30) +#define PUD_SIZE_L4_4K ((1UL) << PUD_SHIFT_L4_4K) +#define PUD_MASK_L4_4K (~(PUD_SIZE_L4_4K-1)) +#define PMD_SHIFT_L4_4K (21) +#define PMD_SIZE_L4_4K (1UL << PMD_SHIFT_L4_4K) +#define PMD_MASK_L4_4K (~(PMD_SIZE_L4_4K-1)) + +#define PGDIR_SIZE_48VA (1UL << ((48 - 39) + 3)) +#define PGDIR_MASK_48VA (~(PGDIR_SIZE_48VA - 1)) +#define PGDIR_OFFSET_48VA(X) (((ulong)(X)) & (PGDIR_SIZE_48VA - 1)) + +/* + * 3-levels / 64K pages + */ +#define PTRS_PER_PGD_L3_64K (64) +#define PTRS_PER_PMD_L3_64K (8192) +#define PTRS_PER_PTE_L3_64K (8192) +#define PGDIR_SHIFT_L3_64K (42) +#define PGDIR_SIZE_L3_64K ((1UL) << PGDIR_SHIFT_L3_64K) +#define PGDIR_MASK_L3_64K (~(PGDIR_SIZE_L3_64K-1)) +#define PMD_SHIFT_L3_64K (29) +#define PMD_SIZE_L3_64K (1UL << PMD_SHIFT_L3_64K) +#define PMD_MASK_L3_64K (~(PMD_SIZE_L3_64K-1)) +#define PGDIR_OFFSET_L3_64K(X) (((ulong)(X)) & ((PTRS_PER_PGD_L3_64K * 8) - 1)) + +/* + * 2-levels / 64K pages + */ +#define PTRS_PER_PGD_L2_64K (8192) +#define PTRS_PER_PTE_L2_64K (8192) +#define PGDIR_SHIFT_L2_64K (29) +#define PGDIR_SIZE_L2_64K ((1UL) << PGDIR_SHIFT_L2_64K) +#define PGDIR_MASK_L2_64K (~(PGDIR_SIZE_L2_64K-1)) + +/* + * Software defined PTE bits definition. + * (arch/arm64/include/asm/pgtable.h) + */ +#define PTE_VALID (1UL << 0) +#define PTE_DIRTY (1UL << 55) +#define PTE_SPECIAL (1UL << 56) + +/* + * Level 3 descriptor (PTE). + * (arch/arm64/include/asm/pgtable-hwdef.h) + */ +#define PTE_TYPE_MASK (3UL << 0) +#define PTE_TYPE_FAULT (0UL << 0) +#define PTE_TYPE_PAGE (3UL << 0) +#define PTE_USER (1UL << 6) /* AP[1] */ +#define PTE_RDONLY (1UL << 7) /* AP[2] */ +#define PTE_SHARED (3UL << 8) /* SH[1:0], inner shareable */ +#define PTE_AF (1UL << 10) /* Access Flag */ +#define PTE_NG (1UL << 11) /* nG */ +#define PTE_PXN (1UL << 53) /* Privileged XN */ +#define PTE_UXN (1UL << 54) /* User XN */ + +#define __swp_type(x) arm64_swp_type(x) +#define __swp_offset(x) arm64_swp_offset(x) +#define SWP_TYPE(x) __swp_type(x) +#define SWP_OFFSET(x) __swp_offset(x) + +#define KSYMS_START (0x1) +#define PHYS_OFFSET (0x2) +#define VM_L2_64K (0x4) +#define VM_L3_64K (0x8) +#define VM_L3_4K (0x10) +#define KDUMP_ENABLED (0x20) +#define IRQ_STACKS (0x40) +#define NEW_VMEMMAP (0x80) +#define VM_L4_4K (0x100) + +/* + * Get kimage_voffset from /dev/crash + */ +#define DEV_CRASH_ARCH_DATA _IOR('c', 1, unsigned long) + +/* + * sources: Documentation/arm64/memory.txt + * arch/arm64/include/asm/memory.h + * arch/arm64/include/asm/pgtable.h + */ +#define ARM64_VA_START ((0xffffffffffffffffUL) \ + << machdep->machspec->VA_BITS) +#define ARM64_PAGE_OFFSET ((0xffffffffffffffffUL) \ + << (machdep->machspec->VA_BITS - 1)) +#define ARM64_USERSPACE_TOP ((1UL) << machdep->machspec->VA_BITS) + +/* only used for v4.6 or later */ +#define ARM64_MODULES_VSIZE MEGABYTES(128) +#define ARM64_KASAN_SHADOW_SIZE (1UL << (machdep->machspec->VA_BITS - 3)) + +/* + * The following 3 definitions are the original values, but are obsolete + * for 3.17 and later kernels because they are now build-time calculations. + * They all depend on the kernel's new VMEMMAP_SIZE value, which is dependent + * upon the size of struct page. Accordingly, arm64_calc_virtual_memory_ranges() + * determines their values at POST_GDB time. + */ +#define ARM64_VMALLOC_END (ARM64_PAGE_OFFSET - 0x400000000UL - KILOBYTES(64) - 1) +#define ARM64_VMEMMAP_VADDR ((ARM64_VMALLOC_END+1) + KILOBYTES(64)) +#define ARM64_VMEMMAP_END (ARM64_VMEMMAP_VADDR + GIGABYTES(8UL) - 1) + +#define ARM64_STACK_SIZE (16384) + +#define _SECTION_SIZE_BITS 30 +#define _MAX_PHYSMEM_BITS 40 +#define _MAX_PHYSMEM_BITS_3_17 48 + +typedef unsigned long long __u64; +typedef unsigned long long u64; + +struct arm64_user_pt_regs { + __u64 regs[31]; + __u64 sp; + __u64 pc; + __u64 pstate; +}; + +struct arm64_pt_regs { + union { + struct arm64_user_pt_regs user_regs; + struct { + u64 regs[31]; + u64 sp; + u64 pc; + u64 pstate; + }; + }; + u64 orig_x0; + u64 syscallno; +}; + +/* AArch32 CPSR bits */ +#define PSR_MODE32_BIT 0x00000010 + +#define TIF_SIGPENDING (0) +#define display_idt_table() \ + error(FATAL, "-d option is not applicable to ARM64 architecture\n") + +struct machine_specific { + ulong flags; + ulong userspace_top; + ulong page_offset; + ulong vmalloc_start_addr; + ulong vmalloc_end; + ulong vmemmap_vaddr; + ulong vmemmap_end; + ulong modules_vaddr; + ulong modules_end; + ulong phys_offset; + ulong __exception_text_start; + ulong __exception_text_end; + struct arm64_pt_regs *panic_task_regs; + ulong PTE_PROT_NONE; + ulong PTE_FILE; + ulong VA_BITS; + ulong __SWP_TYPE_BITS; + ulong __SWP_TYPE_SHIFT; + ulong __SWP_TYPE_MASK; + ulong __SWP_OFFSET_BITS; + ulong __SWP_OFFSET_SHIFT; + ulong __SWP_OFFSET_MASK; + ulong crash_kexec_start; + ulong crash_kexec_end; + ulong crash_save_cpu_start; + ulong crash_save_cpu_end; + ulong kernel_flags; + ulong irq_stack_size; + ulong *irq_stacks; + char *irq_stackbuf; + ulong __irqentry_text_start; + ulong __irqentry_text_end; + /* for exception vector code */ + ulong exp_entry1_start; + ulong exp_entry1_end; + ulong exp_entry2_start; + ulong exp_entry2_end; + /* only needed for v4.6 or later kernel */ + ulong kimage_voffset; + ulong kimage_text; + ulong kimage_end; +}; + +struct arm64_stackframe { + unsigned long fp; + unsigned long sp; + unsigned long pc; +}; + +#endif /* ARM64 */ + +#ifdef MIPS +#define _32BIT_ +#define MACHINE_TYPE "MIPS" + +#define PAGEBASE(X) (((ulong)(X)) & (ulong)machdep->pagemask) + +#define PTOV(X) ((unsigned long)(X) + 0x80000000lu) +#define VTOP(X) ((unsigned long)(X) & 0x1ffffffflu) + +#define IS_VMALLOC_ADDR(X) (vt->vmalloc_start && (ulong)(X) >= vt->vmalloc_start) + +#define DEFAULT_MODULES_VADDR (machdep->kvbase - 16 * 1024 * 1024) +#define MODULES_VADDR (machdep->machspec->modules_vaddr) +#define MODULES_END (machdep->machspec->modules_end) +#define VMALLOC_START (machdep->machspec->vmalloc_start_addr) +#define VMALLOC_END (machdep->machspec->vmalloc_end) + +#define __SWP_TYPE_SHIFT 3 +#define __SWP_TYPE_BITS 6 +#define __SWP_TYPE_MASK ((1 << __SWP_TYPE_BITS) - 1) +#define __SWP_OFFSET_SHIFT (__SWP_TYPE_BITS + __SWP_TYPE_SHIFT) + +#define SWP_TYPE(entry) (((entry) >> __SWP_TYPE_SHIFT) & __SWP_TYPE_MASK) +#define SWP_OFFSET(entry) ((entry) >> __SWP_OFFSET_SHIFT) + +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#define TIF_SIGPENDING (2) + +#define _SECTION_SIZE_BITS 26 +#define _MAX_PHYSMEM_BITS 32 +#endif /* MIPS */ + +#ifdef X86 +#define _32BIT_ +#define MACHINE_TYPE "X86" +#define PTOV(X) ((unsigned long)(X)+(machdep->kvbase)) +#define VTOP(X) ((unsigned long)(X)-(machdep->kvbase)) +#define IS_VMALLOC_ADDR(X) (vt->vmalloc_start && (ulong)(X) >= vt->vmalloc_start) +#define KVBASE_MASK (0x1ffffff) + +#define PGDIR_SHIFT_2LEVEL (22) +#define PTRS_PER_PTE_2LEVEL (1024) +#define PTRS_PER_PGD_2LEVEL (1024) + +#define PGDIR_SHIFT_3LEVEL (30) +#define PTRS_PER_PTE_3LEVEL (512) +#define PTRS_PER_PGD_3LEVEL (4) +#define PMD_SHIFT (21) /* only used by PAE translators */ +#define PTRS_PER_PMD (512) /* only used by PAE translators */ + +#define _PAGE_PRESENT 0x001 +#define _PAGE_RW 0x002 +#define _PAGE_USER 0x004 +#define _PAGE_PWT 0x008 +#define _PAGE_PCD 0x010 +#define _PAGE_ACCESSED 0x020 +#define _PAGE_DIRTY 0x040 +#define _PAGE_4M 0x080 /* 4 MB page, Pentium+, if present.. */ +#define _PAGE_PSE 0x080 /* 4 MB (or 2MB) page, Pentium+, if present.. */ +#define _PAGE_GLOBAL 0x100 /* Global TLB entry PPro+ */ +#define _PAGE_PROTNONE (machdep->machspec->page_protnone) +#define _PAGE_NX (0x8000000000000000ULL) + +#define NONPAE_PAGEBASE(X) (((unsigned long)(X)) & (unsigned long)machdep->pagemask) +#define NX_BIT_MASK (0x7fffffffffffffffULL) +#define PAE_PAGEBASE(X) (((unsigned long long)(X)) & ((unsigned long long)machdep->pagemask) & NX_BIT_MASK) + +#define SWP_TYPE(entry) (((entry) >> 1) & 0x3f) +#define SWP_OFFSET(entry) ((entry) >> 8) +#define __swp_type_PAE(entry) (((entry) >> 32) & 0x1f) +#define __swp_type_nonPAE(entry) (((entry) >> 1) & 0x1f) +#define __swp_offset_PAE(entry) (((entry) >> 32) >> 5) +#define __swp_offset_nonPAE(entry) ((entry) >> 8) +#define __swp_type(entry) (machdep->flags & PAE ? \ + __swp_type_PAE(entry) : __swp_type_nonPAE(entry)) +#define __swp_offset(entry) (machdep->flags & PAE ? \ + __swp_offset_PAE(entry) : __swp_offset_nonPAE(entry)) + +#define TIF_SIGPENDING (2) + +// CONFIG_X86_PAE +#define _SECTION_SIZE_BITS_PAE_ORIG 30 +#define _SECTION_SIZE_BITS_PAE_2_6_26 29 +#define _MAX_PHYSMEM_BITS_PAE 36 + +// !CONFIG_X86_PAE +#define _SECTION_SIZE_BITS 26 +#define _MAX_PHYSMEM_BITS 32 + +#define IS_LAST_PMD_READ_PAE(pmd) ((ulong)(pmd) == machdep->machspec->last_pmd_read_PAE) +#define IS_LAST_PTBL_READ_PAE(ptbl) ((ulong)(ptbl) == machdep->machspec->last_ptbl_read_PAE) + +#define FILL_PMD_PAE(PMD, TYPE, SIZE) \ + if (!IS_LAST_PMD_READ_PAE(PMD)) { \ + readmem((ulonglong)(PMD), TYPE, machdep->pmd, \ + SIZE, "pmd page", FAULT_ON_ERROR); \ + machdep->machspec->last_pmd_read_PAE = (ulonglong)(PMD); \ + } + +#define FILL_PTBL_PAE(PTBL, TYPE, SIZE) \ + if (!IS_LAST_PTBL_READ_PAE(PTBL)) { \ + readmem((ulonglong)(PTBL), TYPE, machdep->ptbl, \ + SIZE, "page table", FAULT_ON_ERROR); \ + machdep->machspec->last_ptbl_read_PAE = (ulonglong)(PTBL); \ + } + +#endif /* X86 */ + +#ifdef X86_64 +#define _64BIT_ +#define MACHINE_TYPE "X86_64" + +#define USERSPACE_TOP (machdep->machspec->userspace_top) +#define PAGE_OFFSET (machdep->machspec->page_offset) +#define VMALLOC_START (machdep->machspec->vmalloc_start_addr) +#define VMALLOC_END (machdep->machspec->vmalloc_end) +#define VMEMMAP_VADDR (machdep->machspec->vmemmap_vaddr) +#define VMEMMAP_END (machdep->machspec->vmemmap_end) +#define MODULES_VADDR (machdep->machspec->modules_vaddr) +#define MODULES_END (machdep->machspec->modules_end) + +#define __START_KERNEL_map 0xffffffff80000000UL +#define MODULES_LEN (MODULES_END - MODULES_VADDR) + +#define USERSPACE_TOP_ORIG 0x0000008000000000 +#define PAGE_OFFSET_ORIG 0x0000010000000000 +#define VMALLOC_START_ADDR_ORIG 0xffffff0000000000 +#define VMALLOC_END_ORIG 0xffffff7fffffffff +#define MODULES_VADDR_ORIG 0xffffffffa0000000 +#define MODULES_END_ORIG 0xffffffffafffffff + +#define USERSPACE_TOP_2_6_11 0x0000800000000000 +#define PAGE_OFFSET_2_6_11 0xffff810000000000 +#define VMALLOC_START_ADDR_2_6_11 0xffffc20000000000 +#define VMALLOC_END_2_6_11 0xffffe1ffffffffff +#define MODULES_VADDR_2_6_11 0xffffffff88000000 +#define MODULES_END_2_6_11 0xfffffffffff00000 + +#define VMEMMAP_VADDR_2_6_24 0xffffe20000000000 +#define VMEMMAP_END_2_6_24 0xffffe2ffffffffff + +#define MODULES_VADDR_2_6_26 0xffffffffa0000000 + +#define PAGE_OFFSET_2_6_27 0xffff880000000000 +#define MODULES_END_2_6_27 0xffffffffff000000 + +#define USERSPACE_TOP_XEN 0x0000800000000000 +#define PAGE_OFFSET_XEN 0xffff880000000000 +#define VMALLOC_START_ADDR_XEN 0xffffc20000000000 +#define VMALLOC_END_XEN 0xffffe1ffffffffff +#define MODULES_VADDR_XEN 0xffffffff88000000 +#define MODULES_END_XEN 0xfffffffffff00000 + +#define USERSPACE_TOP_XEN_RHEL4 0x0000008000000000 +#define PAGE_OFFSET_XEN_RHEL4 0xffffff8000000000 +#define VMALLOC_START_ADDR_XEN_RHEL4 0xffffff0000000000 +#define VMALLOC_END_XEN_RHEL4 0xffffff7fffffffff +#define MODULES_VADDR_XEN_RHEL4 0xffffffffa0000000 +#define MODULES_END_XEN_RHEL4 0xffffffffafffffff + +#define VMALLOC_START_ADDR_2_6_31 0xffffc90000000000 +#define VMALLOC_END_2_6_31 0xffffe8ffffffffff +#define VMEMMAP_VADDR_2_6_31 0xffffea0000000000 +#define VMEMMAP_END_2_6_31 0xffffeaffffffffff +#define MODULES_VADDR_2_6_31 0xffffffffa0000000 +#define MODULES_END_2_6_31 0xffffffffff000000 + +#define VSYSCALL_START 0xffffffffff600000 +#define VSYSCALL_END 0xffffffffffe00000 + +#define PTOV(X) ((unsigned long)(X)+(machdep->kvbase)) +#define VTOP(X) x86_64_VTOP((ulong)(X)) +#define IS_VMALLOC_ADDR(X) x86_64_IS_VMALLOC_ADDR((ulong)(X)) + +#define PML4_SHIFT 39 +#define PTRS_PER_PML4 512 +#define PGDIR_SHIFT 30 +#define PTRS_PER_PGD 512 +#define PMD_SHIFT 21 +#define PTRS_PER_PMD 512 +#define PTRS_PER_PTE 512 + +#define pml4_index(address) (((address) >> PML4_SHIFT) & (PTRS_PER_PML4-1)) +#define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) +#define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) +#define pte_index(address) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) + +#define IS_LAST_PML4_READ(pml4) ((ulong)(pml4) == machdep->machspec->last_pml4_read) + +#define FILL_PML4() { \ + if (!(pc->flags & RUNTIME) || ACTIVE()) { \ + if (!IS_LAST_PML4_READ(vt->kernel_pgd[0])) \ + readmem(vt->kernel_pgd[0], KVADDR, machdep->machspec->pml4, \ + PAGESIZE(), "init_level4_pgt", FAULT_ON_ERROR); \ + machdep->machspec->last_pml4_read = (ulong)(vt->kernel_pgd[0]); \ + } \ +} + +#define FILL_PML4_HYPER() { \ + if (!machdep->machspec->last_pml4_read) { \ + unsigned long idle_pg_table = \ + symbol_exists("idle_pg_table_4") ? symbol_value("idle_pg_table_4") : \ + symbol_value("idle_pg_table"); \ + readmem(idle_pg_table, KVADDR, \ + machdep->machspec->pml4, PAGESIZE(), "idle_pg_table", \ + FAULT_ON_ERROR); \ + machdep->machspec->last_pml4_read = idle_pg_table; \ + }\ +} + +#define IS_LAST_UPML_READ(pml) ((ulong)(pml) == machdep->machspec->last_upml_read) + +#define FILL_UPML(PML, TYPE, SIZE) \ + if (!IS_LAST_UPML_READ(PML)) { \ + readmem((ulonglong)((ulong)(PML)), TYPE, machdep->machspec->upml, \ + SIZE, "pml page", FAULT_ON_ERROR); \ + machdep->machspec->last_upml_read = (ulong)(PML); \ + } + +/* + * PHYSICAL_PAGE_MASK changed (enlarged) between 2.4 and 2.6, so + * for safety, use the 2.6 values to generate it. + */ +#define __PHYSICAL_MASK_SHIFT 40 +#define __PHYSICAL_MASK ((1UL << __PHYSICAL_MASK_SHIFT) - 1) +#define __VIRTUAL_MASK_SHIFT 48 +#define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1) +#define PAGE_SHIFT 12 +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PHYSICAL_PAGE_MASK (~(PAGE_SIZE-1) & (__PHYSICAL_MASK << PAGE_SHIFT)) + +#define _PAGE_BIT_NX 63 +#define _PAGE_PRESENT 0x001 +#define _PAGE_RW 0x002 +#define _PAGE_USER 0x004 +#define _PAGE_PWT 0x008 +#define _PAGE_PCD 0x010 +#define _PAGE_ACCESSED 0x020 +#define _PAGE_DIRTY 0x040 +#define _PAGE_PSE 0x080 /* 2MB page */ +#define _PAGE_FILE 0x040 /* set:pagecache, unset:swap */ +#define _PAGE_GLOBAL 0x100 /* Global TLB entry */ +#define _PAGE_PROTNONE (machdep->machspec->page_protnone) +#define _PAGE_NX (1UL<<_PAGE_BIT_NX) + +#define SWP_TYPE(entry) (((entry) >> 1) & 0x3f) +#define SWP_OFFSET(entry) ((entry) >> 8) +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#define TIF_SIGPENDING (2) + +#define PAGEBASE(X) (((ulong)(X)) & (ulong)machdep->pagemask) + +#define _CPU_PDA_READ2(CPU, BUFFER) \ + ((readmem(symbol_value("_cpu_pda"), \ + KVADDR, &cpu_pda_addr, sizeof(unsigned long), \ + "_cpu_pda addr", RETURN_ON_ERROR)) && \ + (readmem(cpu_pda_addr + ((CPU) * sizeof(void *)), \ + KVADDR, &cpu_pda_addr, sizeof(unsigned long), \ + "_cpu_pda addr", RETURN_ON_ERROR)) && \ + (cpu_pda_addr) && \ + (readmem(cpu_pda_addr, KVADDR, (BUFFER), SIZE(x8664_pda), \ + "cpu_pda entry", RETURN_ON_ERROR))) + +#define _CPU_PDA_READ(CPU, BUFFER) \ + ((STRNEQ("_cpu_pda", closest_symbol((symbol_value("_cpu_pda") + \ + ((CPU) * sizeof(unsigned long)))))) && \ + (readmem(symbol_value("_cpu_pda") + ((CPU) * sizeof(void *)), \ + KVADDR, &cpu_pda_addr, sizeof(unsigned long), \ + "_cpu_pda addr", RETURN_ON_ERROR)) && \ + (readmem(cpu_pda_addr, KVADDR, (BUFFER), SIZE(x8664_pda), \ + "cpu_pda entry", RETURN_ON_ERROR))) + +#define CPU_PDA_READ(CPU, BUFFER) \ + (STRNEQ("cpu_pda", closest_symbol((symbol_value("cpu_pda") + \ + ((CPU) * SIZE(x8664_pda))))) && \ + readmem(symbol_value("cpu_pda") + ((CPU) * SIZE(x8664_pda)), \ + KVADDR, (BUFFER), SIZE(x8664_pda), "cpu_pda entry", \ + RETURN_ON_ERROR)) + +#define VALID_LEVEL4_PGT_ADDR(X) \ + (((X) == VIRTPAGEBASE(X)) && IS_KVADDR(X) && !IS_VMALLOC_ADDR(X)) + +#define _SECTION_SIZE_BITS 27 +#define _MAX_PHYSMEM_BITS 40 +#define _MAX_PHYSMEM_BITS_2_6_26 44 +#define _MAX_PHYSMEM_BITS_2_6_31 46 + +#endif /* X86_64 */ + +#ifdef ALPHA +#define _64BIT_ +#define MACHINE_TYPE "ALPHA" + +#define PAGEBASE(X) (((unsigned long)(X)) & (unsigned long)machdep->pagemask) + +#define PTOV(X) ((unsigned long)(X)+(machdep->kvbase)) +#define VTOP(X) ((unsigned long)(X)-(machdep->kvbase)) +#define IS_VMALLOC_ADDR(X) (vt->vmalloc_start && (ulong)(X) >= vt->vmalloc_start) +#define KSEG_BASE_48_BIT (0xffff800000000000) +#define KSEG_BASE (0xfffffc0000000000) +#define _PFN_MASK (0xFFFFFFFF00000000) +#define VMALLOC_START (0xFFFFFE0000000000) +#define MIN_SYMBOL_VALUE (KSEG_BASE_48_BIT) + +#define PGDIR_SHIFT (PAGESHIFT() + 2*(PAGESHIFT()-3)) +#define PMD_SHIFT (PAGESHIFT() + (PAGESHIFT()-3)) +#define PTRS_PER_PAGE (1024) + +#define PTRS_PER_PGD (1UL << (PAGESHIFT()-3)) + +/* + * OSF/1 PAL-code-imposed page table bits + */ +#define _PAGE_VALID 0x0001 +#define _PAGE_FOR 0x0002 /* used for page protection (fault on read) */ +#define _PAGE_FOW 0x0004 /* used for page protection (fault on write) */ +#define _PAGE_FOE 0x0008 /* used for page protection (fault on exec) */ +#define _PAGE_ASM 0x0010 +#define _PAGE_KRE 0x0100 /* xxx - see below on the "accessed" bit */ +#define _PAGE_URE 0x0200 /* xxx */ +#define _PAGE_KWE 0x1000 /* used to do the dirty bit in software */ +#define _PAGE_UWE 0x2000 /* used to do the dirty bit in software */ + +/* .. and these are ours ... */ +#define _PAGE_DIRTY 0x20000 +#define _PAGE_ACCESSED 0x40000 + +#define SWP_TYPE(entry) (((entry) >> 32) & 0xff) +#define SWP_OFFSET(entry) ((entry) >> 40) +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#define TIF_SIGPENDING (2) + +#endif /* ALPHA */ + +#ifdef PPC +#define _32BIT_ +#define MACHINE_TYPE "PPC" + +#define PAGEBASE(X) ((X) & machdep->pagemask) + +#define PTOV(X) ((unsigned long)(X)+(machdep->kvbase)) +#define VTOP(X) ((unsigned long)(X)-(machdep->kvbase)) +#define IS_VMALLOC_ADDR(X) (vt->vmalloc_start && (ulong)(X) >= vt->vmalloc_start) + +/* Holds the platform specific info for page translation */ +struct machine_specific { + char *platform; + + /* page address translation bits */ + int pte_size; + int pte_rpn_shift; + + /* page flags */ + ulong _page_present; + ulong _page_user; + ulong _page_rw; + ulong _page_guarded; + ulong _page_coherent; + ulong _page_no_cache; + ulong _page_writethru; + ulong _page_dirty; + ulong _page_accessed; + ulong _page_hwwrite; + ulong _page_shared; + ulong _page_k_rw; + + /* platform special vtop */ + int (*vtop_special)(ulong vaddr, physaddr_t *paddr, int verbose); + void *mmu_special; +}; + +/* machdep flags for ppc32 specific */ +#define IS_PAE() (machdep->flags & PAE) +#define IS_BOOKE() (machdep->flags & CPU_BOOKE) +/* Page translation bits */ +#define PPC_PLATFORM (machdep->machspec->platform) +#define PTE_SIZE (machdep->machspec->pte_size) +#define PTE_RPN_SHIFT (machdep->machspec->pte_rpn_shift) +#define PAGE_SHIFT (12) +#define PTE_T_LOG2 (ffs(PTE_SIZE) - 1) +#define PTE_SHIFT (PAGE_SHIFT - PTE_T_LOG2) +#define PGDIR_SHIFT (PAGE_SHIFT + PTE_SHIFT) +#define PTRS_PER_PGD (1 << (32 - PGDIR_SHIFT)) +#define PTRS_PER_PTE (1 << PTE_SHIFT) +/* special vtop */ +#define VTOP_SPECIAL (machdep->machspec->vtop_special) +#define MMU_SPECIAL (machdep->machspec->mmu_special) + +/* PFN shifts */ +#define BOOKE3E_PTE_RPN_SHIFT (24) + +/* PAGE flags */ +#define _PAGE_PRESENT (machdep->machspec->_page_present) /* software: pte contains a translation */ +#define _PAGE_USER (machdep->machspec->_page_user) /* matches one of the PP bits */ +#define _PAGE_RW (machdep->machspec->_page_rw) /* software: user write access allowed */ +#define _PAGE_GUARDED (machdep->machspec->_page_guarded) +#define _PAGE_COHERENT (machdep->machspec->_page_coherent /* M: enforce memory coherence (SMP systems) */) +#define _PAGE_NO_CACHE (machdep->machspec->_page_no_cache) /* I: cache inhibit */ +#define _PAGE_WRITETHRU (machdep->machspec->_page_writethru) /* W: cache write-through */ +#define _PAGE_DIRTY (machdep->machspec->_page_dirty) /* C: page changed */ +#define _PAGE_ACCESSED (machdep->machspec->_page_accessed) /* R: page referenced */ +#define _PAGE_HWWRITE (machdep->machspec->_page_hwwrite) /* software: _PAGE_RW & _PAGE_DIRTY */ +#define _PAGE_SHARED (machdep->machspec->_page_shared) +#define _PAGE_K_RW (machdep->machspec->_page_k_rw) /* privilege only write access allowed */ + +/* Default values for PAGE flags */ +#define DEFAULT_PAGE_PRESENT 0x001 +#define DEFAULT_PAGE_USER 0x002 +#define DEFAULT_PAGE_RW 0x004 +#define DEFAULT_PAGE_GUARDED 0x008 +#define DEFAULT_PAGE_COHERENT 0x010 +#define DEFAULT_PAGE_NO_CACHE 0x020 +#define DEFAULT_PAGE_WRITETHRU 0x040 +#define DEFAULT_PAGE_DIRTY 0x080 +#define DEFAULT_PAGE_ACCESSED 0x100 +#define DEFAULT_PAGE_HWWRITE 0x200 +#define DEFAULT_PAGE_SHARED 0 + +/* PPC44x PAGE flags: Values from kernel asm/pte-44x.h */ +#define PPC44x_PAGE_PRESENT 0x001 +#define PPC44x_PAGE_RW 0x002 +#define PPC44x_PAGE_ACCESSED 0x008 +#define PPC44x_PAGE_DIRTY 0x010 +#define PPC44x_PAGE_USER 0x040 +#define PPC44x_PAGE_GUARDED 0x100 +#define PPC44x_PAGE_COHERENT 0x200 +#define PPC44x_PAGE_NO_CACHE 0x400 +#define PPC44x_PAGE_WRITETHRU 0x800 +#define PPC44x_PAGE_HWWRITE 0 +#define PPC44x_PAGE_SHARED 0 + +/* BOOK3E */ +#define BOOK3E_PAGE_PRESENT 0x000001 +#define BOOK3E_PAGE_BAP_SR 0x000004 +#define BOOK3E_PAGE_BAP_UR 0x000008 /* User Readable */ +#define BOOK3E_PAGE_BAP_SW 0x000010 +#define BOOK3E_PAGE_BAP_UW 0x000020 /* User Writable */ +#define BOOK3E_PAGE_DIRTY 0x001000 +#define BOOK3E_PAGE_ACCESSED 0x040000 +#define BOOK3E_PAGE_GUARDED 0x100000 +#define BOOK3E_PAGE_COHERENT 0x200000 +#define BOOK3E_PAGE_NO_CACHE 0x400000 +#define BOOK3E_PAGE_WRITETHRU 0x800000 +#define BOOK3E_PAGE_HWWRITE 0 +#define BOOK3E_PAGE_SHARED 0 +#define BOOK3E_PAGE_USER (BOOK3E_PAGE_BAP_SR | BOOK3E_PAGE_BAP_UR) +#define BOOK3E_PAGE_RW (BOOK3E_PAGE_BAP_SW | BOOK3E_PAGE_BAP_UW) +#define BOOK3E_PAGE_KERNEL_RW (BOOK3E_PAGE_BAP_SW | BOOK3E_PAGE_BAP_SR | BOOK3E_PAGE_DIRTY) + +/* FSL BOOKE */ +#define FSL_BOOKE_PAGE_PRESENT 0x00001 +#define FSL_BOOKE_PAGE_USER 0x00002 +#define FSL_BOOKE_PAGE_RW 0x00004 +#define FSL_BOOKE_PAGE_DIRTY 0x00008 +#define FSL_BOOKE_PAGE_ACCESSED 0x00020 +#define FSL_BOOKE_PAGE_GUARDED 0x00080 +#define FSL_BOOKE_PAGE_COHERENT 0x00100 +#define FSL_BOOKE_PAGE_NO_CACHE 0x00200 +#define FSL_BOOKE_PAGE_WRITETHRU 0x00400 +#define FSL_BOOKE_PAGE_HWWRITE 0 +#define FSL_BOOKE_PAGE_SHARED 0 + +#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f) +#define SWP_OFFSET(entry) ((entry) >> 8) +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#define TIF_SIGPENDING (2) + +#define _SECTION_SIZE_BITS 24 +#define _MAX_PHYSMEM_BITS 44 + +#define STACK_FRAME_OVERHEAD 16 +#define STACK_FRAME_LR_SAVE (sizeof(ulong)) +#define STACK_FRAME_MARKER (2 * sizeof(ulong)) +#define STACK_FRAME_REGS_MARKER 0x72656773 +#define PPC_STACK_SIZE 8192 + +#endif /* PPC */ + +#ifdef IA64 +#define _64BIT_ +#define MACHINE_TYPE "IA64" + +#define PAGEBASE(X) (((unsigned long)(X)) & (unsigned long)machdep->pagemask) + +#define REGION_SHIFT (61) +#define VADDR_REGION(X) ((ulong)(X) >> REGION_SHIFT) + +#define KERNEL_CACHED_REGION (7) +#define KERNEL_UNCACHED_REGION (6) +#define KERNEL_VMALLOC_REGION (5) +#define USER_STACK_REGION (4) +#define USER_DATA_REGION (3) +#define USER_TEXT_REGION (2) +#define USER_SHMEM_REGION (1) +#define USER_IA32_EMUL_REGION (0) + +#define KERNEL_VMALLOC_BASE ((ulong)KERNEL_VMALLOC_REGION << REGION_SHIFT) +#define KERNEL_UNCACHED_BASE ((ulong)KERNEL_UNCACHED_REGION << REGION_SHIFT) +#define KERNEL_CACHED_BASE ((ulong)KERNEL_CACHED_REGION << REGION_SHIFT) + +#define _SECTION_SIZE_BITS 30 +#define _MAX_PHYSMEM_BITS 50 + +/* + * As of 2.6, these are no longer straight forward. + */ +#define PTOV(X) ia64_PTOV((ulong)(X)) +#define VTOP(X) ia64_VTOP((ulong)(X)) +#define IS_VMALLOC_ADDR(X) ia64_IS_VMALLOC_ADDR((ulong)(X)) + +#define SWITCH_STACK_ADDR(X) (ia64_get_switch_stack((ulong)(X))) + +#define __IA64_UL(x) ((unsigned long)(x)) +#define IA64_MAX_PHYS_BITS (50) /* max # of phys address bits (architected) */ + +/* + * How many pointers will a page table level hold expressed in shift + */ +#define PTRS_PER_PTD_SHIFT (PAGESHIFT()-3) + +/* + * Definitions for fourth level: + */ +#define PTRS_PER_PTE (__IA64_UL(1) << (PTRS_PER_PTD_SHIFT)) + +/* + * Definitions for third level: + * + * PMD_SHIFT determines the size of the area a third-level page table + * can map. + */ +#define PMD_SHIFT (PAGESHIFT() + (PTRS_PER_PTD_SHIFT)) +#define PMD_SIZE (1UL << PMD_SHIFT) +#define PMD_MASK (~(PMD_SIZE-1)) +#define PTRS_PER_PMD (1UL << (PTRS_PER_PTD_SHIFT)) + +/* + * PUD_SHIFT determines the size of the area a second-level page table + * can map + */ +#define PUD_SHIFT (PMD_SHIFT + (PTRS_PER_PTD_SHIFT)) +#define PUD_SIZE (1UL << PUD_SHIFT) +#define PUD_MASK (~(PUD_SIZE-1)) +#define PTRS_PER_PUD (1UL << (PTRS_PER_PTD_SHIFT)) + +/* + * Definitions for first level: + * + * PGDIR_SHIFT determines what a first-level page table entry can map. + */ + +#define PGDIR_SHIFT_4L (PUD_SHIFT + (PTRS_PER_PTD_SHIFT)) +#define PGDIR_SHIFT_3L (PMD_SHIFT + (PTRS_PER_PTD_SHIFT)) +/* Turns out 4L & 3L PGDIR_SHIFT are the same (for now) */ +#define PGDIR_SHIFT PGDIR_SHIFT_4L +#define PGDIR_SIZE (__IA64_UL(1) << PGDIR_SHIFT) +#define PGDIR_MASK (~(PGDIR_SIZE-1)) +#define PTRS_PER_PGD_SHIFT PTRS_PER_PTD_SHIFT +#define PTRS_PER_PGD (1UL << PTRS_PER_PGD_SHIFT) +#define USER_PTRS_PER_PGD (5*PTRS_PER_PGD/8) /* regions 0-4 are user regions */ +#define FIRST_USER_ADDRESS 0 + +/* + * First, define the various bits in a PTE. Note that the PTE format + * matches the VHPT short format, the firt doubleword of the VHPD long + * format, and the first doubleword of the TLB insertion format. + */ +#define _PAGE_P (1 << 0) /* page present bit */ +#define _PAGE_MA_WB (0x0 << 2) /* write back memory attribute */ +#define _PAGE_MA_UC (0x4 << 2) /* uncacheable memory attribute */ +#define _PAGE_MA_UCE (0x5 << 2) /* UC exported attribute */ +#define _PAGE_MA_WC (0x6 << 2) /* write coalescing memory attribute */ +#define _PAGE_MA_NAT (0x7 << 2) /* not-a-thing attribute */ +#define _PAGE_MA_MASK (0x7 << 2) +#define _PAGE_PL_0 (0 << 7) /* privilege level 0 (kernel) */ +#define _PAGE_PL_1 (1 << 7) /* privilege level 1 (unused) */ +#define _PAGE_PL_2 (2 << 7) /* privilege level 2 (unused) */ +#define _PAGE_PL_3 (3 << 7) /* privilege level 3 (user) */ +#define _PAGE_PL_MASK (3 << 7) +#define _PAGE_AR_R (0 << 9) /* read only */ +#define _PAGE_AR_RX (1 << 9) /* read & execute */ +#define _PAGE_AR_RW (2 << 9) /* read & write */ +#define _PAGE_AR_RWX (3 << 9) /* read, write & execute */ +#define _PAGE_AR_R_RW (4 << 9) /* read / read & write */ +#define _PAGE_AR_RX_RWX (5 << 9) /* read & exec / read, write & exec */ +#define _PAGE_AR_RWX_RW (6 << 9) /* read, write & exec / read & write */ +#define _PAGE_AR_X_RX (7 << 9) /* exec & promote / read & exec */ +#define _PAGE_AR_MASK (7 << 9) +#define _PAGE_AR_SHIFT 9 +#define _PAGE_A (1 << 5) /* page accessed bit */ +#define _PAGE_D (1 << 6) /* page dirty bit */ +#define _PAGE_PPN_MASK (((__IA64_UL(1) << IA64_MAX_PHYS_BITS) - 1) & ~0xfffUL) +#define _PAGE_ED (__IA64_UL(1) << 52) /* exception deferral */ +#define _PAGE_PROTNONE (__IA64_UL(1) << 63) + +#define _PFN_MASK _PAGE_PPN_MASK +#define _PAGE_CHG_MASK (_PFN_MASK | _PAGE_A | _PAGE_D) + +#define _PAGE_SIZE_4K 12 +#define _PAGE_SIZE_8K 13 +#define _PAGE_SIZE_16K 14 +#define _PAGE_SIZE_64K 16 +#define _PAGE_SIZE_256K 18 +#define _PAGE_SIZE_1M 20 +#define _PAGE_SIZE_4M 22 +#define _PAGE_SIZE_16M 24 +#define _PAGE_SIZE_64M 26 +#define _PAGE_SIZE_256M 28 + +#define __ACCESS_BITS _PAGE_ED | _PAGE_A | _PAGE_P | _PAGE_MA_WB +#define __DIRTY_BITS_NO_ED _PAGE_A | _PAGE_P | _PAGE_D | _PAGE_MA_WB +#define __DIRTY_BITS _PAGE_ED | __DIRTY_BITS_NO_ED + +#define EFI_PAGE_SHIFT (12) + +/* + * NOTE: #include'ing creates too many compiler problems, so + * this stuff is hardwired here; it's probably etched in stone somewhere. + */ +struct efi_memory_desc_t { + uint32_t type; + uint32_t pad; + uint64_t phys_addr; + uint64_t virt_addr; + uint64_t num_pages; + uint64_t attribute; +} desc; + +/* Memory types: */ +#define EFI_RESERVED_TYPE 0 +#define EFI_LOADER_CODE 1 +#define EFI_LOADER_DATA 2 +#define EFI_BOOT_SERVICES_CODE 3 +#define EFI_BOOT_SERVICES_DATA 4 +#define EFI_RUNTIME_SERVICES_CODE 5 +#define EFI_RUNTIME_SERVICES_DATA 6 +#define EFI_CONVENTIONAL_MEMORY 7 +#define EFI_UNUSABLE_MEMORY 8 +#define EFI_ACPI_RECLAIM_MEMORY 9 +#define EFI_ACPI_MEMORY_NVS 10 +#define EFI_MEMORY_MAPPED_IO 11 +#define EFI_MEMORY_MAPPED_IO_PORT_SPACE 12 +#define EFI_PAL_CODE 13 +#define EFI_MAX_MEMORY_TYPE 14 + +/* Attribute values: */ +#define EFI_MEMORY_UC 0x0000000000000001 /* uncached */ +#define EFI_MEMORY_WC 0x0000000000000002 /* write-coalescing */ +#define EFI_MEMORY_WT 0x0000000000000004 /* write-through */ +#define EFI_MEMORY_WB 0x0000000000000008 /* write-back */ +#define EFI_MEMORY_WP 0x0000000000001000 /* write-protect */ +#define EFI_MEMORY_RP 0x0000000000002000 /* read-protect */ +#define EFI_MEMORY_XP 0x0000000000004000 /* execute-protect */ +#define EFI_MEMORY_RUNTIME 0x8000000000000000 /* range requires runtime mapping */ + +#define SWP_TYPE(entry) (((entry) >> 1) & 0xff) +#define SWP_OFFSET(entry) ((entry) >> 9) +#define __swp_type(entry) ((entry >> 2) & 0x7f) +#define __swp_offset(entry) ((entry << 1) >> 10) + +#define TIF_SIGPENDING (1) + +#define KERNEL_TR_PAGE_SIZE (1 << _PAGE_SIZE_64M) +#define KERNEL_TR_PAGE_MASK (~(KERNEL_TR_PAGE_SIZE - 1)) + +#define UNKNOWN_PHYS_START ((ulong)(-1)) +#define DEFAULT_PHYS_START (KERNEL_TR_PAGE_SIZE * 1) + +#define IA64_GET_STACK_ULONG(OFF) \ + ((INSTACK(OFF,bt)) ? (GET_STACK_ULONG(OFF)) : get_init_stack_ulong((unsigned long)OFF)) + +#endif /* IA64 */ + +#ifdef PPC64 +#define _64BIT_ +#define MACHINE_TYPE "PPC64" + +#define PPC64_64K_PAGE_SIZE 65536 +#define PPC64_STACK_SIZE 16384 + +#define PAGEBASE(X) (((ulong)(X)) & (ulong)machdep->pagemask) + +#define PTOV(X) ((unsigned long)(X)+(machdep->identity_map_base)) +#define VTOP(X) ((unsigned long)(X)-(machdep->identity_map_base)) +#define BOOK3E_VMBASE 0x8000000000000000 +#define IS_VMALLOC_ADDR(X) machdep->machspec->is_vmaddr(X) +#define KERNELBASE machdep->pageoffset + +#define PGDIR_SHIFT (machdep->pageshift + (machdep->pageshift -3) + (machdep->pageshift - 2)) +#define PMD_SHIFT (machdep->pageshift + (machdep->pageshift - 3)) + +#define PGD_MASK (~((1UL << PGDIR_SHIFT) - 1)) +#define PMD_MASK (~((1UL << PMD_SHIFT) - 1)) + +/* shift to put page number into pte */ +#define PTE_RPN_SHIFT_DEFAULT 16 +#define PMD_TO_PTEPAGE_SHIFT 2 /* Used for 2.6 or later */ + +#define PTE_INDEX_SIZE 9 +#define PMD_INDEX_SIZE 10 +#define PGD_INDEX_SIZE 10 + +#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE) +#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE) +#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE) + +#define PGD_OFFSET_24(vaddr) ((vaddr >> PGDIR_SHIFT) & (PTRS_PER_PGD - 1)) +#define PGD_OFFSET(vaddr) ((vaddr >> PGDIR_SHIFT) & 0x7ff) +#define PMD_OFFSET(vaddr) ((vaddr >> PMD_SHIFT) & (PTRS_PER_PMD - 1)) + +/* 4-level page table support */ + +/* 4K pagesize */ +#define PTE_INDEX_SIZE_L4_4K 9 +#define PMD_INDEX_SIZE_L4_4K 7 +#define PUD_INDEX_SIZE_L4_4K 7 +#define PGD_INDEX_SIZE_L4_4K 9 +#define PUD_INDEX_SIZE_L4_4K_3_7 9 +#define PTE_INDEX_SIZE_RADIX_4K 9 +#define PMD_INDEX_SIZE_RADIX_4K 9 +#define PUD_INDEX_SIZE_RADIX_4K 9 +#define PGD_INDEX_SIZE_RADIX_4K 13 +#define PTE_RPN_SHIFT_L4_4K 17 +#define PTE_RPN_SHIFT_L4_4K_4_5 18 +#define PGD_MASKED_BITS_4K 0 +#define PUD_MASKED_BITS_4K 0 +#define PMD_MASKED_BITS_4K 0 + +/* 64K pagesize */ +#define PTE_INDEX_SIZE_L4_64K 12 +#define PMD_INDEX_SIZE_L4_64K 12 +#define PUD_INDEX_SIZE_L4_64K 0 +#define PGD_INDEX_SIZE_L4_64K 4 +#define PTE_INDEX_SIZE_L4_64K_3_10 8 +#define PMD_INDEX_SIZE_L4_64K_3_10 10 +#define PGD_INDEX_SIZE_L4_64K_3_10 12 +#define PMD_INDEX_SIZE_L4_64K_4_6 5 +#define PUD_INDEX_SIZE_L4_64K_4_6 5 +#define PTE_INDEX_SIZE_RADIX_64K 5 +#define PMD_INDEX_SIZE_RADIX_64K 9 +#define PUD_INDEX_SIZE_RADIX_64K 9 +#define PGD_INDEX_SIZE_RADIX_64K 13 +#define PTE_RPN_SHIFT_L4_64K_V1 32 +#define PTE_RPN_SHIFT_L4_64K_V2 30 +#define PTE_RPN_SHIFT_L4_BOOK3E_64K 28 +#define PTE_RPN_SHIFT_L4_BOOK3E_4K 24 +#define PGD_MASKED_BITS_64K 0 +#define PUD_MASKED_BITS_64K 0x1ff +#define PMD_MASKED_BITS_64K 0x1ff +#define PMD_MASKED_BITS_64K_3_11 0xfff +#define PMD_MASKED_BITS_BOOK3E_64K_4_5 0x7ff +#define PGD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL +#define PUD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL +#define PMD_MASKED_BITS_64K_4_6 0xc0000000000000ffUL + +#define PTE_RPN_MASK_DEFAULT 0xffffffffffffffffUL +#define PTE_RPN_SIZE_L4_4_6 (PAGESIZE() == PPC64_64K_PAGE_SIZE ? 41 : 45) +#define PTE_RPN_MASK_L4_4_6 (((1UL << PTE_RPN_SIZE_L4_4_6) - 1) << PAGESHIFT()) +#define PTE_RPN_SHIFT_L4_4_6 PAGESHIFT() + +#define PGD_MASKED_BITS_4_7 0xc0000000000000ffUL +#define PUD_MASKED_BITS_4_7 0xc0000000000000ffUL +#define PMD_MASKED_BITS_4_7 0xc0000000000000ffUL + +#define PD_HUGE 0x8000000000000000 +#define HUGE_PTE_MASK 0x03 +#define HUGEPD_SHIFT_MASK 0x3f +#define HUGEPD_ADDR_MASK (0x0fffffffffffffffUL & ~HUGEPD_SHIFT_MASK) + +#define PGD_MASK_L4 \ + (THIS_KERNEL_VERSION >= LINUX(3,10,0) ? (machdep->ptrs_per_pgd - 1) : 0x1ff) + +#define PGD_OFFSET_L4(vaddr) \ + ((vaddr >> (machdep->machspec->l4_shift)) & PGD_MASK_L4) + +#define PUD_OFFSET_L4(vaddr) \ + ((vaddr >> (machdep->machspec->l3_shift)) & (machdep->machspec->ptrs_per_l3 - 1)) + +#define PMD_OFFSET_L4(vaddr) \ + ((vaddr >> (machdep->machspec->l2_shift)) & (machdep->machspec->ptrs_per_l2 - 1)) + +#define _PAGE_PTE (machdep->machspec->_page_pte) /* distinguishes PTEs from pointers */ +#define _PAGE_PRESENT (machdep->machspec->_page_present) /* software: pte contains a translation */ +#define _PAGE_USER (machdep->machspec->_page_user) /* matches one of the PP bits */ +#define _PAGE_RW (machdep->machspec->_page_rw) /* software: user write access allowed */ +#define _PAGE_GUARDED (machdep->machspec->_page_guarded) +#define _PAGE_COHERENT (machdep->machspec->_page_coherent /* M: enforce memory coherence (SMP systems) */) +#define _PAGE_NO_CACHE (machdep->machspec->_page_no_cache) /* I: cache inhibit */ +#define _PAGE_WRITETHRU (machdep->machspec->_page_writethru) /* W: cache write-through */ +#define _PAGE_DIRTY (machdep->machspec->_page_dirty) /* C: page changed */ +#define _PAGE_ACCESSED (machdep->machspec->_page_accessed) /* R: page referenced */ + +#define PTE_RPN_MASK (machdep->machspec->pte_rpn_mask) +#define PTE_RPN_SHIFT (machdep->machspec->pte_rpn_shift) + +#define TIF_SIGPENDING (2) + +#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f) +#define SWP_OFFSET(entry) ((entry) >> 8) +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#define MSR_PR_LG 14 /* Problem State / Privilege Level */ + /* Used to find the user or kernel-mode frame*/ + +#define STACK_FRAME_OVERHEAD 112 +#define EXCP_FRAME_MARKER 0x7265677368657265 + +#define _SECTION_SIZE_BITS 24 +#define _MAX_PHYSMEM_BITS 44 +#define _MAX_PHYSMEM_BITS_3_7 46 + +#endif /* PPC64 */ + +#ifdef S390 +#define _32BIT_ +#define MACHINE_TYPE "S390" + +#define PTOV(X) ((unsigned long)(X)+(machdep->kvbase)) +#define VTOP(X) ((unsigned long)(X)-(machdep->kvbase)) +#define IS_VMALLOC_ADDR(X) (vt->vmalloc_start && (ulong)(X) >= vt->vmalloc_start) + +#define PTRS_PER_PTE 1024 +#define PTRS_PER_PMD 1 +#define PTRS_PER_PGD 512 +#define SEGMENT_TABLE_SIZE ((sizeof(ulong)*4) * PTRS_PER_PGD) + +#define SWP_TYPE(entry) (((entry) >> 2) & 0x1f) +#define SWP_OFFSET(entry) ((((entry) >> 11) & 0xfffffffe) | \ + (((entry) >> 7) & 0x1)) +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#define TIF_SIGPENDING (2) + +#define _SECTION_SIZE_BITS 25 +#define _MAX_PHYSMEM_BITS 31 + +#endif /* S390 */ + +#ifdef S390X +#define _64BIT_ +#define MACHINE_TYPE "S390X" + +#define PTOV(X) ((unsigned long)(X)+(machdep->kvbase)) +#define VTOP(X) ((unsigned long)(X)-(machdep->kvbase)) +#define IS_VMALLOC_ADDR(X) (vt->vmalloc_start && (ulong)(X) >= vt->vmalloc_start) +#define PTRS_PER_PTE 512 +#define PTRS_PER_PMD 1024 +#define PTRS_PER_PGD 2048 +#define SEGMENT_TABLE_SIZE ((sizeof(ulong)*2) * PTRS_PER_PMD) + +#define SWP_TYPE(entry) (((entry) >> 2) & 0x1f) +#define SWP_OFFSET(entry) ((((entry) >> 11) & 0xfffffffffffffffe) | \ + (((entry) >> 7) & 0x1)) +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#define TIF_SIGPENDING (2) + +#define _SECTION_SIZE_BITS 28 +#define _MAX_PHYSMEM_BITS_OLD 42 +#define _MAX_PHYSMEM_BITS_NEW 46 + +#endif /* S390X */ + +#ifdef SPARC64 +#define _64BIT_ +#define MACHINE_TYPE "SPARC64" + +#define PTOV(X) \ + ((unsigned long)(X) + machdep->machspec->page_offset) +#define VTOP(X) \ + ((unsigned long)(X) - machdep->machspec->page_offset) + +#define PAGE_OFFSET (machdep->machspec->page_offset) + +extern int sparc64_IS_VMALLOC_ADDR(ulong vaddr); +#define IS_VMALLOC_ADDR(X) sparc64_IS_VMALLOC_ADDR((ulong)(X)) +#define PAGE_SHIFT (13) +#define PAGE_SIZE (1UL << PAGE_SHIFT) +#define PAGE_MASK (~(PAGE_SIZE - 1)) +#define PAGEBASE(X) (((ulong)(X)) & (ulong)machdep->pagemask) +#define THREAD_SIZE (2 * PAGE_SIZE) + +/* S3 Core + * Core 48-bit physical address supported. + * Bit 47 distinguishes memory or I/O. When set to "1" it is I/O. + */ +#define PHYS_MASK_SHIFT (47) +#define PHYS_MASK (((1UL) << PHYS_MASK_SHIFT) - 1) + +typedef signed int s32; + +/* + * This next two defines are convenience defines for normal page table. + */ +#define PTES_PER_PAGE (1UL << (PAGE_SHIFT - 3)) +#define PTES_PER_PAGE_MASK (PTES_PER_PAGE - 1) + +/* 4-level page table */ +#define PMD_SHIFT (PAGE_SHIFT + (PAGE_SHIFT-3)) +#define PMD_SIZE (1UL << PMD_SHIFT) +#define PMD_MASK (~(PMD_SIZE - 1)) +#define PMD_BITS (PAGE_SHIFT - 3) + +#define PUD_SHIFT (PMD_SHIFT + PMD_BITS) +#define PUD_SIZE (1UL << PUD_SHIFT) +#define PUD_MASK (~(PUD_SIZE - 1)) +#define PUD_BITS (PAGE_SHIFT - 3) + +#define PGDIR_SHIFT (PUD_SHIFT + PUD_BITS) +#define PGDIR_SIZE (1UL << PGDIR_SHIFT) +#define PGDIR_MASK (~(PGDIR_SIZE - 1)) +#define PGDIR_BITS (PAGE_SHIFT - 3) + +#define PTRS_PER_PTE (1UL << (PAGE_SHIFT - 3)) +#define PTRS_PER_PMD (1UL << PMD_BITS) +#define PTRS_PER_PUD (1UL << PUD_BITS) +#define PTRS_PER_PGD (1UL << PGDIR_BITS) + +#define HPAGE_SHIFT (23) +/* Down one huge page */ +#define SPARC64_USERSPACE_TOP (-(1UL << HPAGE_SHIFT)) +#define PAGE_PMD_HUGE (0x0100000000000000UL) + +/* These are for SUN4V. */ +#define _PAGE_VALID (0x8000000000000000UL) +#define _PAGE_NFO_4V (0x4000000000000000UL) +#define _PAGE_MODIFIED_4V (0x2000000000000000UL) +#define _PAGE_ACCESSED_4V (0x1000000000000000UL) +#define _PAGE_READ_4V (0x0800000000000000UL) +#define _PAGE_WRITE_4V (0x0400000000000000UL) +#define _PAGE_PADDR_4V (0x00FFFFFFFFFFE000UL) +#define _PAGE_PFN_MASK (_PAGE_PADDR_4V) +#define _PAGE_P_4V (0x0000000000000100UL) +#define _PAGE_EXEC_4V (0x0000000000000080UL) +#define _PAGE_W_4V (0x0000000000000040UL) +#define _PAGE_PRESENT_4V (0x0000000000000010UL) +#define _PAGE_SZALL_4V (0x0000000000000007UL) +/* There are other page sizes. Some supported. */ +#define _PAGE_SZ4MB_4V (0x0000000000000003UL) +#define _PAGE_SZ512K_4V (0x0000000000000002UL) +#define _PAGE_SZ64K_4V (0x0000000000000001UL) +#define _PAGE_SZ8K_4V (0x0000000000000000UL) + +#define SPARC64_MODULES_VADDR (0x0000000010000000UL) +#define SPARC64_MODULES_END (0x00000000f0000000UL) +#define SPARC64_VMALLOC_START (0x0000000100000000UL) + +#define SPARC64_STACK_SIZE 0x4000 + +/* sparsemem */ +#define _SECTION_SIZE_BITS 30 +#define _MAX_PHYSMEM_BITS 53 + +#define STACK_BIAS 2047 + +struct machine_specific { + ulong page_offset; + ulong vmalloc_end; +}; + +#define TIF_SIGPENDING (2) +#define SWP_OFFSET(E) ((E) >> (PAGE_SHIFT + 8UL)) +#define SWP_TYPE(E) (((E) >> PAGE_SHIFT) & 0xffUL) +#define __swp_type(E) SWP_TYPE(E) +#define __swp_offset(E) SWP_OFFSET(E) +#endif /* SPARC64 */ + +#ifdef PLATFORM + +#define SWP_TYPE(entry) (error("PLATFORM_SWP_TYPE: TBD\n")) +#define SWP_OFFSET(entry) (error("PLATFORM_SWP_OFFSET: TBD\n")) +#define __swp_type(entry) SWP_TYPE(entry) +#define __swp_offset(entry) SWP_OFFSET(entry) + +#endif /* PLATFORM */ + +#define KILOBYTES(x) ((x) * (1024)) +#define MEGABYTES(x) ((x) * (1048576)) +#define GIGABYTES(x) ((x) * (1073741824)) +#define TB_SHIFT (40) +#define TERABYTES(x) ((x) * (1UL << TB_SHIFT)) + +#define MEGABYTE_MASK (MEGABYTES(1)-1) + +#define SIZEOF_64BIT (8) +#define SIZEOF_32BIT (4) +#define SIZEOF_16BIT (2) +#define SIZEOF_8BIT (1) + +#ifdef ARM +#define MAX_HEXADDR_STRLEN (8) +#define UVADDR_PRLEN (8) +#endif +#ifdef X86 +#define MAX_HEXADDR_STRLEN (8) +#define UVADDR_PRLEN (8) +#endif +#ifdef ALPHA +#define MAX_HEXADDR_STRLEN (16) +#define UVADDR_PRLEN (11) +#endif +#ifdef PPC +#define MAX_HEXADDR_STRLEN (8) +#define UVADDR_PRLEN (8) +#endif +#ifdef IA64 +#define MAX_HEXADDR_STRLEN (16) +#define UVADDR_PRLEN (16) +#endif +#ifdef S390 +#define MAX_HEXADDR_STRLEN (8) +#define UVADDR_PRLEN (8) +#endif +#ifdef S390X +#define MAX_HEXADDR_STRLEN (16) +#define UVADDR_PRLEN (16) +#endif +#ifdef X86_64 +#define MAX_HEXADDR_STRLEN (16) +#define UVADDR_PRLEN (10) +#endif +#ifdef PPC64 +#define MAX_HEXADDR_STRLEN (16) +#define UVADDR_PRLEN (16) +#endif +#ifdef ARM64 +#define MAX_HEXADDR_STRLEN (16) +#define UVADDR_PRLEN (10) +#endif +#ifdef MIPS +#define MAX_HEXADDR_STRLEN (8) +#define UVADDR_PRLEN (8) +#endif +#ifdef SPARC64 +#define MAX_HEXADDR_STRLEN (16) +#define UVADDR_PRLEN (16) +#endif + +#define BADADDR ((ulong)(-1)) +#define BADVAL ((ulong)(-1)) +#define UNUSED (-1) + +#define UNINITIALIZED (BADVAL) + +#define BITS_PER_BYTE (8) +#define BITS_PER_LONG (BITS_PER_BYTE * sizeof(long)) +#define NUM_TO_BIT(x) (1UL<<((x)%BITS_PER_LONG)) +#define NUM_IN_BITMAP(bitmap, x) (bitmap[(x)/BITS_PER_LONG] & NUM_TO_BIT(x)) +#define SET_BIT(bitmap, x) (bitmap[(x)/BITS_PER_LONG] |= NUM_TO_BIT(x)) + +/* + * precision lengths for fprintf + */ +#define VADDR_PRLEN (sizeof(char *) == 8 ? 16 : 8) +#define LONG_LONG_PRLEN (16) +#define LONG_PRLEN (sizeof(long) == 8 ? 16 : 8) +#define INT_PRLEN (sizeof(int) == 8 ? 16 : 8) +#define CHAR_PRLEN (2) +#define SHORT_PRLEN (4) + +#define MINSPACE (-100) + +#define SYNOPSIS (0x1) +#define COMPLETE_HELP (0x2) +#define PIPE_TO_SCROLL (0x4) +#define MUST_HELP (0x8) + +#define LEFT_JUSTIFY (1) +#define RIGHT_JUSTIFY (2) + +#define CENTER (0x1) +#define LJUST (0x2) +#define RJUST (0x4) +#define LONG_DEC (0x8) +#define LONG_HEX (0x10) +#define INT_DEC (0x20) +#define INT_HEX (0x40) +#define LONGLONG_HEX (0x80) +#define ZERO_FILL (0x100) + +#define INIT_TIME (1) +#define RUN_TIME (2) + +/* + * IRQ line status. + * For kernels up to and including 2.6.17 + */ +#define IRQ_INPROGRESS_2_6_17 1 /* IRQ handler active - do not enter! */ +#define IRQ_DISABLED_2_6_17 2 /* IRQ disabled - do not enter! */ +#define IRQ_PENDING_2_6_17 4 /* IRQ pending - replay on enable */ +#define IRQ_REPLAY_2_6_17 8 /* IRQ has been replayed but not acked yet */ +#define IRQ_AUTODETECT_2_6_17 16 /* IRQ is being autodetected */ +#define IRQ_WAITING_2_6_17 32 /* IRQ not yet seen - for autodetection */ +#define IRQ_LEVEL_2_6_17 64 /* IRQ level triggered */ +#define IRQ_MASKED_2_6_17 128 /* IRQ masked - shouldn't be seen again */ + +/* + * For kernel 2.6.21 and later + */ +#define IRQ_TYPE_NONE_2_6_21 0x00000000 /* Default, unspecified type */ +#define IRQ_TYPE_EDGE_RISING_2_6_21 0x00000001 /* Edge rising type */ +#define IRQ_TYPE_EDGE_FALLING_2_6_21 0x00000002 /* Edge falling type */ +#define IRQ_TYPE_EDGE_BOTH_2_6_21 (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING) +#define IRQ_TYPE_LEVEL_HIGH_2_6_21 0x00000004 /* Level high type */ +#define IRQ_TYPE_LEVEL_LOW_2_6_21 0x00000008 /* Level low type */ +#define IRQ_TYPE_SENSE_MASK_2_6_21 0x0000000f /* Mask of the above */ +#define IRQ_TYPE_PROBE_2_6_21 0x00000010 /* Probing in progress */ + +#define IRQ_INPROGRESS_2_6_21 0x00000100 /* IRQ handler active - do not enter! */ +#define IRQ_DISABLED_2_6_21 0x00000200 /* IRQ disabled - do not enter! */ +#define IRQ_PENDING_2_6_21 0x00000400 /* IRQ pending - replay on enable */ +#define IRQ_REPLAY_2_6_21 0x00000800 /* IRQ has been replayed but not acked yet */ +#define IRQ_AUTODETECT_2_6_21 0x00001000 /* IRQ is being autodetected */ +#define IRQ_WAITING_2_6_21 0x00002000 /* IRQ not yet seen - for autodetection */ +#define IRQ_LEVEL_2_6_21 0x00004000 /* IRQ level triggered */ +#define IRQ_MASKED_2_6_21 0x00008000 /* IRQ masked - shouldn't be seen again */ +#define IRQ_PER_CPU_2_6_21 0x00010000 /* IRQ is per CPU */ +#define IRQ_NOPROBE_2_6_21 0x00020000 /* IRQ is not valid for probing */ +#define IRQ_NOREQUEST_2_6_21 0x00040000 /* IRQ cannot be requested */ +#define IRQ_NOAUTOEN_2_6_21 0x00080000 /* IRQ will not be enabled on request irq */ +#define IRQ_WAKEUP_2_6_21 0x00100000 /* IRQ triggers system wakeup */ +#define IRQ_MOVE_PENDING_2_6_21 0x00200000 /* need to re-target IRQ destination */ +#define IRQ_NO_BALANCING_2_6_21 0x00400000 /* IRQ is excluded from balancing */ +#define IRQ_SPURIOUS_DISABLED_2_6_21 0x00800000 /* IRQ was disabled by the spurious trap */ +#define IRQ_MOVE_PCNTXT_2_6_21 0x01000000 /* IRQ migration from process context */ +#define IRQ_AFFINITY_SET_2_6_21 0x02000000 /* IRQ affinity was set from userspace*/ + +/* + * Select proper IRQ value depending on kernel version + */ +#define IRQ_TYPE_NONE \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_TYPE_NONE_2_6_21 : 0) +#define IRQ_TYPE_EDGE_RISING \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_TYPE_EDGE_RISING_2_6_21 : 0) +#define IRQ_TYPE_EDGE_FALLING \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_TYPE_EDGE_FALLING_2_6_21 : 0) +#define IRQ_TYPE_EDGE_BOTH \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_TYPE_EDGE_BOTH_2_6_21 : 0) +#define IRQ_TYPE_LEVEL_HIGH \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_TYPE_LEVEL_HIGH_2_6_21 : 0) +#define IRQ_TYPE_LEVEL_LOW \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_TYPE_LEVEL_LOW_2_6_21 : 0) +#define IRQ_TYPE_SENSE_MASK \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_TYPE_SENSE_MASK_2_6_21 : 0) +#define IRQ_TYPE_PROBE \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_TYPE_PROBE_2_6_21 : 0) + +#define IRQ_INPROGRESS \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_INPROGRESS_2_6_21 : IRQ_INPROGRESS_2_6_17) +#define IRQ_DISABLED \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_DISABLED_2_6_21 : IRQ_DISABLED_2_6_17) +#define IRQ_PENDING \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_PENDING_2_6_21 : IRQ_PENDING_2_6_17) +#define IRQ_REPLAY \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_REPLAY_2_6_21 : IRQ_REPLAY_2_6_17) +#define IRQ_AUTODETECT \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_AUTODETECT_2_6_21 : IRQ_AUTODETECT_2_6_17) +#define IRQ_WAITING \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_WAITING_2_6_21 : IRQ_WAITING_2_6_17) +#define IRQ_LEVEL \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_LEVEL_2_6_21 : IRQ_LEVEL_2_6_17) +#define IRQ_MASKED \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_MASKED_2_6_21 : IRQ_MASKED_2_6_17) +#define IRQ_PER_CPU \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_PER_CPU_2_6_21 : 0) +#define IRQ_NOPROBE \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_NOPROBE_2_6_21 : 0) +#define IRQ_NOREQUEST \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_NOREQUEST_2_6_21 : 0) +#define IRQ_NOAUTOEN \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_NOAUTOEN_2_6_21 : 0) +#define IRQ_WAKEUP \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_WAKEUP_2_6_21 : 0) +#define IRQ_MOVE_PENDING \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_MOVE_PENDING_2_6_21 : 0) +#define IRQ_NO_BALANCING \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_NO_BALANCING_2_6_21 : 0) +#define IRQ_SPURIOUS_DISABLED \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_SPURIOUS_DISABLED_2_6_21 : 0) +#define IRQ_MOVE_PCNTXT \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_MOVE_PCNTXT_2_6_21 : 0) +#define IRQ_AFFINITY_SET \ + (THIS_KERNEL_VERSION >= LINUX(2,6,21) ? IRQ_AFFINITY_SET_2_6_21 : 0) + +#ifdef ARM +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x04000000 +#define SA_RESTORER 0x04000000 +#endif + +#ifdef X86 +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x04000000 +#define SA_RESTORER 0x04000000 +#endif + +#ifdef X86_64 +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x04000000 +#define SA_RESTORER 0x04000000 +#endif + +#ifdef ALPHA +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x40000000 +#endif + +#ifdef PPC +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x04000000 +#define SA_RESTORER 0x04000000 +#endif + +#ifdef PPC64 +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x04000000 +#define SA_RESTORER 0x04000000u +#endif + +#ifdef IA64 +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x04000000 +#define SA_RESTORER 0x04000000 +#endif + +#ifdef S390 +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x04000000 +#define SA_RESTORER 0x04000000 +#endif + +#ifdef S390X +#define SA_PROBE SA_ONESHOT +#define SA_SAMPLE_RANDOM SA_RESTART +#define SA_SHIRQ 0x04000000 +#define SA_RESTORER 0x04000000 +#endif + + +#define ACTION_FLAGS (SA_INTERRUPT|SA_PROBE|SA_SAMPLE_RANDOM|SA_SHIRQ) + + +#endif /* !GDB_COMMON */ + +/* + * Common request structure for BFD or GDB data or commands. + */ +struct gnu_request { + int command; + char *buf; + FILE *fp; + ulong addr; + ulong addr2; + ulong count; + ulong flags; + char *name; + ulong length; + int typecode; +#if defined(GDB_5_3) || defined(GDB_6_0) || defined(GDB_6_1) || defined(GDB_7_0) + char *typename; +#else + char *type_name; +#endif + char *target_typename; + ulong target_length; + int target_typecode; + int is_typedef; + char *member; + long member_offset; + long member_length; + int member_typecode; + long value; + char *tagname; + ulong pc; + ulong sp; + ulong ra; + int curframe; + ulong frame; + ulong prevsp; + ulong prevpc; + ulong lastsp; + ulong task; + ulong debug; + struct stack_hook *hookp; + struct global_iterator { + int finished; + int block_index; + struct symtab *symtab; + struct symbol *sym; + struct objfile *obj; + } global_iterator; +}; + +/* + * GNU commands + */ +#define GNU_DATATYPE_INIT (1) +#define GNU_DISASSEMBLE (2) +#define GNU_GET_LINE_NUMBER (3) +#define GNU_PASS_THROUGH (4) +#define GNU_GET_DATATYPE (5) +#define GNU_COMMAND_EXISTS (6) +#define GNU_STACK_TRACE (7) +#define GNU_ALPHA_FRAME_OFFSET (8) +#define GNU_FUNCTION_NUMARGS (9) +#define GNU_RESOLVE_TEXT_ADDR (10) +#define GNU_ADD_SYMBOL_FILE (11) +#define GNU_DELETE_SYMBOL_FILE (12) +#define GNU_VERSION (13) +#define GNU_PATCH_SYMBOL_VALUES (14) +#define GNU_GET_SYMBOL_TYPE (15) +#define GNU_USER_PRINT_OPTION (16) +#define GNU_SET_CRASH_BLOCK (17) +#define GNU_GET_FUNCTION_RANGE (18) +#define GNU_GET_NEXT_DATATYPE (19) +#define GNU_LOOKUP_STRUCT_CONTENTS (20) +#define GNU_DEBUG_COMMAND (100) +/* + * GNU flags + */ +#define GNU_PRINT_LINE_NUMBERS (0x1) +#define GNU_FUNCTION_ONLY (0x2) +#define GNU_PRINT_ENUMERATORS (0x4) +#define GNU_RETURN_ON_ERROR (0x8) +#define GNU_COMMAND_FAILED (0x10) +#define GNU_FROM_TTY_OFF (0x20) +#define GNU_NO_READMEM (0x40) +#define GNU_VAR_LENGTH_TYPECODE (0x80) + +#undef TRUE +#undef FALSE + +#define TRUE (1) +#define FALSE (0) + +#ifdef GDB_COMMON +/* + * function prototypes required by modified gdb source files. + */ +int console(char *, ...); +int gdb_CRASHDEBUG(ulong); +int gdb_readmem_callback(ulong, void *, int, int); +void patch_load_module(struct objfile *objfile, struct minimal_symbol *msymbol); +int patch_kernel_symbol(struct gnu_request *); +struct syment *symbol_search(char *); +int gdb_line_number_callback(ulong, ulong, ulong); +int gdb_print_callback(ulong); +#endif + +#ifndef GDB_COMMON +/* + * WARNING: the following type codes are type_code enums from gdb/gdbtypes.h + */ +enum type_code { + TYPE_CODE_UNDEF, /* Not used; catches errors */ + TYPE_CODE_PTR, /* Pointer type */ + TYPE_CODE_ARRAY, /* Array type with lower & upper bounds. */ + TYPE_CODE_STRUCT, /* C struct or Pascal record */ + TYPE_CODE_UNION, /* C union or Pascal variant part */ + TYPE_CODE_ENUM, /* Enumeration type */ +#if defined(GDB_5_3) || defined(GDB_6_0) || defined(GDB_6_1) || defined(GDB_7_0) || defined(GDB_7_3_1) || defined(GDB_7_6) +#if defined(GDB_7_0) || defined(GDB_7_3_1) || defined(GDB_7_6) + TYPE_CODE_FLAGS, /* Bit flags type */ +#endif + TYPE_CODE_FUNC, /* Function type */ + TYPE_CODE_INT, /* Integer type */ + + /* Floating type. This is *NOT* a complex type. Beware, there are parts + of GDB which bogusly assume that TYPE_CODE_FLT can mean complex. */ + TYPE_CODE_FLT, + + /* Void type. The length field specifies the length (probably always + one) which is used in pointer arithmetic involving pointers to + this type, but actually dereferencing such a pointer is invalid; + a void type has no length and no actual representation in memory + or registers. A pointer to a void type is a generic pointer. */ + TYPE_CODE_VOID, + + TYPE_CODE_SET, /* Pascal sets */ + TYPE_CODE_RANGE, /* Range (integers within spec'd bounds) */ + + /* + * NOTE: the remainder of the type codes are not list or used here... + */ + TYPE_CODE_BOOL = 20, +#endif +}; + +/* + * include/linux/sched.h + */ +#define PF_EXITING 0x00000004 /* getting shut down */ +#define PF_KTHREAD 0x00200000 /* I am a kernel thread */ + +extern long _ZOMBIE_; +#define IS_ZOMBIE(task) (task_state(task) & _ZOMBIE_) +#define IS_EXITING(task) (task_flags(task) & PF_EXITING) + +/* + * ps command options. + */ +#define PS_BY_PID (0x1) +#define PS_BY_TASK (0x2) +#define PS_BY_CMD (0x4) +#define PS_SHOW_ALL (0x8) +#define PS_PPID_LIST (0x10) +#define PS_CHILD_LIST (0x20) +#define PS_KERNEL (0x40) +#define PS_USER (0x80) +#define PS_TIMES (0x100) +#define PS_KSTACKP (0x200) +#define PS_LAST_RUN (0x400) +#define PS_ARGV_ENVP (0x800) +#define PS_TGID_LIST (0x1000) +#define PS_RLIMIT (0x2000) +#define PS_GROUP (0x4000) +#define PS_BY_REGEX (0x8000) +#define PS_NO_HEADER (0x10000) +#define PS_MSECS (0x20000) +#define PS_SUMMARY (0x40000) + +#define PS_EXCLUSIVE (PS_TGID_LIST|PS_ARGV_ENVP|PS_TIMES|PS_CHILD_LIST|PS_PPID_LIST|PS_LAST_RUN|PS_RLIMIT|PS_MSECS|PS_SUMMARY) + +#define MAX_PS_ARGS (100) /* maximum command-line specific requests */ + +struct psinfo { + int argc; + ulong pid[MAX_PS_ARGS]; + int type[MAX_PS_ARGS]; + ulong task[MAX_PS_ARGS]; + char comm[MAX_PS_ARGS][TASK_COMM_LEN+1]; + struct regex_data { + char *pattern; + regex_t regex; + } regex_data[MAX_PS_ARGS]; + int regexs; + ulong *cpus; +}; + +#define IS_A_NUMBER(X) (decimal(X, 0) || hexadecimal(X, 0)) +#define AMBIGUOUS_NUMBER(X) (decimal(X, 0) && hexadecimal(X, 0)) + +#define is_mclx_compressed_dump(X) (va_server_init((X), 0, 0, 0) == 0) + +struct task_mem_usage { + ulong rss; + ulong total_vm; + double pct_physmem; + ulong mm_struct_addr; + ulong pgd_addr; +}; + +/* + * Global data (global_data.c) + */ +extern FILE *fp; +extern struct program_context program_context, *pc; +extern struct task_table task_table, *tt; +extern struct kernel_table kernel_table, *kt; +extern struct command_table_entry linux_command_table[]; +extern char *args[MAXARGS]; +extern int argcnt; +extern int argerrs; +extern struct offset_table offset_table; +extern struct size_table size_table; +extern struct array_table array_table; +extern struct vm_table vm_table, *vt; +extern struct machdep_table *machdep; +extern struct symbol_table_data symbol_table_data, *st; +extern struct extension_table *extension_table; + +/* + * Generated in build_data.c + */ +extern char *build_command; +extern char *build_data; +extern char *build_target; +extern char *build_version; +extern char *compiler_version; + + +/* + * command prototypes + */ +void cmd_quit(void); /* main.c */ +void cmd_mach(void); /* main.c */ +void cmd_help(void); /* help.c */ +void cmd_test(void); /* test.c */ +void cmd_ascii(void); /* tools.c */ +void cmd_set(void); /* tools.c */ +void cmd_eval(void); /* tools.c */ +void cmd_list(void); /* tools.c */ +void cmd_tree(void); /* tools.c */ +void cmd_template(void); /* tools.c */ +void cmd_alias(void); /* cmdline.c */ +void cmd_repeat(void); /* cmdline.c */ +void cmd_rd(void); /* memory.c */ +void cmd_wr(void); /* memory.c */ +void cmd_ptov(void); /* memory.c */ +void cmd_vtop(void); /* memory.c */ +void cmd_vm(void); /* memory.c */ +void cmd_ptob(void); /* memory.c */ +void cmd_btop(void); /* memory.c */ +void cmd_kmem(void); /* memory.c */ +void cmd_search(void); /* memory.c */ +void cmd_swap(void); /* memory.c */ +void cmd_pte(void); /* memory.c */ +void cmd_ps(void); /* task.c */ +void cmd_task(void); /* task.c */ +void cmd_foreach(void); /* task.c */ +void cmd_runq(void); /* task.c */ +void cmd_sig(void); /* task.c */ +void cmd_bt(void); /* kernel.c */ +void cmd_dis(void); /* kernel.c */ +void cmd_mod(void); /* kernel.c */ +void cmd_log(void); /* kernel.c */ +void cmd_sys(void); /* kernel.c */ +void cmd_irq(void); /* kernel.c */ +void cmd_timer(void); /* kernel.c */ +void cmd_waitq(void); /* kernel.c */ +void cmd_sym(void); /* symbols.c */ +void cmd_struct(void); /* symbols.c */ +void cmd_union(void); /* symbols.c */ +void cmd_pointer(void); /* symbols.c */ +void cmd_whatis(void); /* symbols.c */ +void cmd_p(void); /* symbols.c */ +void cmd_mount(void); /* filesys.c */ +void cmd_files(void); /* filesys.c */ +void cmd_fuser(void); /* filesys.c */ +void cmd_dev(void); /* dev.c */ +void cmd_gdb(void); /* gdb_interface.c */ +void cmd_net(void); /* net.c */ +void cmd_extend(void); /* extensions.c */ +#if defined(S390) || defined(S390X) +void cmd_s390dbf(void); +#endif +void cmd_map(void); /* kvmdump.c */ +void cmd_ipcs(void); /* ipcs.c */ + +/* + * main.c + */ +void main_loop(void); +void exec_command(void); +struct command_table_entry *get_command_table_entry(char *); +void program_usage(int); +#define LONG_FORM (1) +#define SHORT_FORM (0) +void dump_program_context(void); +void dump_build_data(void); +#ifdef ARM +#define machdep_init(X) arm_init(X) +#endif +#ifdef ARM64 +#define machdep_init(X) arm64_init(X) +#endif +#ifdef X86 +#define machdep_init(X) x86_init(X) +#endif +#ifdef ALPHA +#define machdep_init(X) alpha_init(X) +#endif +#ifdef PPC +#define machdep_init(X) ppc_init(X) +#endif +#ifdef IA64 +#define machdep_init(X) ia64_init(X) +#endif +#ifdef S390 +#define machdep_init(X) s390_init(X) +#endif +#ifdef S390X +#define machdep_init(X) s390x_init(X) +#endif +#ifdef X86_64 +#define machdep_init(X) x86_64_init(X) +#endif +#ifdef PPC64 +#define machdep_init(X) ppc64_init(X) +#endif +#ifdef MIPS +#define machdep_init(X) mips_init(X) +#endif +#ifdef SPARC64 +#define machdep_init(X) sparc64_init(X) +#endif +int clean_exit(int); +int untrusted_file(FILE *, char *); +char *readmem_function_name(void); +char *writemem_function_name(void); + +/* + * cmdline.c + */ +void restart(int); +void alias_init(char *); +struct alias_data *is_alias(char *); +void deallocate_alias(char *); +void cmdline_init(void); +void set_command_prompt(char *); +void exec_input_file(void); +void process_command_line(void); +void dump_history(void); +void resolve_rc_cmd(char *, int); +void dump_alias_data(void); +int output_open(void); +#define output_closed() (!output_open()) +void close_output(void); +int interruptible(void); +int received_SIGINT(void); +void debug_redirect(char *); +int CRASHPAGER_valid(void); +char *setup_scroll_command(void); +int minimal_functions(char *); +int is_args_input_file(struct command_table_entry *, struct args_input_file *); +void exec_args_input_file(struct command_table_entry *, struct args_input_file *); + +/* + * tools.c + */ +int __error(int, char *, ...); +#define error __error /* avoid conflict with gdb error() */ +int console(char *, ...); +void create_console_device(char *); +int console_off(void); +int console_on(int); +int console_verbatim(char *); +int whitespace(int); +int ascii(int); +int ascii_string(char *); +int printable_string(char *); +char *clean_line(char *); +char *strip_line_end(char *); +char *strip_linefeeds(char *); +char *strip_beginning_whitespace(char *); +char *strip_ending_whitespace(char *); +char *strip_ending_char(char *, char); +char *strip_beginning_char(char *, char); +char *strip_comma(char *); +char *strip_hex(char *); +char *upper_case(char *, char *); +char *first_nonspace(char *); +char *first_space(char *); +char *replace_string(char *, char *, char); +void string_insert(char *, char *); +char *strstr_rightmost(char *, char *); +char *null_first_space(char *); +int parse_line(char *, char **); +void print_verbatim(FILE *, char *); +char *fixup_percent(char *); +int can_eval(char *); +ulong eval(char *, int, int *); +ulonglong evall(char *, int, int *); +int eval_common(char *, int, int *, struct number_option *); +ulong htol(char *, int, int *); +ulong dtol(char *, int, int *); +unsigned int dtoi(char *, int, int *); +ulong stol(char *, int, int *); +ulonglong stoll(char *, int, int *); +ulonglong htoll(char *, int, int *); +ulonglong dtoll(char *, int, int *); +int decimal(char *, int); +int hexadecimal(char *, int); +int hexadecimal_only(char *, int); +ulong convert(char *, int, int *, ulong); +void pad_line(FILE *, int, char); +#define INDENT(x) pad_line(fp, x, ' ') +char *mkstring(char *, int, ulong, const char *); +#define MKSTR(X) ((const char *)(X)) +int count_leading_spaces(char *); +int count_chars(char *, char); +long count_buffer_chars(char *, char, long); +char *space(int); +char *concat_args(char *, int, int); +char *shift_string_left(char *, int); +char *shift_string_right(char *, int); +int bracketed(char *, char *, int); +void backspace(int); +int do_list(struct list_data *); +struct radix_tree_ops { + void (*entry)(ulong node, ulong slot, const char *path, + ulong index, void *private); + uint radix; + void *private; +}; +int do_radix_tree_traverse(ulong ptr, int is_root, struct radix_tree_ops *ops); +int do_rdtree(struct tree_data *); +int do_rbtree(struct tree_data *); +int retrieve_list(ulong *, int); +long power(long, int); +long long ll_power(long long, long long); +void hq_init(void); +int hq_open(void); +int hq_close(void); +int hq_enter(ulong); +int hq_entry_exists(ulong); +int hq_is_open(void); +int hq_is_inuse(void); +long get_embedded(void); +void dump_embedded(char *); +char *ordinal(ulong, char *); +char *first_nonspace(char *); +void dump_hash_table(int); +void dump_shared_bufs(void); +void drop_core(char *); +int extract_hex(char *, ulong *, char, ulong); +int count_bits_int(int); +int count_bits_long(ulong); +int highest_bit_long(ulong); +int lowest_bit_long(ulong); +void buf_init(void); +void sym_buf_init(void); +void free_all_bufs(void); +char *getbuf(long); +void freebuf(char *); +char *resizebuf(char *, long, long); +char *strdupbuf(char *); +#define GETBUF(X) getbuf((long)(X)) +#define FREEBUF(X) freebuf((char *)(X)) +#define RESIZEBUF(X,Y,Z) (X) = (typeof(X))resizebuf((char *)(X), (long)(Y), (long)(Z)); +#define STRDUPBUF(X) strdupbuf((char *)(X)) +void sigsetup(int, void *, struct sigaction *, struct sigaction *); +#define SIGACTION(s, h, a, o) sigsetup(s, h, a, o) +char *convert_time(ulonglong, char *); +void stall(ulong); +char *pages_to_size(ulong, char *); +int clean_arg(void); +int empty_list(ulong); +int machine_type(char *); +int machine_type_mismatch(char *, char *, char *, ulong); +void command_not_supported(void); +void option_not_supported(int); +void please_wait(char *); +void please_wait_done(void); +int pathcmp(char *, char *); +int calculate(char *, ulong *, ulonglong *, ulong); +int endian_mismatch(char *, char, ulong); +uint16_t swap16(uint16_t, int); +uint32_t swap32(uint32_t, int); +uint64_t swap64(uint64_t, int); +ulong *get_cpumask_buf(void); +int make_cpumask(char *, ulong *, int, int *); +size_t strlcpy(char *, char *, size_t); +struct rb_node *rb_first(struct rb_root *); +struct rb_node *rb_parent(struct rb_node *, struct rb_node *); +struct rb_node *rb_right(struct rb_node *, struct rb_node *); +struct rb_node *rb_left(struct rb_node *, struct rb_node *); +struct rb_node *rb_next(struct rb_node *); +struct rb_node *rb_last(struct rb_root *); + +/* + * symbols.c + */ +void symtab_init(void); +char *check_specified_kernel_debug_file(void); +void no_debugging_data(int); +void get_text_init_space(void); +int is_kernel_text(ulong); +int is_kernel_data(ulong); +int is_init_data(ulong value); +int is_kernel_text_offset(ulong); +int is_symbol_text(struct syment *); +int is_rodata(ulong, struct syment **); +int get_text_function_range(ulong, ulong *, ulong *); +void datatype_init(void); +struct syment *symbol_search(char *); +struct syment *value_search(ulong, ulong *); +struct syment *value_search_base_kernel(ulong, ulong *); +struct syment *value_search_module(ulong, ulong *); +struct syment *symbol_search_next(char *, struct syment *); +ulong highest_bss_symbol(void); +int in_ksymbol_range(ulong); +int module_symbol(ulong, struct syment **, + struct load_module **, char *, ulong); +#define IS_MODULE_VADDR(X) \ + (module_symbol((ulong)(X), NULL, NULL, NULL, *gdb_output_radix)) +char *closest_symbol(ulong); +ulong closest_symbol_value(ulong); +#define SAME_FUNCTION(X,Y) (closest_symbol_value(X) == closest_symbol_value(Y)) +void show_symbol(struct syment *, ulong, ulong); +#define SHOW_LINENUM (0x1) +#define SHOW_SECTION (0x2) +#define SHOW_HEX_OFFS (0x4) +#define SHOW_DEC_OFFS (0x8) +#define SHOW_RADIX() (*gdb_output_radix == 16 ? SHOW_HEX_OFFS : SHOW_DEC_OFFS) +#define SHOW_MODULE (0x10) +int symbol_name_count(char *); +int symbol_query(char *, char *, struct syment **); +struct syment *next_symbol(char *, struct syment *); +struct syment *prev_symbol(char *, struct syment *); +void get_symbol_data(char *, long, void *); +int try_get_symbol_data(char *, long, void *); +char *value_to_symstr(ulong, char *, ulong); +char *value_symbol(ulong); +ulong symbol_value(char *); +ulong symbol_value_module(char *, char *); +struct syment *per_cpu_symbol_search(char *); +int symbol_exists(char *s); +int kernel_symbol_exists(char *s); +struct syment *kernel_symbol_search(char *); +int get_syment_array(char *, struct syment **, int); +void set_temporary_radix(unsigned int, unsigned int *); +void restore_current_radix(unsigned int); +void dump_struct(char *, ulong, unsigned); +void dump_struct_member(char *, ulong, unsigned); +void dump_union(char *, ulong, unsigned); +void store_module_symbols_v1(ulong, int); +void store_module_symbols_v2(ulong, int); +int is_datatype_command(void); +int is_typedef(char *); +int arg_to_datatype(char *, struct datatype_member *, ulong); +void dump_symbol_table(void); +void dump_struct_table(ulong); +void dump_offset_table(char *, ulong); +int is_elf_file(char *); +int is_kernel(char *); +int is_shared_object(char *); +int file_elf_version(char *); +int is_system_map(char *); +int is_compressed_kernel(char *, char **); +int select_namelist(char *); +int get_array_length(char *, int *, long); +int get_array_length_alt(char *, char *, int *, long); +int builtin_array_length(char *, int, int *); +char *get_line_number(ulong, char *, int); +char *get_build_directory(char *); +int datatype_exists(char *); +int get_function_numargs(ulong); +int is_module_name(char *, ulong *, struct load_module **); +int is_module_address(ulong, char *); +ulong lowest_module_address(void); +ulong highest_module_address(void); +int load_module_symbols(char *, char *, ulong); +void delete_load_module(ulong); +ulong gdb_load_module_callback(ulong, char *); +char *load_module_filter(char *, int); +#define LM_P_FILTER (1) +#define LM_DIS_FILTER (2) +long datatype_info(char *, char *, struct datatype_member *); +int get_symbol_type(char *, char *, struct gnu_request *); +int get_symbol_length(char *); +int text_value_cache(ulong, uint32_t, uint32_t *); +int text_value_cache_byte(ulong, unsigned char *); +void dump_text_value_cache(int); +void clear_text_value_cache(void); +void dump_numargs_cache(void); +int patch_kernel_symbol(struct gnu_request *); +struct syment *generic_machdep_value_to_symbol(ulong, ulong *); +long OFFSET_verify(long, char *, char *, int, char *); +long SIZE_verify(long, char *, char *, int, char *); +long OFFSET_option(long, long, char *, char *, int, char *, char *); +long SIZE_option(long, long, char *, char *, int, char *, char *); +void dump_trace(void **); +int enumerator_value(char *, long *); +int dump_enumerator_list(char *); +struct load_module *init_module_function(ulong); +struct struct_member_data { + char *structure; + char *member; + long type; + long unsigned_type; + long length; + long offset; + long bitpos; + long bitsize; +}; +int fill_struct_member_data(struct struct_member_data *); +void parse_for_member_extended(struct datatype_member *, ulong); +void add_to_downsized(char *); +int is_downsized(char *); +int is_string(char *, char *); + +/* + * memory.c + */ +void mem_init(void); +void vm_init(void); +int readmem(ulonglong, int, void *, long, char *, ulong); +int writemem(ulonglong, int, void *, long, char *, ulong); +int generic_verify_paddr(uint64_t); +int read_dev_mem(int, void *, int, ulong, physaddr_t); +int read_memory_device(int, void *, int, ulong, physaddr_t); +int read_mclx_dumpfile(int, void *, int, ulong, physaddr_t); +int read_lkcd_dumpfile(int, void *, int, ulong, physaddr_t); +int read_daemon(int, void *, int, ulong, physaddr_t); +int write_dev_mem(int, void *, int, ulong, physaddr_t); +int write_memory_device(int, void *, int, ulong, physaddr_t); +int write_mclx_dumpfile(int, void *, int, ulong, physaddr_t); +int write_lkcd_dumpfile(int, void *, int, ulong, physaddr_t); +int write_daemon(int, void *, int, ulong, physaddr_t); +int kvtop(struct task_context *, ulong, physaddr_t *, int); +int uvtop(struct task_context *, ulong, physaddr_t *, int); +void do_vtop(ulong, struct task_context *, ulong); +void raw_stack_dump(ulong, ulong); +void raw_data_dump(ulong, long, int); +int accessible(ulong); +ulong vm_area_dump(ulong, ulong, ulong, struct reference *); +#define IN_TASK_VMA(TASK,VA) (vm_area_dump((TASK), UVADDR|VERIFY_ADDR, (VA), 0)) +char *fill_vma_cache(ulong); +void clear_vma_cache(void); +void dump_vma_cache(ulong); +int is_page_ptr(ulong, physaddr_t *); +void dump_vm_table(int); +int read_string(ulong, char *, int); +void get_task_mem_usage(ulong, struct task_mem_usage *); +char *get_memory_size(char *); +uint64_t generic_memory_size(void); +char *swap_location(ulonglong, char *); +void clear_swap_info_cache(void); +uint memory_page_size(void); +void force_page_size(char *); +ulong first_vmalloc_address(void); +ulong last_vmalloc_address(void); +int in_vmlist_segment(ulong); +int phys_to_page(physaddr_t, ulong *); +int generic_get_kvaddr_ranges(struct vaddr_range *); +int l1_cache_size(void); +int dumpfile_memory(int); +#define DUMPFILE_MEM_USED (1) +#define DUMPFILE_FREE_MEM (2) +#define DUMPFILE_MEM_DUMP (3) +#define DUMPFILE_ENVIRONMENT (4) +uint64_t total_node_memory(void); +int generic_is_kvaddr(ulong); +int generic_is_uvaddr(ulong, struct task_context *); +void fill_stackbuf(struct bt_info *); +void alter_stackbuf(struct bt_info *); +int vaddr_type(ulong, struct task_context *); +char *format_stack_entry(struct bt_info *bt, char *, ulong, ulong); +int in_user_stack(ulong, ulong); +int dump_inode_page(ulong); + + +/* + * filesys.c + */ +void fd_init(void); +void vfs_init(void); +int is_a_tty(char *); +int file_exists(char *, struct stat *); +int file_readable(char *); +int is_directory(char *); +char *search_directory_tree(char *, char *, int); +void open_tmpfile(void); +void close_tmpfile(void); +void open_tmpfile2(void); +void set_tmpfile2(FILE *); +void close_tmpfile2(void); +void open_files_dump(ulong, int, struct reference *); +void get_pathname(ulong, char *, int, int, ulong); +char *vfsmount_devname(ulong, char *, int); +ulong file_to_dentry(ulong); +ulong file_to_vfsmnt(ulong); +int get_proc_version(void); +int file_checksum(char *, long *); +void dump_filesys_table(int); +char *fill_file_cache(ulong); +void clear_file_cache(void); +char *fill_dentry_cache(ulong); +void clear_dentry_cache(void); +char *fill_inode_cache(ulong); +void clear_inode_cache(void); +int monitor_memory(long *, long *, long *, long *); +int is_readable(char *); +#define RADIX_TREE_COUNT (1) +#define RADIX_TREE_SEARCH (2) +#define RADIX_TREE_DUMP (3) +#define RADIX_TREE_GATHER (4) +#define RADIX_TREE_DUMP_CB (5) +struct radix_tree_pair { + ulong index; + void *value; +}; +ulong do_radix_tree(ulong, int, struct radix_tree_pair *); +int file_dump(ulong, ulong, ulong, int, int); +#define DUMP_FULL_NAME 0x1 +#define DUMP_INODE_ONLY 0x2 +#define DUMP_DENTRY_ONLY 0x4 +#define DUMP_EMPTY_FILE 0x8 +#define DUMP_FILE_NRPAGES 0x10 +#endif /* !GDB_COMMON */ +int same_file(char *, char *); +#ifndef GDB_COMMON +int cleanup_memory_driver(void); + + +/* + * help.c + */ +#define HELP_COLUMNS 5 +#define START_OF_HELP_DATA(X) "START_OF_HELP_DATA" X +#define END_OF_HELP_DATA "END_OF_HELP_DATA" +void help_init(void); +void cmd_usage(char *, int); +void display_version(void); +void display_help_screen(char *); +#ifdef ARM +#define dump_machdep_table(X) arm_dump_machdep_table(X) +#endif +#ifdef ARM64 +#define dump_machdep_table(X) arm64_dump_machdep_table(X) +#endif +#ifdef X86 +#define dump_machdep_table(X) x86_dump_machdep_table(X) +#endif +#ifdef ALPHA +#define dump_machdep_table(X) alpha_dump_machdep_table(X) +#endif +#ifdef PPC +#define dump_machdep_table(X) ppc_dump_machdep_table(X) +#endif +#ifdef IA64 +#define dump_machdep_table(X) ia64_dump_machdep_table(X) +#endif +#ifdef S390 +#define dump_machdep_table(X) s390_dump_machdep_table(X) +#endif +#ifdef S390X +#define dump_machdep_table(X) s390x_dump_machdep_table(X) +#endif +#ifdef X86_64 +#define dump_machdep_table(X) x86_64_dump_machdep_table(X) +#endif +#ifdef PPC64 +#define dump_machdep_table(X) ppc64_dump_machdep_table(X) +#endif +#ifdef MIPS +#define dump_machdep_table(X) mips_dump_machdep_table(X) +#endif +#ifdef SPARC64 +#define dump_machdep_table(X) sparc64_dump_machdep_table(X) +#endif +extern char *help_pointer[]; +extern char *help_alias[]; +extern char *help_ascii[]; +extern char *help_bt[]; +extern char *help_btop[]; +extern char *help_dev[]; +extern char *help_dis[]; +extern char *help_eval[]; +extern char *help_exit[]; +extern char *help_extend[]; +extern char *help_files[]; +extern char *help_foreach[]; +extern char *help_fuser[]; +extern char *help_gdb[]; +extern char *help_help[]; +extern char *help_irq[]; +extern char *help_kmem[]; +extern char *help__list[]; +extern char *help_tree[]; +extern char *help_log[]; +extern char *help_mach[]; +extern char *help_mod[]; +extern char *help_mount[]; +extern char *help_net[]; +extern char *help_p[]; +extern char *help_ps[]; +extern char *help_pte[]; +extern char *help_ptob[]; +extern char *help_ptov[]; +extern char *help_quit[]; +extern char *help_rd[]; +extern char *help_repeat[]; +extern char *help_runq[]; +extern char *help_ipcs[]; +extern char *help_search[]; +extern char *help_set[]; +extern char *help_sig[]; +extern char *help_struct[]; +extern char *help_swap[]; +extern char *help_sym[]; +extern char *help_sys[]; +extern char *help_task[]; +extern char *help_timer[]; +extern char *help_union[]; +extern char *help_vm[]; +extern char *help_vtop[]; +extern char *help_waitq[]; +extern char *help_whatis[]; +extern char *help_wr[]; +#if defined(S390) || defined(S390X) +extern char *help_s390dbf[]; +#endif +extern char *help_map[]; + +/* + * task.c + */ +void task_init(void); +int set_context(ulong, ulong); +void show_context(struct task_context *); +ulong pid_to_task(ulong); +ulong task_to_pid(ulong); +int task_exists(ulong); +int is_kernel_thread(ulong); +int is_idle_thread(ulong); +void get_idle_threads(ulong *, int); +char *task_state_string(ulong, char *, int); +ulong task_flags(ulong); +ulong task_state(ulong); +ulong task_mm(ulong, int); +ulong task_tgid(ulong); +ulonglong task_last_run(ulong); +ulong vaddr_in_task_struct(ulong); +int comm_exists(char *); +struct task_context *task_to_context(ulong); +struct task_context *pid_to_context(ulong); +struct task_context *tgid_to_context(ulong); +ulong stkptr_to_task(ulong); +ulong task_to_thread_info(ulong); +ulong task_to_stackbase(ulong); +int str_to_context(char *, ulong *, struct task_context **); +#define STR_PID (0x1) +#define STR_TASK (0x2) +#define STR_INVALID (0x4) +char *get_panicmsg(char *); +char *task_cpu(int, char *, int); +void print_task_header(FILE *, struct task_context *, int); +ulong get_active_task(int); +int is_task_active(ulong); +int is_panic_thread(ulong); +int get_panic_ksp(struct bt_info *, ulong *); +void foreach(struct foreach_data *); +int pid_exists(ulong); +#define TASKS_PER_PID(x) pid_exists(x) +char *fill_task_struct(ulong); +#define IS_LAST_TASK_READ(task) ((ulong)(task) == tt->last_task_read) +char *fill_thread_info(ulong); +#define IS_LAST_THREAD_INFO_READ(ti) ((ulong)(ti) == tt->last_thread_info_read) +char *fill_mm_struct(ulong); +#define IS_LAST_MM_READ(mm) ((ulong)(mm) == tt->last_mm_read) +void do_task(ulong, ulong, struct reference *, unsigned int); +void clear_task_cache(void); +int get_active_set(void); +void clear_active_set(void); +void do_sig(ulong, ulong, struct reference *); +void modify_signame(int, char *, char *); +ulong generic_get_stackbase(ulong); +ulong generic_get_stacktop(ulong); +void dump_task_table(int); +void sort_context_array(void); +void sort_tgid_array(void); +int sort_by_tgid(const void *, const void *); +int in_irq_ctx(ulonglong, int, ulong); +void check_stack_overflow(void); + +/* + * extensions.c + */ +void register_extension(struct command_table_entry *); +void dump_extension_table(int); +void load_extension(char *); +void unload_extension(char *); +void preload_extensions(void); +/* Hooks for sial */ +unsigned long get_curtask(void); +char *crash_global_cmd(void); +struct command_table_entry *crash_cmd_table(void); + +/* + * kernel.c + */ +void kernel_init(void); +void module_init(void); +void verify_version(void); +void verify_spinlock(void); +void non_matching_kernel(void); +struct load_module *modref_to_load_module(char *); +int load_module_symbols_helper(char *); +void unlink_module(struct load_module *); +int check_specified_module_tree(char *, char *); +int is_system_call(char *, ulong); +void generic_dump_irq(int); +void generic_get_irq_affinity(int); +void generic_show_interrupts(int, ulong *); +int generic_dis_filter(ulong, char *, unsigned int); +int kernel_BUG_encoding_bytes(void); +void display_sys_stats(void); +char *get_uptime(char *, ulonglong *); +void clone_bt_info(struct bt_info *, struct bt_info *, struct task_context *); +void dump_kernel_table(int); +void dump_bt_info(struct bt_info *, char *where); +void dump_log(int); +#define SHOW_LOG_LEVEL (0x1) +#define SHOW_LOG_DICT (0x2) +#define SHOW_LOG_TEXT (0x4) +void set_cpu(int); +void clear_machdep_cache(void); +struct stack_hook *gather_text_list(struct bt_info *); +int get_cpus_online(void); +int get_cpus_active(void); +int get_cpus_present(void); +int get_cpus_possible(void); +int check_offline_cpu(int); +int hide_offline_cpu(int); +int get_highest_cpu_online(void); +int get_highest_cpu_present(void); +int get_cpus_to_display(void); +void get_log_from_vmcoreinfo(char *file); +int in_cpu_map(int, int); +void paravirt_init(void); +void print_stack_text_syms(struct bt_info *, ulong, ulong); +void back_trace(struct bt_info *); +int in_alternate_stack(int, ulong); +ulong cpu_map_addr(const char *type); +#define BT_RAW (0x1ULL) +#define BT_SYMBOLIC_ARGS (0x2ULL) +#define BT_FULL (0x4ULL) +#define BT_TEXT_SYMBOLS (0x8ULL) +#define BT_TEXT_SYMBOLS_PRINT (0x10ULL) +#define BT_TEXT_SYMBOLS_NOPRINT (0x20ULL) +#define BT_USE_GDB (0x40ULL) +#define BT_EXCEPTION_FRAME (0x80ULL) +#define BT_LINE_NUMBERS (0x100ULL) +#define BT_USER_EFRAME (0x200ULL) +#define BT_INCOMPLETE_USER_EFRAME (BT_USER_EFRAME) +#define BT_SAVE_LASTSP (0x400ULL) +#define BT_FROM_EXCEPTION (0x800ULL) +#define BT_FROM_CALLFRAME (0x1000ULL) +#define BT_EFRAME_SEARCH (0x2000ULL) +#define BT_SPECULATE (0x4000ULL) +#define BT_FRAMESIZE_DISABLE (BT_SPECULATE) +#define BT_RESCHEDULE (0x8000ULL) +#define BT_SCHEDULE (BT_RESCHEDULE) +#define BT_RET_FROM_SMP_FORK (0x10000ULL) +#define BT_STRACE (0x20000ULL) +#define BT_KDUMP_ADJUST (BT_STRACE) +#define BT_KSTACKP (0x40000ULL) +#define BT_LOOP_TRAP (0x80000ULL) +#define BT_BUMP_FRAME_LEVEL (0x100000ULL) +#define BT_EFRAME_COUNT (0x200000ULL) +#define BT_CPU_IDLE (0x400000ULL) +#define BT_WRAP_TRAP (0x800000ULL) +#define BT_KERNEL_THREAD (0x1000000ULL) +#define BT_ERROR_MASK (BT_LOOP_TRAP|BT_WRAP_TRAP|BT_KERNEL_THREAD|BT_CPU_IDLE) +#define BT_UNWIND_ERROR (0x2000000ULL) +#define BT_OLD_BACK_TRACE (0x4000000ULL) +#define BT_OPT_BACK_TRACE (0x4000000ULL) +#define BT_FRAMESIZE_DEBUG (0x8000000ULL) +#define BT_CONTEXT_SWITCH (0x10000000ULL) +#define BT_HARDIRQ (0x20000000ULL) +#define BT_SOFTIRQ (0x40000000ULL) +#define BT_CHECK_CALLER (0x80000000ULL) +#define BT_NO_CHECK_CALLER (0x100000000ULL) +#define BT_EXCEPTION_STACK (0x200000000ULL) +#define BT_IRQSTACK (0x400000000ULL) +#define BT_DUMPFILE_SEARCH (0x800000000ULL) +#define BT_EFRAME_SEARCH2 (0x1000000000ULL) +#define BT_START (0x2000000000ULL) +#define BT_TEXT_SYMBOLS_ALL (0x4000000000ULL) +#define BT_XEN_STOP_THIS_CPU (0x8000000000ULL) +#define BT_THREAD_GROUP (0x10000000000ULL) +#define BT_SAVE_EFRAME_IP (0x20000000000ULL) +#define BT_FULL_SYM_SLAB (0x40000000000ULL) +#define BT_KDUMP_ELF_REGS (0x80000000000ULL) +#define BT_USER_SPACE (0x100000000000ULL) +#define BT_KERNEL_SPACE (0x200000000000ULL) +#define BT_FULL_SYM_SLAB2 (0x400000000000ULL) +#define BT_EFRAME_TARGET (0x800000000000ULL) +#define BT_CPUMASK (0x1000000000000ULL) +#define BT_SHOW_ALL_REGS (0x2000000000000ULL) +#define BT_REGS_NOT_FOUND (0x4000000000000ULL) +#define BT_SYMBOL_OFFSET (BT_SYMBOLIC_ARGS) + +#define BT_REF_HEXVAL (0x1) +#define BT_REF_SYMBOL (0x2) +#define BT_REF_FOUND (0x4) +#define BT_REFERENCE_CHECK(X) ((X)->ref) +#define BT_REFERENCE_FOUND(X) ((X)->ref && ((X)->ref->cmdflags & BT_REF_FOUND)) + +#define NO_MODULES() \ + (!kt->module_list || (kt->module_list == kt->kernel_module)) + +#define USER_EFRAME_ADDR(task) \ + ((ulong)task + UNION_SIZE("task_union") - SIZE(pt_regs)) + +struct remote_file { + char *filename; + char *local; + int fd; + int flags; + int type; + long csum; + off_t size; +}; + +#define REMOTE_VERBOSE (O_RDWR << 1) +#define REMOTE_COPY_DONE (REMOTE_VERBOSE << 1) +#define TYPE_ELF (REMOTE_VERBOSE << 2) +#define TYPE_DEVMEM (REMOTE_VERBOSE << 3) +#define TYPE_MCLXCD (REMOTE_VERBOSE << 4) +#define TYPE_LKCD (REMOTE_VERBOSE << 5) +#define TYPE_S390D (REMOTE_VERBOSE << 6) +#define TYPE_NETDUMP (REMOTE_VERBOSE << 7) + +ulonglong xen_m2p(ulonglong); + +void read_in_kernel_config(int); + +#define IKCFG_INIT (0) +#define IKCFG_READ (1) +#define IKCFG_SETUP (2) +#define IKCFG_FREE (3) + +int get_kernel_config(char *, char **); +enum { + IKCONFIG_N, + IKCONFIG_Y, + IKCONFIG_M, + IKCONFIG_STR, +}; + +#define MAGIC_START "IKCFG_ST" +#define MAGIC_END "IKCFG_ED" +#define MAGIC_SIZE (sizeof(MAGIC_START) - 1) + +/* + * dev.c + */ +void dev_init(void); +void dump_dev_table(void); + +#ifdef ARM +void arm_init(int); +void arm_dump_machdep_table(ulong); +int arm_is_vmalloc_addr(ulong); +void arm_dump_backtrace_entry(struct bt_info *, int, ulong, ulong); + +#define display_idt_table() \ + error(FATAL, "-d option is not applicable to ARM architecture\n") + +struct arm_pt_regs { + ulong uregs[18]; +}; + +#define ARM_cpsr uregs[16] +#define ARM_pc uregs[15] +#define ARM_lr uregs[14] +#define ARM_sp uregs[13] +#define ARM_ip uregs[12] +#define ARM_fp uregs[11] +#define ARM_r10 uregs[10] +#define ARM_r9 uregs[9] +#define ARM_r8 uregs[8] +#define ARM_r7 uregs[7] +#define ARM_r6 uregs[6] +#define ARM_r5 uregs[5] +#define ARM_r4 uregs[4] +#define ARM_r3 uregs[3] +#define ARM_r2 uregs[2] +#define ARM_r1 uregs[1] +#define ARM_r0 uregs[0] +#define ARM_ORIG_r0 uregs[17] + +#define KSYMS_START (0x1) +#define PHYS_BASE (0x2) +#define PGTABLE_V2 (0x4) +#define IDMAP_PGD (0x8) + +#define KVBASE_MASK (0x1ffffff) + +struct machine_specific { + ulong phys_base; + ulong vmalloc_start_addr; + ulong modules_vaddr; + ulong modules_end; + ulong kernel_text_start; + ulong kernel_text_end; + ulong exception_text_start; + ulong exception_text_end; + ulonglong last_pgd_read_lpae; + ulonglong last_pmd_read_lpae; + ulonglong last_ptbl_read_lpae; + struct arm_pt_regs *crash_task_regs; + int unwind_index_prel31; +}; + +int init_unwind_tables(void); +void unwind_backtrace(struct bt_info *); +#endif /* ARM */ + +/* + * arm64.c + */ +#ifdef ARM64 +void arm64_init(int); +void arm64_dump_machdep_table(ulong); +ulong arm64_VTOP(ulong); +int arm64_IS_VMALLOC_ADDR(ulong); +ulong arm64_swp_type(ulong); +ulong arm64_swp_offset(ulong); +#endif + +/* + * alpha.c + */ +#ifdef ALPHA +void alpha_init(int); +void alpha_dump_machdep_table(ulong); +#define display_idt_table() \ + error(FATAL, "-d option is not applicable to alpha architecture\n") + +#define HWRESET_TASK(X) ((machdep->flags & HWRESET) && is_task_active(X) && \ + (task_to_context(X)->processor == 0)) +#endif + +/* + * x86.c + */ +#ifdef X86 +void x86_init(int); +void x86_dump_machdep_table(ulong); +void x86_display_idt_table(void); +#define display_idt_table() x86_display_idt_table() +#define KSYMS_START (0x1) +void x86_dump_eframe_common(struct bt_info *bt, ulong *, int); +char *x86_function_called_by(ulong); +struct syment *x86_jmp_error_code(ulong); +struct syment *x86_text_lock_jmp(ulong, ulong *); + +struct machine_specific { + ulong *idt_table; + ulong entry_tramp_start; + ulong entry_tramp_end; + physaddr_t entry_tramp_start_phys; + ulonglong last_pmd_read_PAE; + ulonglong last_ptbl_read_PAE; + ulong page_protnone; + int max_numnodes; + ulong *remap_start_vaddr; + ulong *remap_end_vaddr; + ulong *remap_start_pfn; +}; + +struct syment *x86_is_entry_tramp_address(ulong, ulong *); +#endif + +/* + * x86_64.c + */ +#ifdef X86_64 +void x86_64_init(int); +void x86_64_dump_machdep_table(ulong); +ulong x86_64_PTOV(ulong); +ulong x86_64_VTOP(ulong); +int x86_64_IS_VMALLOC_ADDR(ulong); +void x86_64_display_idt_table(void); +#define display_idt_table() x86_64_display_idt_table() +long x86_64_exception_frame(ulong, ulong, char *, struct bt_info *, FILE *); +#define EFRAME_INIT (0) + +struct x86_64_pt_regs_offsets { + long r15; + long r14; + long r13; + long r12; + long rbp; + long rbx; +/* arguments: non interrupts/non tracing syscalls only save upto here*/ + long r11; + long r10; + long r9; + long r8; + long rax; + long rcx; + long rdx; + long rsi; + long rdi; + long orig_rax; +/* end of arguments */ +/* cpu exception frame or undefined */ + long rip; + long cs; + long eflags; + long rsp; + long ss; +}; + +#define MAX_EXCEPTION_STACKS 7 +#define NMI_STACK (machdep->machspec->stkinfo.NMI_stack_index) + +struct x86_64_stkinfo { + ulong ebase[NR_CPUS][MAX_EXCEPTION_STACKS]; + int esize[MAX_EXCEPTION_STACKS]; + ulong ibase[NR_CPUS]; + int isize; + int NMI_stack_index; + char *exception_stacks[MAX_EXCEPTION_STACKS]; +}; + +struct machine_specific { + ulong userspace_top; + ulong page_offset; + ulong vmalloc_start_addr; + ulong vmalloc_end; + ulong vmemmap_vaddr; + ulong vmemmap_end; + ulong modules_vaddr; + ulong modules_end; + ulong phys_base; + char *pml4; + char *upml; + ulong last_upml_read; + ulong last_pml4_read; + char *irqstack; + ulong irq_eframe_link; + struct x86_64_pt_regs_offsets pto; + struct x86_64_stkinfo stkinfo; + ulong *current; + ulong *crash_nmi_rsp; + ulong vsyscall_page; + ulong thread_return; + ulong page_protnone; + ulong GART_start; + ulong GART_end; + ulong kernel_image_size; +}; + +#define KSYMS_START (0x1) +#define PT_REGS_INIT (0x2) +#define VM_ORIG (0x4) +#define VM_2_6_11 (0x8) +#define VM_XEN (0x10) +#define NO_TSS (0x20) +#define SCHED_TEXT (0x40) +#define PHYS_BASE (0x80) +#define VM_XEN_RHEL4 (0x100) +#define FRAMEPOINTER (0x200) +#define GART_REGION (0x400) +#define NESTED_NMI (0x800) +#define RANDOMIZED (0x1000) + +#define VM_FLAGS (VM_ORIG|VM_2_6_11|VM_XEN|VM_XEN_RHEL4) + +#define _2MB_PAGE_MASK (~((MEGABYTES(2))-1)) + +#endif + +#if defined(X86) || defined(X86_64) + +/* + * unwind_x86_32_64.c + */ +void init_unwind_table(void); +int dwarf_backtrace(struct bt_info *, int, ulong); +void dwarf_debug(struct bt_info *); +int dwarf_print_stack_entry(struct bt_info *, int); + +#endif + + +/* + * ppc64.c + */ + +/* + * This structure was copied from kernel source + * in include/asm-ppc/ptrace.h + */ +struct ppc64_pt_regs { + long gpr[32]; + long nip; + long msr; + long orig_gpr3; /* Used for restarting system calls */ + long ctr; + long link; + long xer; + long ccr; + long mq; /* 601 only (not used at present) */ + /* Used on APUS to hold IPL value. */ + long trap; /* Reason for being here */ + long dar; /* Fault registers */ + long dsisr; + long result; /* Result of a system call */ +}; + +struct ppc64_elf_siginfo { + int si_signo; + int si_code; + int si_errno; +}; + +struct ppc64_elf_prstatus { + struct ppc64_elf_siginfo pr_info; + short pr_cursig; + unsigned long pr_sigpend; + unsigned long pr_sighold; + pid_t pr_pid; + pid_t pr_ppid; + pid_t pr_pgrp; + pid_t pr_sid; + struct timeval pr_utime; + struct timeval pr_stime; + struct timeval pr_cutime; + struct timeval pr_cstime; + struct ppc64_pt_regs pr_reg; + int pr_fpvalid; +}; + +#ifdef PPC64 + +struct ppc64_vmemmap { + unsigned long phys; + unsigned long virt; +}; + +/* + * Used to store the HW interrupt stack. It is only for 2.4. + */ +struct machine_specific { + ulong hwintrstack[NR_CPUS]; + char *hwstackbuf; + uint hwstacksize; + + uint l4_index_size; + uint l3_index_size; + uint l2_index_size; + uint l1_index_size; + + uint ptrs_per_l4; + uint ptrs_per_l3; + uint ptrs_per_l2; + uint ptrs_per_l1; + + uint l4_shift; + uint l3_shift; + uint l2_shift; + uint l1_shift; + + uint pte_rpn_shift; + ulong pte_rpn_mask; + ulong pgd_masked_bits; + ulong pud_masked_bits; + ulong pmd_masked_bits; + + int vmemmap_cnt; + int vmemmap_psize; + ulong vmemmap_base; + struct ppc64_vmemmap *vmemmap_list; + ulong _page_pte; + ulong _page_present; + ulong _page_user; + ulong _page_rw; + ulong _page_guarded; + ulong _page_coherent; + ulong _page_no_cache; + ulong _page_writethru; + ulong _page_dirty; + ulong _page_accessed; + int (*is_kvaddr)(ulong); + int (*is_vmaddr)(ulong); +}; + +void ppc64_init(int); +void ppc64_dump_machdep_table(ulong); +#define display_idt_table() \ + error(FATAL, "-d option is not applicable to PowerPC architecture\n") +#define KSYMS_START (0x1) +#define VM_ORIG (0x2) +#define VMEMMAP_AWARE (0x4) +#define BOOK3E (0x8) +#define PHYS_ENTRY_L4 (0x10) +#define SWAP_ENTRY_L4 (0x20) +/* + * The flag bit for radix MMU in cpu_spec.mmu_features + * in the kernel is also 0x40. + */ +#define RADIX_MMU (0x40) + +#define REGION_SHIFT (60UL) +#define REGION_ID(addr) (((unsigned long)(addr)) >> REGION_SHIFT) +#define VMEMMAP_REGION_ID (0xfUL) +#endif + +/* + * ppc.c + */ +#ifdef PPC +void ppc_init(int); +void ppc_dump_machdep_table(ulong); +void ppc_relocate_nt_prstatus_percpu(void **, uint *); +#define display_idt_table() \ + error(FATAL, "-d option is not applicable to PowerPC architecture\n") +#define KSYMS_START (0x1) +/* This should match PPC_FEATURE_BOOKE from include/asm-powerpc/cputable.h */ +#define CPU_BOOKE (0x00008000) +#else +#define ppc_relocate_nt_prstatus_percpu(X,Y) do {} while (0) +#endif + +/* + * lkcd_fix_mem.c + */ + +struct _dump_header_asm_s; +struct _dump_header_s; +ulong get_lkcd_switch_stack(ulong); +int fix_addr_v8(struct _dump_header_asm_s *); +int lkcd_dump_init_v8_arch(struct _dump_header_s *dh); +int fix_addr_v7(int); +int get_lkcd_regs_for_cpu_arch(int cpu, ulong *eip, ulong *esp); +int lkcd_get_kernel_start_v8(ulong *addr); + +/* + * lkcd_v8.c + */ +int get_lkcd_regs_for_cpu_v8(struct bt_info *bt, ulong *eip, ulong *esp); + +/* + * ia64.c + */ +#ifdef IA64 +void ia64_init(int); +void ia64_dump_machdep_table(ulong); +void ia64_dump_line_number(ulong); +ulong ia64_get_switch_stack(ulong); +void ia64_exception_frame(ulong, struct bt_info *bt); +ulong ia64_PTOV(ulong); +ulong ia64_VTOP(ulong); +int ia64_IS_VMALLOC_ADDR(ulong); +#define display_idt_table() \ + error(FATAL, "-d option TBD on ia64 architecture\n"); +int ia64_in_init_stack(ulong addr); +int ia64_in_mca_stack_hyper(ulong addr, struct bt_info *bt); +physaddr_t ia64_xen_kdump_p2m(struct xen_kdump_data *xkd, physaddr_t pseudo); + +#define OLD_UNWIND (0x1) /* CONFIG_IA64_NEW_UNWIND not turned on */ +#define NEW_UNWIND (0x2) /* CONFIG_IA64_NEW_UNWIND turned on */ +#define NEW_UNW_V1 (0x4) +#define NEW_UNW_V2 (0x8) +#define NEW_UNW_V3 (0x10) +#define UNW_OUT_OF_SYNC (0x20) /* shared data structures out of sync */ +#define UNW_READ (0x40) /* kernel unw has been read successfully */ +#define MEM_LIMIT (0x80) +#define UNW_PTREGS (0x100) +#define UNW_R0 (0x200) + +#undef IA64_RBS_OFFSET +#undef IA64_STK_OFFSET +#define IA64_RBS_OFFSET ((SIZE(task_struct) + 15) & ~15) +#define IA64_STK_OFFSET (STACKSIZE()) + +struct machine_specific { + ulong cpu_data_address; + ulong unimpl_va_mask; + ulong unimpl_pa_mask; + long unw_tables_offset; + long unw_kernel_table_offset; + long unw_pt_regs_offsets; + int script_index; + struct unw_script *script_cache; + ulong script_cache_fills; + ulong script_cache_hits; + void *unw; + ulong mem_limit; + ulong kernel_region; + ulong kernel_start; + ulong phys_start; + ulong vmalloc_start; + char *ia64_memmap; + uint64_t efi_memmap_size; + uint64_t efi_memdesc_size; + void (*unwind_init)(void); + void (*unwind)(struct bt_info *); + void (*dump_unwind_stats)(void); + int (*unwind_debug)(ulong); + int ia64_init_stack_size; +}; + + +/* + * unwind.c + */ +void unwind_init_v1(void); +void unwind_v1(struct bt_info *); +void dump_unwind_stats_v1(void); +int unwind_debug_v1(ulong); + +void unwind_init_v2(void); +void unwind_v2(struct bt_info *); +void dump_unwind_stats_v2(void); +int unwind_debug_v2(ulong); + +void unwind_init_v3(void); +void unwind_v3(struct bt_info *); +void dump_unwind_stats_v3(void); +int unwind_debug_v3(ulong); + +#endif /* IA64 */ + +/* + * s390.c + */ +#ifdef S390 +void s390_init(int); +void s390_dump_machdep_table(ulong); +#define display_idt_table() \ + error(FATAL, "-d option is not applicable to S390 architecture\n") +#define KSYMS_START (0x1) +#endif + +/* + * s390_dump.c + */ +int is_s390_dump(char *); +FILE* s390_dump_init(char *); +int read_s390_dumpfile(int, void *, int, ulong, physaddr_t); +int write_s390_dumpfile(int, void *, int, ulong, physaddr_t); +uint s390_page_size(void); +int s390_memory_used(void); +int s390_free_memory(void); +int s390_memory_dump(FILE *); +ulong get_s390_panic_task(void); +void get_s390_panicmsg(char *); + +/* + * s390x.c + */ +#ifdef S390X +void s390x_init(int); +void s390x_dump_machdep_table(ulong); +#define display_idt_table() \ + error(FATAL, "-d option is not applicable to S390X architecture\n") +#define KSYMS_START (0x1) +#endif + +/* + * mips.c + */ +void mips_display_regs_from_elf_notes(int, FILE *); + +#ifdef MIPS +void mips_init(int); +void mips_dump_machdep_table(ulong); + +#define display_idt_table() \ + error(FATAL, "-d option is not applicable to MIPS architecture\n") + +struct mips_regset { + ulong regs[45]; +}; + +struct mips_pt_regs_main { + ulong regs[32]; + ulong cp0_status; + ulong hi; + ulong lo; +}; + +struct mips_pt_regs_cp0 { + ulong cp0_badvaddr; + ulong cp0_cause; + ulong cp0_epc; +}; + +#define KSYMS_START (0x1) +#define PHYS_BASE (0x2) + +#define KVBASE_MASK (0x1ffffff) + +struct machine_specific { + ulong phys_base; + ulong vmalloc_start_addr; + ulong modules_vaddr; + ulong modules_end; + + ulong _page_present; + ulong _page_read; + ulong _page_write; + ulong _page_accessed; + ulong _page_modified; + ulong _page_global; + ulong _page_valid; + ulong _page_no_read; + ulong _page_no_exec; + ulong _page_dirty; + + ulong _pfn_shift; + +#define _PAGE_PRESENT (machdep->machspec->_page_present) +#define _PAGE_READ (machdep->machspec->_page_read) +#define _PAGE_WRITE (machdep->machspec->_page_write) +#define _PAGE_ACCESSED (machdep->machspec->_page_accessed) +#define _PAGE_MODIFIED (machdep->machspec->_page_modified) +#define _PAGE_GLOBAL (machdep->machspec->_page_global) +#define _PAGE_VALID (machdep->machspec->_page_valid) +#define _PAGE_NO_READ (machdep->machspec->_page_no_read) +#define _PAGE_NO_EXEC (machdep->machspec->_page_no_exec) +#define _PAGE_DIRTY (machdep->machspec->_page_dirty) +#define _PFN_SHIFT (machdep->machspec->_pfn_shift) + + struct mips_regset *crash_task_regs; +}; +#endif /* MIPS */ + +/* + * sparc64.c + */ +#ifdef SPARC64 +void sparc64_init(int); +void sparc64_dump_machdep_table(ulong); +int sparc64_vmalloc_addr(ulong); +#define display_idt_table() \ + error(FATAL, "The -d option is not applicable to sparc64.\n") +#endif + +/* + * netdump.c + */ +int is_netdump(char *, ulong); +uint netdump_page_size(void); +int read_netdump(int, void *, int, ulong, physaddr_t); +int write_netdump(int, void *, int, ulong, physaddr_t); +int netdump_free_memory(void); +int netdump_memory_used(void); +int netdump_init(char *, FILE *); +ulong get_netdump_panic_task(void); +ulong get_netdump_switch_stack(ulong); +FILE *set_netdump_fp(FILE *); +int netdump_memory_dump(FILE *); +void get_netdump_regs(struct bt_info *, ulong *, ulong *); +int is_partial_netdump(void); +void get_netdump_regs_x86(struct bt_info *, ulong *, ulong *); +void get_netdump_regs_x86_64(struct bt_info *, ulong *, ulong *); +void dump_registers_for_elf_dumpfiles(void); +struct vmcore_data; +struct vmcore_data *get_kdump_vmcore_data(void); +int read_kdump(int, void *, int, ulong, physaddr_t); +int write_kdump(int, void *, int, ulong, physaddr_t); +int is_kdump(char *, ulong); +int kdump_init(char *, FILE *); +ulong get_kdump_panic_task(void); +uint kdump_page_size(void); +int kdump_free_memory(void); +int kdump_memory_used(void); +int kdump_memory_dump(FILE *); +void get_kdump_regs(struct bt_info *, ulong *, ulong *); +void xen_kdump_p2m_mfn(char *); +int is_sadump_xen(void); +void set_xen_phys_start(char *); +ulong xen_phys_start(void); +int xen_major_version(void); +int xen_minor_version(void); +int get_netdump_arch(void); +int exist_regs_in_elf_notes(struct task_context *); +void *get_regs_from_elf_notes(struct task_context *); +void map_cpus_to_prstatus(void); +int arm_kdump_phys_base(ulong *); +int is_proc_kcore(char *, ulong); +int proc_kcore_init(FILE *); +int read_proc_kcore(int, void *, int, ulong, physaddr_t); +int write_proc_kcore(int, void *, int, ulong, physaddr_t); +int kcore_memory_dump(FILE *); +void dump_registers_for_qemu_mem_dump(void); +void kdump_backup_region_init(void); +void display_regs_from_elf_notes(int, FILE *); +void display_ELF_note(int, int, void *, FILE *); +void *netdump_get_prstatus_percpu(int); +#define PRSTATUS_NOTE (1) +#define QEMU_NOTE (2) + +/* + * ramdump.c + */ +int is_ramdump(char *pattern); +char *ramdump_to_elf(void); +void ramdump_elf_output_file(char *opt); +void ramdump_cleanup(void); +int read_ramdump(int fd, void *bufptr, int cnt, ulong addr, physaddr_t paddr); +void show_ramdump_files(void); +void dump_ramdump_data(void); +int is_ramdump_image(void); + +/* + * diskdump.c + */ +int is_diskdump(char *); +uint diskdump_page_size(void); +int read_diskdump(int, void *, int, ulong, physaddr_t); +int write_diskdump(int, void *, int, ulong, physaddr_t); +int diskdump_free_memory(void); +int diskdump_memory_used(void); +int diskdump_init(char *, FILE *); +ulong get_diskdump_panic_task(void); +ulong get_diskdump_switch_stack(ulong); +int diskdump_memory_dump(FILE *); +FILE *set_diskdump_fp(FILE *); +void get_diskdump_regs(struct bt_info *, ulong *, ulong *); +int diskdump_phys_base(unsigned long *); +ulong *diskdump_flags; +int is_partial_diskdump(void); +int dumpfile_is_split(void); +void show_split_dumpfiles(void); +void x86_process_elf_notes(void *, unsigned long); +void *diskdump_get_prstatus_percpu(int); +void map_cpus_to_prstatus_kdump_cmprs(void); +void diskdump_display_regs(int, FILE *); +void process_elf32_notes(void *, ulong); +void process_elf64_notes(void *, ulong); +void dump_registers_for_compressed_kdump(void); + +/* + * makedumpfile.c + */ +void check_flattened_format(char *file); +int is_flattened_format(char *file); +int read_flattened_format(int fd, off_t offset, void *buf, size_t size); +void dump_flat_header(FILE *); + +/* + * xendump.c + */ +int is_xendump(char *); +int read_xendump(int, void *, int, ulong, physaddr_t); +int write_xendump(int, void *, int, ulong, physaddr_t); +uint xendump_page_size(void); +int xendump_free_memory(void); +int xendump_memory_used(void); +int xendump_init(char *, FILE *); +int xendump_memory_dump(FILE *); +ulong get_xendump_panic_task(void); +void get_xendump_regs(struct bt_info *, ulong *, ulong *); +char *xc_core_mfn_to_page(ulong, char *); +int xc_core_mfn_to_page_index(ulong); +void xendump_panic_hook(char *); +int read_xendump_hyper(int, void *, int, ulong, physaddr_t); +struct xendump_data *get_xendump_data(void); + +/* + * kvmdump.c + */ +int is_kvmdump(char *); +int is_kvmdump_mapfile(char *); +int kvmdump_init(char *, FILE *); +int read_kvmdump(int, void *, int, ulong, physaddr_t); +int write_kvmdump(int, void *, int, ulong, physaddr_t); +int kvmdump_free_memory(void); +int kvmdump_memory_used(void); +int kvmdump_memory_dump(FILE *); +void get_kvmdump_regs(struct bt_info *, ulong *, ulong *); +ulong get_kvmdump_panic_task(void); +int kvmdump_phys_base(unsigned long *); +void kvmdump_display_regs(int, FILE *); +void set_kvmhost_type(char *); +void set_kvm_iohole(char *); +struct kvm_register_set { + union { + uint32_t cs; + uint32_t ss; + uint32_t ds; + uint32_t es; + uint32_t fs; + uint32_t gs; + uint64_t ip; + uint64_t flags; + uint64_t regs[16]; + } x86; +}; +int get_kvm_register_set(int, struct kvm_register_set *); + +/* + * sadump.c + */ +int is_sadump(char *); +uint sadump_page_size(void); +int read_sadump(int, void *, int, ulong, physaddr_t); +int write_sadump(int, void *, int, ulong, physaddr_t); +int sadump_init(char *, FILE *); +int sadump_is_diskset(void); +ulong get_sadump_panic_task(void); +ulong get_sadump_switch_stack(ulong); +int sadump_memory_used(void); +int sadump_free_memory(void); +int sadump_memory_dump(FILE *); +FILE *set_sadump_fp(FILE *); +void get_sadump_regs(struct bt_info *bt, ulong *ipp, ulong *spp); +void sadump_display_regs(int, FILE *); +int sadump_phys_base(ulong *); +void sadump_show_diskset(void); +int sadump_is_zero_excluded(void); +void sadump_set_zero_excluded(void); +void sadump_unset_zero_excluded(void); +struct sadump_data; +struct sadump_data *get_sadump_data(void); + +/* + * qemu.c + */ +int qemu_init(char *); + +/* + * qemu-load.c + */ +int is_qemu_vm_file(char *); +void dump_qemu_header(FILE *); + +/* + * net.c + */ +void net_init(void); +void dump_net_table(void); +void dump_sockets_workhorse(ulong, ulong, struct reference *); + +/* + * remote.c + */ +int is_remote_daemon(char *); +physaddr_t get_remote_phys_base(physaddr_t, physaddr_t); +physaddr_t remote_vtop(int, physaddr_t); +int get_remote_regs(struct bt_info *, ulong *, ulong *); +physaddr_t get_remote_cr3(int); +void remote_fd_init(void); +int get_remote_file(struct remote_file *); +uint remote_page_size(void); +int find_remote_module_objfile(struct load_module *lm, char *, char *); +int remote_free_memory(void); +int remote_memory_dump(int); +int remote_memory_used(void); +void remote_exit(void); +int remote_execute(void); +void remote_clear_pipeline(void); +int remote_memory_read(int, char *, int, physaddr_t, int); + +/* + * vmware_vmss.c + */ +int is_vmware_vmss(char *filename); +int vmware_vmss_init(char *filename, FILE *ofp); +uint vmware_vmss_page_size(void); +int read_vmware_vmss(int, void *, int, ulong, physaddr_t); +int write_vmware_vmss(int, void *, int, ulong, physaddr_t); + +/* + * gnu_binutils.c + */ + +/* NO LONGER IN USE */ + +/* + * test.c + */ +void cmd_template(void); +void foreach_test(ulong, ulong); + +/* + * va_server.c + */ +int mclx_page_size(void); +int vas_memory_used(void); +int vas_memory_dump(FILE *); +int vas_free_memory(char *); +void set_vas_debug(ulong); +size_t vas_write(void *, size_t); +int va_server_init(char *, ulong *, ulong *, ulong *); +size_t vas_read(void *, size_t); +int vas_lseek(ulong, int); + +/* + * lkcd_x86_trace.c + */ +int lkcd_x86_back_trace(struct bt_info *, int, FILE *); + +/* + * lkcd_common.c + */ +int lkcd_dump_init(FILE *, int, char *); +ulong get_lkcd_panic_task(void); +void get_lkcd_panicmsg(char *); +int is_lkcd_compressed_dump(char *); +void dump_lkcd_environment(ulong); +int lkcd_lseek(physaddr_t); +long lkcd_read(void *, long); +void set_lkcd_debug(ulong); +FILE *set_lkcd_fp(FILE *); +uint lkcd_page_size(void); +int lkcd_memory_used(void); +int lkcd_memory_dump(FILE *); +int lkcd_free_memory(void); +void lkcd_print(char *, ...); +void set_remote_lkcd_panic_data(ulong, char *); +void set_lkcd_nohash(void); +int lkcd_load_dump_page_header(void *, ulong); +void lkcd_dumpfile_complaint(uint32_t, uint32_t, int); +int set_mb_benchmark(ulong); +ulonglong fix_lkcd_address(ulonglong); +int lkcd_get_kernel_start(ulong *addr); +int get_lkcd_regs_for_cpu(struct bt_info *bt, ulong *eip, ulong *esp); + +/* + * lkcd_v1.c + */ +int lkcd_dump_init_v1(FILE *, int); +void dump_dump_page_v1(char *, void *); +void dump_lkcd_environment_v1(ulong); +uint32_t get_dp_size_v1(void); +uint32_t get_dp_flags_v1(void); +uint64_t get_dp_address_v1(void); + +/* + * lkcd_v2_v3.c + */ +int lkcd_dump_init_v2_v3(FILE *, int); +void dump_dump_page_v2_v3(char *, void *); +void dump_lkcd_environment_v2_v3(ulong); +uint32_t get_dp_size_v2_v3(void); +uint32_t get_dp_flags_v2_v3(void); +uint64_t get_dp_address_v2_v3(void); + +/* + * lkcd_v5.c + */ +int lkcd_dump_init_v5(FILE *, int); +void dump_dump_page_v5(char *, void *); +void dump_lkcd_environment_v5(ulong); +uint32_t get_dp_size_v5(void); +uint32_t get_dp_flags_v5(void); +uint64_t get_dp_address_v5(void); + +/* + * lkcd_v7.c + */ +int lkcd_dump_init_v7(FILE *, int, char *); +void dump_dump_page_v7(char *, void *); +void dump_lkcd_environment_v7(ulong); +uint32_t get_dp_size_v7(void); +uint32_t get_dp_flags_v7(void); +uint64_t get_dp_address_v7(void); + +/* + * lkcd_v8.c + */ +int lkcd_dump_init_v8(FILE *, int, char *); +void dump_dump_page_v8(char *, void *); +void dump_lkcd_environment_v8(ulong); +uint32_t get_dp_size_v8(void); +uint32_t get_dp_flags_v8(void); +uint64_t get_dp_address_v8(void); + +#ifdef LKCD_COMMON +/* + * Until they differ across versions, these remain usable in the common + * routines in lkcd_common.c + */ +#define LKCD_DUMP_MAGIC_NUMBER (0xa8190173618f23edULL) +#define LKCD_DUMP_MAGIC_LIVE (0xa8190173618f23cdULL) + +#define LKCD_DUMP_V1 (0x1) /* DUMP_VERSION_NUMBER */ +#define LKCD_DUMP_V2 (0x2) /* DUMP_VERSION_NUMBER */ +#define LKCD_DUMP_V3 (0x3) /* DUMP_VERSION_NUMBER */ +#define LKCD_DUMP_V5 (0x5) /* DUMP_VERSION_NUMBER */ +#define LKCD_DUMP_V6 (0x6) /* DUMP_VERSION_NUMBER */ +#define LKCD_DUMP_V7 (0x7) /* DUMP_VERSION_NUMBER */ +#define LKCD_DUMP_V8 (0x8) /* DUMP_VERSION_NUMBER */ +#define LKCD_DUMP_V9 (0x9) /* DUMP_VERSION_NUMBER */ +#define LKCD_DUMP_V10 (0xa) /* DUMP_VERSION_NUMBER */ + +#define LKCD_DUMP_VERSION_NUMBER_MASK (0xf) +#define LKCD_DUMP_RAW (0x1) /* DUMP_[DH_]RAW */ +#define LKCD_DUMP_COMPRESSED (0x2) /* DUMP_[DH_]COMPRESSED */ +#define LKCD_DUMP_END (0x4) /* DUMP_[DH_]END */ + +#define LKCD_DUMP_COMPRESS_NONE (0x0) /* DUMP_COMPRESS_NONE */ +#define LKCD_DUMP_COMPRESS_RLE (0x1) /* DUMP_COMPRESS_RLE */ +#define LKCD_DUMP_COMPRESS_GZIP (0x2) /* DUMP_COMPRESS_GZIP */ + +#define LKCD_DUMP_MCLX_V0 (0x80000000) /* MCLX mod of LKCD */ +#define LKCD_DUMP_MCLX_V1 (0x40000000) /* Extra page header data */ +#define LKCD_OFFSET_TO_FIRST_PAGE (65536) + +#define MCLX_PAGE_HEADERS (4096) +#define MCLX_V1_PAGE_HEADER_CACHE ((sizeof(uint64_t)) * MCLX_PAGE_HEADERS) + +/* + * lkcd_load_dump_page_header() return values + */ +#define LKCD_DUMPFILE_OK (0) +#define LKCD_DUMPFILE_EOF (1) +#define LKCD_DUMPFILE_END (2) + +/* + * Common handling of LKCD dump environment + */ +#define LKCD_CACHED_PAGES (16) +#define LKCD_PAGE_HASH (32) +#define LKCD_DUMP_HEADER_ONLY (1) /* arguments to lkcd_dump_environment */ +#define LKCD_DUMP_PAGE_ONLY (2) + +#define LKCD_VALID (0x1) /* flags */ +#define LKCD_REMOTE (0x2) +#define LKCD_NOHASH (0x4) +#define LKCD_MCLX (0x8) +#define LKCD_BAD_DUMP (0x10) + +struct page_hash_entry { + uint32_t pg_flags; + uint64_t pg_addr; + off_t pg_hdr_offset; + struct page_hash_entry *next; +}; + +struct page_desc { + off_t offset; /* lseek offset in dump file */ +}; + +struct physmem_zone { + uint64_t start; + struct page_desc *pages; +}; + +struct fix_addrs { + ulong task; + ulong saddr; + ulong sw; +}; + + +struct lkcd_environment { + int fd; /* dumpfile file descriptor */ + ulong flags; /* flags from above */ + ulong debug; /* shadow of pc->debug */ + FILE *fp; /* abstracted fp for fprintf */ + void *dump_header; /* header stash, v1 or v2 */ + void *dump_header_asm; /* architecture specific header for v2 */ + void *dump_header_asm_smp; /* architecture specific header for v7 & v8 */ + void *dump_page; /* current page header holder */ + uint32_t version; /* version number of this dump */ + uint32_t page_size; /* size of a Linux memory page */ + int page_shift; /* byte address to page */ + int bits; /* processor bitsize */ + ulong panic_task; /* panic task address */ + char *panic_string; /* pointer to stashed panic string */ + uint32_t compression; /* compression type */ + uint32_t (*get_dp_size)(void); /* returns current page's dp_size */ + uint32_t (*get_dp_flags)(void); /* returns current page's dp_size */ + uint64_t (*get_dp_address)(void); /* returns current page's dp_address*/ + size_t page_header_size; /* size of version's page header */ + unsigned long curpos; /* offset into current page */ + uint64_t curpaddr; /* current page's physical address */ + off_t curhdroffs; /* current page's header offset */ + char *curbufptr; /* pointer to uncompressed page buffer */ + uint64_t kvbase; /* physical-to-LKCD page address format*/ + char *page_cache_buf; /* base of cached buffer pages */ + char *compressed_page; /* copy of compressed page data */ + int evict_index; /* next page to evict */ + ulong evictions; /* total evictions done */ + struct page_cache_hdr { /* header for each cached page */ + uint32_t pg_flags; + uint64_t pg_addr; + char *pg_bufptr; + ulong pg_hit_count; + } page_cache_hdr[LKCD_CACHED_PAGES]; + struct page_hash_entry *page_hash; + ulong total_pages; + ulong benchmark_pages; + ulong benchmarks_done; + off_t *mb_hdr_offsets; + ulong total_reads; + ulong cached_reads; + ulong hashed_reads; + ulong hashed; + ulong compressed; + ulong raw; + + /* lkcd_v7 additions */ + char *dumpfile_index; /* array of offsets for each page */ + int ifd; /* index file for dump (LKCD V7+) */ + long memory_pages; /* Mamimum index of dump pages */ + off_t page_offset_max; /* Offset of page with greatest offset seen so far */ + long page_index_max; /* Index of page with greatest offset seen so far */ + off_t *page_offsets; /* Pointer to huge array with seek offsets */ + /* NB: There are no holes in the array */ + + struct physmem_zone *zones; /* Array of physical memory zones */ + int num_zones; /* Number of zones initialized */ + int max_zones; /* Size of the zones array */ + long zoned_offsets; /* Number of stored page offsets */ + uint64_t zone_mask; + int zone_shift; + + int fix_addr_num; /* Number of active stacks to switch to saved values */ + struct fix_addrs *fix_addr; /* Array of active stacks to switch to saved values */ + + +}; + +#define ZONE_ALLOC 128 +#define ZONE_SIZE (MEGABYTES(512)) + +#define MEGABYTE_ALIGNED(vaddr) (!((uint64_t)(vaddr) & MEGABYTE_MASK)) + +#define LKCD_PAGE_HASH_INDEX(paddr) \ + (((paddr) >> lkcd->page_shift) % LKCD_PAGE_HASH) +#define LKCD_PAGES_PER_MEGABYTE() (MEGABYTES(1) / lkcd->page_size) +#define LKCD_PAGE_MEGABYTE(page) ((page) / LKCD_PAGES_PER_MEGABYTE()) +#define LKCD_BENCHMARKS_DONE() (lkcd->benchmarks_done >= lkcd->benchmark_pages) +#define LKCD_VALID_PAGE(flags) ((flags) & LKCD_VALID) + +extern struct lkcd_environment *lkcd; + +#define LKCD_DEBUG(x) (lkcd->debug >= (x)) +#undef BITS +#undef BITS32 +#undef BITS64 +#define BITS() (lkcd->bits) +#define BITS32() (lkcd->bits == 32) +#define BITS64() (lkcd->bits == 64) + +#endif /* LKCD_COMMON */ + +/* + * gdb_interface.c + */ +void gdb_main_loop(int, char **); +void display_gdb_banner(void); +void get_gdb_version(void); +void gdb_session_init(void); +void gdb_interface(struct gnu_request *); +int gdb_pass_through(char *, FILE *, ulong); +int gdb_readmem_callback(ulong, void *, int, int); +int gdb_line_number_callback(ulong, ulong, ulong); +int gdb_print_callback(ulong); +void gdb_error_hook(void); +void restore_gdb_sanity(void); +int is_gdb_command(int, ulong); +char *gdb_command_string(int, char *, int); +void dump_gnu_request(struct gnu_request *, int); +int gdb_CRASHDEBUG(ulong); +void dump_gdb_data(void); +void update_gdb_hooks(void); +void gdb_readnow_warning(void); +int gdb_set_crash_scope(ulong, char *); +extern int *gdb_output_format; +extern unsigned int *gdb_print_max; +extern int *gdb_prettyprint_structs; +extern int *gdb_prettyprint_arrays; +extern int *gdb_repeat_count_threshold; +extern int *gdb_stop_print_at_null; +extern unsigned int *gdb_output_radix; + +/* + * gdb/top.c + */ +extern void execute_command (char *, int); +#if defined(GDB_5_3) || defined(GDB_6_0) || defined(GDB_6_1) +extern void (*command_loop_hook)(void); +extern void (*error_hook)(void); +#else +extern void (*deprecated_command_loop_hook)(void); + +/* + * gdb/exceptions.c + */ +extern void (*error_hook)(void); +#endif + +/* + * gdb/symtab.c + */ +extern void gdb_command_funnel(struct gnu_request *); + +/* + * gdb/symfile.c + */ +#if defined(GDB_6_0) || defined(GDB_6_1) +struct objfile; +extern void (*target_new_objfile_hook)(struct objfile *); +#endif + +/* + * gdb/valprint.c + */ +extern unsigned output_radix; +#if defined(GDB_5_3) || defined(GDB_6_0) || defined(GDB_6_1) +extern int output_format; +extern int prettyprint_structs; +extern int prettyprint_arrays; +extern int repeat_count_threshold; +extern unsigned int print_max; +extern int stop_print_at_null; +#endif + +#ifdef GDB_7_6 +/* + * gdb/cleanups.c + */ +struct cleanup; +extern struct cleanup *all_cleanups(void); +extern void do_cleanups(struct cleanup *); +#else +/* + * gdb/utils.c + */ +extern void do_cleanups(void *); +#endif + +/* + * gdb/version.c + */ +extern char *version; + +/* + * gdb/disasm.c + */ +#ifdef GDB_5_3 +extern int gdb_disassemble_from_exec; +#endif + +/* + * readline/readline.c + */ +#ifdef GDB_5_3 +extern char *readline(char *); +#else +extern char *readline(const char *); +#endif +extern int rl_editing_mode; + +/* + * readline/history.c + */ +extern int history_offset; + +/* + * external gdb routines + */ +extern int gdb_main_entry(int, char **); +#ifdef GDB_5_3 +extern unsigned long calc_crc32(unsigned long, unsigned char *, size_t); +#else +extern unsigned long gnu_debuglink_crc32 (unsigned long, unsigned char *, size_t); +#endif +extern int have_partial_symbols(void); +extern int have_full_symbols(void); + +#if defined(X86) || defined(X86_64) || defined(IA64) +#define XEN_HYPERVISOR_ARCH +#endif + +#endif /* !GDB_COMMON */ diff --git a/executer/kernel/mcoverlayfs/Makefile.in b/executer/kernel/mcoverlayfs/Makefile.in index d0f571b2..a7fc8e9b 100644 --- a/executer/kernel/mcoverlayfs/Makefile.in +++ b/executer/kernel/mcoverlayfs/Makefile.in @@ -21,7 +21,10 @@ endif endif ifeq ($(BUILD_MODULE_TMP),rhel) ifeq ($(BUILD_MODULE),none) -BUILD_MODULE=$(shell if [ ${LINUX_VERSION_CODE} -eq 199168 -a ${RHEL_RELEASE} -ge 327 -a ${RHEL_RELEASE} -le 514 ]; then echo "linux-3.10.0-327.36.1.el7"; else echo "none"; fi) +BUILD_MODULE=$(shell if [ ${LINUX_VERSION_CODE} -eq 199168 -a ${RHEL_RELEASE} -ge 327 -a ${RHEL_RELEASE} -le 693 ]; then echo "linux-3.10.0-327.36.1.el7"; else echo "none"; fi) +endif +ifeq ($(BUILD_MODULE),none) +BUILD_MODULE=$(shell if [ ${LINUX_VERSION_CODE} -ge 262144 -a ${LINUX_VERSION_CODE} -lt 262400 ]; then echo "linux-4.0.9"; else echo "none"; fi) endif endif endif diff --git a/executer/user/Makefile.in b/executer/user/Makefile.in index 3281bbbd..cc87016f 100644 --- a/executer/user/Makefile.in +++ b/executer/user/Makefile.in @@ -13,7 +13,7 @@ CFLAGS=-Wall -O -I. -I$(VPATH)/arch/${ARCH} LDFLAGS=@LDFLAGS@ RPATH=$(shell echo $(LDFLAGS)|awk '{for(i=1;i<=NF;i++){if($$i~/^-L/){w=$$i;sub(/^-L/,"-Wl,-rpath,",w);print w}}}') VPATH=@abs_srcdir@ -TARGET=mcexec libsched_yield +TARGET=mcexec libsched_yield ldump2mcdump.so @uncomment_if_ENABLE_MEMDUMP@TARGET+=eclair LIBS=@LIBS@ ARCH=@ARCH@ @@ -45,6 +45,9 @@ eclair: eclair.c $(CC) $(CFLAGS) -I${IHKDIR} -o $@ $^ $(LIBS) endif +ldump2mcdump.so: ldump2mcdump.c + $(CC) $(CFLAGS) $(LDFLAGS) -shared -fPIC -o $@ $< + libsched_yield: libsched_yield.c $(CC) -shared -fPIC -Wl,-soname,sched_yield.so.1 -o libsched_yield.so.1.0.0 $^ -lc -ldl @@ -83,6 +86,7 @@ install:: mkdir -p -m 755 $(BINDIR) install -m 755 mcexec $(BINDIR) mkdir -p -m 755 $(MCKERNEL_LIBDIR) + install -m 755 ldump2mcdump.so $(MCKERNEL_LIBDIR) install -m 755 libsched_yield.so.1.0.0 $(MCKERNEL_LIBDIR) ifeq ($(ENABLE_QLMPI),yes) install -m 644 ../include/qlmpilib.h $(MCKERNEL_INCDIR) @@ -94,3 +98,5 @@ ifeq ($(ENABLE_QLMPI),yes) install -m 755 ql_talker $(SBINDIR) endif @uncomment_if_ENABLE_MEMDUMP@install -m 755 eclair $(BINDIR) + @uncomment_if_ENABLE_MEMDUMP@install -m 755 vmcore2mckdump $(BINDIR) + diff --git a/executer/user/eclair.c b/executer/user/eclair.c index 22a70f2f..dc758789 100644 --- a/executer/user/eclair.c +++ b/executer/user/eclair.c @@ -29,6 +29,8 @@ #define CPU_TID_BASE 1000000 +#define PHYSMEM_NAME_SIZE 32 + struct options { uint8_t cpu; uint8_t help; @@ -123,6 +125,8 @@ static int read_physmem(uintptr_t pa, void *buf, size_t size) { bfd_boolean ok; int i; + char physmem_name[PHYSMEM_NAME_SIZE]; + off = 0; /* Check if pa is valid in any chunks and figure * out the global offset in dump section */ @@ -135,8 +139,6 @@ static int read_physmem(uintptr_t pa, void *buf, size_t size) { off += (pa - mem_chunks->chunks[i].addr); break; } - - off += mem_chunks->chunks[i].size; } if (i == mem_chunks->nr_chunks) { @@ -144,6 +146,15 @@ static int read_physmem(uintptr_t pa, void *buf, size_t size) { return 1; } + memset(physmem_name,0,sizeof(physmem_name)); + sprintf(physmem_name, "physmem%d",i); + + dumpscn = bfd_get_section_by_name(dumpbfd, physmem_name); + if (!dumpscn) { + bfd_perror("read_physmem:bfd_get_section_by_name(physmem)"); + return 1; + } + ok = bfd_get_section_contents(dumpbfd, dumpscn, buf, off, size); if (!ok) { bfd_perror("read_physmem:bfd_get_section_contents"); @@ -596,6 +607,11 @@ static int setup_symbols(char *fname) { static int setup_dump(char *fname) { bfd_boolean ok; + long mem_size; + static dump_mem_chunks_t mem_info; + + char physmem_name[PHYSMEM_NAME_SIZE]; + int i; #ifdef POSTK_DEBUG_ARCH_DEP_34 dumpbfd = bfd_fopen(opt.dump_path, NULL, "r", -1); @@ -613,31 +629,45 @@ static int setup_dump(char *fname) { return 1; } - mem_chunks = malloc(PHYS_CHUNKS_DESC_SIZE); - if (!mem_chunks) { - perror("allocating mem chunks descriptor: "); - return 1; - } - dumpscn = bfd_get_section_by_name(dumpbfd, "physchunks"); if (!dumpscn) { bfd_perror("bfd_get_section_by_name"); return 1; } - ok = bfd_get_section_contents(dumpbfd, dumpscn, mem_chunks, - 0, PHYS_CHUNKS_DESC_SIZE); + ok = bfd_get_section_contents(dumpbfd, dumpscn, &mem_info, + 0, sizeof(mem_info)); if (!ok) { - bfd_perror("read_physmem:bfd_get_section_contents"); + bfd_perror("read_physmem:bfd_get_section_contents(mem_size)"); + return 1; + } + + mem_size = (sizeof(dump_mem_chunks_t) + (sizeof(struct dump_mem_chunk) * mem_info.nr_chunks)); + + mem_chunks = malloc(mem_size); + if (!mem_chunks) { + perror("allocating mem chunks descriptor: "); + return 1; + } + + ok = bfd_get_section_contents(dumpbfd, dumpscn, mem_chunks, + 0, mem_size); + if (!ok) { + bfd_perror("read_physmem:bfd_get_section_contents(mem_chunks)"); return 1; } kernel_base = mem_chunks->kernel_base; - dumpscn = bfd_get_section_by_name(dumpbfd, "physmem"); - if (!dumpscn) { - bfd_perror("bfd_get_section_by_name"); - return 1; + for (i = 0; i < mem_info.nr_chunks; ++i) { + memset(physmem_name,0,sizeof(physmem_name)); + sprintf(physmem_name, "physmem%d",i); + + dumpscn = bfd_get_section_by_name(dumpbfd, physmem_name); + if (!dumpscn) { + bfd_perror("read_physmem:bfd_get_section_by_name(physmem)"); + return 1; + } } return 0; diff --git a/executer/user/ldump2mcdump.c b/executer/user/ldump2mcdump.c new file mode 100644 index 00000000..d86acee3 --- /dev/null +++ b/executer/user/ldump2mcdump.c @@ -0,0 +1,483 @@ + +#include "../include/defs.h" /* From the crash source top-level directory */ +#include +#include + +void ldump2mcdump_init(void); /* constructor function */ +void ldump2mcdump_fini(void); /* destructor function (optional) */ + +void cmd_ldump2mcdump(void); /* Declare the commands and their help data. */ +char *help_ldump2mcdump[]; + +static struct command_table_entry command_table[] = { + { "ldump2mcdump", cmd_ldump2mcdump, help_ldump2mcdump, 0}, /* One or more commands, */ + { NULL }, /* terminated by NULL, */ +}; + + +void __attribute__((constructor)) +ldump2mcdump_init(void) /* Register the command set. */ +{ + register_extension(command_table); +} + +/* + * This function is called if the shared object is unloaded. + * If desired, perform any cleanups here. + */ +void __attribute__((destructor)) +ldump2mcdump_fini(void) { } + +struct ihk_dump_page { + unsigned long start; + unsigned long map_count; + unsigned long map[0]; +}; + +struct ihk_dump_page_set { + unsigned int completion_flag; + unsigned int count; + unsigned long page_size; + unsigned long phy_page; +}; + +struct dump_mem_chunk { + unsigned long addr; + unsigned long size; +}; + +typedef struct dump_mem_chunks_s { + int nr_chunks; + unsigned long kernel_base; + struct dump_mem_chunk chunks[]; +} dump_mem_chunks_t; + +#define PATH_MAX 4096 +#define DUMP_MEM_SYMBOL "dump_page_set_addr" +#define BOOTSTRAP_MEM_SYMBOL "dump_bootstrap_mem_start" +#define MCDUMP_DEFAULT_FILENAME "mcdump" +#define PAGE_SHIFT 12 +#define LARGE_PAGE_SHIFT 21 +#define LARGE_PAGE_SIZE (1UL << LARGE_PAGE_SHIFT) +#define LARGE_PAGE_MASK (~((unsigned long)LARGE_PAGE_SIZE - 1)) + +#define PHYSMEM_NAME_SIZE 32 + +void cmd_ldump2mcdump(void) +{ + static char path[PATH_MAX]; + static char hname[HOST_NAME_MAX+1]; + bfd *abfd = NULL; + char *fname; + bfd_boolean ok; + asection *scn; + unsigned long phys_size, phys_offset; + int error; + size_t bsize; + void *buf = NULL; + uintptr_t addr; + size_t cpsize; + time_t t; + struct tm *tm; + char *date; + struct passwd *pw; + dump_mem_chunks_t *mem_chunks = NULL; + long mem_size; + int opt = 0; + int read_mem_ret = TRUE; + + ulong symbol_dump_page_set = 0; + ulong dump_page_set_addr = 0; + ulong symbol_bootstrap_mem = 0; + ulong bootstrap_mem = 0; + struct ihk_dump_page_set dump_page_set; + ulong ihk_dump_page_addr = 0; + struct ihk_dump_page ihk_dump_page; + ulong *map_buf = NULL; + ulong map_size = 0; + int i,j,k,index,mem_num; + ulong map_start,bit_count; + char *physmem_name_buf = NULL; + char physmem_name[PHYSMEM_NAME_SIZE]; + + ulong read_mem_addr = 0; + + if (argcnt < 2) { + perror("argument error"); + return; + } + + strcpy(path,MCDUMP_DEFAULT_FILENAME); + + while ((opt = getopt(argcnt, args, "o:")) != -1) { + switch (opt) { + case 'o': /* '-o' */ + strcpy(path,optarg); + break; + default: /* '?' */ + fprintf(stderr, "ldump2mcdump os_index [-o file_name]\n"); + return; + } + } + + fname = path; + symbol_dump_page_set = symbol_value(DUMP_MEM_SYMBOL); + readmem(symbol_dump_page_set,KVADDR,&dump_page_set_addr,sizeof(dump_page_set_addr),"",FAULT_ON_ERROR); + readmem(dump_page_set_addr,KVADDR,&dump_page_set,sizeof(dump_page_set),"",FAULT_ON_ERROR); + + // DUMP_QUERY_NUM_MEM_AREAS + ihk_dump_page_addr = PTOV(dump_page_set.phy_page); + for (i = 0, mem_num = 0; i < dump_page_set.count; i++) { + + readmem(ihk_dump_page_addr,KVADDR,&ihk_dump_page,sizeof(ihk_dump_page),"",FAULT_ON_ERROR); + map_size = sizeof(unsigned long)*ihk_dump_page.map_count; + map_buf = malloc(map_size); + if (map_buf != NULL) { + memset(map_buf,0x00,map_size); + readmem((ihk_dump_page_addr+sizeof(struct ihk_dump_page)),KVADDR,map_buf,map_size,"",FAULT_ON_ERROR); + + for (j = 0, bit_count = 0; j < ihk_dump_page.map_count; j++) { + for ( k = 0; k < 64; k++) { + if (((ulong)*(map_buf+j) >> k) & 0x1) { + bit_count++; + } else { + if (bit_count) { + mem_num++; + bit_count = 0; + } + } + } + } + + if (bit_count) { + mem_num++; + } + free(map_buf); + } else { + perror("allocating mem buffer: "); + return; + } + + ihk_dump_page_addr += (sizeof(struct ihk_dump_page)+(sizeof(unsigned long)*ihk_dump_page.map_count)); + } + mem_size = (sizeof(dump_mem_chunks_t) + (sizeof(struct dump_mem_chunk) * mem_num)); + + // DUMP_QUERY_MEM_AREAS + mem_chunks = malloc(mem_size); + if (mem_chunks != NULL) { + memset(mem_chunks, 0, mem_size); + ihk_dump_page_addr = PTOV(dump_page_set.phy_page); + + for (i = 0, index = 0; i < dump_page_set.count; i++) { + + readmem(ihk_dump_page_addr,KVADDR,&ihk_dump_page,sizeof(ihk_dump_page),"",FAULT_ON_ERROR); + map_size = sizeof(unsigned long)*ihk_dump_page.map_count; + map_buf = malloc(map_size); + if (map_buf != NULL) { + memset(map_buf,0x00,map_size); + readmem((ihk_dump_page_addr+sizeof(struct ihk_dump_page)),KVADDR,map_buf,map_size,"",FAULT_ON_ERROR); + + for (j = 0, bit_count = 0; j < ihk_dump_page.map_count; j++) { + for (k = 0; k < 64; k++) { + if (((ulong)*(map_buf+j) >> k) & 0x1) { + if (!bit_count) { + map_start = (unsigned long)(ihk_dump_page.start + ((unsigned long)j << (PAGE_SHIFT+6))); + map_start = map_start + ((unsigned long)k << PAGE_SHIFT); + } + bit_count++; + } else { + if (bit_count) { + mem_chunks->chunks[index].addr = map_start; + mem_chunks->chunks[index].size = (bit_count << PAGE_SHIFT); + index++; + bit_count = 0; + } + } + } + } + + if (bit_count) { + mem_chunks->chunks[index].addr = map_start; + mem_chunks->chunks[index].size = (bit_count << PAGE_SHIFT); + index++; + } + + ihk_dump_page_addr += (sizeof(struct ihk_dump_page)+(sizeof(unsigned long)*ihk_dump_page.map_count)); + free(map_buf); + } else { + perror("allocating mem buffer: "); + return; + } + + } + mem_chunks->nr_chunks = index; + + symbol_bootstrap_mem = symbol_value(BOOTSTRAP_MEM_SYMBOL); + + readmem(symbol_bootstrap_mem,KVADDR,&bootstrap_mem,sizeof(bootstrap_mem),"",FAULT_ON_ERROR); + + /* See load_file() for the calculation below */ + mem_chunks->kernel_base = + (bootstrap_mem + LARGE_PAGE_SIZE * 2 - 1) & LARGE_PAGE_MASK; + } else { + perror("allocating mem buffer: "); + return; + } + + // DUMP_READ + phys_size = 0; + +// fprintf(fp,"%s: nr chunks: %d\n", __FUNCTION__, mem_chunks->nr_chunks); + for (i = 0; i < mem_chunks->nr_chunks; ++i) { +// fprintf(fp,"%s: 0x%lx:0x%lx\n", +// __FUNCTION__, +// mem_chunks->chunks[i].addr, +// mem_chunks->chunks[i].size); + phys_size += mem_chunks->chunks[i].size; + } + + bsize = 0x100000; + buf = malloc(bsize); + if (!buf) { + perror("malloc"); + return; + } + + bfd_init(); + + abfd = bfd_fopen(fname, "elf64-x86-64", "w", -1); + if (!abfd) { + bfd_perror("bfd_fopen"); + return; + } + + ok = bfd_set_format(abfd, bfd_object); + if (!ok) { + bfd_perror("bfd_set_format"); + return; + } + + t = time(NULL); + if (t == (time_t)-1) { + perror("time"); + return; + } + + tm = localtime(&t); + if (!tm) { + perror("localtime"); + return; + } + + date = asctime(tm); + if (date) { + cpsize = strlen(date) - 1; /* exclude trailing '\n' */ + scn = bfd_make_section_anyway(abfd, "date"); + if (!scn) { + bfd_perror("bfd_make_section_anyway(date)"); + return; + } + + ok = bfd_set_section_size(abfd, scn, cpsize); + if (!ok) { + bfd_perror("bfd_set_section_size"); + return; + } + + ok = bfd_set_section_flags(abfd, scn, SEC_HAS_CONTENTS); + if (!ok) { + bfd_perror("bfd_set_setction_flags"); + return; + } + } + error = gethostname(hname, sizeof(hname)); + if (!error) { + cpsize = strlen(hname); + scn = bfd_make_section_anyway(abfd, "hostname"); + if (!scn) { + bfd_perror("bfd_make_section_anyway(hostname)"); + return; + } + + ok = bfd_set_section_size(abfd, scn, cpsize); + if (!ok) { + bfd_perror("bfd_set_section_size"); + return; + } + + ok = bfd_set_section_flags(abfd, scn, SEC_HAS_CONTENTS); + if (!ok) { + bfd_perror("bfd_set_setction_flags"); + return; + } + } + pw = getpwuid(getuid()); + if (pw) { + cpsize = strlen(pw->pw_name); + scn = bfd_make_section_anyway(abfd, "user"); + if (!scn) { + bfd_perror("bfd_make_section_anyway(user)"); + return; + } + + ok = bfd_set_section_size(abfd, scn, cpsize); + if (!ok) { + bfd_perror("bfd_set_section_size"); + return; + } + + ok = bfd_set_section_flags(abfd, scn, SEC_HAS_CONTENTS); + if (!ok) { + bfd_perror("bfd_set_setction_flags"); + return; + } + } + + /* Add section for physical memory chunks information */ + scn = bfd_make_section_anyway(abfd, "physchunks"); + if (!scn) { + bfd_perror("bfd_make_section_anyway(physchunks)"); + return; + } + + ok = bfd_set_section_size(abfd, scn, mem_size); + if (!ok) { + bfd_perror("bfd_set_section_size"); + return; + } + + ok = bfd_set_section_flags(abfd, scn, SEC_ALLOC|SEC_HAS_CONTENTS); + if (!ok) { + bfd_perror("bfd_set_setction_flags"); + return; + } + + for (i = 0; i < mem_chunks->nr_chunks; ++i) { + + physmem_name_buf = malloc(PHYSMEM_NAME_SIZE); + memset(physmem_name_buf,0,PHYSMEM_NAME_SIZE); + sprintf(physmem_name_buf, "physmem%d",i); + + /* Physical memory contents section */ + scn = bfd_make_section_anyway(abfd, physmem_name_buf); + if (!scn) { + bfd_perror("bfd_make_section_anyway(physmem)"); + return; + } + + ok = bfd_set_section_size(abfd, scn, mem_chunks->chunks[i].size); + + if (!ok) { + bfd_perror("bfd_set_section_size"); + return; + } + + ok = bfd_set_section_flags(abfd, scn, SEC_ALLOC|SEC_HAS_CONTENTS); + if (!ok) { + bfd_perror("bfd_set_setction_flags"); + return; + } + + scn->vma = mem_chunks->chunks[i].addr; + + } + + scn = bfd_get_section_by_name(abfd, "date"); + if (scn) { + ok = bfd_set_section_contents(abfd, scn, date, 0, scn->size); + if (!ok) { + bfd_perror("bfd_set_section_contents(date)"); + return; + } + } + + scn = bfd_get_section_by_name(abfd, "hostname"); + if (scn) { + ok = bfd_set_section_contents(abfd, scn, hname, 0, scn->size); + if (!ok) { + bfd_perror("bfd_set_section_contents(hostname)"); + return; + } + } + + scn = bfd_get_section_by_name(abfd, "user"); + if (scn) { + ok = bfd_set_section_contents(abfd, scn, pw->pw_name, 0, scn->size); + if (!ok) { + bfd_perror("bfd_set_section_contents(user)"); + return; + } + } + + scn = bfd_get_section_by_name(abfd, "physchunks"); + if (scn) { + ok = bfd_set_section_contents(abfd, scn, mem_chunks, 0, mem_size); + if (!ok) { + bfd_perror("bfd_set_section_contents(physchunks)"); + return; + } + } + + for (i = 0; i < mem_chunks->nr_chunks; ++i) { + + phys_offset = 0; + memset(physmem_name,0,sizeof(physmem_name)); + sprintf(physmem_name, "physmem%d",i); + + scn = bfd_get_section_by_name(abfd, physmem_name); + if (!scn) { + bfd_perror("err bfd_get_section_by_name(physmem_name)"); + return ; + } + + for (addr = mem_chunks->chunks[i].addr; + addr < (mem_chunks->chunks[i].addr + mem_chunks->chunks[i].size); + addr += cpsize) { + + cpsize = (mem_chunks->chunks[i].addr + mem_chunks->chunks[i].size) - addr; + if (cpsize > bsize) { + cpsize = bsize; + } + + memset(buf,0x00,cpsize); + read_mem_addr = PTOV(addr); + read_mem_ret = readmem(read_mem_addr,KVADDR,buf,cpsize,"",FAULT_ON_ERROR|RETURN_ON_ERROR); + if (read_mem_ret == TRUE) { + ok = bfd_set_section_contents(abfd, scn, buf, phys_offset, cpsize); + if (!ok) { + bfd_perror("bfd_set_section_contents(physmem)"); + return; + } + + phys_offset += cpsize; + } else { + fprintf(fp, "readmem error(%d)\n",read_mem_ret); + } + } + } + + ok = bfd_close(abfd); + if (!ok) { + bfd_perror("bfd_close"); + return; + } + + free(buf); + free(mem_chunks); + + return; + +} + +char *help_ldump2mcdump[] = { + "ldump2mcdump", /* command name */ + "dump format conversion", /* short description */ + " [-o ]", /* argument synopsis, or " " if none */ + " This command converts the McKernel dump file format.", + "\nEXAMPLE", + " ldump2mcdump all command arguments:\n", + " crash>ldump2mcdump 0 -o /tmp/mcdump", + NULL +}; + + diff --git a/executer/user/vmcore2mckdump.in b/executer/user/vmcore2mckdump.in new file mode 100644 index 00000000..1e41b0e9 --- /dev/null +++ b/executer/user/vmcore2mckdump.in @@ -0,0 +1,43 @@ +#!/bin/sh +export VMLINUX=/usr/lib/debug/lib/modules/`uname -r`/vmlinux +export INSTALLDIR=@prefix@ +export INFILE=$1 +export OUTFILE=$2 + +if [ "X$INFILE" = X -o "X$OUTFILE" = X -o "X$3" != X ]; then + echo "usage: vmcore2mckdump " >&2 + exit 1 +fi + +if [ ! -f "$INFILE" ]; then + echo "$INFILE: not found" >&2 + exit 1 +fi + +/usr/bin/expect -c " +set timeout 60 +spawn /usr/bin/crash $VMLINUX $INFILE + +expect \"crash>\" +send \"mod -s ihk_smp_x86 $INSTALLDIR/kmod/ihk-smp-x86.ko\n\" + +expect \"crash>\" +send \"extend $INSTALLDIR/lib/ldump2mcdump.so\n\" + +expect \"crash>\" +send \"ldump2mcdump 0 -o $OUTFILE\n\" + +expect \"crash>\" +send \"extend -u $INSTALLDIR/lib/ldump2mcdump.so\n\" + +expect \"crash>\" +send \"quit\n\" +" +if [ -f ${OUTFILE} ]; then + echo "mcdump: ${OUTFILE} is extracted." + exit 0 +else + echo "Error: failed to extract mcdump." + exit 1 +fi + diff --git a/kernel/include/rbtree.h b/kernel/include/rbtree.h index b48898b4..990f0d74 100644 --- a/kernel/include/rbtree.h +++ b/kernel/include/rbtree.h @@ -65,8 +65,10 @@ extern void rb_erase(struct rb_node *, struct rb_root *); /* Find logical next and previous nodes in a tree */ extern struct rb_node *rb_next(const struct rb_node *); +extern struct rb_node *rb_next_safe(const struct rb_node *); extern struct rb_node *rb_prev(const struct rb_node *); extern struct rb_node *rb_first(const struct rb_root *); +extern struct rb_node *rb_first_safe(const struct rb_root *); extern struct rb_node *rb_last(const struct rb_root *); /* Postorder iteration - always visit the parent after its children */ diff --git a/kernel/init.c b/kernel/init.c index f4f9aec9..1039af69 100644 --- a/kernel/init.c +++ b/kernel/init.c @@ -48,6 +48,8 @@ #define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0) #endif +#define DUMP_LEVEL_USER_UNUSED_EXCLUDE 24 + int osnum = 0; extern struct ihk_kmsg_buf kmsg_buf; @@ -426,12 +428,26 @@ int main(void) { char *ptr; int mode = 0; + char *key_dump_level = "dump_level="; + unsigned int dump_level = DUMP_LEVEL_USER_UNUSED_EXCLUDE; ptr = find_command_line("ksyslogd="); if (ptr) { mode = ptr[9] - 0x30; if (mode < 0 || mode > 2) mode = 0; } + + ptr = find_command_line(key_dump_level); + if (ptr) { + ptr += strlen(key_dump_level); + dump_level = 0; + while (('0' <= *ptr) && (*ptr <= '9')) { + dump_level *= 10; + dump_level += *ptr++ - '0'; + } + } + ihk_mc_set_dump_level(dump_level); + kmsg_init(mode); kputs("IHK/McKernel started.\n"); diff --git a/kernel/mem.c b/kernel/mem.c index 601991b8..8fe450da 100644 --- a/kernel/mem.c +++ b/kernel/mem.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -114,6 +115,38 @@ struct pagealloc_track_entry { ihk_spinlock_t addr_list_lock; }; +struct page_table { + pte_t entry[PT_ENTRIES]; +}; + +struct ihk_dump_page { + unsigned long start; + unsigned long map_count; + unsigned long map[0]; +}; + +struct ihk_dump_page_set { + volatile unsigned int completion_flag; + unsigned int count; + unsigned long page_size; + unsigned long phy_page; +}; + +struct dump_pase_info { + struct ihk_dump_page_set *dump_page_set; + struct ihk_dump_page *dump_pages; +}; + +#define IHK_DUMP_PAGE_SET_INCOMPLETE 0 +#define IHK_DUMP_PAGE_SET_COMPLETED 1 +#define DUMP_LEVEL_ALL 0 +#define DUMP_LEVEL_USER_UNUSED_EXCLUDE 24 + +/** Get the index in the map array */ +#define MAP_INDEX(n) ((n) >> 6) +/** Get the bit number in a map element */ +#define MAP_BIT(n) ((n) & 0x3f) + void pagealloc_track_init(void) { if (!pagealloc_track_initialized) { @@ -2241,3 +2274,211 @@ int is_mckernel_memory(unsigned long phys) } #endif /* IHK_RBTREE_ALLOCATOR */ #endif /* POSTK_DEBUG_TEMP_FIX_52 */ + +void ihk_mc_query_mem_areas(void){ + + int cpu_id; + struct ihk_dump_page_set *dump_page_set; + struct dump_pase_info dump_pase_info; + + /* Performed only for CPU 0 */ + cpu_id = ihk_mc_get_processor_id(); + + if (0 != cpu_id) + return; + + dump_page_set = ihk_mc_get_dump_page_set(); + + if (DUMP_LEVEL_USER_UNUSED_EXCLUDE == ihk_mc_get_dump_level()) { + if (dump_page_set->count) { + + dump_pase_info.dump_page_set = dump_page_set; + dump_pase_info.dump_pages = ihk_mc_get_dump_page(); + + /* Get user page information */ + ihk_mc_query_mem_user_page((void *)&dump_pase_info); + /* Get unused page information */ + ihk_mc_query_mem_free_page((void *)&dump_pase_info); + } + } + + dump_page_set->completion_flag = IHK_DUMP_PAGE_SET_COMPLETED; + + return; +} + +void ihk_mc_query_mem_user_page(void *dump_pase_info) { + + struct resource_set *rset = cpu_local_var(resource_set); + struct process_hash *phash = rset->process_hash; + struct process *p; + struct process_vm *vm; + int i; + + for (i=0; ilist[i], hash_list){ + vm = p->vm; + if (vm) { + if(vm->address_space->page_table) { + visit_pte_range_safe(vm->address_space->page_table, 0, + (void *)USER_END, 0, 0, + &ihk_mc_get_mem_user_page, (void *)dump_pase_info); + } + } + } + } + + return; +} + +void ihk_mc_query_mem_free_page(void *dump_pase_info) { + + struct free_chunk *chunk; + struct rb_node *node; + struct rb_root *free_chunks; + unsigned long phy_start, map_start, map_end, free_pages, free_page_cnt, map_size, set_size, k; + int i, j; + struct ihk_dump_page_set *dump_page_set; + struct ihk_dump_page *dump_page; + struct dump_pase_info *dump_pase_in; + unsigned long chunk_addr, chunk_size; + + dump_pase_in = (struct dump_pase_info *)dump_pase_info; + dump_page_set = dump_pase_in->dump_page_set; + + /* Search all NUMA nodes */ + for (i = 0; i < ihk_mc_get_nr_numa_nodes(); i++) { + + free_chunks = &memory_nodes[i].free_chunks; + free_pages = memory_nodes[i].nr_free_pages; + + /* rb-tree search */ + for (free_page_cnt = 0, node = rb_first_safe(free_chunks); node; free_page_cnt++, node = rb_next_safe(node)) { + + if (free_page_cnt >= free_pages) + break; + + /* Get chunk information */ + chunk = container_of(node, struct free_chunk, node); + + dump_page = dump_pase_in->dump_pages; + chunk_addr = chunk->addr; + chunk_size = chunk->size; + + for (j = 0; j < dump_page_set->count; j++) { + + if (j) { + dump_page = (struct ihk_dump_page *)((char *)dump_page + ((dump_page->map_count * sizeof(unsigned long)) + sizeof(struct ihk_dump_page))); + } + + phy_start = dump_page->start; + map_size = (dump_page->map_count << (PAGE_SHIFT+6)); + + if ((chunk_addr >= phy_start) + && ((phy_start + map_size) >= chunk_addr)) { + + /* Set free page to page map */ + map_start = (chunk_addr - phy_start) >> PAGE_SHIFT; + + if ((phy_start + map_size) < (chunk_addr + chunk_size)) { + set_size = map_size - (chunk_addr - phy_start); + map_end = (map_start + (set_size >> PAGE_SHIFT)); + chunk_addr += set_size; + chunk_size -= set_size; + } else { + map_end = (map_start + (chunk_size >> PAGE_SHIFT)); + } + + for (k = map_start; k < map_end; k++) { + + if (MAP_INDEX(k) >= dump_page->map_count) { + kprintf("%s:free page is out of range(max:%d): %ld (map_start:0x%lx, map_end:0x%lx) k(0x%lx)\n", __FUNCTION__, dump_page->map_count, MAP_INDEX(k), map_start, map_end, k); + break; + } + + dump_page->map[MAP_INDEX(k)] &= ~(1UL << MAP_BIT(k)); + } + } + } + } + } + + return; +} + +int ihk_mc_chk_page_address(pte_t mem_addr){ + + int i, numa_id;; + unsigned long start, end; + + /* Search all NUMA nodes */ + for (i = 0; i < ihk_mc_get_nr_memory_chunks(); i++) { + ihk_mc_get_memory_chunk(i, &start, &end, &numa_id); + if ((mem_addr >= start) && (end >= mem_addr)) + return 0; + } + + return -1; +} + +int ihk_mc_get_mem_user_page(void *arg0, page_table_t pt, pte_t *ptep, void *pgaddr, int pgshift) +{ + struct ihk_dump_page_set *dump_page_set; + int i; + unsigned long j, phy_start, phys, map_start, map_end, map_size, set_size; + struct ihk_dump_page *dump_page; + struct dump_pase_info *dump_pase_in; + unsigned long chunk_addr, chunk_size; + + if (((*ptep) & PTATTR_ACTIVE) && ((*ptep) & PTATTR_USER)) { + phys = pte_get_phys(ptep); + /* Confirm accessible address */ + if (-1 != ihk_mc_chk_page_address(phys)) { + + dump_pase_in = (struct dump_pase_info *)arg0; + dump_page_set = dump_pase_in->dump_page_set; + dump_page = dump_pase_in->dump_pages; + + chunk_addr = phys; + chunk_size = (1UL << pgshift); + + for (i = 0; i < dump_page_set->count; i++) { + + if (i) { + dump_page = (struct ihk_dump_page *)((char *)dump_page + ((dump_page->map_count * sizeof(unsigned long)) + sizeof(struct ihk_dump_page))); + } + + phy_start = dump_page->start; + map_size = (dump_page->map_count << (PAGE_SHIFT+6)); + + if ((chunk_addr >= phy_start) + && ((phy_start + map_size) >= chunk_addr)) { + + /* Set user page to page map */ + map_start = (chunk_addr - phy_start) >> PAGE_SHIFT; + + if ((phy_start + map_size) < (chunk_addr + chunk_size)) { + set_size = map_size - (chunk_addr - phy_start); + map_end = (map_start + (set_size >> PAGE_SHIFT)); + chunk_addr += set_size; + chunk_size -= set_size; + } else { + map_end = (map_start + (chunk_size >> PAGE_SHIFT)); + } + + for (j = map_start; j < map_end; j++) { + + if (MAP_INDEX(j) >= dump_page->map_count) { + kprintf("%s:user page is out of range(max:%d): %ld (map_start:0x%lx, map_end:0x%lx) j(0x%lx)\n", __FUNCTION__, dump_page->map_count, MAP_INDEX(j), map_start, map_end, j); + break; + } + dump_page->map[MAP_INDEX(j)] &= ~(1UL << MAP_BIT(j)); + } + } + } + } + } + + return 0; +} diff --git a/kernel/rbtree.c b/kernel/rbtree.c index 983f43c5..5134a0d6 100644 --- a/kernel/rbtree.c +++ b/kernel/rbtree.c @@ -25,6 +25,9 @@ #define EXPORT_SYMBOL(x) +extern int ihk_mc_chk_page_address(unsigned long mem_addr); +extern unsigned long virt_to_phys(void *v); + /* * red-black trees properties: http://en.wikipedia.org/wiki/Rbtree * @@ -429,6 +432,32 @@ struct rb_node *rb_first(const struct rb_root *root) } EXPORT_SYMBOL(rb_first); +struct rb_node *rb_first_safe(const struct rb_root *root) +{ + struct rb_node *n; + unsigned long phys; + + n = root->rb_node; + if (!n) + return NULL; + + phys = virt_to_phys(n); + if (-1 == ihk_mc_chk_page_address(phys)) + return NULL; + + while (n->rb_left) { + n = n->rb_left; + if (!n) + return NULL; + + phys = virt_to_phys(n); + if (-1 == ihk_mc_chk_page_address(phys)) + return NULL; + } + return n; +} +EXPORT_SYMBOL(rb_first_safe); + struct rb_node *rb_last(const struct rb_root *root) { struct rb_node *n; @@ -474,6 +503,58 @@ struct rb_node *rb_next(const struct rb_node *node) } EXPORT_SYMBOL(rb_next); +struct rb_node *rb_next_safe(const struct rb_node *node) +{ + struct rb_node *parent; + struct rb_node *chk_node; + unsigned long phys; + + if (RB_EMPTY_NODE(node)) + return NULL; + + /* + * If we have a right-hand child, go down and then left as far + * as we can. + */ + if (node->rb_right) { + node = node->rb_right; + + if(!node) + return NULL; + + chk_node = (struct rb_node *)node; + phys = virt_to_phys(chk_node); + if (-1 == ihk_mc_chk_page_address(phys)) + return NULL; + + while (node->rb_left) { + node=node->rb_left; + if(!node) + return NULL; + + chk_node = (struct rb_node *)node; + phys = virt_to_phys(chk_node); + if (-1 == ihk_mc_chk_page_address(phys)) + return NULL; + } + + return (struct rb_node *)node; + } + + /* + * No right-hand children. Everything down and left is smaller than us, + * so any 'next' node must be in the general direction of our parent. + * Go up the tree; any time the ancestor is a right-hand child of its + * parent, keep going up. First time it's a left-hand child of its + * parent, said parent is our 'next' node. + */ + while ((parent = rb_parent(node)) && node == parent->rb_right) + node = parent; + + return parent; +} +EXPORT_SYMBOL(rb_next_safe); + struct rb_node *rb_prev(const struct rb_node *node) { struct rb_node *parent; diff --git a/lib/include/ihk/mm.h b/lib/include/ihk/mm.h index 2da99210..5b2aa70d 100644 --- a/lib/include/ihk/mm.h +++ b/lib/include/ihk/mm.h @@ -189,6 +189,8 @@ typedef int pte_visitor_t(void *arg, page_table_t pt, pte_t *ptep, void *pgaddr, int pgshift); int visit_pte_range(page_table_t pt, void *start, void *end, int pgshift, enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg); +int visit_pte_range_safe(page_table_t pt, void *start, void *end, int pgshift, + enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg); int move_pte_range(page_table_t pt, struct process_vm *vm, void *src, void *dest, size_t size, struct vm_range *range); @@ -239,4 +241,14 @@ struct tlb_flush_entry { extern struct tlb_flush_entry tlb_flush_vector[IHK_TLB_FLUSH_IRQ_VECTOR_SIZE]; +void ihk_mc_set_dump_level(unsigned int level); +unsigned int ihk_mc_get_dump_level(void); +struct ihk_dump_page_set *ihk_mc_get_dump_page_set(void); +struct ihk_dump_page *ihk_mc_get_dump_page(void); +void ihk_mc_query_mem_areas(void); +void ihk_mc_query_mem_user_page(void *dump_page_set); +void ihk_mc_query_mem_free_page(void *dump_page_set); +int ihk_mc_chk_page_address(pte_t mem_addr); +int ihk_mc_get_mem_user_page(void *arg0, page_table_t pt, pte_t *ptep, void *pgaddr, int pgshift); + #endif diff --git a/test/dump/config b/test/dump/config new file mode 100755 index 00000000..16ef4db3 --- /dev/null +++ b/test/dump/config @@ -0,0 +1,3 @@ +MCMOD_DIR=$HOME/ppos + +export MCMOD_DIR diff --git a/test/dump/destroy_mem.patch b/test/dump/destroy_mem.patch new file mode 100644 index 00000000..edf72dd2 --- /dev/null +++ b/test/dump/destroy_mem.patch @@ -0,0 +1,321 @@ +diff --git a/arch/x86/kernel/include/syscall_list.h b/arch/x86/kernel/include/syscall_list.h +index 7c6edcb..f7f709b 100644 +--- a/arch/x86/kernel/include/syscall_list.h ++++ b/arch/x86/kernel/include/syscall_list.h +@@ -161,6 +161,9 @@ SYSCALL_HANDLED(__NR_profile, profile) + SYSCALL_HANDLED(730, util_migrate_inter_kernel) + SYSCALL_HANDLED(731, util_indicate_clone) + SYSCALL_HANDLED(732, get_system) ++/* McKernel Specific */ ++SYSCALL_HANDLED(901, usedmem_destroy) ++SYSCALL_HANDLED(902, freemem_destroy) + + /* McKernel Specific */ + SYSCALL_HANDLED(801, swapout) +diff --git a/arch/x86/kernel/memory.c b/arch/x86/kernel/memory.c +index 293daff..d7f17b9 100644 +--- a/arch/x86/kernel/memory.c ++++ b/arch/x86/kernel/memory.c +@@ -36,6 +36,8 @@ + #define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0) + #endif + ++#define MEM_DESTROY_VAL 0xffffffffffffffff ++ + static char *last_page; + extern char _head[], _end[]; + +@@ -1364,6 +1366,119 @@ int visit_pte_range_safe(page_table_t pt, void *start0, void *end0, int pgshift, + return walk_pte_l4_safe(pt, 0, start, end, &visit_pte_l4_safe, &args); + } + ++static int visit_pte_l1_dest(void *arg0, pte_t *ptep, uintptr_t base, ++ uintptr_t start, uintptr_t end) ++{ ++ if (*ptep == PTE_NULL) { ++ return 0; ++ } ++ ++ *ptep = MEM_DESTROY_VAL; ++ return 0; ++} ++ ++static int visit_pte_l2_dest(void *arg0, pte_t *ptep, uintptr_t base, ++ uintptr_t start, uintptr_t end) ++{ ++ int error = 0; ++ struct visit_pte_args *args = arg0; ++ struct page_table *pt; ++ ++ if (*ptep == PTE_NULL) { ++ return 0; ++ } ++ ++ if ((*ptep & PFL2_SIZE) ++ && (start <= base) ++ && (((base + PTL2_SIZE) <= end) ++ || (end == 0)) ++ && (!args->pgshift || (args->pgshift == PTL2_SHIFT))) { ++ ++ *ptep = MEM_DESTROY_VAL; ++ return error; ++ } ++ ++ ++ if (*ptep & PFL2_SIZE) { ++ ekprintf("visit_pte_l2:split large page\n"); ++ return -ENOMEM; ++ } ++ ++ pt = phys_to_virt(*ptep & PT_PHYSMASK); ++ ++ error = walk_pte_l1_safe(pt, base, start, end, &visit_pte_l1_dest, arg0); ++ return error; ++} ++ ++static int visit_pte_l3_dest(void *arg0, pte_t *ptep, uintptr_t base, ++ uintptr_t start, uintptr_t end) ++{ ++ int error = 0; ++ struct visit_pte_args *args = arg0; ++ struct page_table *pt; ++ ++ if (*ptep == PTE_NULL) { ++ return 0; ++ } ++ ++ if ((*ptep & PFL3_SIZE) ++ && (start <= base) ++ && (((base + PTL3_SIZE) <= end) ++ || (end == 0)) ++ && (!args->pgshift || (args->pgshift == PTL3_SHIFT)) ++ && use_1gb_page) { ++ ++ *ptep =MEM_DESTROY_VAL; ++ return error; ++ } ++ ++ if (*ptep & PFL3_SIZE) { ++ ekprintf("visit_pte_l3:split large page\n"); ++ return -ENOMEM; ++ } ++ ++ pt = phys_to_virt(*ptep & PT_PHYSMASK); ++ ++ error = walk_pte_l2_safe(pt, base, start, end, &visit_pte_l2_dest, arg0); ++ return error; ++} ++ ++static int visit_pte_l4_dest(void *arg0, pte_t *ptep, uintptr_t base, ++ uintptr_t start, uintptr_t end) ++{ ++ int error; ++ struct page_table *pt; ++ ++ kprintf("%s:Start.\n", __FUNCTION__); ++ ++ if (*ptep == PTE_NULL) { ++ kprintf("%s:End.\n", __FUNCTION__); ++ return 0; ++ } ++ ++ pt = phys_to_virt(*ptep & PT_PHYSMASK); ++ ++ error = walk_pte_l3_safe(pt, base, start, end, &visit_pte_l3_dest, arg0); ++ kprintf("%s:End.\n", __FUNCTION__); ++ return error; ++} ++ ++int visit_pte_range_dest(page_table_t pt, void *start0, void *end0, int pgshift, ++ enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg) ++{ ++ const uintptr_t start = (uintptr_t)start0; ++ const uintptr_t end = (uintptr_t)end0; ++ struct visit_pte_args args; ++ ++ args.pt = pt; ++ args.flags = flags; ++ args.funcp = funcp; ++ args.arg = arg; ++ args.pgshift = pgshift; ++ ++ return walk_pte_l4_safe(pt, 0, start, end, &visit_pte_l4_dest, &args); ++} ++ + struct clear_range_args { + int free_physical; + struct memobj *memobj; +diff --git a/kernel/include/rbtree.h b/kernel/include/rbtree.h +index 990f0d7..24d71c2 100644 +--- a/kernel/include/rbtree.h ++++ b/kernel/include/rbtree.h +@@ -66,6 +66,7 @@ extern void rb_erase(struct rb_node *, struct rb_root *); + /* Find logical next and previous nodes in a tree */ + extern struct rb_node *rb_next(const struct rb_node *); + extern struct rb_node *rb_next_safe(const struct rb_node *); ++extern struct rb_node *rb_next_dest(const struct rb_node *); + extern struct rb_node *rb_prev(const struct rb_node *); + extern struct rb_node *rb_first(const struct rb_root *); + extern struct rb_node *rb_first_safe(const struct rb_root *); +diff --git a/kernel/mem.c b/kernel/mem.c +index 8fe450d..e8e05bd 100644 +--- a/kernel/mem.c ++++ b/kernel/mem.c +@@ -2482,3 +2482,28 @@ int ihk_mc_get_mem_user_page(void *arg0, page_table_t pt, pte_t *ptep, void *pga + + return 0; + } ++ ++void ihk_mc_mem_free_page_dest(void) { ++ struct rb_node *node; ++ struct rb_root *free_chunks; ++ unsigned long free_pages, free_page_cnt; ++ int i; ++ ++ /* Search all NUMA nodes */ ++ for (i = 0; i < ihk_mc_get_nr_numa_nodes(); i++) { ++ ++ free_chunks = &memory_nodes[i].free_chunks; ++ free_pages = memory_nodes[i].nr_free_pages; ++ ++ /* rb-tree search */ ++ for (free_page_cnt = 0, node = rb_first(free_chunks); node; free_page_cnt++, node = rb_next_dest(node)) { ++ ++ if (free_page_cnt >= free_pages) ++ break; ++ ++ } ++ } ++ ++ return; ++} ++ +diff --git a/kernel/rbtree.c b/kernel/rbtree.c +index 5134a0d..2a0383f 100644 +--- a/kernel/rbtree.c ++++ b/kernel/rbtree.c +@@ -25,6 +25,8 @@ + + #define EXPORT_SYMBOL(x) + ++#define MEM_DESTROY_VAL 0xffffffffffffffff ++ + extern int ihk_mc_chk_page_address(unsigned long mem_addr); + extern unsigned long virt_to_phys(void *v); + +@@ -555,6 +557,47 @@ struct rb_node *rb_next_safe(const struct rb_node *node) + } + EXPORT_SYMBOL(rb_next_safe); + ++struct rb_node *rb_next_dest(const struct rb_node *node) ++{ ++ struct rb_node *parent; ++ struct rb_node *node_tmp = NULL; ++ ++ if (RB_EMPTY_NODE(node)) ++ return NULL; ++ ++ /* ++ * * If we have a right-hand child, go down and then left as far ++ * * as we can. ++ * */ ++ if (node->rb_right) { ++ node = node->rb_right; ++ ++ while (node->rb_left) { ++ node_tmp = (struct rb_node *)node; ++ node=node->rb_left; ++ } ++ ++ if(node_tmp != NULL) { ++ node_tmp->rb_left = (struct rb_node *)MEM_DESTROY_VAL; ++ } ++ ++ return (struct rb_node *)node; ++ } ++ ++ /* ++ * * No right-hand children. Everything down and left is smaller than us, ++ * * so any 'next' node must be in the general direction of our parent. ++ * * Go up the tree; any time the ancestor is a right-hand child of its ++ * * parent, keep going up. First time it's a left-hand child of its ++ * * parent, said parent is our 'next' node. ++ * */ ++ while ((parent = rb_parent(node)) && node == parent->rb_right) ++ node = parent; ++ ++ return parent; ++} ++EXPORT_SYMBOL(rb_next_dest); ++ + struct rb_node *rb_prev(const struct rb_node *node) + { + struct rb_node *parent; +diff --git a/kernel/syscall.c b/kernel/syscall.c +index 6d23702..5620bf4 100644 +--- a/kernel/syscall.c ++++ b/kernel/syscall.c +@@ -9885,6 +9885,43 @@ set_cputime(int mode) + } + } + ++SYSCALL_DECLARE(usedmem_destroy) ++{ ++ kprintf("usedmem_destroy() call\n"); ++ ++ struct resource_set *rset = cpu_local_var(resource_set); ++ struct process_hash *phash = rset->process_hash; ++ struct process *p; ++ struct process_vm *vm; ++ int i; ++ ++ for (i=0; ilist[i], hash_list){ ++ vm = p->vm; ++ if (vm) { ++ if(vm->address_space->page_table) { ++ visit_pte_range_dest(vm->address_space->page_table, 0, ++ (void *)USER_END, 0, 0, ++ (void *)NULL, (void *)NULL); ++ } ++ } ++ } ++ } ++ ++ return 0; ++} ++ ++SYSCALL_DECLARE(freemem_destroy) ++{ ++ kprintf("freemem_destroy() call\n"); ++ ++ ihk_mc_mem_free_page_dest(); ++ ++ return 0; ++} ++ ++ + long syscall(int num, ihk_mc_user_context_t *ctx) + { + long l; +diff --git a/lib/include/ihk/mm.h b/lib/include/ihk/mm.h +index 5b2aa70..18a5408 100644 +--- a/lib/include/ihk/mm.h ++++ b/lib/include/ihk/mm.h +@@ -191,6 +191,8 @@ int visit_pte_range(page_table_t pt, void *start, void *end, int pgshift, + enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg); + int visit_pte_range_safe(page_table_t pt, void *start, void *end, int pgshift, + enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg); ++int visit_pte_range_dest(page_table_t pt, void *start, void *end, int pgshift, ++ enum visit_pte_flag flags, pte_visitor_t *funcp, void *arg); + int move_pte_range(page_table_t pt, struct process_vm *vm, + void *src, void *dest, size_t size, struct vm_range *range); + +@@ -250,5 +252,5 @@ void ihk_mc_query_mem_user_page(void *dump_page_set); + void ihk_mc_query_mem_free_page(void *dump_page_set); + int ihk_mc_chk_page_address(pte_t mem_addr); + int ihk_mc_get_mem_user_page(void *arg0, page_table_t pt, pte_t *ptep, void *pgaddr, int pgshift); +- ++void ihk_mc_mem_free_page_dest(void); + #endif diff --git a/test/dump/dumps/.gitignore b/test/dump/dumps/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/test/dump/go_linux_dump_test.sh b/test/dump/go_linux_dump_test.sh new file mode 100755 index 00000000..c088a07a --- /dev/null +++ b/test/dump/go_linux_dump_test.sh @@ -0,0 +1,64 @@ +#!/bin/sh + +source ./config + +FORCE_STOP=${HOME}/tmp/force_stop_linux_dump +if [ -e ${FORCE_STOP} ]; then + echo "force stopped Linux dump test " + exit 1 +fi + +PANIC_LIST="./panic_list" +PROGRESS_FILE="${HOME}/progress_linux_dump_test.txt" + +if [ ! -f ${PANIC_LIST} ]; then + cp ${PANIC_LIST}.in ${PANIC_LIST} +fi + +# check existing of done_panic +if [ -e ./done_panic ]; then + # test of ldump2mcdump + + source ./done_panic + + # find latest vmcore file + latest_vmcore_dir="/var/crash/`ls -1t /var/crash | head -1`" + latest_vmcore="${latest_vmcore_dir}/vmcore" + + if [ ! -e ${latest_vmcore} ]; then + echo "Error: latest vmcore is not found." + exit 1 + fi + + for case_name in ${BELOW_CASES} + do + param_file=./linux_testcases/${case_name}.txt + mkdir -p "./result/linux_dump" + logfile="./result/linux_dump/${case_name}.log" + + ./linux_dump_test.sh ${latest_vmcore} ${param_file} &> ${logfile} + if [ $? -eq 0 ]; then + echo "[OK] ${case_name} is done." >> ${PROGRESS_FILE} + else + echo "[NG] failed to test ${case_name}, Please check ${logfile}" >> ${PROGRESS_FILE} + fi + done + + rm ./done_panic + # remove vmcore + sudo rm -r ${latest_vmcore_dir} + + # remove dump_file + sudo rm ./mcdump &> /dev/null + sudo rm ./dumps/mcdump_* &> /dev/null +fi + +# occur test panic +panic_param=`head -1 ./panic_list` +if [ "X${panic_param}" = "X" ]; then + echo "All panic is done" + exit 0 +fi +sed -i -e "/`basename ${panic_param}`/d" ./panic_list +./linux_dump_panic.sh ${panic_param} + diff --git a/test/dump/go_mck_dump_test.sh b/test/dump/go_mck_dump_test.sh new file mode 100755 index 00000000..fb412daa --- /dev/null +++ b/test/dump/go_mck_dump_test.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +for test_case in `ls -1 ./mck_testcases/*.txt` +do + case_name=`basename ${test_case} .txt` + + mkdir -p "./result/mck_dump" + + logfile="./result/mck_dump/${case_name}.log" + ./mck_dump_test.sh ${test_case} &> ${logfile} + + if [ $? -eq 0 ]; then + echo "[OK] ${case_name} is done." + else + echo "[NG] failed to test ${case_name}. Please check ${logfile}" + fi + + # save dump_file + #sudo mv mcdump_* ./result/${case_name}/ &> /dev/null + #sudo mv dumps/dumpfile_* ./result/${case_name}/ &> /dev/null + + # remove dump_file + sudo rm ./mcdump_* &> /dev/null + sudo rm ./dumps/dumpfile_* &> /dev/null +done diff --git a/test/dump/go_mck_dump_test_ofp.sh b/test/dump/go_mck_dump_test_ofp.sh new file mode 100755 index 00000000..a44eb047 --- /dev/null +++ b/test/dump/go_mck_dump_test_ofp.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +for test_case in `ls -1 ./mck_testcases_ofp/*.txt` +do + case_name=`basename ${test_case} .txt` + + mkdir -p "./result/mck_dump" + + logfile="./result/mck_dump/${case_name}.log" + ./mck_dump_test.sh ${test_case} &> ${logfile} + + if [ $? -eq 0 ]; then + echo "[OK] ${case_name} is done." + else + echo "[NG] failed to test ${case_name}. Please check ${logfile}" + fi + + # save dump_file + #sudo mv mcdump_* ./result/${case_name}/ &> /dev/null + #sudo mv dumps/dumpfile_* ./result/${case_name}/ &> /dev/null + + # remove dump_file + sudo rm ./mcdump_* &> /dev/null + sudo rm ./dumps/dumpfile_* &> /dev/null +done diff --git a/test/dump/linux_dump_panic.sh b/test/dump/linux_dump_panic.sh new file mode 100755 index 00000000..c5cc5487 --- /dev/null +++ b/test/dump/linux_dump_panic.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "Error: too few arguments." + echo "usage: `basename $0` " +fi + +# read config +source ./config + +# read testcase param +source $1 + +echo `grep "BELOW_CASES" $1` > ./done_panic + +# mcexec processのkill +./utils/kill_mcexec.sh &> /dev/null + +# stop mckernel +#echo "${MCMOD_DIR}/sbin/mcstop+release.sh" +sudo ${MCMOD_DIR}/sbin/mcstop+release.sh + +# boot mckernel +#echo "${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,}" +sudo ${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,} ${DUMP_OPT} + +sleep 1 + +if [ ! -e "/dev/mcos0" ]; then + echo "Error: failed to mcreboot" + exit 1 +fi + +# exec mckernel test program +for mc_proc in ${USR_PROC} +do + echo "${MCMOD_DIR}/bin/mcexec ${mc_proc}" + ${MCMOD_DIR}/bin/mcexec ${mc_proc} & +done + +# wait mmap +sleep 10 + +echo `grep "BELOW_CASES" $1` > ./done_panic +sleep 1 + +# do panic +sudo sh -c "echo 1 > /proc/sys/kernel/sysrq" +sudo sh -c "echo c > /proc/sysrq-trigger" + +exit 0 diff --git a/test/dump/linux_dump_test.sh b/test/dump/linux_dump_test.sh new file mode 100755 index 00000000..15f9c6bb --- /dev/null +++ b/test/dump/linux_dump_test.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +if [ $# -lt 2 ]; then + echo "Error: too few arguments" + echo "usage: `basename $0` " + exit 1 +fi + +# read test_param_file +source $2 + +VMCORE=$1 + +sudo sh -c "env MCMOD_DIR=${MCMOD_DIR} ./utils/extract_mckdump.sh ${VMCORE} ${OUTFILE}" +sleep 1 + +if [ "X${OUTFILE}" = "X" ]; then + out_mckdump="./mcdump" +else + out_mckdump="${OUTFILE}" +fi + +if [ "X${ERROR_CASE}" = "X" ]; then + # Normal case + if [ ! -f ${out_mckdump} ]; then + echo "Error: ${out_mckdump} is not created." + exit 1 + fi + + # show dump_file info + ./utils/show_mckdump.sh ${out_mckdump} + +else + # Error case + if [ -f ${out_mckdump} ]; then + echo "Error: ${out_mckdump} is created." + exit 1 + fi +fi + +exit 0 diff --git a/test/dump/linux_testcases/0001_linux.txt b/test/dump/linux_testcases/0001_linux.txt new file mode 100644 index 00000000..2fea341c --- /dev/null +++ b/test/dump/linux_testcases/0001_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0001.dmp" diff --git a/test/dump/linux_testcases/0002_linux.txt b/test/dump/linux_testcases/0002_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0002_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0003_linux.txt b/test/dump/linux_testcases/0003_linux.txt new file mode 100644 index 00000000..098a8531 --- /dev/null +++ b/test/dump/linux_testcases/0003_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0003.dmp" diff --git a/test/dump/linux_testcases/0004_linux.txt b/test/dump/linux_testcases/0004_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0004_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0005_linux.txt b/test/dump/linux_testcases/0005_linux.txt new file mode 100644 index 00000000..1f8f2aad --- /dev/null +++ b/test/dump/linux_testcases/0005_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0005.dmp" diff --git a/test/dump/linux_testcases/0006_linux.txt b/test/dump/linux_testcases/0006_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0006_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0007_linux.txt b/test/dump/linux_testcases/0007_linux.txt new file mode 100644 index 00000000..43ea048d --- /dev/null +++ b/test/dump/linux_testcases/0007_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0007.dmp" diff --git a/test/dump/linux_testcases/0008_linux.txt b/test/dump/linux_testcases/0008_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0008_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0009_linux.txt b/test/dump/linux_testcases/0009_linux.txt new file mode 100644 index 00000000..0a0378b5 --- /dev/null +++ b/test/dump/linux_testcases/0009_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0009.dmp" diff --git a/test/dump/linux_testcases/0010_linux.txt b/test/dump/linux_testcases/0010_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0010_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0011_linux.txt b/test/dump/linux_testcases/0011_linux.txt new file mode 100644 index 00000000..3b7d7de6 --- /dev/null +++ b/test/dump/linux_testcases/0011_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0011.dmp" diff --git a/test/dump/linux_testcases/0012_linux.txt b/test/dump/linux_testcases/0012_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0012_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0013_linux.txt b/test/dump/linux_testcases/0013_linux.txt new file mode 100644 index 00000000..5e15c873 --- /dev/null +++ b/test/dump/linux_testcases/0013_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0013.dmp" diff --git a/test/dump/linux_testcases/0014_linux.txt b/test/dump/linux_testcases/0014_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0014_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0015_linux.txt b/test/dump/linux_testcases/0015_linux.txt new file mode 100644 index 00000000..d6ed7ba7 --- /dev/null +++ b/test/dump/linux_testcases/0015_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0015.dmp" diff --git a/test/dump/linux_testcases/0016_linux.txt b/test/dump/linux_testcases/0016_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0016_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0017_linux.txt b/test/dump/linux_testcases/0017_linux.txt new file mode 100644 index 00000000..aa23724b --- /dev/null +++ b/test/dump/linux_testcases/0017_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0017.dmp" diff --git a/test/dump/linux_testcases/0018_linux.txt b/test/dump/linux_testcases/0018_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0018_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0019_linux.txt b/test/dump/linux_testcases/0019_linux.txt new file mode 100644 index 00000000..cb53ec18 --- /dev/null +++ b/test/dump/linux_testcases/0019_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0019.dmp" diff --git a/test/dump/linux_testcases/0020_linux.txt b/test/dump/linux_testcases/0020_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0020_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0021_linux.txt b/test/dump/linux_testcases/0021_linux.txt new file mode 100644 index 00000000..bebe26a6 --- /dev/null +++ b/test/dump/linux_testcases/0021_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0021.dmp" diff --git a/test/dump/linux_testcases/0022_linux.txt b/test/dump/linux_testcases/0022_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0022_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0023_linux.txt b/test/dump/linux_testcases/0023_linux.txt new file mode 100644 index 00000000..6faa0415 --- /dev/null +++ b/test/dump/linux_testcases/0023_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0023.dmp" diff --git a/test/dump/linux_testcases/0024_linux.txt b/test/dump/linux_testcases/0024_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0024_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0025_linux.txt b/test/dump/linux_testcases/0025_linux.txt new file mode 100644 index 00000000..bbd0246d --- /dev/null +++ b/test/dump/linux_testcases/0025_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0025.dmp" diff --git a/test/dump/linux_testcases/0026_linux.txt b/test/dump/linux_testcases/0026_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0026_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0027_linux.txt b/test/dump/linux_testcases/0027_linux.txt new file mode 100644 index 00000000..24619ca8 --- /dev/null +++ b/test/dump/linux_testcases/0027_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0027.dmp" diff --git a/test/dump/linux_testcases/0028_linux.txt b/test/dump/linux_testcases/0028_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0028_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0029_linux.txt b/test/dump/linux_testcases/0029_linux.txt new file mode 100644 index 00000000..2ab72e6f --- /dev/null +++ b/test/dump/linux_testcases/0029_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0029.dmp" diff --git a/test/dump/linux_testcases/0030_linux.txt b/test/dump/linux_testcases/0030_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0030_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0031_linux.txt b/test/dump/linux_testcases/0031_linux.txt new file mode 100644 index 00000000..76c3d898 --- /dev/null +++ b/test/dump/linux_testcases/0031_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0031.dmp" diff --git a/test/dump/linux_testcases/0032_linux.txt b/test/dump/linux_testcases/0032_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0032_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0033_linux.txt b/test/dump/linux_testcases/0033_linux.txt new file mode 100644 index 00000000..e7ccce2a --- /dev/null +++ b/test/dump/linux_testcases/0033_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0033.dmp" diff --git a/test/dump/linux_testcases/0034_linux.txt b/test/dump/linux_testcases/0034_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0034_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0035_linux.txt b/test/dump/linux_testcases/0035_linux.txt new file mode 100644 index 00000000..5cdf6553 --- /dev/null +++ b/test/dump/linux_testcases/0035_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0035.dmp" diff --git a/test/dump/linux_testcases/0036_linux.txt b/test/dump/linux_testcases/0036_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0036_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0037_linux.txt b/test/dump/linux_testcases/0037_linux.txt new file mode 100644 index 00000000..c06fddeb --- /dev/null +++ b/test/dump/linux_testcases/0037_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0037.dmp" diff --git a/test/dump/linux_testcases/0038_linux.txt b/test/dump/linux_testcases/0038_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0038_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0039_linux.txt b/test/dump/linux_testcases/0039_linux.txt new file mode 100644 index 00000000..4e842469 --- /dev/null +++ b/test/dump/linux_testcases/0039_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0039.dmp" diff --git a/test/dump/linux_testcases/0040_linux.txt b/test/dump/linux_testcases/0040_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0040_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0041_linux.txt b/test/dump/linux_testcases/0041_linux.txt new file mode 100644 index 00000000..5414ed08 --- /dev/null +++ b/test/dump/linux_testcases/0041_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0041.dmp" diff --git a/test/dump/linux_testcases/0042_linux.txt b/test/dump/linux_testcases/0042_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0042_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0043_linux.txt b/test/dump/linux_testcases/0043_linux.txt new file mode 100644 index 00000000..45c1ee20 --- /dev/null +++ b/test/dump/linux_testcases/0043_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0043.dmp" diff --git a/test/dump/linux_testcases/0044_linux.txt b/test/dump/linux_testcases/0044_linux.txt new file mode 100644 index 00000000..4df87c37 --- /dev/null +++ b/test/dump/linux_testcases/0044_linux.txt @@ -0,0 +1 @@ +OUTFILE="" diff --git a/test/dump/linux_testcases/0045_linux.txt b/test/dump/linux_testcases/0045_linux.txt new file mode 100644 index 00000000..bc4472b9 --- /dev/null +++ b/test/dump/linux_testcases/0045_linux.txt @@ -0,0 +1 @@ +OUTFILE="./dumps/mcdump_0045.dmp" diff --git a/test/dump/linux_testcases/0046_linux.txt b/test/dump/linux_testcases/0046_linux.txt new file mode 100644 index 00000000..84625fea --- /dev/null +++ b/test/dump/linux_testcases/0046_linux.txt @@ -0,0 +1,2 @@ +OUTFILE="./not_exist_dir/file" +ERROR_CASE="yes" diff --git a/test/dump/linux_testcases/0047_linux.txt b/test/dump/linux_testcases/0047_linux.txt new file mode 100644 index 00000000..8bed0a3e --- /dev/null +++ b/test/dump/linux_testcases/0047_linux.txt @@ -0,0 +1,2 @@ +OUTFILE="${HOME}/testdump" +ERROR_CASE="yes" diff --git a/test/dump/linux_testcases/panic_0001.txt b/test/dump/linux_testcases/panic_0001.txt new file mode 100644 index 00000000..ad8a262f --- /dev/null +++ b/test/dump/linux_testcases/panic_0001.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m 32M@0" +DUMP_OPT="" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +BELOW_CASES="0001_linux 0002_linux" diff --git a/test/dump/linux_testcases/panic_0002.txt b/test/dump/linux_testcases/panic_0002.txt new file mode 100644 index 00000000..a3f3efa7 --- /dev/null +++ b/test/dump/linux_testcases/panic_0002.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m 32M@0" +DUMP_OPT="-d 0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +BELOW_CASES="0003_linux 0004_linux" diff --git a/test/dump/linux_testcases/panic_0003.txt b/test/dump/linux_testcases/panic_0003.txt new file mode 100644 index 00000000..921fd05f --- /dev/null +++ b/test/dump/linux_testcases/panic_0003.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m 2G@0" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0005_linux 0006_linux" diff --git a/test/dump/linux_testcases/panic_0004.txt b/test/dump/linux_testcases/panic_0004.txt new file mode 100644 index 00000000..670b8e6b --- /dev/null +++ b/test/dump/linux_testcases/panic_0004.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 128`" +DUMP_OPT="" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +BELOW_CASES="0007_linux 0008_linux" diff --git a/test/dump/linux_testcases/panic_0005.txt b/test/dump/linux_testcases/panic_0005.txt new file mode 100644 index 00000000..a149a6da --- /dev/null +++ b/test/dump/linux_testcases/panic_0005.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 128`" +DUMP_OPT="-d 0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +BELOW_CASES="0009_linux 0010_linux" diff --git a/test/dump/linux_testcases/panic_0006.txt b/test/dump/linux_testcases/panic_0006.txt new file mode 100644 index 00000000..4eb61414 --- /dev/null +++ b/test/dump/linux_testcases/panic_0006.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 128`" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0011_linux 0012_linux" diff --git a/test/dump/linux_testcases/panic_0007.txt b/test/dump/linux_testcases/panic_0007.txt new file mode 100644 index 00000000..bc6b3843 --- /dev/null +++ b/test/dump/linux_testcases/panic_0007.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`" +DUMP_OPT="" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +BELOW_CASES="0013_linux 0014_linux" diff --git a/test/dump/linux_testcases/panic_0008.txt b/test/dump/linux_testcases/panic_0008.txt new file mode 100644 index 00000000..503504ca --- /dev/null +++ b/test/dump/linux_testcases/panic_0008.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`" +DUMP_OPT="-d 0" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0015_linux 0016_linux" diff --git a/test/dump/linux_testcases/panic_0009.txt b/test/dump/linux_testcases/panic_0009.txt new file mode 100644 index 00000000..3be12c6a --- /dev/null +++ b/test/dump/linux_testcases/panic_0009.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 48M 512`" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_20mb_1000times" +BELOW_CASES="0017_linux 0018_linux" diff --git a/test/dump/linux_testcases/panic_0010.txt b/test/dump/linux_testcases/panic_0010.txt new file mode 100644 index 00000000..2acc658c --- /dev/null +++ b/test/dump/linux_testcases/panic_0010.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +DUMP_OPT="" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +BELOW_CASES="0019_linux 0020_linux" diff --git a/test/dump/linux_testcases/panic_0011.txt b/test/dump/linux_testcases/panic_0011.txt new file mode 100644 index 00000000..62472ce6 --- /dev/null +++ b/test/dump/linux_testcases/panic_0011.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 1`" +DUMP_OPT="-d 0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +BELOW_CASES="0021_linux 0022_linux" diff --git a/test/dump/linux_testcases/panic_0012.txt b/test/dump/linux_testcases/panic_0012.txt new file mode 100644 index 00000000..7fa028ec --- /dev/null +++ b/test/dump/linux_testcases/panic_0012.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 1G 1`" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0023_linux 0024_linux" diff --git a/test/dump/linux_testcases/panic_0013.txt b/test/dump/linux_testcases/panic_0013.txt new file mode 100644 index 00000000..8f0894c0 --- /dev/null +++ b/test/dump/linux_testcases/panic_0013.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 64`" +DUMP_OPT="" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +BELOW_CASES="0025_linux 0026_linux" diff --git a/test/dump/linux_testcases/panic_0014.txt b/test/dump/linux_testcases/panic_0014.txt new file mode 100644 index 00000000..76a35e74 --- /dev/null +++ b/test/dump/linux_testcases/panic_0014.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 64`" +DUMP_OPT="-d 0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +BELOW_CASES="0027_linux 0028_linux" diff --git a/test/dump/linux_testcases/panic_0015.txt b/test/dump/linux_testcases/panic_0015.txt new file mode 100644 index 00000000..6ac76323 --- /dev/null +++ b/test/dump/linux_testcases/panic_0015.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 64`" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0029_linux 0030_linux" diff --git a/test/dump/linux_testcases/panic_0016.txt b/test/dump/linux_testcases/panic_0016.txt new file mode 100644 index 00000000..28a0d2fb --- /dev/null +++ b/test/dump/linux_testcases/panic_0016.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`" +DUMP_OPT="" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +BELOW_CASES="0031_linux 0032_linux" diff --git a/test/dump/linux_testcases/panic_0017.txt b/test/dump/linux_testcases/panic_0017.txt new file mode 100644 index 00000000..25311522 --- /dev/null +++ b/test/dump/linux_testcases/panic_0017.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`" +DUMP_OPT="-d 0" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0033_linux 0034_linux" diff --git a/test/dump/linux_testcases/panic_0018.txt b/test/dump/linux_testcases/panic_0018.txt new file mode 100644 index 00000000..3c1d8167 --- /dev/null +++ b/test/dump/linux_testcases/panic_0018.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 48M 256`" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_20mb_1000times" +BELOW_CASES="0035_linux 0036_linux" diff --git a/test/dump/linux_testcases/panic_0019.txt b/test/dump/linux_testcases/panic_0019.txt new file mode 100644 index 00000000..28ce8cd2 --- /dev/null +++ b/test/dump/linux_testcases/panic_0019.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-c 4,12 -m `./utils/gen_mem_chunks.sh "0 1" 1G 1`" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0037_linux 0038_linux" diff --git a/test/dump/linux_testcases/panic_0020.txt b/test/dump/linux_testcases/panic_0020.txt new file mode 100644 index 00000000..3150a0f1 --- /dev/null +++ b/test/dump/linux_testcases/panic_0020.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-c 4,12 -m `./utils/gen_mem_chunks.sh "0 1" 32M 64`" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0039_linux 0040_linux" diff --git a/test/dump/linux_testcases/panic_0021.txt b/test/dump/linux_testcases/panic_0021.txt new file mode 100644 index 00000000..88dff436 --- /dev/null +++ b/test/dump/linux_testcases/panic_0021.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-c 4,12 -m `./utils/gen_mem_chunks.sh "0 1" 20M 256`" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time mcexec_test_proc/test_pt_1gb_1time" +BELOW_CASES="0041_linux 0042_linux" diff --git a/test/dump/linux_testcases/panic_0022.txt b/test/dump/linux_testcases/panic_0022.txt new file mode 100644 index 00000000..8c091cd5 --- /dev/null +++ b/test/dump/linux_testcases/panic_0022.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m 32M@0" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times mcexec_test_proc/memtest_used_destroy" +BELOW_CASES="0043_linux" diff --git a/test/dump/linux_testcases/panic_0023.txt b/test/dump/linux_testcases/panic_0023.txt new file mode 100644 index 00000000..9b9e364d --- /dev/null +++ b/test/dump/linux_testcases/panic_0023.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m 32M@0" +DUMP_OPT="-d 24" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times mcexec_test_proc/memtest_free_destroy" +BELOW_CASES="0044_linux 0045_linux 0046_linux 0047_linux" diff --git a/test/dump/linux_testcases/panic_0024.txt b/test/dump/linux_testcases/panic_0024.txt new file mode 100644 index 00000000..0d31f5e6 --- /dev/null +++ b/test/dump/linux_testcases/panic_0024.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m 32M@0" +DUMP_OPT="-d 99" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +BELOW_CASES="0045_linux 0046_linux 0047_linux" diff --git a/test/dump/mcexec_test_proc/Makefile b/test/dump/mcexec_test_proc/Makefile new file mode 100644 index 00000000..0ea2722e --- /dev/null +++ b/test/dump/mcexec_test_proc/Makefile @@ -0,0 +1,6 @@ +OBJS = test_pt_1gb_10times test_pt_1gb_1time test_pt_1kb_1time test_pt_1mb_10times test_pt_20mb_1000times memtest_free_destroy memtest_used_destroy + +all: $(OBJS) + +clean: + rm $(OBJS) diff --git a/test/dump/mcexec_test_proc/memtest_free_destroy.c b/test/dump/mcexec_test_proc/memtest_free_destroy.c new file mode 100644 index 00000000..bf9255a5 --- /dev/null +++ b/test/dump/mcexec_test_proc/memtest_free_destroy.c @@ -0,0 +1,14 @@ +#include +#define _GNU_SOURCE +#include +#include + +main() { + + int rst = 0; + + rst = syscall(902); + printf("freemem_destroy result:%d\n",rst); + + return; +} diff --git a/test/dump/mcexec_test_proc/memtest_used_destroy.c b/test/dump/mcexec_test_proc/memtest_used_destroy.c new file mode 100644 index 00000000..cdfe79b6 --- /dev/null +++ b/test/dump/mcexec_test_proc/memtest_used_destroy.c @@ -0,0 +1,14 @@ +#include +#define _GNU_SOURCE +#include +#include + +main() { + + int rst = 0; + + rst = syscall(901); + printf("usedmem_destroy result:%d\n",rst); + + return; +} diff --git a/test/dump/mcexec_test_proc/test_pt_1gb_10times.c b/test/dump/mcexec_test_proc/test_pt_1gb_10times.c new file mode 100644 index 00000000..13e9d375 --- /dev/null +++ b/test/dump/mcexec_test_proc/test_pt_1gb_10times.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +#define MEM_SIZE (1024*1024*1024) +#define LOOP_MAX 10 +#define SLEEP_TIME 30 + +main() +{ + + int *buf,buf_size,index; + + buf_size = MEM_SIZE; + + for (index = 0; index < LOOP_MAX; index++) { + buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + if (NULL != buf) { + memset(buf, 1, buf_size); + } else { + printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size); + } + } + printf("mmap is done\n"); + + sleep(SLEEP_TIME); + + return 0; +} diff --git a/test/dump/mcexec_test_proc/test_pt_1gb_1time.c b/test/dump/mcexec_test_proc/test_pt_1gb_1time.c new file mode 100644 index 00000000..21cd1c2d --- /dev/null +++ b/test/dump/mcexec_test_proc/test_pt_1gb_1time.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +#define MEM_SIZE (1024*1024*1024) +#define LOOP_MAX 1 +#define SLEEP_TIME 30 + +main() +{ + + int *buf,buf_size,index; + + buf_size = MEM_SIZE; + + for (index = 0; index < LOOP_MAX; index++) { + buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + if (NULL != buf) { + memset(buf, 1, buf_size); + } else { + printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size); + } + } + printf("mmap is done\n"); + + sleep(SLEEP_TIME); + + return 0; +} diff --git a/test/dump/mcexec_test_proc/test_pt_1kb_1time.c b/test/dump/mcexec_test_proc/test_pt_1kb_1time.c new file mode 100644 index 00000000..f88de546 --- /dev/null +++ b/test/dump/mcexec_test_proc/test_pt_1kb_1time.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +#define MEM_SIZE (1024) +#define LOOP_MAX 1 +#define SLEEP_TIME 30 + +main() +{ + + int *buf,buf_size,index; + + buf_size = MEM_SIZE; + + for (index = 0; index < LOOP_MAX; index++) { + buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + if (NULL != buf) { + memset(buf, 1, buf_size); + } else { + printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size); + } + } + printf("mmap is done\n"); + + sleep(SLEEP_TIME); + + return 0; +} diff --git a/test/dump/mcexec_test_proc/test_pt_1mb_10times.c b/test/dump/mcexec_test_proc/test_pt_1mb_10times.c new file mode 100644 index 00000000..f95bc9d4 --- /dev/null +++ b/test/dump/mcexec_test_proc/test_pt_1mb_10times.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +#define MEM_SIZE (1024*1024) +#define LOOP_MAX 10 +#define SLEEP_TIME 30 + +main() +{ + + int *buf,buf_size,index; + + buf_size = MEM_SIZE; + + for (index = 0; index < LOOP_MAX; index++) { + buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + if (NULL != buf) { + memset(buf, 1, buf_size); + } else { + printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size); + } + } + printf("mmap is done\n"); + + sleep(SLEEP_TIME); + + return 0; +} diff --git a/test/dump/mcexec_test_proc/test_pt_20mb_1000times.c b/test/dump/mcexec_test_proc/test_pt_20mb_1000times.c new file mode 100644 index 00000000..ebf108fd --- /dev/null +++ b/test/dump/mcexec_test_proc/test_pt_20mb_1000times.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +#define MEM_SIZE (1024*1024*20) +#define LOOP_MAX 1024 +#define SLEEP_TIME 30 + +main() +{ + + int *buf,buf_size,index; + + buf_size = MEM_SIZE; + + for (index = 0; index < LOOP_MAX; index++) { + buf = mmap(0, buf_size, PROT_READ|PROT_WRITE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); + if (NULL != buf) { + memset(buf, 1, buf_size); + } else { + printf("[%d] mmap error!!! buf_size:%d(0x%x)\n", index, buf_size, buf_size); + } + } + printf("mmap is done\n"); + + sleep(SLEEP_TIME); + + return 0; +} diff --git a/test/dump/mck_dump_test.sh b/test/dump/mck_dump_test.sh new file mode 100755 index 00000000..80637d03 --- /dev/null +++ b/test/dump/mck_dump_test.sh @@ -0,0 +1,100 @@ +#!/bin/sh + +if [ $# -lt 1 ]; then + echo "Error: too few arguments." + echo "usage: `basename $0` " +fi + +# read config +source ./config + +# read testcase param +source $1 + +# mcexec processのkill +./utils/kill_mcexec.sh &> /dev/null + +# stop mckernel +sudo ${MCMOD_DIR}/sbin/mcstop+release.sh + +# boot mckernel +echo "${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,}" +sudo ${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT%,} + +sleep 1 + +if [ ! -e "/dev/mcos0" ]; then + echo "Error: failed to mcreboot" + exit 1 +fi + +# exec mckernel test program +for mc_proc in ${USR_PROC} +do + echo "${MCMOD_DIR}/bin/mcexec ${mc_proc}" + ${MCMOD_DIR}/bin/mcexec ${mc_proc} & +done +# wait mmap +sleep 5 + +if [ "X${DUMP_FILE}" = "X" ]; then + dump_cnt=`find ./ -maxdepth 1 -name "mcdump_*" | wc -l` +fi + +# do dump +echo "${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} dump ${DUMP_OPT} ${DUMP_FILE}" +SECONDS=0 +if [ "X${NO_SUDO}" = "X" ]; then + sudo ${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} dump ${DUMP_OPT} ${DUMP_FILE} +else + ${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} dump ${DUMP_OPT} ${DUMP_FILE} +fi +rc=$? + +echo "Dump takes ${SECONDS} secs." + +if [ "X${ERROR_CASE}" = "X" ]; then + # Normal case + if [ ${rc} -ne 0 ]; then + echo "Error: dump returns not 0" + exit 1 + fi + + if [ "X${DUMP_FILE}" = "X" ]; then + if [ ${dump_cnt} -eq `find ./ -maxdepth 1 -name "mcdump_*" | wc -l` ]; then + echo "Error: default dump_file is not created" + echo "$dump_cnt `ls`" + exit 1 + else + out_dump_file=`ls -1 ./mcdump_*` + fi + else + if [ ! -e ${DUMP_FILE} ]; then + echo "Error: specified dump_file, ${DUMP_FILE} is not created" + exit 1 + else + out_dump_file=${DUMP_FILE} + fi + fi + # show dump_file info + ./utils/show_mckdump.sh ${out_dump_file} +else + # Error case + if [ ${rc} -eq 0 ]; then + echo "dump return 0" + exit 1 + fi + if [ "X${DUMP_FILE}" = "X" ]; then + if [ ${dump_cnt} -ne `find ./ -maxdepth 1 -name "mcdump_*" | wc -l` ]; then + echo "Error: default dump_file is created" + exit 1 + fi + else + if [ -e ${DUMP_FILE} ]; then + echo "Error: specified dump_file, ${DUMP_FILE} is created" + exit 1 + fi + fi +fi + +exit 0 diff --git a/test/dump/mck_testcases/0001_mckernel.txt b/test/dump/mck_testcases/0001_mckernel.txt new file mode 100644 index 00000000..0860cbfe --- /dev/null +++ b/test/dump/mck_testcases/0001_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0002_mckernel.txt b/test/dump/mck_testcases/0002_mckernel.txt new file mode 100644 index 00000000..ee85d259 --- /dev/null +++ b/test/dump/mck_testcases/0002_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@1" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0003_mckernel.txt b/test/dump/mck_testcases/0003_mckernel.txt new file mode 100644 index 00000000..992525c4 --- /dev/null +++ b/test/dump/mck_testcases/0003_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0004_mckernel.txt b/test/dump/mck_testcases/0004_mckernel.txt new file mode 100644 index 00000000..01b1c15c --- /dev/null +++ b/test/dump/mck_testcases/0004_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0004.log" diff --git a/test/dump/mck_testcases/0005_mckernel.txt b/test/dump/mck_testcases/0005_mckernel.txt new file mode 100644 index 00000000..75a8ad3a --- /dev/null +++ b/test/dump/mck_testcases/0005_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0005.log" diff --git a/test/dump/mck_testcases/0006_mckernel.txt b/test/dump/mck_testcases/0006_mckernel.txt new file mode 100644 index 00000000..042aebdd --- /dev/null +++ b/test/dump/mck_testcases/0006_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0007_mckernel.txt b/test/dump/mck_testcases/0007_mckernel.txt new file mode 100644 index 00000000..eb932a6c --- /dev/null +++ b/test/dump/mck_testcases/0007_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0008_mckernel.txt b/test/dump/mck_testcases/0008_mckernel.txt new file mode 100644 index 00000000..345b56de --- /dev/null +++ b/test/dump/mck_testcases/0008_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@1" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0009_mckernel.txt b/test/dump/mck_testcases/0009_mckernel.txt new file mode 100644 index 00000000..b94b4833 --- /dev/null +++ b/test/dump/mck_testcases/0009_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0010_mckernel.txt b/test/dump/mck_testcases/0010_mckernel.txt new file mode 100644 index 00000000..969608f3 --- /dev/null +++ b/test/dump/mck_testcases/0010_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0010.log" diff --git a/test/dump/mck_testcases/0011_mckernel.txt b/test/dump/mck_testcases/0011_mckernel.txt new file mode 100644 index 00000000..2177bce1 --- /dev/null +++ b/test/dump/mck_testcases/0011_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="./dumps/dumpfile_0011.log" diff --git a/test/dump/mck_testcases/0012_mckernel.txt b/test/dump/mck_testcases/0012_mckernel.txt new file mode 100644 index 00000000..5430c9a1 --- /dev/null +++ b/test/dump/mck_testcases/0012_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0013_mckernel.txt b/test/dump/mck_testcases/0013_mckernel.txt new file mode 100644 index 00000000..e750ee71 --- /dev/null +++ b/test/dump/mck_testcases/0013_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 2G 1`" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="" +DUMP_FILE="./dumps/dumpfile_0013.log" diff --git a/test/dump/mck_testcases/0014_mckernel.txt b/test/dump/mck_testcases/0014_mckernel.txt new file mode 100644 index 00000000..7630cd71 --- /dev/null +++ b/test/dump/mck_testcases/0014_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 1G 1`" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0015_mckernel.txt b/test/dump/mck_testcases/0015_mckernel.txt new file mode 100644 index 00000000..78691ea6 --- /dev/null +++ b/test/dump/mck_testcases/0015_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="./dumps/dumpfile_0015.log" diff --git a/test/dump/mck_testcases/0016_mckernel.txt b/test/dump/mck_testcases/0016_mckernel.txt new file mode 100644 index 00000000..8db9d36c --- /dev/null +++ b/test/dump/mck_testcases/0016_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0016.log" diff --git a/test/dump/mck_testcases/0017_mckernel.txt b/test/dump/mck_testcases/0017_mckernel.txt new file mode 100644 index 00000000..72934924 --- /dev/null +++ b/test/dump/mck_testcases/0017_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 20M 512`" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0017.log" diff --git a/test/dump/mck_testcases/0018_mckernel.txt b/test/dump/mck_testcases/0018_mckernel.txt new file mode 100644 index 00000000..658fe48c --- /dev/null +++ b/test/dump/mck_testcases/0018_mckernel.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 20M 256`" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="" diff --git a/test/dump/mck_testcases/0019_mckernel.txt b/test/dump/mck_testcases/0019_mckernel.txt new file mode 100644 index 00000000..f7a435a9 --- /dev/null +++ b/test/dump/mck_testcases/0019_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 12G@0" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="" +DUMP_FILE="./dumps/dumpfile_0019.log" diff --git a/test/dump/mck_testcases/0020_mckernel.txt b/test/dump/mck_testcases/0020_mckernel.txt new file mode 100644 index 00000000..d99831e0 --- /dev/null +++ b/test/dump/mck_testcases/0020_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 6G@0,6G@1" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0021_mckernel.txt b/test/dump/mck_testcases/0021_mckernel.txt new file mode 100644 index 00000000..834f8270 --- /dev/null +++ b/test/dump/mck_testcases/0021_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="./dumps/dumpfile_0021.log" diff --git a/test/dump/mck_testcases/0022_mckernel.txt b/test/dump/mck_testcases/0022_mckernel.txt new file mode 100644 index 00000000..421c125f --- /dev/null +++ b/test/dump/mck_testcases/0022_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0022.log" diff --git a/test/dump/mck_testcases/0023_mckernel.txt b/test/dump/mck_testcases/0023_mckernel.txt new file mode 100644 index 00000000..1610f825 --- /dev/null +++ b/test/dump/mck_testcases/0023_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0" 32M 512`" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0023.log" diff --git a/test/dump/mck_testcases/0024_mckernel.txt b/test/dump/mck_testcases/0024_mckernel.txt new file mode 100644 index 00000000..b26d3b96 --- /dev/null +++ b/test/dump/mck_testcases/0024_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 32M 256`" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0049_mckernel.txt b/test/dump/mck_testcases/0049_mckernel.txt new file mode 100644 index 00000000..75fad497 --- /dev/null +++ b/test/dump/mck_testcases/0049_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 24 -i" +DUMP_FILE="./dumps/dumpfile_0049.log" diff --git a/test/dump/mck_testcases/0050_mckernel.txt b/test/dump/mck_testcases/0050_mckernel.txt new file mode 100644 index 00000000..4c017f0e --- /dev/null +++ b/test/dump/mck_testcases/0050_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 0 --interactive" +DUMP_FILE="" diff --git a/test/dump/mck_testcases/0051_mckernel.txt b/test/dump/mck_testcases/0051_mckernel.txt new file mode 100644 index 00000000..d4ab7d25 --- /dev/null +++ b/test/dump/mck_testcases/0051_mckernel.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m 32M@0" +USR_PROC="mcexec_test_proc/test_pt_1kb_10times" +OS_IDX=1 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0050.log" +ERROR_CASE="yes" diff --git a/test/dump/mck_testcases/0052_mckernel.txt b/test/dump/mck_testcases/0052_mckernel.txt new file mode 100644 index 00000000..74698cf0 --- /dev/null +++ b/test/dump/mck_testcases/0052_mckernel.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 4" +DUMP_FILE="./dumps/dumpfile_0052.log" +ERROR_CASE="yes" diff --git a/test/dump/mck_testcases/0053_mckernel.txt b/test/dump/mck_testcases/0053_mckernel.txt new file mode 100644 index 00000000..c8d7b63c --- /dev/null +++ b/test/dump/mck_testcases/0053_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24 ./not_exist_dir/file" +ERROR_CASE="yes" diff --git a/test/dump/mck_testcases/0054_mckernel.txt b/test/dump/mck_testcases/0054_mckernel.txt new file mode 100644 index 00000000..aa7fc001 --- /dev/null +++ b/test/dump/mck_testcases/0054_mckernel.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m 512M@0" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="${HOME}/testdump" +ERROR_CASE="yes" diff --git a/test/dump/mck_testcases/0055_mckernel.txt b/test/dump/mck_testcases/0055_mckernel.txt new file mode 100644 index 00000000..056bab10 --- /dev/null +++ b/test/dump/mck_testcases/0055_mckernel.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m 512M@0" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24 ./dumps/dumpfile_0055.log" +ERROR_CASE="yes" +NO_SUDO="yes" diff --git a/test/dump/mck_testcases/0056_mckernel.txt b/test/dump/mck_testcases/0056_mckernel.txt new file mode 100644 index 00000000..9c750c37 --- /dev/null +++ b/test/dump/mck_testcases/0056_mckernel.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 48M 256`" +USR_PROC="mcexec_test_proc/test_pt_20mb_1000times" +OS_IDX=0 +DUMP_OPT="-d 24" diff --git a/test/dump/mck_testcases/0057_mckernel.txt b/test/dump/mck_testcases/0057_mckernel.txt new file mode 100644 index 00000000..471b6a8c --- /dev/null +++ b/test/dump/mck_testcases/0057_mckernel.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1" 48M 256`" +USR_PROC="mcexec_test_proc/test_pt_20mb_1000times" +OS_IDX=0 +DUMP_OPT="-d 0" diff --git a/test/dump/mck_testcases/0058_mckernel.txt b/test/dump/mck_testcases/0058_mckernel.txt new file mode 100644 index 00000000..a41dd207 --- /dev/null +++ b/test/dump/mck_testcases/0058_mckernel.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m 256M@0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times mcexec_test_proc/memtest_used_destroy" +OS_IDX=0 +DUMP_OPT="-d 24" diff --git a/test/dump/mck_testcases/0059_mckernel.txt b/test/dump/mck_testcases/0059_mckernel.txt new file mode 100644 index 00000000..11735056 --- /dev/null +++ b/test/dump/mck_testcases/0059_mckernel.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m 256M@0" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times mcexec_test_proc/memtest_free_destroy" +OS_IDX=0 +DUMP_OPT="-d 24" diff --git a/test/dump/mck_testcases/0060_mckernel.txt b/test/dump/mck_testcases/0060_mckernel.txt new file mode 100644 index 00000000..2352825f --- /dev/null +++ b/test/dump/mck_testcases/0060_mckernel.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-c 4,12 -m 2G@0,2G@1" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" diff --git a/test/dump/mck_testcases_ofp/0025_mckernel.txt b/test/dump/mck_testcases_ofp/0025_mckernel.txt new file mode 100644 index 00000000..b9ec434f --- /dev/null +++ b/test/dump/mck_testcases_ofp/0025_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@1,32M@2,32M@3" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0026_mckernel.txt b/test/dump/mck_testcases_ofp/0026_mckernel.txt new file mode 100644 index 00000000..620648fa --- /dev/null +++ b/test/dump/mck_testcases_ofp/0026_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@1,32M@2,32M@3,32M@4,32M@5,32M@6,32M@7" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0026.log" diff --git a/test/dump/mck_testcases_ofp/0027_mckernel.txt b/test/dump/mck_testcases_ofp/0027_mckernel.txt new file mode 100644 index 00000000..a45baf50 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0027_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3" 32M 32`" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0027.log" diff --git a/test/dump/mck_testcases_ofp/0028_mckernel.txt b/test/dump/mck_testcases_ofp/0028_mckernel.txt new file mode 100644 index 00000000..038fdc33 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0028_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3 4 5 6 7" 32M 16`" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0029_mckernel.txt b/test/dump/mck_testcases_ofp/0029_mckernel.txt new file mode 100644 index 00000000..672d5c3a --- /dev/null +++ b/test/dump/mck_testcases_ofp/0029_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3" 20M 128`" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0030_mckernel.txt b/test/dump/mck_testcases_ofp/0030_mckernel.txt new file mode 100644 index 00000000..cece9440 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0030_mckernel.txt @@ -0,0 +1,4 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3 4 5 6 7" 20M 64`" +USR_PROC="mcexec_test_proc/test_pt_1kb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" diff --git a/test/dump/mck_testcases_ofp/0031_mckernel.txt b/test/dump/mck_testcases_ofp/0031_mckernel.txt new file mode 100644 index 00000000..aaa2b978 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0031_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@1,32M@2,32M@3" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0032_mckernel.txt b/test/dump/mck_testcases_ofp/0032_mckernel.txt new file mode 100644 index 00000000..3bd70a03 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0032_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@1,32M@2,32M@3,32M@4,32M@5,32M@6,32M@7" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="./dumps/dumpfile_0032.log" diff --git a/test/dump/mck_testcases_ofp/0033_mckernel.txt b/test/dump/mck_testcases_ofp/0033_mckernel.txt new file mode 100644 index 00000000..908175c1 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0033_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="./dumps/dumpfile_0033.log" diff --git a/test/dump/mck_testcases_ofp/0034_mckernel.txt b/test/dump/mck_testcases_ofp/0034_mckernel.txt new file mode 100644 index 00000000..25a50788 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0034_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0035_mckernel.txt b/test/dump/mck_testcases_ofp/0035_mckernel.txt new file mode 100644 index 00000000..e1d85ebd --- /dev/null +++ b/test/dump/mck_testcases_ofp/0035_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3" 20M 128`" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0036_mckernel.txt b/test/dump/mck_testcases_ofp/0036_mckernel.txt new file mode 100644 index 00000000..989b62b0 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0036_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3 4 5 6 7" 20M 64`" +USR_PROC="mcexec_test_proc/test_pt_1mb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0037_mckernel.txt b/test/dump/mck_testcases_ofp/0037_mckernel.txt new file mode 100644 index 00000000..ee287656 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0037_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 512M@0,512M@1,512M@2,512M@3" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0038_mckernel.txt b/test/dump/mck_testcases_ofp/0038_mckernel.txt new file mode 100644 index 00000000..792a94d4 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0038_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 256M@0,256M@1,256M@2,256M@3,256M@4,256M@5,256M@6,256M@7" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0038.log" diff --git a/test/dump/mck_testcases_ofp/0039_mckernel.txt b/test/dump/mck_testcases_ofp/0039_mckernel.txt new file mode 100644 index 00000000..14e42308 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0039_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="./dumps/dumpfile_0039.log" diff --git a/test/dump/mck_testcases_ofp/0040_mckernel.txt b/test/dump/mck_testcases_ofp/0040_mckernel.txt new file mode 100644 index 00000000..d1871689 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0040_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@0,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@1,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@2,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@3,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@4,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@5,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@6,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7,32M@7" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0041_mckernel.txt b/test/dump/mck_testcases_ofp/0041_mckernel.txt new file mode 100644 index 00000000..95feb7b8 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0041_mckernel.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m 20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3" +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3" 32M 128`" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0042_mckernel.txt b/test/dump/mck_testcases_ofp/0042_mckernel.txt new file mode 100644 index 00000000..5c01d62e --- /dev/null +++ b/test/dump/mck_testcases_ofp/0042_mckernel.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m 20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7" +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3 4 5 6 7" 32M 64`" +USR_PROC="mcexec_test_proc/test_pt_1gb_1time" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0043_mckernel.txt b/test/dump/mck_testcases_ofp/0043_mckernel.txt new file mode 100644 index 00000000..d3147852 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0043_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 3G@0,3G@1,3G@2,3G@3" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0044_mckernel.txt b/test/dump/mck_testcases_ofp/0044_mckernel.txt new file mode 100644 index 00000000..ca1f27f6 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0044_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 2G@0,2G@1,2G@2,2G@3,2G@4,2G@5,2G@6,2G@7" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="./dumps/dumpfile_0044.log" diff --git a/test/dump/mck_testcases_ofp/0045_mckernel.txt b/test/dump/mck_testcases_ofp/0045_mckernel.txt new file mode 100644 index 00000000..a8a787b0 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0045_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="./dumps/dumpfile_0045.log" diff --git a/test/dump/mck_testcases_ofp/0046_mckernel.txt b/test/dump/mck_testcases_ofp/0046_mckernel.txt new file mode 100644 index 00000000..05ab8288 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0046_mckernel.txt @@ -0,0 +1,5 @@ +MCRBT_OPT="-m 128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@0,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@1,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@2,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@3,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@4,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@5,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@6,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7,128M@7" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0047_mckernel.txt b/test/dump/mck_testcases_ofp/0047_mckernel.txt new file mode 100644 index 00000000..9ea529dd --- /dev/null +++ b/test/dump/mck_testcases_ofp/0047_mckernel.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m 20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3" +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3" 32M 128`" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 0" +DUMP_FILE="" diff --git a/test/dump/mck_testcases_ofp/0048_mckernel.txt b/test/dump/mck_testcases_ofp/0048_mckernel.txt new file mode 100644 index 00000000..25c14207 --- /dev/null +++ b/test/dump/mck_testcases_ofp/0048_mckernel.txt @@ -0,0 +1,6 @@ +MCRBT_OPT="-m 20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@0,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@1,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@2,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@3,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@4,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@5,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@6,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7,20M@7" +MCRBT_OPT="-m `./utils/gen_mem_chunks.sh "0 1 2 3 4 5 6 7" 32M 64`" +USR_PROC="mcexec_test_proc/test_pt_1gb_10times" +OS_IDX=0 +DUMP_OPT="-d 24" +DUMP_FILE="" diff --git a/test/dump/panic_list.in b/test/dump/panic_list.in new file mode 100644 index 00000000..027ebfd1 --- /dev/null +++ b/test/dump/panic_list.in @@ -0,0 +1,24 @@ +./linux_testcases/panic_0001.txt +./linux_testcases/panic_0002.txt +./linux_testcases/panic_0003.txt +./linux_testcases/panic_0004.txt +./linux_testcases/panic_0005.txt +./linux_testcases/panic_0006.txt +./linux_testcases/panic_0007.txt +./linux_testcases/panic_0008.txt +./linux_testcases/panic_0009.txt +./linux_testcases/panic_0010.txt +./linux_testcases/panic_0011.txt +./linux_testcases/panic_0012.txt +./linux_testcases/panic_0013.txt +./linux_testcases/panic_0014.txt +./linux_testcases/panic_0015.txt +./linux_testcases/panic_0016.txt +./linux_testcases/panic_0017.txt +./linux_testcases/panic_0018.txt +./linux_testcases/panic_0019.txt +./linux_testcases/panic_0020.txt +./linux_testcases/panic_0021.txt +./linux_testcases/panic_0022.txt +./linux_testcases/panic_0023.txt +./linux_testcases/panic_0024.txt diff --git a/test/dump/result/.gitignore b/test/dump/result/.gitignore new file mode 100644 index 00000000..e69de29b diff --git a/test/dump/utils/extract_mckdump.sh b/test/dump/utils/extract_mckdump.sh new file mode 100755 index 00000000..5170833e --- /dev/null +++ b/test/dump/utils/extract_mckdump.sh @@ -0,0 +1,47 @@ +#!/bin/sh +VMLINUX=/usr/lib/debug/lib/modules/3.10.0-693.1.1.el7.x86_64/vmlinux + +if [ $# -lt 1 ]; then + echo "Error: too few arguments" + echo "usage: `basename $0` [outfile]" + exit 1 +fi + +VMCORE=$1 +OUTFILE=$2 + +echo "***** vmcore file info ******************************" +ls -lh ${VMCORE} + +if [ "X${OUTFILE}" = "X" ]; then + ext_opt="" +else + ext_opt="-o ${OUTFILE}" +fi + +if [ ! -f "${VMCORE}" ]; then + echo "Error: vmcore (${VMCORE}) is not found" >&2 + exit 1 +fi + +echo "***** Extract mcdump from vmcore *******************" +/usr/bin/expect -c " +set timeout -1 +spawn /usr/bin/crash $VMLINUX $VMCORE + +expect \"crash>\" +send \"mod -s ihk_smp_x86 $MCMOD_DIR/kmod/ihk-smp-x86.ko\n\" + +expect \"crash>\" +send \"extend $MCMOD_DIR/lib/ldump2mcdump.so\n\" + +expect \"crash>\" +send \"ldump2mcdump 0 $ext_opt\n\" + +expect \"crash>\" +send \"extend -u $MCMOD_DIR/lib/ldump2mcdump.so\n\" + +expect \"crash>\" +send \"quit\n\" +" +echo "" diff --git a/test/dump/utils/gen_mem_chunks.sh b/test/dump/utils/gen_mem_chunks.sh new file mode 100755 index 00000000..ce81c872 --- /dev/null +++ b/test/dump/utils/gen_mem_chunks.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +NUMAS=$1 +MEM_SIZE=$2 +REP=$3 +CHUNKS="" + +for numa in ${NUMAS} +do + for rep in `seq 1 ${REP}` + do + CHUNKS="${CHUNKS}${MEM_SIZE}@${numa}," + done +done + +echo ${CHUNKS%,} diff --git a/test/dump/utils/kill_mcexec.sh b/test/dump/utils/kill_mcexec.sh new file mode 100755 index 00000000..74c4d6d2 --- /dev/null +++ b/test/dump/utils/kill_mcexec.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +count=`pgrep -c -f 'mcexec '` +if [ ${count} -gt 0 ] +then + echo "kill process :" ${count} + pgrep -l -f 'mcexec ' + pgrep -f 'mcexec ' | xargs kill -9 +fi + diff --git a/test/dump/utils/linux_dump_cronjob.sh b/test/dump/utils/linux_dump_cronjob.sh new file mode 100755 index 00000000..31c5d2f8 --- /dev/null +++ b/test/dump/utils/linux_dump_cronjob.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +sleep 3 + +export TERM=xterm-256color + +export DUMP_TEST_HOME=$(cd `dirname $0`/.. && pwd -P) +cd ${DUMP_TEST_HOME} +./go_linux_dump_test.sh diff --git a/test/dump/utils/show_mckdump.sh b/test/dump/utils/show_mckdump.sh new file mode 100755 index 00000000..e85f99a0 --- /dev/null +++ b/test/dump/utils/show_mckdump.sh @@ -0,0 +1,50 @@ +#!/bin/sh +#source ./config +export MCKERNEL=${MCMOD_DIR}/smp-x86/kernel/mckernel.img +export INFILE=$1 + +if [ "X$INFILE" = X -o "X$2" != X ]; then + echo "usage: `basename $0` " >&2 + exit 1 +fi + +if [ ! -f "${INFILE}" ]; then + echo "Error: mckdump is not found" >&2 + exit 1 +fi + +if [ ! -e "${MCKERNEL}" ]; then + echo "Error: mckernel.img is not found" + exit 1 +fi + +echo "***** dump_file info *************************" +ls -lh ${INFILE} + +echo "***** Result of readelf -a ********************" +readelf -a ${INFILE} + +echo "" +echo "***** Result of eclair ************************" +expect -c " +set timeout 20 +spawn ${MCMOD_DIR}/bin/eclair -d $INFILE -k $MCKERNEL -l + +expect \"(eclair)\" +send \"set pagination 0\n\" + +expect \"(eclair)\" +send \"info threads\n\" + +expect \"(eclair)\" +send \"info register\n\" + +expect \"(eclair)\" +send \"bt\n\" + +expect \"(eclair)\" +send \"quit\n\ + +" +echo "**********************************************" +exit 0