2008-02-03 11:33:27 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2011-06-17 06:12:28 +00:00
|
|
|
# Copyright (c) 2006 "David Kirchner" <dpk@dpk.net>. All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in the
|
|
|
|
# documentation and/or other materials provided with the distribution.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
# SUCH DAMAGE.
|
|
|
|
#
|
2008-02-03 11:33:27 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
# Generates kdump_subr.c
|
|
|
|
# mkioctls is a special-purpose script, and works fine as it is
|
|
|
|
# now, so it remains independent. The idea behind how it generates
|
|
|
|
# its list was heavily borrowed here.
|
|
|
|
#
|
|
|
|
# Some functions here are automatically generated. This can mean
|
|
|
|
# the user will see unusual kdump output or errors while building
|
|
|
|
# if the underlying .h files are changed significantly.
|
|
|
|
#
|
|
|
|
# Key:
|
|
|
|
# AUTO: Completely auto-generated with either the "or" or the "switch"
|
|
|
|
# method.
|
|
|
|
# AUTO - Special: Generated automatically, but with some extra commands
|
|
|
|
# that the auto_*_type() functions are inappropriate for.
|
|
|
|
# MANUAL: Manually entered and must therefore be manually updated.
|
|
|
|
|
2008-02-03 11:33:27 +00:00
|
|
|
set -e
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
|
|
|
|
LC_ALL=C; export LC_ALL
|
|
|
|
|
|
|
|
if [ -z "$1" ]
|
|
|
|
then
|
|
|
|
echo "usage: sh $0 include-dir"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
include_dir=$1
|
|
|
|
|
|
|
|
#
|
|
|
|
# Automatically generates a C function that will print out the
|
|
|
|
# numeric input as a pipe-delimited string of the appropriate
|
|
|
|
# #define keys. ex:
|
|
|
|
# S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
|
|
|
|
# The XOR is necessary to prevent including the "0"-value in every
|
|
|
|
# line.
|
|
|
|
#
|
|
|
|
auto_or_type () {
|
|
|
|
local name grep file
|
|
|
|
name=$1
|
|
|
|
grep=$2
|
|
|
|
file=$3
|
|
|
|
|
|
|
|
cat <<_EOF_
|
|
|
|
/* AUTO */
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
$name(intmax_t arg)
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
{
|
2011-10-08 09:57:29 +00:00
|
|
|
int or = 0;
|
|
|
|
printf("%#jx<", (uintmax_t)arg);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
_EOF_
|
|
|
|
egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
|
|
|
|
$include_dir/$file | \
|
|
|
|
awk '{ for (i = 1; i <= NF; i++) \
|
|
|
|
if ($i ~ /define/) \
|
|
|
|
break; \
|
|
|
|
++i; \
|
2011-10-08 09:57:29 +00:00
|
|
|
printf "\tif (!((arg > 0) ^ ((%s) > 0)))\n\t\tif_print_or(arg, %s, or);\n", $i, $i }'
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
cat <<_EOF_
|
2010-09-16 11:40:41 +00:00
|
|
|
printf(">");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
if (or == 0)
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid>%jd", arg);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_EOF_
|
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Automatically generates a C function used when the argument
|
|
|
|
# maps to a single, specific #definition
|
|
|
|
#
|
|
|
|
auto_switch_type () {
|
|
|
|
local name grep file
|
|
|
|
name=$1
|
|
|
|
grep=$2
|
|
|
|
file=$3
|
|
|
|
|
|
|
|
cat <<_EOF_
|
|
|
|
/* AUTO */
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
$name(intmax_t arg)
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
{
|
|
|
|
switch (arg) {
|
|
|
|
_EOF_
|
|
|
|
egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
|
|
|
|
$include_dir/$file | \
|
|
|
|
awk '{ for (i = 1; i <= NF; i++) \
|
|
|
|
if ($i ~ /define/) \
|
|
|
|
break; \
|
|
|
|
++i; \
|
2011-10-08 12:28:06 +00:00
|
|
|
printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i }'
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
cat <<_EOF_
|
|
|
|
default: /* Should not reach */
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid=%jd>", arg);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_EOF_
|
|
|
|
}
|
|
|
|
|
2007-01-04 04:18:03 +00:00
|
|
|
#
|
|
|
|
# Automatically generates a C function used when the argument
|
|
|
|
# maps to a #definition
|
|
|
|
#
|
|
|
|
auto_if_type () {
|
|
|
|
local name grep file
|
|
|
|
name=$1
|
|
|
|
grep=$2
|
|
|
|
file=$3
|
|
|
|
|
|
|
|
cat <<_EOF_
|
|
|
|
/* AUTO */
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
$name(intmax_t arg)
|
2007-01-04 04:18:03 +00:00
|
|
|
{
|
|
|
|
_EOF_
|
|
|
|
egrep "^#[[:space:]]*define[[:space:]]+"${grep}"[[:space:]]*" \
|
|
|
|
$include_dir/$file | \
|
|
|
|
awk '{ printf "\t"; \
|
|
|
|
if (NR > 1) \
|
|
|
|
printf "else " ; \
|
|
|
|
printf "if (arg == %s) \n\t\tprintf(\"%s\");\n", $2, $2 }'
|
|
|
|
cat <<_EOF_
|
|
|
|
else /* Should not reach */
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid=%jd>", arg);
|
2007-01-04 04:18:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
_EOF_
|
|
|
|
}
|
|
|
|
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
# C start
|
|
|
|
|
|
|
|
cat <<_EOF_
|
2011-10-08 09:57:29 +00:00
|
|
|
#include <stdint.h>
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/fcntl.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/unistd.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <sys/wait.h>
|
|
|
|
#define _KERNEL
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#undef _KERNEL
|
2007-01-04 04:46:59 +00:00
|
|
|
#include <netinet/in.h>
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/mount.h>
|
2013-09-19 18:53:42 +00:00
|
|
|
#include <sys/procctl.h>
|
2007-04-09 19:16:24 +00:00
|
|
|
#include <sys/ptrace.h>
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
#include <sys/resource.h>
|
|
|
|
#include <sys/reboot.h>
|
|
|
|
#include <sched.h>
|
|
|
|
#include <sys/linker.h>
|
|
|
|
#define _KERNEL
|
|
|
|
#include <sys/thr.h>
|
|
|
|
#undef _KERNEL
|
|
|
|
#include <sys/extattr.h>
|
|
|
|
#include <sys/acl.h>
|
|
|
|
#include <aio.h>
|
|
|
|
#include <sys/sem.h>
|
|
|
|
#include <sys/ipc.h>
|
|
|
|
#include <sys/rtprio.h>
|
|
|
|
#include <sys/shm.h>
|
|
|
|
#include <nfsserver/nfs.h>
|
|
|
|
#include <ufs/ufs/quota.h>
|
2014-03-16 11:04:44 +00:00
|
|
|
#include <sys/capsicum.h>
|
2012-04-05 17:13:14 +00:00
|
|
|
#include <vm/vm.h>
|
|
|
|
#include <vm/vm_param.h>
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
|
|
|
|
#include "kdump_subr.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These are simple support macros. print_or utilizes a variable
|
|
|
|
* defined in the calling function to track whether or not it should
|
|
|
|
* print a logical-OR character ('|') before a string. if_print_or
|
|
|
|
* simply handles the necessary "if" statement used in many lines
|
|
|
|
* of this file.
|
|
|
|
*/
|
|
|
|
#define print_or(str,orflag) do { \\
|
|
|
|
if (orflag) putchar('|'); else orflag = 1; \\
|
|
|
|
printf (str); } \\
|
|
|
|
while (0)
|
|
|
|
#define if_print_or(i,flag,orflag) do { \\
|
|
|
|
if ((i & flag) == flag) \\
|
|
|
|
print_or(#flag,orflag); } \\
|
|
|
|
while (0)
|
|
|
|
|
2013-08-13 19:57:35 +00:00
|
|
|
/* MANUAL */
|
|
|
|
void
|
|
|
|
atfdname(int fd, int decimal)
|
|
|
|
{
|
|
|
|
if (fd == AT_FDCWD)
|
|
|
|
printf("AT_FDCWD");
|
|
|
|
else if (decimal)
|
|
|
|
printf("%d", fd);
|
|
|
|
else
|
|
|
|
printf("%#x", fd);
|
|
|
|
}
|
|
|
|
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
/* MANUAL */
|
|
|
|
extern char *signames[]; /* from kdump.c */
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
signame(int sig)
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
{
|
2006-07-12 12:42:47 +00:00
|
|
|
if (sig > 0 && sig < NSIG)
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("SIG%s",signames[sig]);
|
2006-07-12 12:42:47 +00:00
|
|
|
else
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("SIG %d", sig);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* MANUAL */
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
semctlname(int cmd)
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
{
|
|
|
|
switch (cmd) {
|
|
|
|
case GETNCNT:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("GETNCNT");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case GETPID:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("GETPID");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case GETVAL:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("GETVAL");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case GETALL:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("GETALL");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case GETZCNT:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("GETZCNT");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case SETVAL:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("SETVAL");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case SETALL:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("SETALL");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case IPC_RMID:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("IPC_RMID");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case IPC_SET:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("IPC_SET");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case IPC_STAT:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("IPC_STAT");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
default: /* Should not reach */
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid=%d>", cmd);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* MANUAL */
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
shmctlname(int cmd)
|
|
|
|
{
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
switch (cmd) {
|
|
|
|
case IPC_RMID:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("IPC_RMID");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case IPC_SET:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("IPC_SET");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
case IPC_STAT:
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("IPC_STAT");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
break;
|
|
|
|
default: /* Should not reach */
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid=%d>", cmd);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* MANUAL */
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
semgetname(int flag)
|
|
|
|
{
|
|
|
|
int or = 0;
|
2010-12-02 18:24:22 +00:00
|
|
|
if_print_or(flag, IPC_CREAT, or);
|
|
|
|
if_print_or(flag, IPC_EXCL, or);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
if_print_or(flag, SEM_R, or);
|
|
|
|
if_print_or(flag, SEM_A, or);
|
|
|
|
if_print_or(flag, (SEM_R>>3), or);
|
|
|
|
if_print_or(flag, (SEM_A>>3), or);
|
|
|
|
if_print_or(flag, (SEM_R>>6), or);
|
|
|
|
if_print_or(flag, (SEM_A>>6), or);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* MANUAL
|
|
|
|
*
|
|
|
|
* Only used by SYS_open. Unless O_CREAT is set in flags, the
|
|
|
|
* mode argument is unused (and often bogus and misleading).
|
|
|
|
*/
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
flagsandmodename(int flags, int mode, int decimal)
|
|
|
|
{
|
|
|
|
flagsname(flags);
|
2011-10-08 12:28:06 +00:00
|
|
|
putchar(',');
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
if ((flags & O_CREAT) == O_CREAT) {
|
|
|
|
modename (mode);
|
|
|
|
} else {
|
|
|
|
if (decimal) {
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<unused>%d", mode);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
} else {
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<unused>%#x", (unsigned int)mode);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-12 18:08:25 +00:00
|
|
|
/* MANUAL */
|
|
|
|
void
|
|
|
|
idtypename(idtype_t idtype, int decimal)
|
|
|
|
{
|
|
|
|
switch(idtype) {
|
|
|
|
case P_PID:
|
|
|
|
printf("P_PID");
|
|
|
|
break;
|
|
|
|
case P_PPID:
|
|
|
|
printf("P_PPID");
|
|
|
|
break;
|
|
|
|
case P_PGID:
|
|
|
|
printf("P_PGID");
|
|
|
|
break;
|
|
|
|
case P_SID:
|
|
|
|
printf("P_SID");
|
|
|
|
break;
|
|
|
|
case P_CID:
|
|
|
|
printf("P_CID");
|
|
|
|
break;
|
|
|
|
case P_UID:
|
|
|
|
printf("P_UID");
|
|
|
|
break;
|
|
|
|
case P_GID:
|
|
|
|
printf("P_GID");
|
|
|
|
break;
|
|
|
|
case P_ALL:
|
|
|
|
printf("P_ALL");
|
|
|
|
break;
|
|
|
|
case P_LWPID:
|
|
|
|
printf("P_LWPID");
|
|
|
|
break;
|
|
|
|
case P_TASKID:
|
|
|
|
printf("P_TASKID");
|
|
|
|
break;
|
|
|
|
case P_PROJID:
|
|
|
|
printf("P_PROJID");
|
|
|
|
break;
|
|
|
|
case P_POOLID:
|
|
|
|
printf("P_POOLID");
|
|
|
|
break;
|
|
|
|
case P_JAILID:
|
|
|
|
printf("P_JAILID");
|
|
|
|
break;
|
|
|
|
case P_CTID:
|
|
|
|
printf("P_CTID");
|
|
|
|
break;
|
|
|
|
case P_CPUID:
|
|
|
|
printf("P_CPUID");
|
|
|
|
break;
|
|
|
|
case P_PSETID:
|
|
|
|
printf("P_PSETID");
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (decimal) {
|
|
|
|
printf("%d", idtype);
|
|
|
|
} else {
|
|
|
|
printf("%#x", idtype);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
/*
|
|
|
|
* MANUAL
|
|
|
|
*
|
|
|
|
* [g|s]etsockopt's level argument can either be SOL_SOCKET or a value
|
|
|
|
* referring to a line in /etc/protocols . It might be appropriate
|
|
|
|
* to use getprotoent(3) here.
|
|
|
|
*/
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
sockoptlevelname(int level, int decimal)
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
{
|
|
|
|
if (level == SOL_SOCKET) {
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("SOL_SOCKET");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
} else {
|
|
|
|
if (decimal) {
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("%d", level);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
} else {
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("%#x", (unsigned int)level);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-04-05 17:13:14 +00:00
|
|
|
/*
|
|
|
|
* MANUAL
|
|
|
|
*
|
|
|
|
* Used for page fault type. Cannot use auto_or_type since the macro
|
|
|
|
* values contain a cast. Also, VM_PROT_NONE has to be handled specially.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
vmprotname (int type)
|
|
|
|
{
|
|
|
|
int or = 0;
|
|
|
|
|
|
|
|
if (type == VM_PROT_NONE) {
|
|
|
|
(void)printf("VM_PROT_NONE");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if_print_or(type, VM_PROT_READ, or);
|
|
|
|
if_print_or(type, VM_PROT_WRITE, or);
|
|
|
|
if_print_or(type, VM_PROT_EXECUTE, or);
|
|
|
|
if_print_or(type, VM_PROT_COPY, or);
|
|
|
|
}
|
2013-08-26 17:22:51 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* MANUAL
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
socktypenamewithflags(int type)
|
|
|
|
{
|
|
|
|
if (type & SOCK_CLOEXEC)
|
|
|
|
printf("SOCK_CLOEXEC|"), type &= ~SOCK_CLOEXEC;
|
|
|
|
if (type & SOCK_NONBLOCK)
|
|
|
|
printf("SOCK_NONBLOCK|"), type &= ~SOCK_NONBLOCK;
|
|
|
|
socktypename(type);
|
|
|
|
}
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
_EOF_
|
|
|
|
|
2011-10-08 11:39:00 +00:00
|
|
|
auto_or_type "accessmodename" "[A-Z]_OK[[:space:]]+0?x?[0-9A-Fa-f]+" "sys/unistd.h"
|
|
|
|
auto_switch_type "acltypename" "ACL_TYPE_[A-Z4_]+[[:space:]]+0x[0-9]+" "sys/acl.h"
|
2014-03-16 11:04:44 +00:00
|
|
|
auto_or_type "capfcntlname" "CAP_FCNTL_[A-Z]+[[:space:]]+\(1" "sys/capsicum.h"
|
2011-10-08 11:39:00 +00:00
|
|
|
auto_switch_type "extattrctlname" "EXTATTR_NAMESPACE_[A-Z]+[[:space:]]+0x[0-9]+" "sys/extattr.h"
|
2012-02-23 21:08:21 +00:00
|
|
|
auto_switch_type "fadvisebehavname" "POSIX_FADV_[A-Z]+[[:space:]]+[0-9]+" "sys/fcntl.h"
|
2011-10-08 11:39:00 +00:00
|
|
|
auto_or_type "flagsname" "O_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/fcntl.h"
|
|
|
|
auto_or_type "flockname" "LOCK_[A-Z]+[[:space:]]+0x[0-9]+" "sys/fcntl.h"
|
|
|
|
auto_or_type "getfsstatflagsname" "MNT_[A-Z]+[[:space:]]+[1-9][0-9]*" "sys/mount.h"
|
|
|
|
auto_switch_type "kldsymcmdname" "KLDSYM_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
|
|
|
|
auto_switch_type "kldunloadfflagsname" "LINKER_UNLOAD_[A-Z]+[[:space:]]+[0-9]+" "sys/linker.h"
|
|
|
|
auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h"
|
|
|
|
auto_switch_type "madvisebehavname" "_?MADV_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
|
|
|
|
auto_switch_type "minheritname" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
|
|
|
|
auto_or_type "mlockallname" "MCL_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
|
|
|
|
auto_or_type "mmapprotname" "PROT_[A-Z]+[[:space:]]+0x[0-9A-Fa-f]+" "sys/mman.h"
|
|
|
|
auto_or_type "modename" "S_[A-Z]+[[:space:]]+[0-6]{7}" "sys/stat.h"
|
|
|
|
auto_or_type "mountflagsname" "MNT_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mount.h"
|
|
|
|
auto_switch_type "msyncflagsname" "MS_[A-Z]+[[:space:]]+0x[0-9]+" "sys/mman.h"
|
2013-02-12 13:01:34 +00:00
|
|
|
auto_or_type "nfssvcname" "NFSSVC_[A-Z0-9]+[[:space:]]+0x[0-9]+" "nfs/nfssvc.h"
|
2011-10-08 11:39:00 +00:00
|
|
|
auto_switch_type "prioname" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h"
|
2013-09-19 18:53:42 +00:00
|
|
|
auto_switch_type "procctlcmdname" "PROC_[A-Z]+[[:space:]]+[0-9]" "sys/procctl.h"
|
2011-10-08 11:39:00 +00:00
|
|
|
auto_switch_type "ptraceopname" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h"
|
|
|
|
auto_switch_type "quotactlname" "Q_[A-Z]+[[:space:]]+0x[0-9]+" "ufs/ufs/quota.h"
|
|
|
|
auto_or_type "rebootoptname" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h"
|
|
|
|
auto_or_type "rforkname" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h"
|
|
|
|
auto_switch_type "rlimitname" "RLIMIT_[A-Z]+[[:space:]]+[0-9]+" "sys/resource.h"
|
|
|
|
auto_switch_type "schedpolicyname" "SCHED_[A-Z]+[[:space:]]+[0-9]+" "sched.h"
|
|
|
|
auto_switch_type "sendfileflagsname" "SF_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
|
|
|
|
auto_or_type "shmatname" "SHM_[A-Z]+[[:space:]]+[0-9]{6}+" "sys/shm.h"
|
|
|
|
auto_switch_type "shutdownhowname" "SHUT_[A-Z]+[[:space:]]+[0-9]+" "sys/socket.h"
|
2012-09-22 12:40:00 +00:00
|
|
|
auto_switch_type "sigbuscodename" "BUS_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
|
|
|
|
auto_switch_type "sigchldcodename" "CLD_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
|
|
|
|
auto_switch_type "sigfpecodename" "FPE_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
|
2011-10-08 11:39:00 +00:00
|
|
|
auto_switch_type "sigprocmaskhowname" "SIG_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
|
2012-09-22 12:40:00 +00:00
|
|
|
auto_switch_type "sigillcodename" "ILL_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
|
|
|
|
auto_switch_type "sigsegvcodename" "SEGV_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
|
|
|
|
auto_switch_type "sigtrapcodename" "TRAP_[A-Z]+[[:space:]]+[0-9]+" "sys/signal.h"
|
2011-10-08 11:39:00 +00:00
|
|
|
auto_if_type "sockdomainname" "PF_[[:alnum:]]+[[:space:]]+" "sys/socket.h"
|
|
|
|
auto_if_type "sockfamilyname" "AF_[[:alnum:]]+[[:space:]]+" "sys/socket.h"
|
|
|
|
auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h"
|
|
|
|
auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h"
|
|
|
|
auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h"
|
|
|
|
auto_or_type "thrcreateflagsname" "THR_[A-Z]+[[:space:]]+0x[0-9]+" "sys/thr.h"
|
2012-04-05 17:13:14 +00:00
|
|
|
auto_switch_type "vmresultname" "KERN_[A-Z]+[[:space:]]+[0-9]+" "vm/vm_param.h"
|
2013-09-12 18:08:25 +00:00
|
|
|
auto_or_type "wait6optname" "W[A-Z]+[[:space:]]+[0-9]+" "sys/wait.h"
|
2011-10-08 11:39:00 +00:00
|
|
|
auto_switch_type "whencename" "SEEK_[A-Z]+[[:space:]]+[0-9]+" "sys/unistd.h"
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
|
|
|
|
cat <<_EOF_
|
|
|
|
/*
|
|
|
|
* AUTO - Special
|
|
|
|
* F_ is used to specify fcntl commands as well as arguments. Both sets are
|
|
|
|
* grouped in fcntl.h, and this awk script grabs the first group.
|
|
|
|
*/
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
fcntlcmdname(int cmd, int arg, int decimal)
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
{
|
|
|
|
switch (cmd) {
|
|
|
|
_EOF_
|
2012-11-02 16:07:21 +00:00
|
|
|
egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z0-9_]+[[:space:]]+[0-9]+[[:space:]]*" \
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
$include_dir/sys/fcntl.h | \
|
|
|
|
awk 'BEGIN { o=0 } { for (i = 1; i <= NF; i++) \
|
|
|
|
if ($i ~ /define/) \
|
|
|
|
break; \
|
|
|
|
++i; \
|
|
|
|
if (o <= $(i+1)) \
|
2011-10-08 12:28:06 +00:00
|
|
|
printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i; \
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
else \
|
|
|
|
exit; \
|
|
|
|
o = $(i+1) }'
|
|
|
|
cat <<_EOF_
|
|
|
|
default: /* Should not reach */
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid=%d>", cmd);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
2011-10-08 12:28:06 +00:00
|
|
|
putchar(',');
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
if (cmd == F_GETFD || cmd == F_SETFD) {
|
|
|
|
if (arg == FD_CLOEXEC)
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("FD_CLOEXEC");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
else if (arg == 0)
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("0");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
else {
|
|
|
|
if (decimal)
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid>%d", arg);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
else
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid>%#x", (unsigned int)arg);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
} else if (cmd == F_SETFL) {
|
|
|
|
flagsname(arg);
|
|
|
|
} else {
|
|
|
|
if (decimal)
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("%d", arg);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
else
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("%#x", (unsigned int)arg);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-16 21:13:55 +00:00
|
|
|
/*
|
|
|
|
* AUTO - Special
|
|
|
|
*
|
|
|
|
* The MAP_ALIGNED flag requires special handling.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
mmapflagsname(int flags)
|
|
|
|
{
|
|
|
|
int align;
|
|
|
|
int or = 0;
|
|
|
|
printf("%#x<", flags);
|
|
|
|
_EOF_
|
|
|
|
egrep "^#[[:space:]]*define[[:space:]]+MAP_[A-Z_]+[[:space:]]+0x[0-9A-Fa-f]+[[:space:]]*" \
|
|
|
|
$include_dir/sys/mman.h | grep -v MAP_ALIGNED | \
|
|
|
|
awk '{ for (i = 1; i <= NF; i++) \
|
|
|
|
if ($i ~ /define/) \
|
|
|
|
break; \
|
|
|
|
++i; \
|
|
|
|
printf "\tif (!((flags > 0) ^ ((%s) > 0)))\n\t\tif_print_or(flags, %s, or);\n", $i, $i }'
|
|
|
|
cat <<_EOF_
|
2013-09-09 18:11:59 +00:00
|
|
|
#ifdef MAP_32BIT
|
|
|
|
if (!((flags > 0) ^ ((MAP_32BIT) > 0)))
|
|
|
|
if_print_or(flags, MAP_32BIT, or);
|
|
|
|
#endif
|
2013-08-16 21:13:55 +00:00
|
|
|
align = flags & MAP_ALIGNMENT_MASK;
|
|
|
|
if (align != 0) {
|
|
|
|
if (align == MAP_ALIGNED_SUPER)
|
|
|
|
print_or("MAP_ALIGNED_SUPER", or);
|
|
|
|
else {
|
|
|
|
print_or("MAP_ALIGNED", or);
|
|
|
|
printf("(%d)", align >> MAP_ALIGNMENT_SHIFT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
printf(">");
|
|
|
|
if (or == 0)
|
|
|
|
printf("<invalid>%d", flags);
|
|
|
|
}
|
|
|
|
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
/*
|
|
|
|
* AUTO - Special
|
|
|
|
*
|
|
|
|
* The only reason this is not fully automated is due to the
|
|
|
|
* grep -v RTP_PRIO statement. A better egrep line should
|
|
|
|
* make this capable of being a auto_switch_type() function.
|
|
|
|
*/
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
rtprioname(int func)
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
{
|
|
|
|
switch (func) {
|
|
|
|
_EOF_
|
|
|
|
egrep "^#[[:space:]]*define[[:space:]]+RTP_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" \
|
|
|
|
$include_dir/sys/rtprio.h | grep -v RTP_PRIO | \
|
|
|
|
awk '{ for (i = 1; i <= NF; i++) \
|
|
|
|
if ($i ~ /define/) \
|
|
|
|
break; \
|
|
|
|
++i; \
|
2011-10-08 12:28:06 +00:00
|
|
|
printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i }'
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
cat <<_EOF_
|
|
|
|
default: /* Should not reach */
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("<invalid=%d>", func);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* AUTO - Special
|
|
|
|
*
|
|
|
|
* The send and recv functions have a flags argument which can be
|
|
|
|
* set to 0. There is no corresponding #define. The auto_ functions
|
|
|
|
* detect this as "invalid", which is incorrect here.
|
|
|
|
*/
|
|
|
|
void
|
2011-10-08 09:57:29 +00:00
|
|
|
sendrecvflagsname(int flags)
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
{
|
2011-10-08 09:57:29 +00:00
|
|
|
int or = 0;
|
2008-02-03 11:33:27 +00:00
|
|
|
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
if (flags == 0) {
|
2011-10-08 12:28:06 +00:00
|
|
|
printf("0");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
return;
|
|
|
|
}
|
2010-09-16 11:33:31 +00:00
|
|
|
|
2010-09-16 11:40:41 +00:00
|
|
|
printf("%#x<", flags);
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
_EOF_
|
|
|
|
egrep "^#[[:space:]]*define[[:space:]]+MSG_[A-Z]+[[:space:]]+0x[0-9]+[[:space:]]*" $include_dir/sys/socket.h | \
|
|
|
|
awk '{ for (i = 1; i <= NF; i++) \
|
|
|
|
if ($i ~ /define/) \
|
|
|
|
break; \
|
|
|
|
++i; \
|
|
|
|
printf "\tif(!((flags>0)^((%s)>0)))\n\t\tif_print_or(flags, %s, or);\n", $i, $i }'
|
|
|
|
cat <<_EOF_
|
2010-09-16 11:40:41 +00:00
|
|
|
printf(">");
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
}
|
|
|
|
|
2012-09-22 12:40:00 +00:00
|
|
|
/*
|
|
|
|
* AUTO - Special
|
|
|
|
*
|
|
|
|
* Check general codes first, then defer to signal-specific codes.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
sigcodename(int sig, int code)
|
|
|
|
{
|
|
|
|
switch (code) {
|
Change kdump to print more useful information, i.e. it changes from
32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,0,0x1b6)
32229 telnet CALL socket(0x2,0x2,0)
to
32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6)
32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0)
David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.
Submitted by: "David Kirchner" <dpk@dpk.net>
Suggested by: FreeBSD ideas list page
Reviewed by: arch
2006-05-20 14:27:22 +00:00
|
|
|
_EOF_
|
2012-09-22 12:40:00 +00:00
|
|
|
egrep "^#[[:space:]]*define[[:space:]]+SI_[A-Z]+[[:space:]]+0(x[0-9abcdef]+)?[[:space:]]*" \
|
|
|
|
$include_dir/sys/signal.h | grep -v SI_UNDEFINED | \
|
|
|
|
awk '{ for (i = 1; i <= NF; i++) \
|
|
|
|
if ($i ~ /define/) \
|
|
|
|
break; \
|
|
|
|
++i; \
|
|
|
|
printf "\tcase %s:\n\t\tprintf(\"%s\");\n\t\tbreak;\n", $i, $i }'
|
|
|
|
cat <<_EOF_
|
|
|
|
default:
|
|
|
|
switch (sig) {
|
|
|
|
case SIGILL:
|
|
|
|
sigillcodename(code);
|
|
|
|
break;
|
|
|
|
case SIGBUS:
|
|
|
|
sigbuscodename(code);
|
|
|
|
break;
|
|
|
|
case SIGSEGV:
|
|
|
|
sigsegvcodename(code);
|
|
|
|
break;
|
|
|
|
case SIGFPE:
|
|
|
|
sigfpecodename(code);
|
|
|
|
break;
|
|
|
|
case SIGTRAP:
|
|
|
|
sigtrapcodename(code);
|
|
|
|
break;
|
|
|
|
case SIGCHLD:
|
|
|
|
sigchldcodename(code);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf("<invalid=%#x>", code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
Change the cap_rights_t type from uint64_t to a structure that we can extend
in the future in a backward compatible (API and ABI) way.
The cap_rights_t represents capability rights. We used to use one bit to
represent one right, but we are running out of spare bits. Currently the new
structure provides place for 114 rights (so 50 more than the previous
cap_rights_t), but it is possible to grow the structure to hold at least 285
rights, although we can make it even larger if 285 rights won't be enough.
The structure definition looks like this:
struct cap_rights {
uint64_t cr_rights[CAP_RIGHTS_VERSION + 2];
};
The initial CAP_RIGHTS_VERSION is 0.
The top two bits in the first element of the cr_rights[] array contain total
number of elements in the array - 2. This means if those two bits are equal to
0, we have 2 array elements.
The top two bits in all remaining array elements should be 0.
The next five bits in all array elements contain array index. Only one bit is
used and bit position in this five-bits range defines array index. This means
there can be at most five array elements in the future.
To define new right the CAPRIGHT() macro must be used. The macro takes two
arguments - an array index and a bit to set, eg.
#define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL)
We still support aliases that combine few rights, but the rights have to belong
to the same array element, eg:
#define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL)
#define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL)
#define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP)
There is new API to manage the new cap_rights_t structure:
cap_rights_t *cap_rights_init(cap_rights_t *rights, ...);
void cap_rights_set(cap_rights_t *rights, ...);
void cap_rights_clear(cap_rights_t *rights, ...);
bool cap_rights_is_set(const cap_rights_t *rights, ...);
bool cap_rights_is_valid(const cap_rights_t *rights);
void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);
Capability rights to the cap_rights_init(), cap_rights_set(),
cap_rights_clear() and cap_rights_is_set() functions are provided by
separating them with commas, eg:
cap_rights_t rights;
cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT);
There is no need to terminate the list of rights, as those functions are
actually macros that take care of the termination, eg:
#define cap_rights_set(rights, ...) \
__cap_rights_set((rights), __VA_ARGS__, 0ULL)
void __cap_rights_set(cap_rights_t *rights, ...);
Thanks to using one bit as an array index we can assert in those functions that
there are no two rights belonging to different array elements provided
together. For example this is illegal and will be detected, because CAP_LOOKUP
belongs to element 0 and CAP_PDKILL to element 1:
cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL);
Providing several rights that belongs to the same array's element this way is
correct, but is not advised. It should only be used for aliases definition.
This commit also breaks compatibility with some existing Capsicum system calls,
but I see no other way to do that. This should be fine as Capsicum is still
experimental and this change is not going to 9.x.
Sponsored by: The FreeBSD Foundation
2013-09-05 00:09:56 +00:00
|
|
|
|
|
|
|
_EOF_
|
|
|
|
egrep '#define[[:space:]]+CAP_[A-Z_]+[[:space:]]+CAPRIGHT\([0-9],[[:space:]]+0x[0-9]{16}ULL\)' \
|
2014-03-16 11:04:44 +00:00
|
|
|
$include_dir/sys/capsicum.h | \
|
Change the cap_rights_t type from uint64_t to a structure that we can extend
in the future in a backward compatible (API and ABI) way.
The cap_rights_t represents capability rights. We used to use one bit to
represent one right, but we are running out of spare bits. Currently the new
structure provides place for 114 rights (so 50 more than the previous
cap_rights_t), but it is possible to grow the structure to hold at least 285
rights, although we can make it even larger if 285 rights won't be enough.
The structure definition looks like this:
struct cap_rights {
uint64_t cr_rights[CAP_RIGHTS_VERSION + 2];
};
The initial CAP_RIGHTS_VERSION is 0.
The top two bits in the first element of the cr_rights[] array contain total
number of elements in the array - 2. This means if those two bits are equal to
0, we have 2 array elements.
The top two bits in all remaining array elements should be 0.
The next five bits in all array elements contain array index. Only one bit is
used and bit position in this five-bits range defines array index. This means
there can be at most five array elements in the future.
To define new right the CAPRIGHT() macro must be used. The macro takes two
arguments - an array index and a bit to set, eg.
#define CAP_PDKILL CAPRIGHT(1, 0x0000000000000800ULL)
We still support aliases that combine few rights, but the rights have to belong
to the same array element, eg:
#define CAP_LOOKUP CAPRIGHT(0, 0x0000000000000400ULL)
#define CAP_FCHMOD CAPRIGHT(0, 0x0000000000002000ULL)
#define CAP_FCHMODAT (CAP_FCHMOD | CAP_LOOKUP)
There is new API to manage the new cap_rights_t structure:
cap_rights_t *cap_rights_init(cap_rights_t *rights, ...);
void cap_rights_set(cap_rights_t *rights, ...);
void cap_rights_clear(cap_rights_t *rights, ...);
bool cap_rights_is_set(const cap_rights_t *rights, ...);
bool cap_rights_is_valid(const cap_rights_t *rights);
void cap_rights_merge(cap_rights_t *dst, const cap_rights_t *src);
void cap_rights_remove(cap_rights_t *dst, const cap_rights_t *src);
bool cap_rights_contains(const cap_rights_t *big, const cap_rights_t *little);
Capability rights to the cap_rights_init(), cap_rights_set(),
cap_rights_clear() and cap_rights_is_set() functions are provided by
separating them with commas, eg:
cap_rights_t rights;
cap_rights_init(&rights, CAP_READ, CAP_WRITE, CAP_FSTAT);
There is no need to terminate the list of rights, as those functions are
actually macros that take care of the termination, eg:
#define cap_rights_set(rights, ...) \
__cap_rights_set((rights), __VA_ARGS__, 0ULL)
void __cap_rights_set(cap_rights_t *rights, ...);
Thanks to using one bit as an array index we can assert in those functions that
there are no two rights belonging to different array elements provided
together. For example this is illegal and will be detected, because CAP_LOOKUP
belongs to element 0 and CAP_PDKILL to element 1:
cap_rights_init(&rights, CAP_LOOKUP | CAP_PDKILL);
Providing several rights that belongs to the same array's element this way is
correct, but is not advised. It should only be used for aliases definition.
This commit also breaks compatibility with some existing Capsicum system calls,
but I see no other way to do that. This should be fine as Capsicum is still
experimental and this change is not going to 9.x.
Sponsored by: The FreeBSD Foundation
2013-09-05 00:09:56 +00:00
|
|
|
sed -E 's/[ ]+/ /g' | \
|
|
|
|
awk -F '[ \(,\)]' '
|
|
|
|
BEGIN {
|
|
|
|
printf "void\n"
|
|
|
|
printf "capname(const cap_rights_t *rightsp)\n"
|
|
|
|
printf "{\n"
|
|
|
|
printf "\tint comma = 0;\n\n"
|
|
|
|
printf "\tprintf(\"<\");\n"
|
|
|
|
}
|
|
|
|
{
|
|
|
|
printf "\tif ((rightsp->cr_rights[%s] & %s) == %s) {\n", $4, $2, $2
|
|
|
|
printf "\t\tif (comma) printf(\",\"); else comma = 1;\n"
|
|
|
|
printf "\t\tprintf(\"%s\");\n", $2
|
|
|
|
printf "\t}\n"
|
|
|
|
}
|
|
|
|
END {
|
|
|
|
printf "\tprintf(\">\");\n"
|
|
|
|
printf "}\n"
|
|
|
|
}'
|