diff options
| author | christos <christos@NetBSD.org> | 2002-03-22 17:14:18 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2002-03-22 17:14:18 +0000 |
| commit | 65fc8539e47a03779ed0bc3c9b2f5b95dce587b9 (patch) | |
| tree | b41c9c26e2a85ceda2f9cbbf1643550429dba8e9 /sys/compat/linux | |
| parent | c8f14c1d4450a7e16983c13af7e47fe059cb7c05 (diff) | |
gc debugging printfs.
Diffstat (limited to 'sys/compat/linux')
| -rw-r--r-- | sys/compat/linux/common/linux_cdrom.c | 8 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_exec_elf32.c | 24 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_file64.c | 6 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_misc.c | 16 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_oldmmap.c | 18 | ||||
| -rw-r--r-- | sys/compat/linux/common/linux_signal.c | 26 |
6 files changed, 52 insertions, 46 deletions
diff --git a/sys/compat/linux/common/linux_cdrom.c b/sys/compat/linux/common/linux_cdrom.c index d63a5b8e6d4..6e946979317 100644 --- a/sys/compat/linux/common/linux_cdrom.c +++ b/sys/compat/linux/common/linux_cdrom.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_cdrom.c,v 1.12 2002/03/16 20:43:53 christos Exp $ */ +/* $NetBSD: linux_cdrom.c,v 1.13 2002/03/22 17:14:18 christos Exp $ */ /* * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.12 2002/03/16 20:43:53 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.13 2002/03/22 17:14:18 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -59,7 +59,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_cdrom.c,v 1.12 2002/03/16 20:43:53 christos Ex static int bsd_to_linux_msf_lba(unsigned address_format, union msf_lba *bml, union linux_cdrom_addr *llml); -#if 0 +#if DEBUG_LINUX #define DPRINTF(x) uprintf x #else #define DPRINTF(x) @@ -204,7 +204,7 @@ linux_ioctl_cdrom(p, uap, retval) l_tocentry.cdte_ctrl = t_entry.control; if (bsd_to_linux_msf_lba(t_entry.addr_type, &t_entry.addr, &l_tocentry.cdte_addr) < 0) { - uprintf("linux_ioctl: unknown format msf/lba\n"); + DPRINTF(("linux_ioctl: unknown format msf/lba\n")); error = EINVAL; break; } diff --git a/sys/compat/linux/common/linux_exec_elf32.c b/sys/compat/linux/common/linux_exec_elf32.c index 75cb74ba826..cc97359571f 100644 --- a/sys/compat/linux/common/linux_exec_elf32.c +++ b/sys/compat/linux/common/linux_exec_elf32.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_exec_elf32.c,v 1.55 2002/02/15 20:02:56 christos Exp $ */ +/* $NetBSD: linux_exec_elf32.c,v 1.56 2002/03/22 17:14:18 christos Exp $ */ /*- * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.55 2002/02/15 20:02:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.56 2002/03/22 17:14:18 christos Exp $"); #ifndef ELFSIZE #define ELFSIZE 32 /* XXX should die */ @@ -85,6 +85,12 @@ static int ELFNAME2(linux,atexit_signature) __P((struct proc *p, struct exec_package *, Elf_Ehdr *)); #endif +#ifdef DEBUG_LINUX +#define DPRINTF(a) uprintf a +#else +#define DPRINTF(a) +#endif + #ifdef LINUX_ATEXIT_SIGNATURE /* * On the PowerPC, statically linked Linux binaries are not recognized @@ -140,10 +146,8 @@ ELFNAME2(linux,atexit_signature)(p, epp, eh) Elf_Shdr *s = &sh[i]; if (!memcmp((void*)(&(strtable[s->sh_name])), signature, sizeof(signature))) { -#ifdef DEBUG_LINUX - uprintf("linux_atexit_sig=%s\n", - &(strtable[s->sh_name])); -#endif + DPRINTF(("linux_atexit_sig=%s\n", + &(strtable[s->sh_name]))); error = 0; goto out; } @@ -210,9 +214,7 @@ ELFNAME2(linux,gcc_signature)(p, epp, eh) /* * error is 0, if the signatures match we are done. */ -#ifdef DEBUG_LINUX - uprintf("linux_gcc_sig: sig=%s\n", buf); -#endif + DPRINTF(("linux_gcc_sig: sig=%s\n", buf)); if (!memcmp(buf, signature, sizeof(signature) - 1)) { error = 0; goto out; @@ -329,9 +331,7 @@ ELFNAME2(linux,probe)(p, epp, eh, itp, pos) free((void *)bp, M_TEMP); } *pos = ELF_NO_ADDR; -#ifdef DEBUG_LINUX - uprintf("linux_probe: returning 0\n"); -#endif + DPRINTF(("linux_probe: returning 0\n")); return 0; } diff --git a/sys/compat/linux/common/linux_file64.c b/sys/compat/linux/common/linux_file64.c index fe237a129b1..66af17e7fc3 100644 --- a/sys/compat/linux/common/linux_file64.c +++ b/sys/compat/linux/common/linux_file64.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_file64.c,v 1.9 2002/03/22 14:54:49 christos Exp $ */ +/* $NetBSD: linux_file64.c,v 1.10 2002/03/22 17:14:18 christos Exp $ */ /*- * Copyright (c) 1995, 1998, 2000 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.9 2002/03/22 14:54:49 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_file64.c,v 1.10 2002/03/22 17:14:18 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -296,8 +296,6 @@ linux_sys_fcntl64(p, v, retval) int cmd = SCARG(uap, cmd); int fd = SCARG(uap, fd); - printf("fcntl(%d, %d, %p)\n", fd, cmd, arg); - switch (cmd) { case LINUX_F_GETLK64: sg = stackgap_init(p, 0); diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c index 70167c5b00a..5b68a4a0201 100644 --- a/sys/compat/linux/common/linux_misc.c +++ b/sys/compat/linux/common/linux_misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_misc.c,v 1.103 2002/03/22 15:21:28 christos Exp $ */ +/* $NetBSD: linux_misc.c,v 1.104 2002/03/22 17:14:18 christos Exp $ */ /*- * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.103 2002/03/22 15:21:28 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.104 2002/03/22 17:14:18 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -160,6 +160,12 @@ const static struct mnttypes { }; #define FSTYPESSIZE (sizeof(fstypes) / sizeof(fstypes[0])) +#ifdef DEBUG_LINUX +#define DPRINTF(a) uprintf a +#else +#define DPRINTF(a) +#endif + /* Local linux_misc.c functions: */ static void bsd_to_linux_statfs __P((struct statfs *, struct linux_statfs *)); static int linux_to_bsd_limit __P((int)); @@ -297,10 +303,8 @@ bsd_to_linux_statfs(bsp, lsp) break; if (i == FSTYPESSIZE) { -#ifdef DIAGNOSTIC - printf("unhandled fstype in linux emulation: %s\n", - bsp->f_fstypename); -#endif + DPRINTF(("unhandled fstype in linux emulation: %s\n", + bsp->f_fstypename)); lsp->l_ftype = LINUX_DEFAULT_SUPER_MAGIC; } else { lsp->l_ftype = fstypes[i].linux; diff --git a/sys/compat/linux/common/linux_oldmmap.c b/sys/compat/linux/common/linux_oldmmap.c index a27325cfe33..49a401ce8ed 100644 --- a/sys/compat/linux/common/linux_oldmmap.c +++ b/sys/compat/linux/common/linux_oldmmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_oldmmap.c,v 1.56 2002/02/15 20:02:56 christos Exp $ */ +/* $NetBSD: linux_oldmmap.c,v 1.57 2002/03/22 17:14:19 christos Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_oldmmap.c,v 1.56 2002/02/15 20:02:56 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_oldmmap.c,v 1.57 2002/03/22 17:14:19 christos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -55,6 +55,12 @@ __KERNEL_RCSID(0, "$NetBSD: linux_oldmmap.c,v 1.56 2002/02/15 20:02:56 christos /* Used on: arm, i386, m68k */ /* Not used on: alpha, mips, pcc, sparc, sparc64 */ +#ifdef DEBUG_LINUX +#define DPRINTF(a) uprintf a +#else +#define DPRINTF(a) +#endif + /* * Linux wants to pass everything to a syscall in registers. * However mmap() has 6 of them. Oops: out of register error. @@ -82,11 +88,9 @@ linux_sys_old_mmap(p, v, retval) SCARG(&nlmap,flags) = lmap.lm_flags; SCARG(&nlmap,fd) = lmap.lm_fd; SCARG(&nlmap,offset) = (unsigned)lmap.lm_pos; -#ifdef DEBUG_LINUX - uprintf("old_mmap(%p, %d, %d, %d, %d, %d)\n", - lmap.lm_addr, lmap.lm_len, lmap.lm_prot, lmap.lm_flags, - lmap.lm_fd, lmap.lm_pos); -#endif + DPRINTF(("old_mmap(%p, %d, %d, %d, %d, %d)\n", + lmap.lm_addr, lmap.lm_len, lmap.lm_prot, lmap.lm_flags, + lmap.lm_fd, lmap.lm_pos)); return linux_sys_mmap(p, &nlmap, retval); } diff --git a/sys/compat/linux/common/linux_signal.c b/sys/compat/linux/common/linux_signal.c index c6c561c1aeb..249921f6806 100644 --- a/sys/compat/linux/common/linux_signal.c +++ b/sys/compat/linux/common/linux_signal.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux_signal.c,v 1.35 2002/03/19 20:52:00 christos Exp $ */ +/* $NetBSD: linux_signal.c,v 1.36 2002/03/22 17:14:19 christos Exp $ */ /*- * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -54,7 +54,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.35 2002/03/19 20:52:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.36 2002/03/22 17:14:19 christos Exp $"); #define COMPAT_LINUX 1 @@ -86,6 +86,12 @@ __KERNEL_RCSID(0, "$NetBSD: linux_signal.c,v 1.35 2002/03/19 20:52:00 christos E #define linux_sigaddset(s, n) ((s)->sig[((n) - 1) / LINUX__NSIG_BPW] \ |= (1 << ((n) - 1) % LINUX__NSIG_BPW)) +#ifdef DEBUG_LINUX +#define DPRINTF(a) uprintf a +#else +#define DPRINTF(a) +#endif + #ifndef LINUX_SIGINFO #define LINUX_SIGINFO 0 #endif @@ -276,12 +282,9 @@ linux_to_native_sigflags(lsf) bsf |= SA_NODEFER; if ((lsf & LINUX_SA_SIGINFO) != 0) bsf |= SA_SIGINFO; -#ifdef DEBUG_LINUX if ((lsf & ~LINUX_SA_ALLBITS) != 0) - uprintf( - "linux_old_to_native_sigflags: %lx extra bits ignored\n", - lsf); -#endif + DPRINTF(("linux_old_to_native_sigflags: " + "%lx extra bits ignored\n", lsf)); return bsf; } @@ -301,10 +304,9 @@ linux_old_to_native_sigaction(bsa, lsa) /* * XXX: On the alpha sa_restorer is elsewhere. */ -#ifdef DEBUG_LINUX if (lsa->sa_restorer != NULL) - uprintf("linux_old_to_native_sigaction: sa_restorer ignored\n"); -#endif + DPRINTF(("linux_old_to_native_sigaction: " + "sa_restorer ignored\n")); #endif } @@ -331,10 +333,8 @@ linux_to_native_sigaction(bsa, lsa) linux_to_native_sigset(&bsa->sa_mask, &lsa->sa_mask); bsa->sa_flags = linux_to_native_sigflags(lsa->sa_flags); #ifndef __alpha__ -#ifdef DEBUG_LINUX if (lsa->sa_restorer != 0) - uprintf("linux_to_native_sigaction: sa_restorer ignored\n"); -#endif + DPRINTF(("linux_to_native_sigaction: sa_restorer ignored\n")); #endif } |
