2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (c) 1988, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 extern bool decimal, fancy, resolv;
37 #define print_number64(first,i,n,c) do { \
40 if (quad_align && (((ptrdiff_t)((i) - (first))) & 1) == 1) { \
44 if (quad_slots == 2) \
45 __v = (uint64_t)(uint32_t)(i)[0] | \
46 ((uint64_t)(uint32_t)(i)[1]) << 32; \
48 __v = (uint64_t)*(i); \
50 printf("%c%jd", (c), (intmax_t)__v); \
52 printf("%c%#jx", (c), (uintmax_t)__v); \
58 #define print_number(i,n,c) do { \
60 printf("%c%jd", c, (intmax_t)*i); \
62 printf("%c%#jx", c, (uintmax_t)(u_register_t)*i); \
68 void decode_filemode(int value);
69 void print_integer_arg(const char *(*decoder)(int), int value);
70 void print_integer_arg_valid(const char *(*decoder)(int), int value);
71 void print_mask_arg(bool (*decoder)(FILE *, int, int *), int value);
72 void print_mask_arg0(bool (*decoder)(FILE *, int, int *), int value);
73 void print_mask_arg32(bool (*decoder)(FILE *, uint32_t, uint32_t *),
75 void print_mask_argul(bool (*decoder)(FILE *, u_long, u_long *),
77 bool print_mask_arg_part(bool (*decoder)(FILE *, int, int *),
80 #ifdef SYSDECODE_HAVE_LINUX
81 bool ktrstruct_linux(const char *name, const char *data, size_t datalen);
82 void ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip,
83 int *resnarg, char *resc);
85 void ktrsyscall_linux32(struct ktr_syscall *ktr, register_t **resip,
86 int *resnarg, char *resc);
88 #endif /* SYSDECODE_HAVE_LINUX */
90 #endif /* !__KDUMP_H__ */