From 26be20a07f6b177513b6083e2c420f23fe87f355 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 23 Dec 2006 00:27:03 +0000 Subject: [PATCH] Rename printf -> kprintf in sys/ and add some defines where necessary (files which are used in userland, too). --- sys/contrib/dev/ath/dragonfly/ah_osdep.c | 12 +- sys/contrib/dev/fla/fla.c | 28 +-- sys/contrib/dev/oltr/if_oltr.c | 188 +++++++++--------- sys/contrib/ipfilter/netinet/fil.c | 13 +- sys/contrib/ipfilter/netinet/ip_auth.c | 8 +- sys/contrib/ipfilter/netinet/ip_fil.c | 12 +- sys/contrib/ipfilter/netinet/ip_ftp_pxy.c | 34 ++-- sys/contrib/ipfilter/netinet/ip_nat.c | 8 +- sys/contrib/ipfilter/netinet/ip_proxy.c | 25 +-- sys/cpu/i386/misc/elf_machdep.c | 6 +- sys/ddb/db_aout.c | 4 +- sys/ddb/db_ps.c | 4 +- sys/ddb/db_sym.c | 4 +- sys/emulation/linux/i386/imgact_linux.c | 12 +- .../linux/i386/linprocfs/linprocfs_vfsops.c | 4 +- .../linux/i386/linprocfs/linprocfs_vnops.c | 6 +- sys/emulation/linux/i386/linux_machdep.c | 38 ++-- sys/emulation/linux/i386/linux_ptrace.c | 6 +- sys/emulation/linux/i386/linux_sysvec.c | 24 +-- sys/emulation/linux/linux_file.c | 52 ++--- sys/emulation/linux/linux_getcwd.c | 4 +- sys/emulation/linux/linux_ioctl.c | 48 ++--- sys/emulation/linux/linux_misc.c | 66 +++--- sys/emulation/linux/linux_signal.c | 18 +- sys/emulation/linux/linux_stats.c | 20 +- sys/emulation/linux/linux_sysctl.c | 8 +- sys/emulation/linux/linux_uid16.c | 10 +- sys/emulation/linux/linux_util.h | 6 +- sys/emulation/ndis/subr_hal.c | 4 +- sys/emulation/ndis/subr_ndis.c | 10 +- sys/emulation/ndis/subr_ntoskrnl.c | 4 +- sys/emulation/ndis/subr_pe.c | 7 +- sys/opencrypto/crypto.c | 20 +- sys/opencrypto/cryptodev.c | 4 +- sys/platform/pc32/acpica5/acpi_machdep.c | 4 +- sys/platform/pc32/acpica5/acpi_toshiba.c | 4 +- sys/platform/pc32/acpica5/acpi_wakeup.c | 18 +- sys/platform/pc32/acpica5/madt.c | 52 ++--- sys/platform/pc32/apic/mpapic.c | 24 +-- sys/platform/pc32/apm/apm.c | 26 +-- sys/platform/pc32/gnu/isa/dgb.c | 70 +++---- sys/platform/pc32/gnu/isa/dgreg.h | 16 +- sys/platform/pc32/i386/autoconf.c | 28 +-- sys/platform/pc32/i386/bios.c | 22 +- sys/platform/pc32/i386/busdma_machdep.c | 4 +- sys/platform/pc32/i386/db_interface.c | 4 +- sys/platform/pc32/i386/elan-mmcr.c | 8 +- sys/platform/pc32/i386/est.c | 16 +- sys/platform/pc32/i386/i686_mem.c | 6 +- sys/platform/pc32/i386/identcpu.c | 100 +++++----- sys/platform/pc32/i386/initcpu.c | 14 +- sys/platform/pc32/i386/k6_mem.c | 4 +- sys/platform/pc32/i386/machdep.c | 48 ++--- sys/platform/pc32/i386/math_emulate.c | 20 +- sys/platform/pc32/i386/mp_machdep.c | 82 ++++---- sys/platform/pc32/i386/nexus.c | 8 +- sys/platform/pc32/i386/p4tcc.c | 4 +- sys/platform/pc32/i386/pmap.c | 24 +-- sys/platform/pc32/i386/pnpbios.c | 22 +- sys/platform/pc32/i386/sys_machdep.c | 6 +- sys/platform/pc32/i386/trap.c | 78 ++++---- sys/platform/pc32/i386/userconfig.c | 106 +++++----- sys/platform/pc32/i386/vm86.c | 4 +- sys/platform/pc32/i386/vm_machdep.c | 20 +- sys/platform/pc32/isa/asc.c | 8 +- sys/platform/pc32/isa/clock.c | 40 ++-- sys/platform/pc32/isa/npx.c | 16 +- sys/platform/vkernel/i386/autoconf.c | 20 +- sys/platform/vkernel/platform/init.c | 4 +- sys/sys/ckpt.h | 10 +- sys/sys/exec.h | 10 +- sys/sys/iconv.h | 4 +- sys/sys/kernel.h | 6 +- sys/sys/linker.h | 4 +- sys/sys/module.h | 4 +- sys/sys/syslog.h | 4 +- sys/sys/thread2.h | 4 +- 77 files changed, 855 insertions(+), 838 deletions(-) diff --git a/sys/contrib/dev/ath/dragonfly/ah_osdep.c b/sys/contrib/dev/ath/dragonfly/ah_osdep.c index 2f2f934850..2eab17e000 100644 --- a/sys/contrib/dev/ath/dragonfly/ah_osdep.c +++ b/sys/contrib/dev/ath/dragonfly/ah_osdep.c @@ -191,14 +191,14 @@ ath_hal_setlogging(int enable) sizeof (struct athregrec), ath_hal_alq_qsize); ath_hal_alq_lost = 0; ath_hal_alq_emitdev = 1; - printf("ath_hal: logging to %s enabled\n", + kprintf("ath_hal: logging to %s enabled\n", ath_hal_logfile); } } else { if (ath_hal_alq) alq_close(ath_hal_alq); ath_hal_alq = NULL; - printf("ath_hal: logging disabled\n"); + kprintf("ath_hal: logging disabled\n"); error = 0; } return (error); @@ -346,7 +346,7 @@ ath_hal_reg_read(struct ath_hal *ah, u_int32_t reg) void ath_hal_assert_failed(const char* filename, int lineno, const char *msg) { - printf("Atheros HAL assertion failure: %s: line %u: %s\n", + kprintf("Atheros HAL assertion failure: %s: line %u: %s\n", filename, lineno, msg); panic("ath_hal_assert"); } @@ -394,13 +394,13 @@ ath_hal_modevent(module_t mod, int type, void *unused) switch (type) { case MOD_LOAD: - printf("ath_hal: %s (", ath_hal_version); + kprintf("ath_hal: %s (", ath_hal_version); sep = ""; for (i = 0; ath_hal_buildopts[i] != NULL; i++) { - printf("%s%s", sep, ath_hal_buildopts[i]); + kprintf("%s%s", sep, ath_hal_buildopts[i]); sep = ", "; } - printf(")\n"); + kprintf(")\n"); return 0; case MOD_UNLOAD: return 0; diff --git a/sys/contrib/dev/fla/fla.c b/sys/contrib/dev/fla/fla.c index 3919f711bf..0ca6124369 100644 --- a/sys/contrib/dev/fla/fla.c +++ b/sys/contrib/dev/fla/fla.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/contrib/dev/fla/fla.c,v 1.16 1999/12/08 04:45:16 ken Exp $ - * $DragonFly: src/sys/contrib/dev/fla/Attic/fla.c,v 1.16 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/contrib/dev/fla/Attic/fla.c,v 1.17 2006/12/23 00:27:02 swildner Exp $ * */ @@ -127,7 +127,7 @@ flaopen(struct dev_open_args *ap) struct disklabel *dl; if (fla_debug) - printf("flaopen(%s %x %x)\n", + kprintf("flaopen(%s %x %x)\n", devtoname(dev), ap->a_oflags, ap->a_devtype); sc = dev->si_drv1; @@ -135,7 +135,7 @@ flaopen(struct dev_open_args *ap) error = doc2k_open(sc->unit); if (error) { - printf("doc2k_open(%d) -> err %d\n", sc->unit, error); + kprintf("doc2k_open(%d) -> err %d\n", sc->unit, error); return (EIO); } @@ -157,14 +157,14 @@ flaclose(struct dev_close_args *ap) struct fla_s *sc; if (fla_debug) - printf("flaclose(%s %x %x)\n", + kprintf("flaclose(%s %x %x)\n", devtoname(dev), ap->a_fflag, ap->a_devtype); sc = dev->si_drv1; error = doc2k_close(sc->unit); if (error) { - printf("doc2k_close(%d) -> err %d\n", sc->unit, error); + kprintf("doc2k_close(%d) -> err %d\n", sc->unit, error); return (EIO); } return (0); @@ -176,7 +176,7 @@ flaioctl(struct dev_ioctl_args *ap) cdev_t dev = ap->a_head.a_dev; if (fla_debug) - printf("flaioctl(%s %lx %p %x)\n", + kprintf("flaioctl(%s %lx %p %x)\n", devtoname(dev), ap->a_cmd, ap->a_data, ap->a_fflag); return (ENOIOCTL); @@ -193,7 +193,7 @@ flastrategy(struct dev_strategy_args *ap) enum doc2k_work what; if (fla_debug > 1) { - printf("flastrategy(%p) %s %x, %lld, %d, %p)\n", + kprintf("flastrategy(%p) %s %x, %lld, %d, %p)\n", bp, devtoname(dev), bp->b_flags, bio->bio_offset, bp->b_bcount, bp->b_data); } @@ -245,7 +245,7 @@ flastrategy(struct dev_strategy_args *ap) ENTER(); if (fla_debug > 1 || error) { - printf("fla%d: %d = rwe(%p, %d, %d, %lld, %d, %p)\n", + kprintf("fla%d: %d = rwe(%p, %d, %d, %lld, %d, %p)\n", unit, error, bp, unit, what, bio->bio_offset, bp->b_bcount, bp->b_data); } @@ -301,32 +301,32 @@ flaattach (device_t dev) error = doc2k_open(unit); if (error) { - printf("doc2k_open(%d) -> err %d\n", unit, error); + kprintf("doc2k_open(%d) -> err %d\n", unit, error); return (EIO); } error = doc2k_size(unit, &sc->nsect, &i, &j, &k ); if (error) { - printf("doc2k_size(%d) -> err %d\n", unit, error); + kprintf("doc2k_size(%d) -> err %d\n", unit, error); return (EIO); } - printf("fla%d: <%s %s>\n", unit, sc->ds.product, sc->ds.model); + kprintf("fla%d: <%s %s>\n", unit, sc->ds.product, sc->ds.model); error = doc2k_close(unit); if (error) { - printf("doc2k_close(%d) -> err %d\n", unit, error); + kprintf("doc2k_close(%d) -> err %d\n", unit, error); return (EIO); } m = 1024L * 1024L / DEV_BSIZE; l = (sc->nsect * 10 + m/2) / m; - printf("fla%d: %d.%01dMB (%u sectors)," + kprintf("fla%d: %d.%01dMB (%u sectors)," " %d cyls, %d heads, %d S/T, 512 B/S\n", unit, l / 10, l % 10, sc->nsect, i, j, k); if (bootverbose) - printf("fla%d: JEDEC=0x%x unitsize=%ld mediasize=%ld" + kprintf("fla%d: JEDEC=0x%x unitsize=%ld mediasize=%ld" " chipsize=%ld interleave=%d window=%lx\n", unit, sc->ds.type, sc->ds.unitSize, sc->ds.mediaSize, sc->ds.chipSize, sc->ds.interleaving, sc->ds.window); diff --git a/sys/contrib/dev/oltr/if_oltr.c b/sys/contrib/dev/oltr/if_oltr.c index f43b9d4658..cba1605b06 100644 --- a/sys/contrib/dev/oltr/if_oltr.c +++ b/sys/contrib/dev/oltr/if_oltr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/contrib/dev/oltr/if_oltr.c,v 1.11.2.5 2001/10/20 04:15:21 mdodd Exp $ - * $DragonFly: src/sys/contrib/dev/oltr/Attic/if_oltr.c,v 1.24 2006/10/25 20:55:52 dillon Exp $ + * $DragonFly: src/sys/contrib/dev/oltr/Attic/if_oltr.c,v 1.25 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -509,11 +509,11 @@ oltr_pci_probe(pcici_t config_id, pcidi_t device_id) rc = TRlldPCIConfig(&LldDriver, &config, PCIConfigHeader); if (rc == TRLLD_PCICONFIG_FAIL) { - printf("oltr: TRlldPciConfig failed!\n"); + kprintf("oltr: TRlldPciConfig failed!\n"); return(NULL); } if (rc == TRLLD_PCICONFIG_VERSION) { - printf("oltr: wrong LLD version.\n"); + kprintf("oltr: wrong LLD version.\n"); return(NULL); } return(AdapterName[config.type]); @@ -536,7 +536,7 @@ oltr_pci_attach(pcici_t config_id, int unit) sc = kmalloc(sizeof(struct oltr_softc), M_DEVBUF, M_NOWAIT | M_ZERO); if (sc == NULL) { - printf("oltr%d: no memory for softc struct!\n", unit); + kprintf("oltr%d: no memory for softc struct!\n", unit); goto config_failed; } sc->unit = unit; @@ -550,32 +550,32 @@ oltr_pci_attach(pcici_t config_id, int unit) case TRLLD_PCICONFIG_OK: break; case TRLLD_PCICONFIG_SET_COMMAND: - printf("oltr%d: enabling bus master mode\n", unit); + kprintf("oltr%d: enabling bus master mode\n", unit); command = pci_conf_read(config_id, PCIR_COMMAND); pci_conf_write(config_id, PCIR_COMMAND, (command | PCIM_CMD_BUSMASTEREN)); command = pci_conf_read(config_id, PCIR_COMMAND); if (!(command & PCIM_CMD_BUSMASTEREN)) { - printf("oltr%d: failed to enable bus master mode\n", unit); + kprintf("oltr%d: failed to enable bus master mode\n", unit); goto config_failed; } break; case TRLLD_PCICONFIG_FAIL: - printf("oltr%d: TRlldPciConfig failed!\n", unit); + kprintf("oltr%d: TRlldPciConfig failed!\n", unit); goto config_failed; break; case TRLLD_PCICONFIG_VERSION: - printf("oltr%d: wrong LLD version\n", unit); + kprintf("oltr%d: wrong LLD version\n", unit); goto config_failed; break; } - printf("oltr%d: MAC address %6D\n", unit, sc->config.macaddress, ":"); + kprintf("oltr%d: MAC address %6D\n", unit, sc->config.macaddress, ":"); scratch_size = TRlldAdapterSize(); if (bootverbose) - printf("oltr%d: adapter memory block size %d bytes\n", unit, scratch_size); + kprintf("oltr%d: adapter memory block size %d bytes\n", unit, scratch_size); sc->TRlldAdapter = (TRlldAdapter_t)kmalloc(scratch_size, M_DEVBUF, M_NOWAIT); if (sc->TRlldAdapter == NULL) { - printf("oltr%d: couldn't allocate scratch buffer (%d bytes)\n",unit, scratch_size); + kprintf("oltr%d: couldn't allocate scratch buffer (%d bytes)\n",unit, scratch_size); goto config_failed; } @@ -590,7 +590,7 @@ oltr_pci_attach(pcici_t config_id, int unit) sc->tx_ring[i].data = (char *)kmalloc(TX_BUFFER_LEN, M_DEVBUF, M_NOWAIT); sc->tx_ring[i].address = vtophys(sc->tx_ring[i].data); if ((!sc->rx_ring[i].data) || (!sc->tx_ring[i].data)) { - printf("oltr%d: unable to allocate ring buffers\n", unit); + kprintf("oltr%d: unable to allocate ring buffers\n", unit); while (i > 0) { if (sc->rx_ring[i].data) kfree(sc->rx_ring[i].data, M_DEVBUF); @@ -606,7 +606,7 @@ oltr_pci_attach(pcici_t config_id, int unit) * Allocate interrupt and DMA channel */ if (!pci_map_int(config_id, oltr_intr, sc)) { - printf("oltr%d: couldn't setup interrupt\n", unit); + kprintf("oltr%d: couldn't setup interrupt\n", unit); goto config_failed; } @@ -669,7 +669,7 @@ oltr_intr(void *xsc) struct oltr_softc *sc = (struct oltr_softc *)xsc; if (DEBUG_MASK & DEBUG_INT) - printf("I"); + kprintf("I"); TRlldInterruptService(sc->TRlldAdapter); @@ -695,7 +695,7 @@ outloop: * Make sure we have buffers to transmit with */ if (sc->tx_avail <= 0) { - printf("oltr%d: tx queue full\n", sc->unit); + kprintf("oltr%d: tx queue full\n", sc->unit); ifp->if_flags |= IFF_OACTIVE; return; } @@ -735,7 +735,7 @@ outloop: crit_exit(); if (rc != TRLLD_TRANSMIT_OK) { - printf("oltr%d: TRlldTransmitFrame returned %d\n", sc->unit, rc); + kprintf("oltr%d: TRlldTransmitFrame returned %d\n", sc->unit, rc); ifp->if_oerrors++; goto bad; } @@ -754,7 +754,7 @@ bad: nobuffers: - printf("oltr%d: queue full\n", sc->unit); + kprintf("oltr%d: queue full\n", sc->unit); ifp->if_flags |= IFF_OACTIVE; ifp->if_oerrors++; /*m_freem(m0);*/ @@ -766,7 +766,7 @@ nobuffers: static void oltr_close(struct oltr_softc *sc) { - /*printf("oltr%d: oltr_close\n", sc->unit);*/ + /*kprintf("oltr%d: oltr_close\n", sc->unit);*/ oltr_stop(sc); @@ -778,7 +778,7 @@ oltr_stop(struct oltr_softc *sc) { struct ifnet *ifp = &sc->arpcom.ac_if; - /*printf("oltr%d: oltr_stop\n", sc->unit);*/ + /*kprintf("oltr%d: oltr_stop\n", sc->unit);*/ ifp->if_flags &= ~(IFF_UP | IFF_RUNNING | IFF_OACTIVE); TRlldClose(sc->TRlldAdapter, 0); @@ -798,7 +798,7 @@ oltr_init(void * xsc) * Check adapter state, don't allow multiple inits */ if (sc->state > OL_CLOSED) { - printf("oltr%d: adapter not ready\n", sc->unit); + kprintf("oltr%d: adapter not ready\n", sc->unit); return; } @@ -811,19 +811,19 @@ oltr_init(void * xsc) (void *)sc, &sc->config)) != TRLLD_INIT_OK) { switch(rc) { case TRLLD_INIT_NOT_FOUND: - printf("oltr%d: adapter not found\n", sc->unit); + kprintf("oltr%d: adapter not found\n", sc->unit); break; case TRLLD_INIT_UNSUPPORTED: - printf("oltr%d: adapter not supported by low level driver\n", sc->unit); + kprintf("oltr%d: adapter not supported by low level driver\n", sc->unit); break; case TRLLD_INIT_PHYS16: - printf("oltr%d: adapter memory block above 16M cannot DMA\n", sc->unit); + kprintf("oltr%d: adapter memory block above 16M cannot DMA\n", sc->unit); break; case TRLLD_INIT_VERSION: - printf("oltr%d: low level driver version mismatch\n", sc->unit); + kprintf("oltr%d: low level driver version mismatch\n", sc->unit); break; default: - printf("oltr%d: unknown init error %d\n", sc->unit, rc); + kprintf("oltr%d: unknown init error %d\n", sc->unit, rc); break; } goto init_failed; @@ -843,7 +843,7 @@ oltr_init(void * xsc) if (work_size) { if ((sc->work_memory = kmalloc(work_size, M_DEVBUF, M_NOWAIT)) == NULL) { - printf("oltr%d: failed to allocate work memory (%d octets).\n", sc->unit, work_size); + kprintf("oltr%d: failed to allocate work memory (%d octets).\n", sc->unit, work_size); } else { TRlldAddMemory(sc->TRlldAdapter, sc->work_memory, vtophys(sc->work_memory), work_size); @@ -869,27 +869,27 @@ oltr_init(void * xsc) * Download adapter micro-code */ if (bootverbose) - printf("oltr%d: Downloading adapter microcode: ", sc->unit); + kprintf("oltr%d: Downloading adapter microcode: ", sc->unit); switch(sc->config.mactype) { case TRLLD_MAC_TMS: rc = TRlldDownload(sc->TRlldAdapter, TRlldMacCode); if (bootverbose) - printf("TMS-380"); + kprintf("TMS-380"); break; case TRLLD_MAC_HAWKEYE: rc = TRlldDownload(sc->TRlldAdapter, TRlldHawkeyeMac); if (bootverbose) - printf("Hawkeye"); + kprintf("Hawkeye"); break; case TRLLD_MAC_BULLSEYE: rc = TRlldDownload(sc->TRlldAdapter, TRlldBullseyeMac); if (bootverbose) - printf("Bullseye"); + kprintf("Bullseye"); break; default: if (bootverbose) - printf("unknown - failed!\n"); + kprintf("unknown - failed!\n"); goto init_failed; break; } @@ -900,18 +900,18 @@ oltr_init(void * xsc) switch(rc) { case TRLLD_DOWNLOAD_OK: if (bootverbose) - printf(" - ok\n"); + kprintf(" - ok\n"); break; case TRLLD_DOWNLOAD_ERROR: if (bootverbose) - printf(" - failed\n"); + kprintf(" - failed\n"); else - printf("oltr%d: adapter microcode download failed\n", sc->unit); + kprintf("oltr%d: adapter microcode download failed\n", sc->unit); goto init_failed; break; case TRLLD_STATE: if (bootverbose) - printf(" - not ready\n"); + kprintf(" - not ready\n"); goto init_failed; break; } @@ -922,14 +922,14 @@ oltr_init(void * xsc) i = 0; while ((poll++ < SELF_TEST_POLLS) && (sc->state < OL_READY)) { if (DEBUG_MASK & DEBUG_INIT) - printf("p"); + kprintf("p"); DELAY(TRlldPoll(sc->TRlldAdapter) * 1000); if (TRlldInterruptService(sc->TRlldAdapter) != 0) - if (DEBUG_MASK & DEBUG_INIT) printf("i"); + if (DEBUG_MASK & DEBUG_INIT) kprintf("i"); } if (sc->state != OL_CLOSED) { - printf("oltr%d: self-test failed\n", sc->unit); + kprintf("oltr%d: self-test failed\n", sc->unit); goto init_failed; } @@ -950,19 +950,19 @@ oltr_init(void * xsc) case TRLLD_OPEN_OK: break; case TRLLD_OPEN_STATE: - printf("oltr%d: adapter not ready for open\n", sc->unit); + kprintf("oltr%d: adapter not ready for open\n", sc->unit); crit_exit(); return; case TRLLD_OPEN_ADDRESS_ERROR: - printf("oltr%d: illegal MAC address\n", sc->unit); + kprintf("oltr%d: illegal MAC address\n", sc->unit); crit_exit(); return; case TRLLD_OPEN_MODE_ERROR: - printf("oltr%d: illegal open mode\n", sc->unit); + kprintf("oltr%d: illegal open mode\n", sc->unit); crit_exit(); return; default: - printf("oltr%d: unknown open error (%d)\n", sc->unit, rc); + kprintf("oltr%d: unknown open error (%d)\n", sc->unit, rc); crit_exit(); return; } @@ -985,7 +985,7 @@ oltr_init(void * xsc) rc = TRlldReceiveFragment(sc->TRlldAdapter, (void *)sc->rx_ring[i].data, sc->rx_ring[i].address, RX_BUFFER_LEN, (void *)sc->rx_ring[i].index); if (rc != TRLLD_RECEIVE_OK) { - printf("oltr%d: adapter refused receive fragment %d (rc = %d)\n", sc->unit, i, rc); + kprintf("oltr%d: adapter refused receive fragment %d (rc = %d)\n", sc->unit, i, rc); break; } } @@ -1061,7 +1061,7 @@ oltr_poll(void *arg) crit_enter(); - if (DEBUG_MASK & DEBUG_POLL) printf("P"); + if (DEBUG_MASK & DEBUG_POLL) kprintf("P"); /* Set up next adapter poll */ callout_reset(&sc->oltr_poll_ch, @@ -1081,7 +1081,7 @@ oltr_stat(void *arg) /* Set up next adapter poll */ sc->oltr_stat_ch = timeout(oltr_stat, (void *)sc, 1*hz); if (TRlldGetStatistics(sc->TRlldAdapter, &sc->current, 0) != 0) { - /*printf("oltr%d: statistics available immediately...\n", sc->unit);*/ + /*kprintf("oltr%d: statistics available immediately...\n", sc->unit);*/ DriverStatistics((void *)sc, &sc->current); } @@ -1126,7 +1126,7 @@ oltr_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) struct oltr_softc *sc = ifp->if_softc; struct ifmedia *ifm = &sc->ifmedia; - /*printf("oltr%d: oltr_ifmedia_sts\n", sc->unit);*/ + /*kprintf("oltr%d: oltr_ifmedia_sts\n", sc->unit);*/ ifmr->ifm_active = IFM_TYPE(ifm->ifm_media)|IFM_SUBTYPE(ifm->ifm_media); @@ -1143,49 +1143,49 @@ DriverStatistics(void *DriverHandle, TRlldStatistics_t *statistics) struct oltr_softc *sc = (struct oltr_softc *)DriverHandle; if (sc->statistics.LineErrors != statistics->LineErrors) - printf("oltr%d: Line Errors %lu\n", sc->unit, + kprintf("oltr%d: Line Errors %lu\n", sc->unit, statistics->LineErrors); if (sc->statistics.InternalErrors != statistics->InternalErrors) - printf("oltr%d: Internal Errors %lu\n", sc->unit, + kprintf("oltr%d: Internal Errors %lu\n", sc->unit, statistics->InternalErrors); if (sc->statistics.BurstErrors != statistics->BurstErrors) - printf("oltr%d: Burst Errors %lu\n", sc->unit, + kprintf("oltr%d: Burst Errors %lu\n", sc->unit, statistics->BurstErrors); if (sc->statistics.AbortDelimiters != statistics->AbortDelimiters) - printf("oltr%d: Abort Delimiters %lu\n", sc->unit, + kprintf("oltr%d: Abort Delimiters %lu\n", sc->unit, statistics->AbortDelimiters); if (sc->statistics.ARIFCIErrors != statistics->ARIFCIErrors) - printf("oltr%d: ARIFCI Errors %lu\n", sc->unit, + kprintf("oltr%d: ARIFCI Errors %lu\n", sc->unit, statistics->ARIFCIErrors); if (sc->statistics.LostFrames != statistics->LostFrames) - printf("oltr%d: Lost Frames %lu\n", sc->unit, + kprintf("oltr%d: Lost Frames %lu\n", sc->unit, statistics->LostFrames); if (sc->statistics.CongestionErrors != statistics->CongestionErrors) - printf("oltr%d: Congestion Errors %lu\n", sc->unit, + kprintf("oltr%d: Congestion Errors %lu\n", sc->unit, statistics->CongestionErrors); if (sc->statistics.FrequencyErrors != statistics->FrequencyErrors) - printf("oltr%d: Frequency Errors %lu\n", sc->unit, + kprintf("oltr%d: Frequency Errors %lu\n", sc->unit, statistics->FrequencyErrors); if (sc->statistics.TokenErrors != statistics->TokenErrors) - printf("oltr%d: Token Errors %lu\n", sc->unit, + kprintf("oltr%d: Token Errors %lu\n", sc->unit, statistics->TokenErrors); if (sc->statistics.DMABusErrors != statistics->DMABusErrors) - printf("oltr%d: DMA Bus Errors %lu\n", sc->unit, + kprintf("oltr%d: DMA Bus Errors %lu\n", sc->unit, statistics->DMABusErrors); if (sc->statistics.DMAParityErrors != statistics->DMAParityErrors) - printf("oltr%d: DMA Parity Errors %lu\n", sc->unit, + kprintf("oltr%d: DMA Parity Errors %lu\n", sc->unit, statistics->DMAParityErrors); if (sc->statistics.ReceiveLongFrame != statistics->ReceiveLongFrame) - printf("oltr%d: Long frames received %lu\n", sc->unit, + kprintf("oltr%d: Long frames received %lu\n", sc->unit, statistics->ReceiveLongFrame); if (sc->statistics.ReceiveCRCErrors != statistics->ReceiveCRCErrors) - printf("oltr%d: Receive CRC Errors %lu\n", sc->unit, + kprintf("oltr%d: Receive CRC Errors %lu\n", sc->unit, statistics->ReceiveCRCErrors); if (sc->statistics.ReceiveOverflow != statistics->ReceiveOverflow) - printf("oltr%d: Recieve overflows %lu\n", sc->unit, + kprintf("oltr%d: Recieve overflows %lu\n", sc->unit, statistics->ReceiveOverflow); if (sc->statistics.TransmitUnderrun != statistics->TransmitUnderrun) - printf("oltr%d: Frequency Errors %lu\n", sc->unit, + kprintf("oltr%d: Frequency Errors %lu\n", sc->unit, statistics->TransmitUnderrun); bcopy(statistics, &sc->statistics, sizeof(TRlldStatistics_t)); #endif @@ -1214,7 +1214,7 @@ DriverStatus(void *DriverHandle, TRlldStatus_t *Status) switch (Status->Type) { case TRLLD_STS_ON_WIRE: - printf("oltr%d: ring insert (%d Mbps - %s)\n", sc->unit, + kprintf("oltr%d: ring insert (%d Mbps - %s)\n", sc->unit, Status->Specification.OnWireInformation.Speed, Protocol[Status->Specification.OnWireInformation.AccessProtocol]); sc->state = OL_OPEN; @@ -1224,15 +1224,15 @@ DriverStatus(void *DriverHandle, TRlldStatus_t *Status) if (Status->Specification.SelftestStatus == TRLLD_ST_OK) { sc->state = OL_CLOSED; if (bootverbose) - printf("oltr%d: self test complete\n", sc->unit); + kprintf("oltr%d: self test complete\n", sc->unit); } if (Status->Specification.SelftestStatus & TRLLD_ST_ERROR) { - printf("oltr%d: Adapter self test error %d", sc->unit, + kprintf("oltr%d: Adapter self test error %d", sc->unit, Status->Specification.SelftestStatus & ~TRLLD_ST_ERROR); sc->state = OL_DEAD; } if (Status->Specification.SelftestStatus & TRLLD_ST_TIMEOUT) { - printf("oltr%d: Adapter self test timed out.\n", sc->unit); + kprintf("oltr%d: Adapter self test timed out.\n", sc->unit); sc->state = OL_DEAD; } break; @@ -1244,48 +1244,48 @@ DriverStatus(void *DriverHandle, TRlldStatus_t *Status) oltr_init(sc); break; } - printf("oltr%d: adapter init failure 0x%03x\n", sc->unit, + kprintf("oltr%d: adapter init failure 0x%03x\n", sc->unit, Status->Specification.InitStatus); oltr_stop(sc); break; case TRLLD_STS_RING_STATUS: if (Status->Specification.RingStatus) { - printf("oltr%d: Ring status change: ", sc->unit); + kprintf("oltr%d: Ring status change: ", sc->unit); if (Status->Specification.RingStatus & TRLLD_RS_SIGNAL_LOSS) - printf(" [Signal Loss]"); + kprintf(" [Signal Loss]"); if (Status->Specification.RingStatus & TRLLD_RS_HARD_ERROR) - printf(" [Hard Error]"); + kprintf(" [Hard Error]"); if (Status->Specification.RingStatus & TRLLD_RS_SOFT_ERROR) - printf(" [Soft Error]"); + kprintf(" [Soft Error]"); if (Status->Specification.RingStatus & TRLLD_RS_TRANSMIT_BEACON) - printf(" [Beacon]"); + kprintf(" [Beacon]"); if (Status->Specification.RingStatus & TRLLD_RS_LOBE_WIRE_FAULT) - printf(" [Wire Fault]"); + kprintf(" [Wire Fault]"); if (Status->Specification.RingStatus & TRLLD_RS_AUTO_REMOVAL_ERROR) - printf(" [Auto Removal]"); + kprintf(" [Auto Removal]"); if (Status->Specification.RingStatus & TRLLD_RS_REMOVE_RECEIVED) - printf(" [Remove Received]"); + kprintf(" [Remove Received]"); if (Status->Specification.RingStatus & TRLLD_RS_COUNTER_OVERFLOW) - printf(" [Counter Overflow]"); + kprintf(" [Counter Overflow]"); if (Status->Specification.RingStatus & TRLLD_RS_SINGLE_STATION) - printf(" [Single Station]"); + kprintf(" [Single Station]"); if (Status->Specification.RingStatus & TRLLD_RS_RING_RECOVERY) - printf(" [Ring Recovery]"); - printf("\n"); + kprintf(" [Ring Recovery]"); + kprintf("\n"); } break; case TRLLD_STS_ADAPTER_CHECK: - printf("oltr%d: adapter check (%04x %04x %04x %04x)\n", sc->unit, + kprintf("oltr%d: adapter check (%04x %04x %04x %04x)\n", sc->unit, Status->Specification.AdapterCheck[0], Status->Specification.AdapterCheck[1], Status->Specification.AdapterCheck[2], @@ -1294,19 +1294,19 @@ DriverStatus(void *DriverHandle, TRlldStatus_t *Status) oltr_stop(sc); break; case TRLLD_STS_PROMISCUOUS_STOPPED: - printf("oltr%d: promiscuous mode ", sc->unit); + kprintf("oltr%d: promiscuous mode ", sc->unit); if (Status->Specification.PromRemovedCause == 1) - printf("remove received."); + kprintf("remove received."); if (Status->Specification.PromRemovedCause == 2) - printf("poll failure."); + kprintf("poll failure."); if (Status->Specification.PromRemovedCause == 2) - printf("buffer size failure."); - printf("\n"); + kprintf("buffer size failure."); + kprintf("\n"); ifp->if_flags &= ~IFF_PROMISC; break; case TRLLD_STS_LLD_ERROR: - printf("oltr%d: low level driver internal error ", sc->unit); - printf("(%04x %04x %04x %04x).\n", + kprintf("oltr%d: low level driver internal error ", sc->unit); + kprintf("(%04x %04x %04x %04x).\n", Status->Specification.InternalError[0], Status->Specification.InternalError[1], Status->Specification.InternalError[2], @@ -1315,11 +1315,11 @@ DriverStatus(void *DriverHandle, TRlldStatus_t *Status) oltr_stop(sc); break; case TRLLD_STS_ADAPTER_TIMEOUT: - printf("oltr%d: adapter %s timeout.\n", sc->unit, + kprintf("oltr%d: adapter %s timeout.\n", sc->unit, Timeout[Status->Specification.AdapterTimeout]); break; default: - printf("oltr%d: driver status Type = %d\n", sc->unit, Status->Type); + kprintf("oltr%d: driver status Type = %d\n", sc->unit, Status->Type); break; } @@ -1335,7 +1335,7 @@ DriverCloseCompleted(void *DriverHandle) { struct oltr_softc *sc = (struct oltr_softc *)DriverHandle; - printf("oltr%d: adapter closed\n", sc->unit); + kprintf("oltr%d: adapter closed\n", sc->unit); wakeup(sc); sc->state = OL_CLOSED; } @@ -1347,11 +1347,11 @@ DriverTransmitFrameCompleted(void *DriverHandle, void *FrameHandle, int Transmit struct ifnet *ifp = &sc->arpcom.ac_if; TRlldTransmit_t *frame = (TRlldTransmit_t *)FrameHandle; - /*printf("oltr%d: DriverTransmitFrameCompleted\n", sc->unit);*/ + /*kprintf("oltr%d: DriverTransmitFrameCompleted\n", sc->unit);*/ if (TransmitStatus != TRLLD_TRANSMIT_OK) { ifp->if_oerrors++; - printf("oltr%d: transmit error %d\n", sc->unit, TransmitStatus); + kprintf("oltr%d: transmit error %d\n", sc->unit, TransmitStatus); } else { ifp->if_opackets++; } @@ -1359,7 +1359,7 @@ DriverTransmitFrameCompleted(void *DriverHandle, void *FrameHandle, int Transmit sc->tx_avail += frame->FragmentCount; if (ifp->if_flags & IFF_OACTIVE) { - printf("oltr%d: queue restart\n", sc->unit); + kprintf("oltr%d: queue restart\n", sc->unit); ifp->if_flags &= ~IFF_OACTIVE; oltr_start(ifp); } @@ -1463,7 +1463,7 @@ DriverReceiveFrameCompleted(void *DriverHandle, int ByteCount, int FragmentCount } else { /* Receiver error */ if (ReceiveStatus != TRLLD_RCV_NO_DATA) { - printf("oltr%d: receive error %d\n", sc->unit, + kprintf("oltr%d: receive error %d\n", sc->unit, ReceiveStatus); ifp->if_ierrors++; } @@ -1478,7 +1478,7 @@ dropped: sc->rx_ring[RING_BUFFER(i)].address, RX_BUFFER_LEN, (void *)sc->rx_ring[RING_BUFFER(i)].index); if (rc != TRLLD_RECEIVE_OK) { - printf("oltr%d: adapter refused receive fragment %d (rc = %d)\n", sc->unit, i, rc); + kprintf("oltr%d: adapter refused receive fragment %d (rc = %d)\n", sc->unit, i, rc); break; } i++; diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 95da234d6c..3c7d2e23bf 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -5,7 +5,7 @@ * * @(#)fil.c 1.36 6/5/96 (C) 1993-2000 Darren Reed * $FreeBSD: src/sys/contrib/ipfilter/netinet/fil.c,v 1.23.2.7 2004/07/04 09:24:38 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/fil.c,v 1.9 2004/07/28 00:22:36 hmp Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/fil.c,v 1.10 2006/12/23 00:27:02 swildner Exp $ */ #if defined(__sgi) && (IRIX > 602) # include @@ -122,6 +122,9 @@ extern kmutex_t ipf_rw; # endif /* SOLARIS || __sgi */ #endif /* _KERNEL */ +#ifndef _KERNEL +# define kprintf printf +#endif struct filterstats frstats[2] = {{0,0,0,0,0},{0,0,0,0,0}}; struct frentry *ipfilter[2][2] = { { NULL, NULL }, { NULL, NULL } }, @@ -679,7 +682,7 @@ void *m; # endif #else if (opts & (OPT_VERBOSE|OPT_DEBUG)) - printf("\n"); + kprintf("\n"); #endif FR_VERBOSE(("%c", fr->fr_skip ? 's' : @@ -904,11 +907,11 @@ int out; static int counter = 0; if (counter == 0) { - printf("WARNING: fr_checkp corrupt: value %lx\n", + kprintf("WARNING: fr_checkp corrupt: value %lx\n", (u_long)fr_checkp); - printf("WARNING: fr_checkp should be %lx\n", + kprintf("WARNING: fr_checkp should be %lx\n", (u_long)fr_check); - printf("WARNING: fixing fr_checkp\n"); + kprintf("WARNING: fixing fr_checkp\n"); } fr_checkp = fr_check; counter++; diff --git a/sys/contrib/ipfilter/netinet/ip_auth.c b/sys/contrib/ipfilter/netinet/ip_auth.c index 5d02007ea5..de45f31be7 100644 --- a/sys/contrib/ipfilter/netinet/ip_auth.c +++ b/sys/contrib/ipfilter/netinet/ip_auth.c @@ -5,7 +5,7 @@ * * @(#)$Id: ip_auth.c,v 2.11.2.20 2002/06/04 14:40:42 darrenr Exp $ * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_auth.c,v 1.21.2.7 2003/03/01 03:55:54 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_auth.c,v 1.8 2005/06/05 12:17:46 corecode Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_auth.c,v 1.9 2006/12/23 00:27:02 swildner Exp $ */ #if defined(__sgi) && (IRIX > 602) # include @@ -121,6 +121,10 @@ extern kcondvar_t ipfauthwait; static struct wait_queue *ipfauthwait = NULL; #endif +#ifndef _KERNEL +#define kprintf printf +#endif + int fr_authsize = FR_NUMAUTH; int fr_authused = 0; int fr_defaultauthage = 600; @@ -624,7 +628,7 @@ frentry_t *fr, **frptr; if ((cmd != SIOCADAFR) && (cmd != SIOCRMAFR)) { /* Should not happen */ - printf("fr_preauthcmd called with bad cmd 0x%lx", (u_long)cmd); + kprintf("fr_preauthcmd called with bad cmd 0x%lx", (u_long)cmd); return EIO; } diff --git a/sys/contrib/ipfilter/netinet/ip_fil.c b/sys/contrib/ipfilter/netinet/ip_fil.c index 2495b0f14c..88154bcd22 100644 --- a/sys/contrib/ipfilter/netinet/ip_fil.c +++ b/sys/contrib/ipfilter/netinet/ip_fil.c @@ -6,7 +6,7 @@ * @(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed * @(#)$Id: ip_fil.c,v 2.42.2.60 2002/08/28 12:40:39 darrenr Exp $ * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.25.2.7 2004/07/04 09:24:38 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.25 2006/12/20 18:14:37 dillon Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_fil.c,v 1.26 2006/12/23 00:27:02 swildner Exp $ */ #ifndef SOLARIS #define SOLARIS (defined(sun) && (defined(__svr4__) || defined(__SVR4))) @@ -385,7 +385,7 @@ int iplattach() SPL_NET(s); if (fr_running || (fr_checkp == fr_check)) { - printf("IP Filter: already initialized\n"); + kprintf("IP Filter: already initialized\n"); SPL_X(s); return EBUSY; } @@ -495,7 +495,7 @@ pfil_error: else defpass = "no-match -> block"; - printf("%s initialized. Default = %s all, Logging = %s\n", + kprintf("%s initialized. Default = %s all, Logging = %s\n", ipfilter_version, defpass, # ifdef IPFILTER_LOG "enabled"); @@ -572,12 +572,12 @@ int ipldetach() SPL_NET(s); if (!fr_running) { - printf("IP Filter: not initialized\n"); + kprintf("IP Filter: not initialized\n"); SPL_X(s); return 0; } - printf("%s unloaded\n", ipfilter_version); + kprintf("%s unloaded\n", ipfilter_version); fr_checkp = fr_savep; i = frflush(IPL_LOGIPF, 0, FR_INQUE|FR_OUTQUE|FR_INACTIVE); @@ -1622,7 +1622,7 @@ iplinit() if (iplattach() != 0) # endif { - printf("IP Filter failed to attach\n"); + kprintf("IP Filter failed to attach\n"); } ip_init(); } diff --git a/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c b/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c index f3b6807759..2d93384cbc 100644 --- a/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c +++ b/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c @@ -2,12 +2,16 @@ * Simple FTP transparent proxy for in-kernel use. For use with the NAT * code. * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c,v 1.17.2.6 2004/07/04 09:24:39 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c,v 1.6 2006/12/20 18:14:37 dillon Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_ftp_pxy.c,v 1.7 2006/12/23 00:27:02 swildner Exp $ */ #if SOLARIS && defined(_KERNEL) extern kmutex_t ipf_rw; #endif +#ifndef _KERNEL +#define kprintf printf +#endif + #define isdigit(x) ((x) >= '0' && (x) <= '9') #define isupper(x) (((unsigned)(x) >= 'A') && ((unsigned)(x) <= 'Z')) #define islower(x) (((unsigned)(x) >= 'a') && ((unsigned)(x) <= 'z')) @@ -912,7 +916,7 @@ int rv; ackoff = aps->aps_ackoff[!sel2]; } else { #if PROXY_DEBUG - printf("seqoff %d thseq %x ackmin %x\n", seqoff, thseq, + kprintf("seqoff %d thseq %x ackmin %x\n", seqoff, thseq, aps->aps_ackmin[sel]); #endif seqoff = aps->aps_ackoff[sel]; @@ -920,7 +924,7 @@ int rv; seqoff = aps->aps_ackoff[!sel]; #if PROXY_DEBUG - printf("ackoff %d thack %x seqmin %x\n", ackoff, thack, + kprintf("ackoff %d thack %x seqmin %x\n", ackoff, thack, aps->aps_seqmin[sel2]); #endif ackoff = aps->aps_seqoff[sel2]; @@ -933,12 +937,12 @@ int rv; } } #if PROXY_DEBUG - printf("%s: %x seq %x/%d ack %x/%d len %d\n", rv ? "IN" : "OUT", + kprintf("%s: %x seq %x/%d ack %x/%d len %d\n", rv ? "IN" : "OUT", tcp->th_flags, thseq, seqoff, thack, ackoff, mlen); - printf("sel %d seqmin %x/%x offset %d/%d\n", sel, + kprintf("sel %d seqmin %x/%x offset %d/%d\n", sel, aps->aps_seqmin[sel], aps->aps_seqmin[sel2], aps->aps_seqoff[sel], aps->aps_seqoff[sel2]); - printf("sel %d ackmin %x/%x offset %d/%d\n", sel2, + kprintf("sel %d ackmin %x/%x offset %d/%d\n", sel2, aps->aps_ackmin[sel], aps->aps_ackmin[sel2], aps->aps_ackoff[sel], aps->aps_ackoff[sel2]); #endif @@ -949,7 +953,7 @@ int rv; * apart from causing packets to go through here ordered). */ #if PROXY_DEBUG - printf("rv %d t:seq[0] %x seq[1] %x %d/%d\n", + kprintf("rv %d t:seq[0] %x seq[1] %x %d/%d\n", rv, t->ftps_seq[0], t->ftps_seq[1], seqoff, ackoff); #endif @@ -982,7 +986,7 @@ int rv; #if PROXY_DEBUG if (!ok) - printf("not ok\n"); + kprintf("not ok\n"); #endif if (!mlen) { @@ -996,7 +1000,7 @@ int rv; } #if PROXY_DEBUG - printf("f:seq[0] %x seq[1] %x\n", f->ftps_seq[0], f->ftps_seq[1]); + kprintf("f:seq[0] %x seq[1] %x\n", f->ftps_seq[0], f->ftps_seq[1]); #endif if (tcp->th_flags & TH_FIN) { if (thseq == f->ftps_seq[1]) { @@ -1004,7 +1008,7 @@ int rv; f->ftps_seq[1] = thseq + 1 - seqoff; } else { #if PROXY_DEBUG || (!defined(_KERNEL) && !defined(KERNEL)) - printf("FIN: thseq %x seqoff %d ftps_seq %x\n", + kprintf("FIN: thseq %x seqoff %d ftps_seq %x\n", thseq, seqoff, f->ftps_seq[0]); #endif return APR_ERR(1); @@ -1028,12 +1032,12 @@ int rv; if (ok == 0) { inc = thseq - f->ftps_seq[0]; #if PROXY_DEBUG || (!defined(_KERNEL) && !defined(KERNEL)) - printf("inc %d sel %d rv %d\n", inc, sel, rv); - printf("th_seq %x ftps_seq %x/%x\n", thseq, f->ftps_seq[0], + kprintf("inc %d sel %d rv %d\n", inc, sel, rv); + kprintf("th_seq %x ftps_seq %x/%x\n", thseq, f->ftps_seq[0], f->ftps_seq[1]); - printf("ackmin %x ackoff %d\n", (u_int)aps->aps_ackmin[sel], + kprintf("ackmin %x ackoff %d\n", (u_int)aps->aps_ackmin[sel], aps->aps_ackoff[sel]); - printf("seqmin %x seqoff %d\n", (u_int)aps->aps_seqmin[sel], + kprintf("seqmin %x seqoff %d\n", (u_int)aps->aps_seqmin[sel], aps->aps_seqoff[sel]); #endif @@ -1149,7 +1153,7 @@ int rv; # endif # endif mlen -= off; - printf("ftps_seq[1] = %x inc %d len %d\n", f->ftps_seq[1], inc, mlen); + kprintf("ftps_seq[1] = %x inc %d len %d\n", f->ftps_seq[1], inc, mlen); #endif f->ftps_rptr = rptr; diff --git a/sys/contrib/ipfilter/netinet/ip_nat.c b/sys/contrib/ipfilter/netinet/ip_nat.c index 2d725c7bad..ade6d54353 100644 --- a/sys/contrib/ipfilter/netinet/ip_nat.c +++ b/sys/contrib/ipfilter/netinet/ip_nat.c @@ -8,7 +8,7 @@ * @(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed * @(#)$Id: ip_nat.c,v 2.37.2.70 2002/08/28 12:45:48 darrenr Exp $ * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_nat.c,v 1.22.2.8 2004/07/04 09:24:39 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_nat.c,v 1.11 2005/06/05 12:17:46 corecode Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_nat.c,v 1.12 2006/12/23 00:27:02 swildner Exp $ */ #if (defined(__DragonFly__) || defined(__FreeBSD__)) && defined(KERNEL) && !defined(_KERNEL) #define _KERNEL @@ -115,6 +115,10 @@ extern struct ifnet vpnif; #undef SOCKADDR_IN #define SOCKADDR_IN struct sockaddr_in +#ifndef _KERNEL +# define kprintf printf +#endif + static const char sccsid[] = "@(#)ip_nat.c 1.11 6/5/96 (C) 1995 Darren Reed"; nat_t **nat_table[2] = { NULL, NULL }, @@ -1198,7 +1202,7 @@ int direction; */ if (ipf_nattable_max > ipf_nattable_sz) { ipf_nattable_max = nat_stats.ns_inuse - 100; - printf("ipf_nattable_max reduced to %d\n", + kprintf("ipf_nattable_max reduced to %d\n", ipf_nattable_max); } return NULL; diff --git a/sys/contrib/ipfilter/netinet/ip_proxy.c b/sys/contrib/ipfilter/netinet/ip_proxy.c index 0aec1979b3..9a1e14f7cd 100644 --- a/sys/contrib/ipfilter/netinet/ip_proxy.c +++ b/sys/contrib/ipfilter/netinet/ip_proxy.c @@ -5,7 +5,7 @@ * * @(#)$Id: ip_proxy.c,v 2.9.2.24 2002/08/28 12:45:51 darrenr Exp $ * $FreeBSD: src/sys/contrib/ipfilter/netinet/ip_proxy.c,v 1.11.2.5 2003/03/01 03:55:54 darrenr Exp $ - * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_proxy.c,v 1.8 2006/12/20 18:14:37 dillon Exp $ + * $DragonFly: src/sys/contrib/ipfilter/netinet/ip_proxy.c,v 1.9 2006/12/23 00:27:02 swildner Exp $ */ #if (defined(__DragonFly__) || defined(__FreeBSD__)) && defined(KERNEL) && !defined(_KERNEL) # define _KERNEL @@ -84,6 +84,7 @@ extern KRWLOCK_T ipf_nat, ipf_state; #ifndef _KERNEL #define ksprintf sprintf +#define kprintf printf #endif static int appr_fixseqack (fr_info_t *, ip_t *, ap_session_t *, int ); @@ -316,7 +317,7 @@ nat_t *nat; #endif if (sum != tcp->th_sum) { #if PROXY_DEBUG || (!defined(_KERNEL) && !defined(KERNEL)) - printf("proxy tcp checksum failure\n"); + kprintf("proxy tcp checksum failure\n"); #endif frstats[fin->fin_out].fr_tcpbad++; return -1; @@ -343,13 +344,13 @@ nat_t *nat; rv = APR_EXIT(err); if (rv == 1) { #if PROXY_DEBUG || (!defined(_KERNEL) && !defined(KERNEL)) - printf("proxy says bad packet received\n"); + kprintf("proxy says bad packet received\n"); #endif return -1; } if (rv == 2) { #if PROXY_DEBUG || (!defined(_KERNEL) && !defined(KERNEL)) - printf("proxy says free app proxy data\n"); + kprintf("proxy says free app proxy data\n"); #endif appr_free(apr); nat->nat_aps = NULL; @@ -464,7 +465,7 @@ int inc; if ((aps->aps_seqmin[!sel] > aps->aps_seqmin[sel]) && (seq1 > aps->aps_seqmin[!sel])) { #if PROXY_DEBUG - printf("proxy out switch set seq %d -> %d %x > %x\n", + kprintf("proxy out switch set seq %d -> %d %x > %x\n", sel, !sel, seq1, aps->aps_seqmin[!sel]); #endif sel = aps->aps_sel[out] = !sel; @@ -484,7 +485,7 @@ int inc; aps->aps_seqmin[sel] = seq1 + nlen - 1; aps->aps_seqoff[sel] = aps->aps_seqoff[sel] + inc; #if PROXY_DEBUG - printf("proxy seq set %d at %x to %d + %d\n", sel, + kprintf("proxy seq set %d at %x to %d + %d\n", sel, aps->aps_seqmin[sel], aps->aps_seqoff[sel], inc); #endif @@ -499,7 +500,7 @@ int inc; if ((aps->aps_ackmin[!sel] > aps->aps_ackmin[sel]) && (seq1 > aps->aps_ackmin[!sel])) { #if PROXY_DEBUG - printf("proxy out switch set ack %d -> %d %x > %x\n", + kprintf("proxy out switch set ack %d -> %d %x > %x\n", sel, !sel, seq1, aps->aps_ackmin[!sel]); #endif sel = aps->aps_sel[1 - out] = !sel; @@ -518,7 +519,7 @@ int inc; if ((aps->aps_ackmin[!sel] > aps->aps_ackmin[sel]) && (seq1 > aps->aps_ackmin[!sel])) { #if PROXY_DEBUG - printf("proxy in switch set ack %d -> %d %x > %x\n", + kprintf("proxy in switch set ack %d -> %d %x > %x\n", sel, !sel, seq1, aps->aps_ackmin[!sel]); #endif sel = aps->aps_sel[out] = !sel; @@ -538,7 +539,7 @@ int inc; aps->aps_ackmin[!sel] = seq1 + nlen - 1; aps->aps_ackoff[!sel] = aps->aps_ackoff[sel] + inc; #if PROXY_DEBUG - printf("proxy ack set %d at %x to %d + %d\n", !sel, + kprintf("proxy ack set %d at %x to %d + %d\n", !sel, aps->aps_seqmin[!sel], aps->aps_seqoff[sel], inc); #endif @@ -553,7 +554,7 @@ int inc; if ((aps->aps_seqmin[!sel] > aps->aps_seqmin[sel]) && (seq1 > aps->aps_seqmin[!sel])) { #if PROXY_DEBUG - printf("proxy in switch set seq %d -> %d %x > %x\n", + kprintf("proxy in switch set seq %d -> %d %x > %x\n", sel, !sel, seq1, aps->aps_seqmin[!sel]); #endif sel = aps->aps_sel[1 - out] = !sel; @@ -561,7 +562,7 @@ int inc; if (aps->aps_seqoff[sel] != 0) { #if PROXY_DEBUG - printf("sel %d seqoff %d seq1 %x seqmin %x\n", sel, + kprintf("sel %d seqoff %d seq1 %x seqmin %x\n", sel, aps->aps_seqoff[sel], seq1, aps->aps_seqmin[sel]); #endif @@ -573,7 +574,7 @@ int inc; } } #if PROXY_DEBUG - printf("appr_fixseqack: seq %x ack %x\n", ntohl(tcp->th_seq), + kprintf("appr_fixseqack: seq %x ack %x\n", ntohl(tcp->th_seq), ntohl(tcp->th_ack)); #endif return ch ? 2 : 0; diff --git a/sys/cpu/i386/misc/elf_machdep.c b/sys/cpu/i386/misc/elf_machdep.c index 576ab6b48c..795fe11d0c 100644 --- a/sys/cpu/i386/misc/elf_machdep.c +++ b/sys/cpu/i386/misc/elf_machdep.c @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/elf_machdep.c,v 1.8 1999/12/21 11:14:02 eivind Exp $ - * $DragonFly: src/sys/cpu/i386/misc/elf_machdep.c,v 1.3 2003/07/18 05:12:37 dillon Exp $ + * $DragonFly: src/sys/cpu/i386/misc/elf_machdep.c,v 1.4 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -93,7 +93,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym) * There shouldn't be copy relocations in kernel * objects. */ - printf("kldload: unexpected R_COPY relocation\n"); + kprintf("kldload: unexpected R_COPY relocation\n"); return -1; break; @@ -114,7 +114,7 @@ elf_reloc(linker_file_t lf, const void *data, int type, const char *sym) break; default: - printf("kldload: unexpected relocation type %d\n", + kprintf("kldload: unexpected relocation type %d\n", rtype); return -1; } diff --git a/sys/ddb/db_aout.c b/sys/ddb/db_aout.c index ba634149b3..167f276467 100644 --- a/sys/ddb/db_aout.c +++ b/sys/ddb/db_aout.c @@ -24,7 +24,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/ddb/db_aout.c,v 1.27 1999/08/28 00:41:05 peter Exp $ - * $DragonFly: src/sys/ddb/db_aout.c,v 1.6 2005/12/23 21:35:44 swildner Exp $ + * $DragonFly: src/sys/ddb/db_aout.c,v 1.7 2006/12/23 00:27:02 swildner Exp $ */ /* @@ -86,7 +86,7 @@ X_db_sym_init(int *symtab, char *esymtab, char *name) int strlen; if (*symtab < 4) { - printf ("DDB: no symbols\n"); + kprintf ("DDB: no symbols\n"); return; } diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c index 864170637f..7e54e5e731 100644 --- a/sys/ddb/db_ps.c +++ b/sys/ddb/db_ps.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/ddb/db_ps.c,v 1.20 1999/08/28 00:41:09 peter Exp $ - * $DragonFly: src/sys/ddb/db_ps.c,v 1.19 2006/09/19 11:47:35 corecode Exp $ + * $DragonFly: src/sys/ddb/db_ps.c,v 1.20 2006/12/23 00:27:02 swildner Exp $ */ #include #include @@ -67,7 +67,7 @@ db_ps(db_expr_t dummy1, boolean_t dummy2, db_expr_t dummy3, char *dummy4) if (db_more(&nl) < 0) return; if (p == NULL) { - printf("oops, ran out of processes early!\n"); + kprintf("oops, ran out of processes early!\n"); break; } pp = p->p_pptr; diff --git a/sys/ddb/db_sym.c b/sys/ddb/db_sym.c index d19e637e0e..9a9c242856 100644 --- a/sys/ddb/db_sym.c +++ b/sys/ddb/db_sym.c @@ -24,7 +24,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/ddb/db_sym.c,v 1.32 1999/08/28 00:41:10 peter Exp $ - * $DragonFly: src/sys/ddb/db_sym.c,v 1.6 2006/12/20 18:14:37 dillon Exp $ + * $DragonFly: src/sys/ddb/db_sym.c,v 1.7 2006/12/23 00:27:02 swildner Exp $ */ /* @@ -62,7 +62,7 @@ void db_add_symbol_table(char *start, char *end, char *name, char *ref) { if (db_nsymtab >= MAXNOSYMTABS) { - printf ("No slots left for %s symbol table", name); + kprintf ("No slots left for %s symbol table", name); panic ("db_sym.c: db_add_symbol_table"); } diff --git a/sys/emulation/linux/i386/imgact_linux.c b/sys/emulation/linux/i386/imgact_linux.c index 96cc10f9ef..48d88ca5ad 100644 --- a/sys/emulation/linux/i386/imgact_linux.c +++ b/sys/emulation/linux/i386/imgact_linux.c @@ -29,7 +29,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/linux/imgact_linux.c,v 1.35.2.2 2001/11/03 01:41:08 ps Exp $ - * $DragonFly: src/sys/emulation/linux/i386/imgact_linux.c,v 1.8 2006/09/11 20:25:00 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/imgact_linux.c,v 1.9 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -86,7 +86,7 @@ exec_linux_imgact(struct image_params *imgp) } bss_size = round_page(a_out->a_bss); #ifdef DEBUG - printf("imgact: text: %08lx, data: %08lx, bss: %08lx\n", + kprintf("imgact: text: %08lx, data: %08lx, bss: %08lx\n", (u_long)a_out->a_text, (u_long)a_out->a_data, bss_size); #endif @@ -121,7 +121,7 @@ exec_linux_imgact(struct image_params *imgp) */ if (file_offset & PAGE_MASK) { #ifdef DEBUG - printf("imgact: Non page aligned binary %lu\n", file_offset); + kprintf("imgact: Non page aligned binary %lu\n", file_offset); #endif /* * Map text+data+bss read/write/execute @@ -163,7 +163,7 @@ exec_linux_imgact(struct image_params *imgp) } else { #ifdef DEBUG - printf("imgact: Page aligned binary %lu\n", file_offset); + kprintf("imgact: Page aligned binary %lu\n", file_offset); #endif /* * Map text+data read/execute @@ -179,7 +179,7 @@ exec_linux_imgact(struct image_params *imgp) return (error); #ifdef DEBUG - printf("imgact: startaddr=%08lx, length=%08lx\n", + kprintf("imgact: startaddr=%08lx, length=%08lx\n", (u_long)vmaddr, a_out->a_text + a_out->a_data); #endif /* @@ -206,7 +206,7 @@ exec_linux_imgact(struct image_params *imgp) if (error) return (error); #ifdef DEBUG - printf("imgact: bssaddr=%08lx, length=%08lx\n", + kprintf("imgact: bssaddr=%08lx, length=%08lx\n", (u_long)vmaddr, bss_size); #endif diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c b/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c index 450bdbffeb..0993847670 100644 --- a/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c +++ b/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c @@ -39,7 +39,7 @@ * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95 * * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_vfsops.c,v 1.2.2.3 2001/10/15 20:42:01 des Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c,v 1.13 2006/07/18 22:22:11 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vfsops.c,v 1.14 2006/12/23 00:27:02 swildner Exp $ */ /* @@ -79,7 +79,7 @@ linprocfs_mount(struct mount *mp, char *path, caddr_t data, struct ucred *cred) return (EOPNOTSUPP); if (mp->mnt_vfc->vfc_refcount == 1 && (error = at_exit(linprocfs_exit))) { - printf("linprocfs: cannot register linprocfs_exit with at_exit\n"); + kprintf("linprocfs: cannot register linprocfs_exit with at_exit\n"); return(error); } diff --git a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c index d7f0fe34cd..50e96e47fe 100644 --- a/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c +++ b/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c @@ -39,7 +39,7 @@ * @(#)procfs_vnops.c 8.18 (Berkeley) 5/21/95 * * $FreeBSD: src/sys/i386/linux/linprocfs/linprocfs_vnops.c,v 1.3.2.5 2001/08/12 14:29:19 rwatson Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.38 2006/12/20 18:14:41 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linprocfs/linprocfs_vnops.c,v 1.39 2006/12/23 00:27:02 swildner Exp $ */ /* @@ -376,7 +376,7 @@ linprocfs_print(struct vop_print_args *ap) { struct pfsnode *pfs = VTOPFS(ap->a_vp); - printf("tag VT_PROCFS, type %d, pid %ld, mode %x, flags %lx\n", + kprintf("tag VT_PROCFS, type %d, pid %ld, mode %x, flags %lx\n", pfs->pfs_type, (long)pfs->pfs_pid, pfs->pfs_mode, pfs->pfs_flags); return (0); } @@ -1043,7 +1043,7 @@ linprocfs_readlink(struct vop_readlink_args *ap) case Pexe: procp = PFIND(pfs->pfs_pid); if (procp == NULL || procp->p_ucred == NULL) { - printf("linprocfs_readlink: pid %d disappeared\n", + kprintf("linprocfs_readlink: pid %d disappeared\n", pfs->pfs_pid); return (uiomove("unknown", sizeof("unknown") - 1, ap->a_uio)); diff --git a/sys/emulation/linux/i386/linux_machdep.c b/sys/emulation/linux/i386/linux_machdep.c index 7cdcd00ed2..0868c482f7 100644 --- a/sys/emulation/linux/i386/linux_machdep.c +++ b/sys/emulation/linux/i386/linux_machdep.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/linux/linux_machdep.c,v 1.6.2.4 2001/11/05 19:08:23 marcel Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linux_machdep.c,v 1.18 2006/10/06 13:40:40 joerg Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linux_machdep.c,v 1.19 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -114,7 +114,7 @@ sys_linux_execve(struct linux_execve_args *args) return (error); #ifdef DEBUG if (ldebug(execve)) - printf(ARGS(execve, "%s"), path); + kprintf(ARGS(execve, "%s"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) { @@ -304,7 +304,7 @@ sys_linux_old_select(struct linux_old_select_args *args) #ifdef DEBUG if (ldebug(old_select)) - printf(ARGS(old_select, "%p"), args->ptr); + kprintf(ARGS(old_select, "%p"), args->ptr); #endif error = copyin((caddr_t)args->ptr, &linux_args, sizeof(linux_args)); @@ -329,7 +329,7 @@ sys_linux_fork(struct linux_fork_args *args) #ifdef DEBUG if (ldebug(fork)) - printf(ARGS(fork, "")); + kprintf(ARGS(fork, "")); #endif if ((error = sys_fork((struct fork_args *)args)) != 0) @@ -360,7 +360,7 @@ sys_linux_vfork(struct linux_vfork_args *args) #ifdef DEBUG if (ldebug(vfork)) - printf(ARGS(vfork, "")); + kprintf(ARGS(vfork, "")); #endif if ((error = sys_vfork((struct vfork_args *)args)) != 0) @@ -388,10 +388,10 @@ sys_linux_clone(struct linux_clone_args *args) #ifdef DEBUG if (ldebug(clone)) { - printf(ARGS(clone, "flags %x, stack %x"), + kprintf(ARGS(clone, "flags %x, stack %x"), (unsigned int)args->flags, (unsigned int)args->stack); if (args->flags & CLONE_PID) - printf(LMSG("CLONE_PID not yet supported")); + kprintf(LMSG("CLONE_PID not yet supported")); } #endif @@ -433,7 +433,7 @@ sys_linux_clone(struct linux_clone_args *args) #ifdef DEBUG if (ldebug(clone)) - printf(LMSG("clone: successful rfork to %ld"), + kprintf(LMSG("clone: successful rfork to %ld"), (long)p2->p_pid); #endif @@ -548,7 +548,7 @@ linux_mmap_common(caddr_t linux_addr, size_t linux_len, int linux_prot, #ifdef DEBUG if (ldebug(mmap) || ldebug(mmap2)) - printf("-> (%p, %d, %d, 0x%08x, %d, %lld)\n", + kprintf("-> (%p, %d, %d, 0x%08x, %d, %lld)\n", addr, len, prot, flags, fd, pos); #endif error = kern_mmap(curproc->p_vmspace, addr, len, @@ -571,7 +571,7 @@ sys_linux_mmap(struct linux_mmap_args *args) #ifdef DEBUG if (ldebug(mmap)) - printf(ARGS(mmap, "%p, %d, %d, 0x%08x, %d, %d"), + kprintf(ARGS(mmap, "%p, %d, %d, 0x%08x, %d, %d"), (void *)linux_args.addr, linux_args.len, linux_args.prot, linux_args.flags, linux_args.fd, linux_args.pos); #endif @@ -580,7 +580,7 @@ sys_linux_mmap(struct linux_mmap_args *args) linux_args.pos, &args->sysmsg_resultp); #ifdef DEBUG if (ldebug(mmap)) - printf("-> %p\n", args->sysmsg_resultp); + kprintf("-> %p\n", args->sysmsg_resultp); #endif return(error); } @@ -592,7 +592,7 @@ sys_linux_mmap2(struct linux_mmap2_args *args) #ifdef DEBUG if (ldebug(mmap2)) - printf(ARGS(mmap2, "%p, %d, %d, 0x%08x, %d, %d"), + kprintf(ARGS(mmap2, "%p, %d, %d, 0x%08x, %d, %d"), (void *)args->addr, args->len, args->prot, args->flags, args->fd, args->pgoff); #endif @@ -601,7 +601,7 @@ sys_linux_mmap2(struct linux_mmap2_args *args) &args->sysmsg_resultp); #ifdef DEBUG if (ldebug(mmap2)) - printf("-> %p\n", args->sysmsg_resultp); + kprintf("-> %p\n", args->sysmsg_resultp); #endif return (error); } @@ -615,7 +615,7 @@ sys_linux_pipe(struct linux_pipe_args *args) #ifdef DEBUG if (ldebug(pipe)) - printf(ARGS(pipe, "*")); + kprintf(ARGS(pipe, "*")); #endif reg_edx = args->sysmsg_fds[1]; @@ -754,7 +754,7 @@ sys_linux_sigaction(struct linux_sigaction_args *args) #ifdef DEBUG if (ldebug(sigaction)) - printf(ARGS(sigaction, "%d, %p, %p"), + kprintf(ARGS(sigaction, "%d, %p, %p"), args->sig, (void *)args->nsa, (void *)args->osa); #endif @@ -798,7 +798,7 @@ sys_linux_sigsuspend(struct linux_sigsuspend_args *args) #ifdef DEBUG if (ldebug(sigsuspend)) - printf(ARGS(sigsuspend, "%08lx"), (unsigned long)args->mask); + kprintf(ARGS(sigsuspend, "%08lx"), (unsigned long)args->mask); #endif LINUX_SIGEMPTYSET(mask); @@ -819,7 +819,7 @@ sys_linux_rt_sigsuspend(struct linux_rt_sigsuspend_args *uap) #ifdef DEBUG if (ldebug(rt_sigsuspend)) - printf(ARGS(rt_sigsuspend, "%p, %d"), + kprintf(ARGS(rt_sigsuspend, "%p, %d"), (void *)uap->newset, uap->sigsetsize); #endif @@ -847,7 +847,7 @@ sys_linux_pause(struct linux_pause_args *args) #ifdef DEBUG if (ldebug(pause)) - printf(ARGS(pause, "")); + kprintf(ARGS(pause, "")); #endif mask = p->p_sigmask; @@ -866,7 +866,7 @@ sys_linux_sigaltstack(struct linux_sigaltstack_args *uap) #ifdef DEBUG if (ldebug(sigaltstack)) - printf(ARGS(sigaltstack, "%p, %p"), uap->uss, uap->uoss); + kprintf(ARGS(sigaltstack, "%p, %p"), uap->uss, uap->uoss); #endif if (uap->uss) { diff --git a/sys/emulation/linux/i386/linux_ptrace.c b/sys/emulation/linux/i386/linux_ptrace.c index 94034f7a4a..66ea019357 100644 --- a/sys/emulation/linux/i386/linux_ptrace.c +++ b/sys/emulation/linux/i386/linux_ptrace.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/linux/linux_ptrace.c,v 1.7.4.3 2003/01/03 17:13:23 kan Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linux_ptrace.c,v 1.12 2006/11/07 20:48:12 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linux_ptrace.c,v 1.13 2006/12/23 00:27:02 swildner Exp $ */ #include "opt_cpu.h" @@ -354,7 +354,7 @@ sys_linux_ptrace(struct linux_ptrace_args *uap) if (sizeof(struct linux_pt_fpxreg) != sizeof(struct savexmm)) { static int once = 0; if (!once) { - printf("linux: savexmm != linux_pt_fpxreg\n"); + kprintf("linux: savexmm != linux_pt_fpxreg\n"); once = 1; } error = EIO; @@ -477,7 +477,7 @@ sys_linux_ptrace(struct linux_ptrace_args *uap) case PTRACE_SYSCALL: /* fall through */ default: - printf("linux: ptrace(%u, ...) not implemented\n", + kprintf("linux: ptrace(%u, ...) not implemented\n", (unsigned int)uap->req); error = EINVAL; break; diff --git a/sys/emulation/linux/i386/linux_sysvec.c b/sys/emulation/linux/i386/linux_sysvec.c index bf9e581b0f..f17de34670 100644 --- a/sys/emulation/linux/i386/linux_sysvec.c +++ b/sys/emulation/linux/i386/linux_sysvec.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/linux/linux_sysvec.c,v 1.55.2.9 2002/01/12 11:03:30 bde Exp $ - * $DragonFly: src/sys/emulation/linux/i386/linux_sysvec.c,v 1.23 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/i386/linux_sysvec.c,v 1.24 2006/12/23 00:27:02 swildner Exp $ */ /* XXX we use functions that might not exist. */ @@ -257,7 +257,7 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) #ifdef DEBUG if (ldebug(rt_sendsig)) - printf(ARGS(rt_sendsig, "%p, %d, %p, %lu"), + kprintf(ARGS(rt_sendsig, "%p, %d, %p, %lu"), catcher, sig, (void*)mask, code); #endif /* @@ -289,7 +289,7 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) SIGDELSET(p->p_sigmask, SIGILL); #ifdef DEBUG if (ldebug(rt_sendsig)) - printf(LMSG("rt_sendsig: bad stack %p, oonstack=%x"), + kprintf(LMSG("rt_sendsig: bad stack %p, oonstack=%x"), fp, oonstack); #endif ksignal(p, SIGILL); @@ -348,7 +348,7 @@ linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) #ifdef DEBUG if (ldebug(rt_sendsig)) - printf(LMSG("rt_sendsig flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x"), + kprintf(LMSG("rt_sendsig flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x"), frame.sf_sc.uc_stack.ss_flags, p->p_sigstk.ss_sp, p->p_sigstk.ss_size, frame.sf_sc.uc_mcontext.sc_mask); #endif @@ -408,7 +408,7 @@ linux_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) #ifdef DEBUG if (ldebug(sendsig)) - printf(ARGS(sendsig, "%p, %d, %p, %lu"), + kprintf(ARGS(sendsig, "%p, %d, %p, %lu"), catcher, sig, (void*)mask, code); #endif @@ -528,7 +528,7 @@ sys_linux_sigreturn(struct linux_sigreturn_args *args) #ifdef DEBUG if (ldebug(sigreturn)) - printf(ARGS(sigreturn, "%p"), (void *)args->sfp); + kprintf(ARGS(sigreturn, "%p"), (void *)args->sfp); #endif /* * The trampoline code hands us the sigframe. @@ -623,7 +623,7 @@ sys_linux_rt_sigreturn(struct linux_rt_sigreturn_args *args) #ifdef DEBUG if (ldebug(rt_sigreturn)) - printf(ARGS(rt_sigreturn, "%p"), (void *)args->ucp); + kprintf(ARGS(rt_sigreturn, "%p"), (void *)args->ucp); #endif /* * The trampoline code hands us the ucontext. @@ -699,7 +699,7 @@ sys_linux_rt_sigreturn(struct linux_rt_sigreturn_args *args) #ifdef DEBUG if (ldebug(rt_sigreturn)) - printf(LMSG("rt_sigret flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x"), + kprintf(LMSG("rt_sigret flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x"), ss.ss_flags, ss.ss_sp, ss.ss_size, context->sc_mask); #endif kern_sigaltstack(&ss, NULL); @@ -884,9 +884,9 @@ linux_elf_modevent(module_t mod, int type, void *data) error = EINVAL; if (error == 0) { if (bootverbose) - printf("Linux ELF exec handler installed\n"); + kprintf("Linux ELF exec handler installed\n"); } else - printf("cannot insert Linux ELF brand handler\n"); + kprintf("cannot insert Linux ELF brand handler\n"); break; case MOD_UNLOAD: for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; @@ -901,9 +901,9 @@ linux_elf_modevent(module_t mod, int type, void *data) } if (error == 0) { if (bootverbose) - printf("Linux ELF exec handler removed\n"); + kprintf("Linux ELF exec handler removed\n"); } else - printf("Could not deinstall ELF interpreter entry\n"); + kprintf("Could not deinstall ELF interpreter entry\n"); break; default: break; diff --git a/sys/emulation/linux/linux_file.c b/sys/emulation/linux/linux_file.c index aa034e8311..8ba7448eb3 100644 --- a/sys/emulation/linux/linux_file.c +++ b/sys/emulation/linux/linux_file.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_file.c,v 1.41.2.6 2003/01/06 09:19:43 fjoe Exp $ - * $DragonFly: src/sys/emulation/linux/linux_file.c,v 1.36 2006/09/05 00:55:44 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_file.c,v 1.37 2006/12/23 00:27:02 swildner Exp $ */ #include "opt_compat.h" @@ -70,7 +70,7 @@ sys_linux_creat(struct linux_creat_args *args) return (error); #ifdef DEBUG if (ldebug(creat)) - printf(ARGS(creat, "%s, %d"), path, args->mode); + kprintf(ARGS(creat, "%s, %d"), path, args->mode); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) { @@ -104,7 +104,7 @@ sys_linux_open(struct linux_open_args *args) #ifdef DEBUG if (ldebug(open)) - printf(ARGS(open, "%s, 0x%x, 0x%x"), path, args->flags, + kprintf(ARGS(open, "%s, 0x%x, 0x%x"), path, args->flags, args->mode); #endif flags = 0; @@ -151,7 +151,7 @@ sys_linux_open(struct linux_open_args *args) } #ifdef DEBUG if (ldebug(open)) - printf(LMSG("open returns error %d"), error); + kprintf(LMSG("open returns error %d"), error); #endif linux_free_path(&path); return error; @@ -164,7 +164,7 @@ sys_linux_lseek(struct linux_lseek_args *args) #ifdef DEBUG if (ldebug(lseek)) - printf(ARGS(lseek, "%d, %ld, %d"), + kprintf(ARGS(lseek, "%d, %ld, %d"), args->fdes, (long)args->off, args->whence); #endif error = kern_lseek(args->fdes, args->off, args->whence, @@ -181,7 +181,7 @@ sys_linux_llseek(struct linux_llseek_args *args) #ifdef DEBUG if (ldebug(llseek)) - printf(ARGS(llseek, "%d, %d:%d, %d"), + kprintf(ARGS(llseek, "%d, %d:%d, %d"), args->fd, args->ohigh, args->olow, args->whence); #endif off = (args->olow) | (((off_t) args->ohigh) << 32); @@ -445,7 +445,7 @@ sys_linux_getdents(struct linux_getdents_args *args) { #ifdef DEBUG if (ldebug(getdents)) - printf(ARGS(getdents, "%d, *, %d"), args->fd, args->count); + kprintf(ARGS(getdents, "%d, *, %d"), args->fd, args->count); #endif return (getdents_common((struct linux_getdents64_args*)args, 0)); } @@ -455,7 +455,7 @@ sys_linux_getdents64(struct linux_getdents64_args *args) { #ifdef DEBUG if (ldebug(getdents64)) - printf(ARGS(getdents64, "%d, *, %d"), args->fd, args->count); + kprintf(ARGS(getdents64, "%d, *, %d"), args->fd, args->count); #endif return (getdents_common(args, 1)); } @@ -476,7 +476,7 @@ sys_linux_access(struct linux_access_args *args) return (error); #ifdef DEBUG if (ldebug(access)) - printf(ARGS(access, "%s, %d"), path, args->flags); + kprintf(ARGS(access, "%s, %d"), path, args->flags); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) @@ -498,7 +498,7 @@ sys_linux_unlink(struct linux_unlink_args *args) return (error); #ifdef DEBUG if (ldebug(unlink)) - printf(ARGS(unlink, "%s"), path); + kprintf(ARGS(unlink, "%s"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); if (error == 0) @@ -520,7 +520,7 @@ sys_linux_chdir(struct linux_chdir_args *args) return (error); #ifdef DEBUG if (ldebug(chdir)) - printf(ARGS(chdir, "%s"), path); + kprintf(ARGS(chdir, "%s"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) { @@ -543,7 +543,7 @@ sys_linux_chmod(struct linux_chmod_args *args) return (error); #ifdef DEBUG if (ldebug(chmod)) - printf(ARGS(chmod, "%s, %d"), path, args->mode); + kprintf(ARGS(chmod, "%s, %d"), path, args->mode); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) @@ -565,7 +565,7 @@ sys_linux_mkdir(struct linux_mkdir_args *args) return (error); #ifdef DEBUG if (ldebug(mkdir)) - printf(ARGS(mkdir, "%s, %d"), path, args->mode); + kprintf(ARGS(mkdir, "%s, %d"), path, args->mode); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); if (error == 0) @@ -588,7 +588,7 @@ sys_linux_rmdir(struct linux_rmdir_args *args) return (error); #ifdef DEBUG if (ldebug(rmdir)) - printf(ARGS(rmdir, "%s"), path); + kprintf(ARGS(rmdir, "%s"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); if (error == 0) @@ -615,7 +615,7 @@ sys_linux_rename(struct linux_rename_args *args) } #ifdef DEBUG if (ldebug(rename)) - printf(ARGS(rename, "%s, %s"), from, to); + kprintf(ARGS(rename, "%s, %s"), from, to); #endif error = nlookup_init(&fromnd, from, UIO_SYSSPACE, 0); if (error == 0) { @@ -649,7 +649,7 @@ sys_linux_symlink(struct linux_symlink_args *args) } #ifdef DEBUG if (ldebug(symlink)) - printf(ARGS(symlink, "%s, %s"), path, link); + kprintf(ARGS(symlink, "%s, %s"), path, link); #endif error = nlookup_init(&nd, link, UIO_SYSSPACE, 0); if (error == 0) { @@ -674,7 +674,7 @@ sys_linux_readlink(struct linux_readlink_args *args) return (error); #ifdef DEBUG if (ldebug(readlink)) - printf(ARGS(readlink, "%s, %p, %d"), path, (void *)args->buf, + kprintf(ARGS(readlink, "%s, %p, %d"), path, (void *)args->buf, args->count); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); @@ -699,7 +699,7 @@ sys_linux_truncate(struct linux_truncate_args *args) return (error); #ifdef DEBUG if (ldebug(truncate)) - printf(ARGS(truncate, "%s, %ld"), path, + kprintf(ARGS(truncate, "%s, %ld"), path, (long)args->length); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); @@ -722,7 +722,7 @@ sys_linux_truncate64(struct linux_truncate64_args *args) return (error); #ifdef DEBUG if (ldebug(truncate64)) - printf(ARGS(truncate64, "%s, %lld"), path, + kprintf(ARGS(truncate64, "%s, %lld"), path, (off_t)args->length); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); @@ -740,7 +740,7 @@ sys_linux_ftruncate(struct linux_ftruncate_args *args) #ifdef DEBUG if (ldebug(ftruncate)) - printf(ARGS(ftruncate, "%d, %ld"), args->fd, + kprintf(ARGS(ftruncate, "%d, %ld"), args->fd, (long)args->length); #endif error = kern_ftruncate(args->fd, args->length); @@ -755,7 +755,7 @@ sys_linux_ftruncate64(struct linux_ftruncate64_args *args) #ifdef DEBUG if (ldebug(ftruncate)) - printf(ARGS(ftruncate64, "%d, %lld"), args->fd, + kprintf(ARGS(ftruncate64, "%d, %lld"), args->fd, (off_t)args->length); #endif error = kern_ftruncate(args->fd, args->length); @@ -780,7 +780,7 @@ sys_linux_link(struct linux_link_args *args) } #ifdef DEBUG if (ldebug(link)) - printf(ARGS(link, "%s, %s"), path, link); + kprintf(ARGS(link, "%s, %s"), path, link); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) { @@ -1123,7 +1123,7 @@ sys_linux_fcntl(struct linux_fcntl_args *args) #ifdef DEBUG if (ldebug(fcntl)) - printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd); + kprintf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd); #endif args64.fd = args->fd; @@ -1145,7 +1145,7 @@ sys_linux_fcntl64(struct linux_fcntl64_args *args) #ifdef DEBUG if (ldebug(fcntl64)) - printf(ARGS(fcntl64, "%d, %08x, *"), args->fd, args->cmd); + kprintf(ARGS(fcntl64, "%d, %08x, *"), args->fd, args->cmd); #endif if (args->cmd == LINUX_F_GETLK64 || args->cmd == LINUX_F_SETLK64 || args->cmd == LINUX_F_SETLKW64) { @@ -1194,7 +1194,7 @@ sys_linux_chown(struct linux_chown_args *args) return (error); #ifdef DEBUG if (ldebug(chown)) - printf(ARGS(chown, "%s, %d, %d"), path, args->uid, args->gid); + kprintf(ARGS(chown, "%s, %d, %d"), path, args->uid, args->gid); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) @@ -1216,7 +1216,7 @@ sys_linux_lchown(struct linux_lchown_args *args) return (error); #ifdef DEBUG if (ldebug(lchown)) - printf(ARGS(lchown, "%s, %d, %d"), path, args->uid, args->gid); + kprintf(ARGS(lchown, "%s, %d, %d"), path, args->uid, args->gid); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); if (error == 0) diff --git a/sys/emulation/linux/linux_getcwd.c b/sys/emulation/linux/linux_getcwd.c index fcd87c7890..f17a1bc710 100644 --- a/sys/emulation/linux/linux_getcwd.c +++ b/sys/emulation/linux/linux_getcwd.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/compat/linux/linux_getcwd.c,v 1.2.2.3 2001/11/05 19:08:22 marcel Exp $ */ -/* $DragonFly: src/sys/emulation/linux/linux_getcwd.c,v 1.22 2006/09/05 00:55:45 dillon Exp $ */ +/* $DragonFly: src/sys/emulation/linux/linux_getcwd.c,v 1.23 2006/12/23 00:27:02 swildner Exp $ */ /* $OpenBSD: linux_getcwd.c,v 1.2 2001/05/16 12:50:21 ho Exp $ */ /* $NetBSD: vfs_getcwd.c,v 1.3.2.3 1999/07/11 10:24:09 sommerfeld Exp $ */ @@ -77,7 +77,7 @@ sys_linux_getcwd(struct linux_getcwd_args *args) char *bp; #ifdef DEBUG - printf("Linux-emul(%d): getcwd(%p, %d)\n", + kprintf("Linux-emul(%d): getcwd(%p, %d)\n", (curthread->td_proc ? (int)curthread->td_proc->p_pid : -1), args->buf, args->bufsize); #endif diff --git a/sys/emulation/linux/linux_ioctl.c b/sys/emulation/linux/linux_ioctl.c index 3a6dd62e95..32123d3102 100644 --- a/sys/emulation/linux/linux_ioctl.c +++ b/sys/emulation/linux/linux_ioctl.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_ioctl.c,v 1.55.2.11 2003/05/01 20:16:09 anholt Exp $ - * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.21 2006/12/20 18:14:41 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_ioctl.c,v 1.22 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -162,14 +162,14 @@ bsd_to_linux_termios(struct termios *bios, struct linux_termios *lios) #ifdef DEBUG if (ldebug(ioctl)) { - printf("LINUX: BSD termios structure (input):\n"); - printf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d\n", + kprintf("LINUX: BSD termios structure (input):\n"); + kprintf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d\n", bios->c_iflag, bios->c_oflag, bios->c_cflag, bios->c_lflag, bios->c_ispeed, bios->c_ospeed); - printf("c_cc "); + kprintf("c_cc "); for (i=0; ic_cc[i]); - printf("\n"); + kprintf("%02x ", bios->c_cc[i]); + kprintf("\n"); } #endif @@ -284,14 +284,14 @@ bsd_to_linux_termios(struct termios *bios, struct linux_termios *lios) #ifdef DEBUG if (ldebug(ioctl)) { - printf("LINUX: LINUX termios structure (output):\n"); - printf("i=%08x o=%08x c=%08x l=%08x line=%d\n", + kprintf("LINUX: LINUX termios structure (output):\n"); + kprintf("i=%08x o=%08x c=%08x l=%08x line=%d\n", lios->c_iflag, lios->c_oflag, lios->c_cflag, lios->c_lflag, (int)lios->c_line); - printf("c_cc "); + kprintf("c_cc "); for (i=0; ic_cc[i]); - printf("\n"); + kprintf("%02x ", lios->c_cc[i]); + kprintf("\n"); } #endif } @@ -303,14 +303,14 @@ linux_to_bsd_termios(struct linux_termios *lios, struct termios *bios) #ifdef DEBUG if (ldebug(ioctl)) { - printf("LINUX: LINUX termios structure (input):\n"); - printf("i=%08x o=%08x c=%08x l=%08x line=%d\n", + kprintf("LINUX: LINUX termios structure (input):\n"); + kprintf("i=%08x o=%08x c=%08x l=%08x line=%d\n", lios->c_iflag, lios->c_oflag, lios->c_cflag, lios->c_lflag, (int)lios->c_line); - printf("c_cc "); + kprintf("c_cc "); for (i=0; ic_cc[i]); - printf("\n"); + kprintf("%02x ", lios->c_cc[i]); + kprintf("\n"); } #endif @@ -426,14 +426,14 @@ linux_to_bsd_termios(struct linux_termios *lios, struct termios *bios) #ifdef DEBUG if (ldebug(ioctl)) { - printf("LINUX: BSD termios structure (output):\n"); - printf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d\n", + kprintf("LINUX: BSD termios structure (output):\n"); + kprintf("i=%08x o=%08x c=%08x l=%08x ispeed=%d ospeed=%d\n", bios->c_iflag, bios->c_oflag, bios->c_cflag, bios->c_lflag, bios->c_ispeed, bios->c_ospeed); - printf("c_cc "); + kprintf("c_cc "); for (i=0; ic_cc[i]); - printf("\n"); + kprintf("%02x ", bios->c_cc[i]); + kprintf("\n"); } #endif } @@ -1129,7 +1129,7 @@ linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, s /* Save the original ifname */ bcopy(oifname, lifname, LINUX_IFNAMSIZ); #ifdef DEBUG - printf("%s(): ioctl %d on %.*s\n", __func__, + kprintf("%s(): ioctl %d on %.*s\n", __func__, (int)(cmd & 0xffff), LINUX_IFNAMSIZ, lifname); #endif /* Replace linux ifname with bsd ifname */ @@ -1140,7 +1140,7 @@ linux_ioctl_map_ifname(struct file *fp, u_long cmd, u_long ocmd, caddr_t data, s } #ifdef DEBUG - printf("%s(): %s translated to %s\n", __func__, + kprintf("%s(): %s translated to %s\n", __func__, lifname, oifname); #endif @@ -1286,7 +1286,7 @@ sys_linux_ioctl(struct linux_ioctl_args *args) { #ifdef DEBUG if (ldebug(ioctl)) - printf(ARGS(ioctl, "%d, %04x, *"), args->fd, args->cmd); + kprintf(ARGS(ioctl, "%d, %04x, *"), args->fd, args->cmd); #endif return (mapped_ioctl(args->fd, args->cmd, (caddr_t)args->arg, &linux_ioctl_map)); diff --git a/sys/emulation/linux/linux_misc.c b/sys/emulation/linux/linux_misc.c index b59187628e..89e1e8626b 100644 --- a/sys/emulation/linux/linux_misc.c +++ b/sys/emulation/linux/linux_misc.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_misc.c,v 1.85.2.9 2002/09/24 08:11:41 mdodd Exp $ - * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.31 2006/10/27 04:56:28 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_misc.c,v 1.32 2006/12/23 00:27:02 swildner Exp $ */ #include "opt_compat.h" @@ -170,7 +170,7 @@ sys_linux_alarm(struct linux_alarm_args *args) #ifdef DEBUG if (ldebug(alarm)) - printf(ARGS(alarm, "%u"), args->secs); + kprintf(ARGS(alarm, "%u"), args->secs); #endif if (args->secs > 100000000) @@ -214,7 +214,7 @@ sys_linux_brk(struct linux_brk_args *args) vm = p->p_vmspace; #ifdef DEBUG if (ldebug(brk)) - printf(ARGS(brk, "%p"), (void *)args->dsend); + kprintf(ARGS(brk, "%p"), (void *)args->dsend); #endif old = (vm_offset_t)vm->vm_daddr + ctob(vm->vm_dsize); new = (vm_offset_t)args->dsend; @@ -254,7 +254,7 @@ sys_linux_uselib(struct linux_uselib_args *args) return (error); #ifdef DEBUG if (ldebug(uselib)) - printf(ARGS(uselib, "%s"), path); + kprintf(ARGS(uselib, "%s"), path); #endif a_out = NULL; @@ -375,7 +375,7 @@ sys_linux_uselib(struct linux_uselib_args *args) */ if (file_offset & PAGE_MASK) { #ifdef DEBUG - printf("uselib: Non page aligned binary %lu\n", file_offset); + kprintf("uselib: Non page aligned binary %lu\n", file_offset); #endif /* Map text+data read/write/execute */ @@ -412,7 +412,7 @@ sys_linux_uselib(struct linux_uselib_args *args) goto cleanup; } else { #ifdef DEBUG - printf("uselib: Page aligned binary %lu\n", file_offset); + kprintf("uselib: Page aligned binary %lu\n", file_offset); #endif /* * for QMAGIC, a_entry is 20 bytes beyond the load address @@ -431,7 +431,7 @@ sys_linux_uselib(struct linux_uselib_args *args) goto cleanup; } #ifdef DEBUG - printf("mem=%08lx = %08lx %08lx\n", (long)vmaddr, ((long*)vmaddr)[0], + kprintf("mem=%08lx = %08lx %08lx\n", (long)vmaddr, ((long*)vmaddr)[0], ((long*)vmaddr)[1]); #endif if (bss_size != 0) { @@ -477,7 +477,7 @@ sys_linux_select(struct linux_select_args *args) #ifdef DEBUG if (ldebug(select)) - printf(ARGS(select, "%d, %p, %p, %p, %p"), args->nfds, + kprintf(ARGS(select, "%d, %p, %p, %p, %p"), args->nfds, (void *)args->readfds, (void *)args->writefds, (void *)args->exceptfds, (void *)args->timeout); #endif @@ -500,7 +500,7 @@ sys_linux_select(struct linux_select_args *args) goto select_out; #ifdef DEBUG if (ldebug(select)) - printf(LMSG("incoming timeout (%ld/%ld)"), + kprintf(LMSG("incoming timeout (%ld/%ld)"), utv.tv_sec, utv.tv_usec); #endif @@ -530,7 +530,7 @@ sys_linux_select(struct linux_select_args *args) args->sysmsg_result = bsa.sysmsg_result; #ifdef DEBUG if (ldebug(select)) - printf(LMSG("real select returns %d"), error); + kprintf(LMSG("real select returns %d"), error); #endif if (error) { /* @@ -559,7 +559,7 @@ sys_linux_select(struct linux_select_args *args) timevalclear(&utv); #ifdef DEBUG if (ldebug(select)) - printf(LMSG("outgoing timeout (%ld/%ld)"), + kprintf(LMSG("outgoing timeout (%ld/%ld)"), utv.tv_sec, utv.tv_usec); #endif if ((error = copyout(&utv, (caddr_t)args->timeout, @@ -570,7 +570,7 @@ sys_linux_select(struct linux_select_args *args) select_out: #ifdef DEBUG if (ldebug(select)) - printf(LMSG("select_out -> %d"), error); + kprintf(LMSG("select_out -> %d"), error); #endif return error; } @@ -583,7 +583,7 @@ sys_linux_mremap(struct linux_mremap_args *args) #ifdef DEBUG if (ldebug(mremap)) - printf(ARGS(mremap, "%p, %08lx, %08lx, %08lx"), + kprintf(ARGS(mremap, "%p, %08lx, %08lx, %08lx"), (void *)args->addr, (unsigned long)args->old_len, (unsigned long)args->new_len, @@ -637,7 +637,7 @@ sys_linux_time(struct linux_time_args *args) #ifdef DEBUG if (ldebug(time)) - printf(ARGS(time, "*")); + kprintf(ARGS(time, "*")); #endif microtime(&tv); @@ -672,7 +672,7 @@ sys_linux_times(struct linux_times_args *args) KKASSERT(p); #ifdef DEBUG if (ldebug(times)) - printf(ARGS(times, "*")); + kprintf(ARGS(times, "*")); #endif calcru(p, &ru.ru_utime, &ru.ru_stime, NULL); @@ -700,7 +700,7 @@ sys_linux_newuname(struct linux_newuname_args *args) #ifdef DEBUG if (ldebug(newuname)) - printf(ARGS(newuname, "*")); + kprintf(ARGS(newuname, "*")); #endif osname = linux_get_osname(td); @@ -737,7 +737,7 @@ sys_linux_utime(struct linux_utime_args *args) return (error); #ifdef DEBUG if (ldebug(utime)) - printf(ARGS(utime, "%s, *"), path); + kprintf(ARGS(utime, "%s, *"), path); #endif if (args->times) { @@ -768,7 +768,7 @@ sys_linux_waitpid(struct linux_waitpid_args *args) #ifdef DEBUG if (ldebug(waitpid)) - printf(ARGS(waitpid, "%d, %p, %d"), + kprintf(ARGS(waitpid, "%d, %p, %d"), args->pid, (void *)args->status, args->options); #endif options = args->options & (WNOHANG | WUNTRACED); @@ -805,7 +805,7 @@ sys_linux_wait4(struct linux_wait4_args *args) #ifdef DEBUG if (ldebug(wait4)) - printf(ARGS(wait4, "%d, %p, %d, %p"), + kprintf(ARGS(wait4, "%d, %p, %d, %p"), args->pid, (void *)args->status, args->options, (void *)args->rusage); #endif @@ -848,7 +848,7 @@ sys_linux_mknod(struct linux_mknod_args *args) return (error); #ifdef DEBUG if (ldebug(mknod)) - printf(ARGS(mknod, "%s, %d, %d"), + kprintf(ARGS(mknod, "%s, %d, %d"), path, args->mode, args->dev); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); @@ -873,7 +873,7 @@ sys_linux_personality(struct linux_personality_args *args) { #ifdef DEBUG if (ldebug(personality)) - printf(ARGS(personality, "%d"), args->per); + kprintf(ARGS(personality, "%d"), args->per); #endif if (args->per != 0) return EINVAL; @@ -895,7 +895,7 @@ sys_linux_setitimer(struct linux_setitimer_args *args) #ifdef DEBUG if (ldebug(setitimer)) - printf(ARGS(setitimer, "%p, %p"), + kprintf(ARGS(setitimer, "%p, %p"), (void *)args->itv, (void *)args->oitv); #endif bsa.which = args->which; @@ -907,9 +907,9 @@ sys_linux_setitimer(struct linux_setitimer_args *args) return error; #ifdef DEBUG if (ldebug(setitimer)) { - printf("setitimer: value: sec: %ld, usec: %ld\n", + kprintf("setitimer: value: sec: %ld, usec: %ld\n", foo.it_value.tv_sec, foo.it_value.tv_usec); - printf("setitimer: interval: sec: %ld, usec: %ld\n", + kprintf("setitimer: interval: sec: %ld, usec: %ld\n", foo.it_interval.tv_sec, foo.it_interval.tv_usec); } #endif @@ -926,7 +926,7 @@ sys_linux_getitimer(struct linux_getitimer_args *args) int error; #ifdef DEBUG if (ldebug(getitimer)) - printf(ARGS(getitimer, "%p"), (void *)args->itv); + kprintf(ARGS(getitimer, "%p"), (void *)args->itv); #endif bsa.which = args->which; bsa.itv = (struct itimerval *)args->itv; @@ -1057,7 +1057,7 @@ sys_linux_setrlimit(struct linux_setrlimit_args *args) #ifdef DEBUG if (ldebug(setrlimit)) - printf(ARGS(setrlimit, "%d, %p"), + kprintf(ARGS(setrlimit, "%d, %p"), args->resource, (void *)args->rlim); #endif if (args->resource >= LINUX_RLIM_NLIMITS) @@ -1087,7 +1087,7 @@ sys_linux_old_getrlimit(struct linux_old_getrlimit_args *args) #ifdef DEBUG if (ldebug(old_getrlimit)) - printf(ARGS(old_getrlimit, "%d, %p"), + kprintf(ARGS(old_getrlimit, "%d, %p"), args->resource, (void *)args->rlim); #endif if (args->resource >= LINUX_RLIM_NLIMITS) @@ -1120,7 +1120,7 @@ sys_linux_getrlimit(struct linux_getrlimit_args *args) #ifdef DEBUG if (ldebug(getrlimit)) - printf(ARGS(getrlimit, "%d, %p"), + kprintf(ARGS(getrlimit, "%d, %p"), args->resource, (void *)args->rlim); #endif if (args->resource >= LINUX_RLIM_NLIMITS) @@ -1147,7 +1147,7 @@ sys_linux_sched_setscheduler(struct linux_sched_setscheduler_args *args) #ifdef DEBUG if (ldebug(sched_setscheduler)) - printf(ARGS(sched_setscheduler, "%d, %d, %p"), + kprintf(ARGS(sched_setscheduler, "%d, %d, %p"), args->pid, args->policy, (const void *)args->param); #endif @@ -1182,7 +1182,7 @@ sys_linux_sched_getscheduler(struct linux_sched_getscheduler_args *args) #ifdef DEBUG if (ldebug(sched_getscheduler)) - printf(ARGS(sched_getscheduler, "%d"), args->pid); + kprintf(ARGS(sched_getscheduler, "%d"), args->pid); #endif bsd.sysmsg_result = 0; @@ -1212,7 +1212,7 @@ sys_linux_sched_get_priority_max(struct linux_sched_get_priority_max_args *args) #ifdef DEBUG if (ldebug(sched_get_priority_max)) - printf(ARGS(sched_get_priority_max, "%d"), args->policy); + kprintf(ARGS(sched_get_priority_max, "%d"), args->policy); #endif switch (args->policy) { @@ -1243,7 +1243,7 @@ sys_linux_sched_get_priority_min(struct linux_sched_get_priority_min_args *args) #ifdef DEBUG if (ldebug(sched_get_priority_min)) - printf(ARGS(sched_get_priority_min, "%d"), args->policy); + kprintf(ARGS(sched_get_priority_min, "%d"), args->policy); #endif switch (args->policy) { @@ -1278,7 +1278,7 @@ sys_linux_reboot(struct linux_reboot_args *args) #ifdef DEBUG if (ldebug(reboot)) - printf(ARGS(reboot, "0x%x"), args->cmd); + kprintf(ARGS(reboot, "0x%x"), args->cmd); #endif if (args->cmd == REBOOT_CAD_ON || args->cmd == REBOOT_CAD_OFF) return (0); diff --git a/sys/emulation/linux/linux_signal.c b/sys/emulation/linux/linux_signal.c index cd1e903a55..e9dcb6f8e3 100644 --- a/sys/emulation/linux/linux_signal.c +++ b/sys/emulation/linux/linux_signal.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_signal.c,v 1.23.2.3 2001/11/05 19:08:23 marcel Exp $ - * $DragonFly: src/sys/emulation/linux/linux_signal.c,v 1.11 2006/06/05 07:26:09 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_signal.c,v 1.12 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -132,7 +132,7 @@ sys_linux_signal(struct linux_signal_args *args) #ifdef DEBUG if (ldebug(signal)) - printf(ARGS(signal, "%d, %p"), + kprintf(ARGS(signal, "%d, %p"), args->sig, (void *)args->handler); #endif linux_nsa.lsa_handler = args->handler; @@ -161,7 +161,7 @@ sys_linux_rt_sigaction(struct linux_rt_sigaction_args *args) #ifdef DEBUG if (ldebug(rt_sigaction)) - printf(ARGS(rt_sigaction, "%ld, %p, %p, %ld"), + kprintf(ARGS(rt_sigaction, "%ld, %p, %p, %ld"), (long)args->sig, (void *)args->act, (void *)args->oact, (long)args->sigsetsize); #endif @@ -216,7 +216,7 @@ sys_linux_sigprocmask(struct linux_sigprocmask_args *args) #ifdef DEBUG if (ldebug(sigprocmask)) - printf(ARGS(sigprocmask, "%d, *, *"), args->how); + kprintf(ARGS(sigprocmask, "%d, *, *"), args->how); #endif if (args->mask) { @@ -249,7 +249,7 @@ sys_linux_rt_sigprocmask(struct linux_rt_sigprocmask_args *args) #ifdef DEBUG if (ldebug(rt_sigprocmask)) - printf(ARGS(rt_sigprocmask, "%d, %p, %p, %ld"), + kprintf(ARGS(rt_sigprocmask, "%d, %p, %p, %ld"), args->how, (void *)args->mask, (void *)args->omask, (long)args->sigsetsize); #endif @@ -284,7 +284,7 @@ sys_linux_sgetmask(struct linux_sgetmask_args *args) #ifdef DEBUG if (ldebug(sgetmask)) - printf(ARGS(sgetmask, "")); + kprintf(ARGS(sgetmask, "")); #endif bsd_to_linux_sigset(&p->p_sigmask, &mask); @@ -301,7 +301,7 @@ sys_linux_ssetmask(struct linux_ssetmask_args *args) #ifdef DEBUG if (ldebug(ssetmask)) - printf(ARGS(ssetmask, "%08lx"), (unsigned long)args->mask); + kprintf(ARGS(ssetmask, "%08lx"), (unsigned long)args->mask); #endif bsd_to_linux_sigset(&p->p_sigmask, &lset); @@ -326,7 +326,7 @@ sys_linux_sigpending(struct linux_sigpending_args *args) #ifdef DEBUG if (ldebug(sigpending)) - printf(ARGS(sigpending, "*")); + kprintf(ARGS(sigpending, "*")); #endif error = kern_sigpending(&set); @@ -347,7 +347,7 @@ sys_linux_kill(struct linux_kill_args *args) #ifdef DEBUG if (ldebug(kill)) - printf(ARGS(kill, "%d, %d"), args->pid, args->signum); + kprintf(ARGS(kill, "%d, %d"), args->pid, args->signum); #endif /* diff --git a/sys/emulation/linux/linux_stats.c b/sys/emulation/linux/linux_stats.c index a6407a3c7c..d1ae4843c4 100644 --- a/sys/emulation/linux/linux_stats.c +++ b/sys/emulation/linux/linux_stats.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_stats.c,v 1.22.2.3 2001/11/05 19:08:23 marcel Exp $ - * $DragonFly: src/sys/emulation/linux/linux_stats.c,v 1.24 2006/10/27 04:56:28 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_stats.c,v 1.25 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -105,7 +105,7 @@ sys_linux_newstat(struct linux_newstat_args *args) return (error); #ifdef DEBUG if (ldebug(newstat)) - printf(ARGS(newstat, "%s, *"), path); + kprintf(ARGS(newstat, "%s, *"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) { @@ -131,7 +131,7 @@ sys_linux_newlstat(struct linux_newlstat_args *args) return (error); #ifdef DEBUG if (ldebug(newlstat)) - printf(ARGS(newlstat, "%s, *"), path); + kprintf(ARGS(newlstat, "%s, *"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); if (error == 0) { @@ -152,7 +152,7 @@ sys_linux_newfstat(struct linux_newfstat_args *args) #ifdef DEBUG if (ldebug(newfstat)) - printf(ARGS(newfstat, "%d, *"), args->fd); + kprintf(ARGS(newfstat, "%d, *"), args->fd); #endif error = kern_fstat(args->fd, &buf); @@ -243,7 +243,7 @@ sys_linux_statfs(struct linux_statfs_args *args) return (error); #ifdef DEBUG if (ldebug(statfs)) - printf(ARGS(statfs, "%s, *"), path); + kprintf(ARGS(statfs, "%s, *"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) @@ -271,7 +271,7 @@ sys_linux_fstatfs(struct linux_fstatfs_args *args) #ifdef DEBUG if (ldebug(fstatfs)) - printf(ARGS(fstatfs, "%d, *"), args->fd); + kprintf(ARGS(fstatfs, "%d, *"), args->fd); #endif if ((error = kern_fstatfs(args->fd, &statfs)) != 0) return (error); @@ -303,7 +303,7 @@ sys_linux_ustat(struct linux_ustat_args *args) #ifdef DEBUG if (ldebug(ustat)) - printf(ARGS(ustat, "%d, *"), args->dev); + kprintf(ARGS(ustat, "%d, *"), args->dev); #endif /* @@ -383,7 +383,7 @@ sys_linux_stat64(struct linux_stat64_args *args) return (error); #ifdef DEBUG if (ldebug(stat64)) - printf(ARGS(stat64, "%s, *"), path); + kprintf(ARGS(stat64, "%s, *"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); if (error == 0) { @@ -409,7 +409,7 @@ sys_linux_lstat64(struct linux_lstat64_args *args) return (error); #ifdef DEBUG if (ldebug(lstat64)) - printf(ARGS(lstat64, "%s, *"), path); + kprintf(ARGS(lstat64, "%s, *"), path); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); if (error == 0) { @@ -430,7 +430,7 @@ sys_linux_fstat64(struct linux_fstat64_args *args) #ifdef DEBUG if (ldebug(fstat64)) - printf(ARGS(fstat64, "%d, *"), args->fd); + kprintf(ARGS(fstat64, "%d, *"), args->fd); #endif error = kern_fstat(args->fd, &buf); diff --git a/sys/emulation/linux/linux_sysctl.c b/sys/emulation/linux/linux_sysctl.c index 46106f9dfc..d51edccf1f 100644 --- a/sys/emulation/linux/linux_sysctl.c +++ b/sys/emulation/linux/linux_sysctl.c @@ -26,7 +26,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_sysctl.c,v 1.2.2.1 2001/10/21 03:57:35 marcel Exp $ - * $DragonFly: src/sys/emulation/linux/linux_sysctl.c,v 1.8 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_sysctl.c,v 1.9 2006/12/23 00:27:02 swildner Exp $ */ #include "opt_compat.h" @@ -113,10 +113,10 @@ sys_linux_sysctl(struct linux_sysctl_args *args) break; } - printf("linux: sysctl: unhandled name="); + kprintf("linux: sysctl: unhandled name="); for (i = 0; i < la.nlen; i++) - printf("%c%d", (i) ? ',' : '{', mib[i]); - printf("}\n"); + kprintf("%c%d", (i) ? ',' : '{', mib[i]); + kprintf("}\n"); kfree(mib, M_TEMP); return (ENOTDIR); diff --git a/sys/emulation/linux/linux_uid16.c b/sys/emulation/linux/linux_uid16.c index f41d35c2bd..6cba97cfeb 100644 --- a/sys/emulation/linux/linux_uid16.c +++ b/sys/emulation/linux/linux_uid16.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/compat/linux/linux_uid16.c,v 1.4.2.1 2001/10/21 03:57:35 marcel Exp $ - * $DragonFly: src/sys/emulation/linux/linux_uid16.c,v 1.11 2006/06/05 07:26:09 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_uid16.c,v 1.12 2006/12/23 00:27:02 swildner Exp $ */ #include "opt_compat.h" @@ -60,7 +60,7 @@ sys_linux_chown16(struct linux_chown16_args *args) return (error); #ifdef DEBUG if (ldebug(chown16)) - printf(ARGS(chown16, "%s, %d, %d"), path, args->uid, + kprintf(ARGS(chown16, "%s, %d, %d"), path, args->uid, args->gid); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); @@ -85,7 +85,7 @@ sys_linux_lchown16(struct linux_lchown16_args *args) return (error); #ifdef DEBUG if (ldebug(lchown16)) - printf(ARGS(lchown16, "%s, %d, %d"), path, args->uid, + kprintf(ARGS(lchown16, "%s, %d, %d"), path, args->uid, args->gid); #endif error = nlookup_init(&nd, path, UIO_SYSSPACE, 0); @@ -109,7 +109,7 @@ sys_linux_setgroups16(struct linux_setgroups16_args *args) #ifdef DEBUG if (ldebug(setgroups16)) - printf(ARGS(setgroups16, "%d, *"), args->gidsetsize); + kprintf(ARGS(setgroups16, "%d, *"), args->gidsetsize); #endif ngrp = args->gidsetsize; @@ -163,7 +163,7 @@ sys_linux_getgroups16(struct linux_getgroups16_args *args) #ifdef DEBUG if (ldebug(getgroups16)) - printf(ARGS(getgroups16, "%d, *"), args->gidsetsize); + kprintf(ARGS(getgroups16, "%d, *"), args->gidsetsize); #endif cred = p->p_ucred; diff --git a/sys/emulation/linux/linux_util.h b/sys/emulation/linux/linux_util.h index e199c6ddec..901c3a4c5f 100644 --- a/sys/emulation/linux/linux_util.h +++ b/sys/emulation/linux/linux_util.h @@ -29,7 +29,7 @@ * from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp * from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp * $FreeBSD: src/sys/compat/linux/linux_util.h,v 1.12.2.2 2000/11/02 23:31:28 obrien Exp $ - * $DragonFly: src/sys/emulation/linux/linux_util.h,v 1.10 2006/09/05 03:48:11 dillon Exp $ + * $DragonFly: src/sys/emulation/linux/linux_util.h,v 1.11 2006/12/23 00:27:02 swildner Exp $ */ /* @@ -100,12 +100,12 @@ unsupported_msg(const char *fname) { struct thread *td = curthread; if (td->td_proc) { - printf( + kprintf( "linux: syscall %s is obsoleted or not implemented (pid=%d)\n", fname, (int)td->td_proc->p_pid ); } else { - printf( + kprintf( "linux: syscall %s is obsoleted or not implemented (td=%p)\n", fname, td ); diff --git a/sys/emulation/ndis/subr_hal.c b/sys/emulation/ndis/subr_hal.c index 3554b5b720..5c482668e7 100644 --- a/sys/emulation/ndis/subr_hal.c +++ b/sys/emulation/ndis/subr_hal.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/subr_hal.c,v 1.12 2004/04/19 22:39:04 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/subr_hal.c,v 1.3 2006/10/25 20:56:02 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_hal.c,v 1.4 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -296,7 +296,7 @@ hal_lower_irql(REGARGS1(uint8_t oldirql)) __stdcall static void dummy(void) { - printf ("hal dummy called...\n"); + kprintf ("hal dummy called...\n"); return; } diff --git a/sys/emulation/ndis/subr_ndis.c b/sys/emulation/ndis/subr_ndis.c index ec9abde9bb..0d8ac36944 100644 --- a/sys/emulation/ndis/subr_ndis.c +++ b/sys/emulation/ndis/subr_ndis.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.62 2004/07/11 00:19:30 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.18 2006/12/20 18:14:41 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_ndis.c,v 1.19 2006/12/23 00:27:02 swildner Exp $ */ /* @@ -1462,7 +1462,7 @@ ndis_free_packetpool(ndis_handle pool) if (head->np_private.npp_count == 0) kfree(pool, M_DEVBUF); else - printf("NDIS: buggy driver deleting active packet pool!\n"); + kprintf("NDIS: buggy driver deleting active packet pool!\n"); return; } @@ -1645,7 +1645,7 @@ ndis_free_bufpool(ndis_handle pool) if (head->nb_bytecount == 0) kfree(pool, M_DEVBUF); else - printf("NDIS: buggy driver deleting active buffer pool!\n"); + kprintf("NDIS: buggy driver deleting active buffer pool!\n"); return; } @@ -2299,7 +2299,7 @@ ndis_open_file(ndis_status *status, ndis_handle *filehandle, uint32_t *filelengt if (error) { *status = NDIS_STATUS_FILE_NOT_FOUND; kfree(fh, M_TEMP); - printf("NDIS: open file %s failed: %d\n", path, error); + kprintf("NDIS: open file %s failed: %d\n", path, error); goto done; } @@ -2590,7 +2590,7 @@ ndis_register_unload(ndis_handle handle, void *func) __stdcall static void dummy(void) { - printf ("NDIS dummy called...\n"); + kprintf ("NDIS dummy called...\n"); return; } diff --git a/sys/emulation/ndis/subr_ntoskrnl.c b/sys/emulation/ndis/subr_ntoskrnl.c index 10bd503e46..ceb2c0d84c 100644 --- a/sys/emulation/ndis/subr_ntoskrnl.c +++ b/sys/emulation/ndis/subr_ntoskrnl.c @@ -30,7 +30,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.40 2004/07/20 20:28:57 wpaul Exp $ - * $DragonFly: src/sys/emulation/ndis/subr_ntoskrnl.c,v 1.12 2006/12/20 18:14:41 dillon Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_ntoskrnl.c,v 1.13 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -1673,7 +1673,7 @@ ntoskrnl_read_timer(ktimer *timer) __stdcall static void dummy(void) { - printf ("ntoskrnl dummy called...\n"); + kprintf ("ntoskrnl dummy called...\n"); return; } diff --git a/sys/emulation/ndis/subr_pe.c b/sys/emulation/ndis/subr_pe.c index f32b15c3a0..ba78ddf171 100644 --- a/sys/emulation/ndis/subr_pe.c +++ b/sys/emulation/ndis/subr_pe.c @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $DragonFly: src/sys/emulation/ndis/subr_pe.c,v 1.2 2005/12/10 16:06:20 swildner Exp $ + * $DragonFly: src/sys/emulation/ndis/subr_pe.c,v 1.3 2006/12/23 00:27:02 swildner Exp $ * $FreeBSD: src/sys/compat/ndis/subr_pe.c,v 1.7 2004/01/13 22:49:45 obrien Exp $ */ @@ -58,6 +58,7 @@ #include #include #include +#define kprintf printf /* ndiscvt(8) uses this file */ #endif #include "regcall.h" @@ -387,7 +388,7 @@ pe_relocate(vm_offset_t imgbase) *sloc += (delta & 0xFFFF); break; default: - printf ("[%d]reloc type: %d\n",i, + kprintf ("[%d]reloc type: %d\n",i, IMR_RELTYPE(rel)); break; } @@ -537,7 +538,7 @@ pe_functbl_match(image_patch_table *functbl, char *name) return((vm_offset_t)p->ipt_func); p++; } - printf ("no match for %s\n", name); + kprintf ("no match for %s\n", name); return((vm_offset_t)p->ipt_func); } diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 10898b9fcb..5747e3566b 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.7 2003/06/03 00:09:02 sam Exp $ */ -/* $DragonFly: src/sys/opencrypto/crypto.c,v 1.13 2006/11/07 18:50:07 dillon Exp $ */ +/* $DragonFly: src/sys/opencrypto/crypto.c,v 1.14 2006/12/23 00:27:03 swildner Exp $ */ /* $OpenBSD: crypto.c,v 1.38 2002/06/11 11:14:29 beck Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) @@ -139,7 +139,7 @@ crypto_init(void) cryptodesc_zone = zinit("cryptodesc", sizeof (struct cryptodesc), 0, 0, 1); if (cryptodesc_zone == NULL || cryptop_zone == NULL) { - printf("crypto_init: cannot setup crypto zones\n"); + kprintf("crypto_init: cannot setup crypto zones\n"); return ENOMEM; } @@ -147,7 +147,7 @@ crypto_init(void) crypto_drivers = kmalloc(crypto_drivers_num * sizeof(struct cryptocap), M_CRYPTO_DATA, M_NOWAIT | M_ZERO); if (crypto_drivers == NULL) { - printf("crypto_init: cannot malloc driver table\n"); + kprintf("crypto_init: cannot malloc driver table\n"); return ENOMEM; } @@ -162,7 +162,7 @@ crypto_init(void) error = kthread_create((void (*)(void *)) cryptoret, NULL, &cryptothread, "cryptoret"); if (error) { - printf("crypto_init: cannot start cryptoret thread; error %d", + kprintf("crypto_init: cannot start cryptoret thread; error %d", error); crypto_destroy(); } @@ -190,7 +190,7 @@ crypto_modevent(module_t mod, int type, void *unused) case MOD_LOAD: error = crypto_init(); if (error == 0 && bootverbose) - printf("crypto: \n"); + kprintf("crypto: \n"); break; case MOD_UNLOAD: /*XXX disallow if active sessions */ @@ -353,7 +353,7 @@ crypto_get_driverid(u_int32_t flags) /* Be careful about wrap-around. */ if (2 * crypto_drivers_num <= crypto_drivers_num) { crit_exit(); - printf("crypto: driver count wraparound!\n"); + kprintf("crypto: driver count wraparound!\n"); return -1; } @@ -361,7 +361,7 @@ crypto_get_driverid(u_int32_t flags) sizeof(struct cryptocap), M_CRYPTO_DATA, M_NOWAIT|M_ZERO); if (newdrv == NULL) { crit_exit(); - printf("crypto: no space to expand driver table!\n"); + kprintf("crypto: no space to expand driver table!\n"); return -1; } @@ -378,7 +378,7 @@ crypto_get_driverid(u_int32_t flags) crypto_drivers[i].cc_sessions = 1; /* Mark */ crypto_drivers[i].cc_flags = flags; if (bootverbose) - printf("crypto: assign driver %u, flags %u\n", i, flags); + kprintf("crypto: assign driver %u, flags %u\n", i, flags); crit_exit(); @@ -418,7 +418,7 @@ crypto_kregister(u_int32_t driverid, int kalg, u_int32_t flags, cap->cc_kalg[kalg] = flags | CRYPTO_ALG_FLAG_SUPPORTED; if (bootverbose) - printf("crypto: driver %u registers key alg %u flags %u\n" + kprintf("crypto: driver %u registers key alg %u flags %u\n" , driverid , kalg , flags @@ -466,7 +466,7 @@ crypto_register(u_int32_t driverid, int alg, u_int16_t maxoplen, cap->cc_alg[alg] = flags | CRYPTO_ALG_FLAG_SUPPORTED; cap->cc_max_op_len[alg] = maxoplen; if (bootverbose) - printf("crypto: driver %u registers alg %u flags %u maxoplen %u\n" + kprintf("crypto: driver %u registers alg %u flags %u maxoplen %u\n" , driverid , alg , flags diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index 10a5ec998e..47ce023873 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $ */ -/* $DragonFly: src/sys/opencrypto/cryptodev.c,v 1.20 2006/09/05 00:55:49 dillon Exp $ */ +/* $DragonFly: src/sys/opencrypto/cryptodev.c,v 1.21 2006/12/23 00:27:03 swildner Exp $ */ /* $OpenBSD: cryptodev.c,v 1.52 2002/06/19 07:22:46 deraadt Exp $ */ /* @@ -784,7 +784,7 @@ cryptodev_modevent(module_t mod, int type, void *unused) switch (type) { case MOD_LOAD: if (bootverbose) - printf("crypto: \n"); + kprintf("crypto: \n"); dev_ops_add(&crypto_ops, 0, 0); make_dev(&crypto_ops, 0, UID_ROOT, GID_WHEEL, 0666, "crypto"); diff --git a/sys/platform/pc32/acpica5/acpi_machdep.c b/sys/platform/pc32/acpica5/acpi_machdep.c index 168485e6bf..6703fc515f 100644 --- a/sys/platform/pc32/acpica5/acpi_machdep.c +++ b/sys/platform/pc32/acpica5/acpi_machdep.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/acpica/acpi_machdep.c,v 1.20 2004/05/05 19:51:15 njl Exp $ - * $DragonFly: src/sys/platform/pc32/acpica5/acpi_machdep.c,v 1.11 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/acpica5/acpi_machdep.c,v 1.12 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -298,7 +298,7 @@ acpi_capm_init(struct acpi_softc *sc) dev_ops_add(&apm_ops, 0, 0); make_dev(&apm_ops, 0, 0, 5, 0664, "apm"); make_dev(&apm_ops, 8, 0, 5, 0664, "apm"); - printf("Warning: ACPI is disabling APM's device. You can't run both\n"); + kprintf("Warning: ACPI is disabling APM's device. You can't run both\n"); } int diff --git a/sys/platform/pc32/acpica5/acpi_toshiba.c b/sys/platform/pc32/acpica5/acpi_toshiba.c index 3a66c24357..4de0211428 100644 --- a/sys/platform/pc32/acpica5/acpi_toshiba.c +++ b/sys/platform/pc32/acpica5/acpi_toshiba.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/acpica/acpi_toshiba.c,v 1.8 2004/05/30 20:34:56 phk Exp $ - * $DragonFly: src/sys/platform/pc32/acpica5/Attic/acpi_toshiba.c,v 1.4 2004/07/17 10:49:43 hmp Exp $ + * $DragonFly: src/sys/platform/pc32/acpica5/Attic/acpi_toshiba.c,v 1.5 2006/12/23 00:27:02 swildner Exp $ */ #include "opt_acpi.h" @@ -423,7 +423,7 @@ hci_call(ACPI_HANDLE h, int op, int function, UINT32 *arg) goto end; res = (ACPI_OBJECT *)results.Pointer; if (!ACPI_PKG_VALID(res, HCI_WORDS)) { - printf("toshiba: invalid package!\n"); + kprintf("toshiba: invalid package!\n"); return (ENXIO); } diff --git a/sys/platform/pc32/acpica5/acpi_wakeup.c b/sys/platform/pc32/acpica5/acpi_wakeup.c index 800ee4b387..5fabb32bad 100644 --- a/sys/platform/pc32/acpica5/acpi_wakeup.c +++ b/sys/platform/pc32/acpica5/acpi_wakeup.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/acpica/acpi_wakeup.c,v 1.33 2004/05/06 02:18:58 njl Exp $ - * $DragonFly: src/sys/platform/pc32/acpica5/acpi_wakeup.c,v 1.12 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/acpica5/acpi_wakeup.c,v 1.13 2006/12/23 00:27:02 swildner Exp $ */ #include @@ -149,17 +149,17 @@ acpi_savecpu: \n\ static void acpi_printcpu(void) { - printf("======== acpi_printcpu() debug dump ========\n"); - printf("gdt[%04x:%08x] idt[%04x:%08x] ldt[%04x] tr[%04x] efl[%08x]\n", + kprintf("======== acpi_printcpu() debug dump ========\n"); + kprintf("gdt[%04x:%08x] idt[%04x:%08x] ldt[%04x] tr[%04x] efl[%08x]\n", r_gdt.rd_limit, r_gdt.rd_base, r_idt.rd_limit, r_idt.rd_base, r_ldt, r_tr, r_efl); - printf("eax[%08x] ebx[%08x] ecx[%08x] edx[%08x]\n", + kprintf("eax[%08x] ebx[%08x] ecx[%08x] edx[%08x]\n", r_eax, r_ebx, r_ecx, r_edx); - printf("esi[%08x] edi[%08x] ebp[%08x] esp[%08x]\n", + kprintf("esi[%08x] edi[%08x] ebp[%08x] esp[%08x]\n", r_esi, r_edi, r_ebp, r_esp); - printf("cr0[%08x] cr2[%08x] cr3[%08x] cr4[%08x]\n", + kprintf("cr0[%08x] cr2[%08x] cr3[%08x] cr4[%08x]\n", r_cr0, r_cr2, r_cr3, r_cr4); - printf("cs[%04x] ds[%04x] es[%04x] fs[%04x] gs[%04x] ss[%04x]\n", + kprintf("cs[%04x] ds[%04x] es[%04x] fs[%04x] gs[%04x] ss[%04x]\n", r_cs, r_ds, r_es, r_fs, r_gs, r_ss); } @@ -320,13 +320,13 @@ acpi_alloc_wakeup_handler(void) /* lowaddr below 1MB */ 0x9ffff, /* highaddr */ BUS_SPACE_MAXADDR, NULL, NULL, PAGE_SIZE, 1, PAGE_SIZE, 0, &acpi_waketag) != 0) { - printf("acpi_alloc_wakeup_handler: can't create wake tag\n"); + kprintf("acpi_alloc_wakeup_handler: can't create wake tag\n"); return; } if (bus_dmamem_alloc(acpi_waketag, (void **)&acpi_wakeaddr, BUS_DMA_NOWAIT, &acpi_wakemap)) { - printf("acpi_alloc_wakeup_handler: can't alloc wake memory\n"); + kprintf("acpi_alloc_wakeup_handler: can't alloc wake memory\n"); return; } } diff --git a/sys/platform/pc32/acpica5/madt.c b/sys/platform/pc32/acpica5/madt.c index 00931f212d..fcd8b887a1 100644 --- a/sys/platform/pc32/acpica5/madt.c +++ b/sys/platform/pc32/acpica5/madt.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/acpica/madt.c,v 1.17 2004/06/10 20:03:46 jhb Exp $ - * $DragonFly: src/sys/platform/pc32/acpica5/madt.c,v 1.7 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/acpica5/madt.c,v 1.8 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -172,7 +172,7 @@ madt_map_table(vm_paddr_t pa, int offset, const char *sig) table = madt_map(pa, offset, length); if (ACPI_FAILURE(AcpiTbVerifyTableChecksum(table))) { if (bootverbose) - printf("MADT: Failed checksum for table %s\n", sig); + kprintf("MADT: Failed checksum for table %s\n", sig); madt_unmap(table, length); return (NULL); } @@ -213,7 +213,7 @@ madt_probe(void) rsdp = pmap_mapdev(rsdp_ptr.Pointer.Physical, sizeof(RSDP_DESCRIPTOR)); if (rsdp == NULL) { if (bootverbose) - printf("MADT: Failed to map RSDP\n"); + kprintf("MADT: Failed to map RSDP\n"); return (ENXIO); } @@ -230,13 +230,13 @@ madt_probe(void) */ if (AcpiTbChecksum(rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0) { if (bootverbose) - printf("MADT: RSDP failed extended checksum\n"); + kprintf("MADT: RSDP failed extended checksum\n"); return (ENXIO); } xsdt = madt_map_table(rsdp->XsdtPhysicalAddress, 1, XSDT_SIG); if (xsdt == NULL) { if (bootverbose) - printf("MADT: Failed to map XSDT\n"); + kprintf("MADT: Failed to map XSDT\n"); return (ENXIO); } count = (xsdt->Length - sizeof(ACPI_TABLE_HEADER)) / @@ -249,7 +249,7 @@ madt_probe(void) rsdt = madt_map_table(rsdp->RsdtPhysicalAddress, 1, RSDT_SIG); if (rsdt == NULL) { if (bootverbose) - printf("MADT: Failed to map RSDT\n"); + kprintf("MADT: Failed to map RSDT\n"); return (ENXIO); } count = (rsdt->Length - sizeof(ACPI_TABLE_HEADER)) / @@ -262,11 +262,11 @@ madt_probe(void) pmap_unmapdev((vm_offset_t)rsdp, sizeof(RSDP_DESCRIPTOR)); if (madt_physaddr == 0) { if (bootverbose) - printf("MADT: No MADT table found\n"); + kprintf("MADT: No MADT table found\n"); return (ENXIO); } if (bootverbose) - printf("MADT: Found table at 0x%jx\n", + kprintf("MADT: Found table at 0x%jx\n", (uintmax_t)madt_physaddr); /* @@ -293,12 +293,12 @@ madt_probe_table(vm_paddr_t address) table = madt_map(address, 0, sizeof(ACPI_TABLE_HEADER)); if (table == NULL) { if (bootverbose) - printf("MADT: Failed to map table at 0x%jx\n", + kprintf("MADT: Failed to map table at 0x%jx\n", (uintmax_t)address); return (0); } if (bootverbose) - printf("Table '%.4s' at 0x%jx\n", table->Signature, + kprintf("Table '%.4s' at 0x%jx\n", table->Signature, (uintmax_t)address); if (strncmp(table->Signature, APIC_SIG, 4) != 0) { @@ -335,7 +335,7 @@ madt_setup_local(void) madt = pmap_mapdev(madt_physaddr, madt_length); lapic_init((uintptr_t)madt->LocalApicAddress); - printf("ACPI APIC Table: <%.*s %.*s>\n", + kprintf("ACPI APIC Table: <%.*s %.*s>\n", (int)sizeof(madt->OemId), madt->OemId, (int)sizeof(madt->OemTableId), madt->OemTableId); @@ -359,9 +359,9 @@ madt_setup_io(void) /* Try to initialize ACPI so that we can access the FADT. */ i = acpi_Startup(); if (ACPI_FAILURE(i)) { - printf("MADT: ACPI Startup failed with %s\n", + kprintf("MADT: ACPI Startup failed with %s\n", AcpiFormatException(i)); - printf("Try disabling either ACPI or apic support.\n"); + kprintf("Try disabling either ACPI or apic support.\n"); panic("Using MADT but ACPI doesn't work"); } @@ -380,10 +380,10 @@ madt_setup_io(void) if (!madt_found_sci_override) { if (madt_find_interrupt(AcpiGbl_FADT->SciInt, &ioapic, &pin) != 0) - printf("MADT: Could not find APIC for SCI IRQ %d\n", + kprintf("MADT: Could not find APIC for SCI IRQ %d\n", AcpiGbl_FADT->SciInt); else { - printf( + kprintf( "MADT: Forcing active-low polarity and level trigger for SCI\n"); ioapic_set_polarity(ioapic, pin, INTR_POLARITY_LOW); ioapic_set_triggermode(ioapic, pin, INTR_TRIGGER_LEVEL); @@ -441,7 +441,7 @@ madt_probe_cpus_handler(APIC_HEADER *entry, void *arg) */ proc = (MADT_PROCESSOR_APIC *)entry; if (bootverbose) - printf("MADT: Found CPU APIC ID %d ACPI ID %d: %s\n", + kprintf("MADT: Found CPU APIC ID %d ACPI ID %d: %s\n", proc->LocalApicId, proc->ProcessorId, proc->ProcessorEnabled ? "enabled" : "disabled"); if (!proc->ProcessorEnabled) @@ -472,7 +472,7 @@ madt_parse_apics(APIC_HEADER *entry, void *arg __unused) case APIC_IO: apic = (MADT_IO_APIC *)entry; if (bootverbose) - printf("MADT: Found IO APIC ID %d, Interrupt %d at %p\n", + kprintf("MADT: Found IO APIC ID %d, Interrupt %d at %p\n", apic->IoApicId, apic->Interrupt, (void *)(uintptr_t)apic->Address); if (apic->IoApicId >= NIOAPICS) @@ -577,7 +577,7 @@ madt_find_interrupt(int intr, void **apic, u_int *pin) *apic = ioapics[best].io_apic; *pin = intr - ioapics[best].io_vector; if (*pin > 32) - printf("WARNING: Found intpin of %u for vector %d\n", *pin, + kprintf("WARNING: Found intpin of %u for vector %d\n", *pin, intr); return (0); } @@ -595,12 +595,12 @@ madt_parse_interrupt_override(MADT_INTERRUPT_OVERRIDE *intr) char buf[64]; if (bootverbose) - printf("MADT: intr override: source %u, irq %u\n", + kprintf("MADT: intr override: source %u, irq %u\n", intr->Source, intr->Interrupt); KASSERT(intr->Bus == 0, ("bus for interrupt overrides must be zero")); if (madt_find_interrupt(intr->Interrupt, &new_ioapic, &new_pin) != 0) { - printf("MADT: Could not find APIC for vector %d (IRQ %d)\n", + kprintf("MADT: Could not find APIC for vector %d (IRQ %d)\n", intr->Interrupt, intr->Source); return; } @@ -628,7 +628,7 @@ madt_parse_interrupt_override(MADT_INTERRUPT_OVERRIDE *intr) panic( "Invalid trigger %s: must be 'edge' or 'level'", buf); - printf("MADT: Forcing SCI to %s trigger\n", + kprintf("MADT: Forcing SCI to %s trigger\n", trig == INTR_TRIGGER_EDGE ? "edge" : "level"); } if (kgetenv_string("hw.acpi.sci.polarity", buf, sizeof(buf))) { @@ -640,7 +640,7 @@ madt_parse_interrupt_override(MADT_INTERRUPT_OVERRIDE *intr) panic( "Invalid polarity %s: must be 'high' or 'low'", buf); - printf("MADT: Forcing SCI to active %s polarity\n", + kprintf("MADT: Forcing SCI to active %s polarity\n", pol == INTR_POLARITY_HIGH ? "high" : "low"); } } @@ -659,7 +659,7 @@ madt_parse_interrupt_override(MADT_INTERRUPT_OVERRIDE *intr) ioapic_remap_vector(new_ioapic, new_pin, intr->Source); if (madt_find_interrupt(intr->Source, &old_ioapic, &old_pin) != 0) - printf("MADT: Could not find APIC for source IRQ %d\n", + kprintf("MADT: Could not find APIC for source IRQ %d\n", intr->Source); else if (ioapic_get_vector(old_ioapic, old_pin) == intr->Source) @@ -681,7 +681,7 @@ madt_parse_nmi(MADT_NMI_SOURCE *nmi) u_int pin; if (madt_find_interrupt(nmi->Interrupt, &ioapic, &pin) != 0) { - printf("MADT: Could not find APIC for vector %d\n", + kprintf("MADT: Could not find APIC for vector %d\n", nmi->Interrupt); return; } @@ -707,7 +707,7 @@ madt_parse_local_nmi(MADT_LOCAL_APIC_NMI *nmi) apic_id = APIC_ID_ALL; else if (madt_find_cpu(nmi->ProcessorId, &apic_id) != 0) { if (bootverbose) - printf("MADT: Ignoring local NMI routed to ACPI CPU %u\n", + kprintf("MADT: Ignoring local NMI routed to ACPI CPU %u\n", nmi->ProcessorId); return; } @@ -768,7 +768,7 @@ madt_set_ids(void *dummy) md->gd_apic_id); md->gd_acpi_id = la->la_acpi_id; if (bootverbose) - printf("APIC: CPU %u has ACPI ID %u\n", i, + kprintf("APIC: CPU %u has ACPI ID %u\n", i, la->la_acpi_id); } } diff --git a/sys/platform/pc32/apic/mpapic.c b/sys/platform/pc32/apic/mpapic.c index b195b7d6f7..dddddee57b 100644 --- a/sys/platform/pc32/apic/mpapic.c +++ b/sys/platform/pc32/apic/mpapic.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/mpapic.c,v 1.37.2.7 2003/01/25 02:31:47 peter Exp $ - * $DragonFly: src/sys/platform/pc32/apic/mpapic.c,v 1.19 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/apic/mpapic.c,v 1.20 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -138,8 +138,8 @@ apic_initialize(void) void apic_dump(char* str) { - printf("SMP: CPU%d %s:\n", mycpu->gd_cpuid, str); - printf(" lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n", + kprintf("SMP: CPU%d %s:\n", mycpu->gd_cpuid, str); + kprintf(" lint0: 0x%08x lint1: 0x%08x TPR: 0x%08x SVR: 0x%08x\n", lapic.lvt_lint0, lapic.lvt_lint1, lapic.tpr, lapic.svr); } @@ -178,7 +178,7 @@ io_apic_set_id(int apic, int id) ux = io_apic_read(apic, IOAPIC_ID); /* get current contents */ if (((ux & APIC_ID_MASK) >> 24) != id) { - printf("Changing APIC ID for IO APIC #%d" + kprintf("Changing APIC ID for IO APIC #%d" " from %d to %d on chip\n", apic, ((ux & APIC_ID_MASK) >> 24), id); ux &= ~APIC_ID_MASK; /* clear the ID field */ @@ -294,7 +294,7 @@ io_apic_setup_intpin(int apic, int pin) } if (bootverbose) { - printf("IOAPIC #%d intpin %d -> irq %d\n", + kprintf("IOAPIC #%d intpin %d -> irq %d\n", apic, pin, irq); } @@ -329,14 +329,14 @@ io_apic_setup(int apic) apic_pin_trigger = 0; /* default to edge-triggered */ maxpin = REDIRCNT_IOAPIC(apic); /* pins in APIC */ - printf("Programming %d pins in IOAPIC #%d\n", maxpin, apic); + kprintf("Programming %d pins in IOAPIC #%d\n", maxpin, apic); for (pin = 0; pin < maxpin; ++pin) { io_apic_setup_intpin(apic, pin); } while (pin < 32) { if (apic_int_type(apic, pin) >= 0) { - printf("Warning: IOAPIC #%d pin %d does not exist," + kprintf("Warning: IOAPIC #%d pin %d does not exist," " cannot program!\n", apic, pin); } ++pin; @@ -425,14 +425,14 @@ trigger(int apic, int pin, u_int32_t * flags) eirq = apic_src_bus_irq(apic, pin); if (eirq < 0 || eirq > 15) { - printf("EISA IRQ %d?!?!\n", eirq); + kprintf("EISA IRQ %d?!?!\n", eirq); goto bad; } if (intcontrol == -1) { intcontrol = inb(ELCR1) << 8; intcontrol |= inb(ELCR0); - printf("EISA INTCONTROL = %08x\n", intcontrol); + kprintf("EISA INTCONTROL = %08x\n", intcontrol); } /* Use ELCR settings to determine level or edge mode */ @@ -527,11 +527,11 @@ imen_dump(void) { int x; - printf("SMP: enabled INTs: "); + kprintf("SMP: enabled INTs: "); for (x = 0; x < 24; ++x) if ((apic_imen & (1 << x)) == 0) - printf("%d, ", x); - printf("apic_imen: 0x%08x\n", apic_imen); + kprintf("%d, ", x); + kprintf("apic_imen: 0x%08x\n", apic_imen); } diff --git a/sys/platform/pc32/apm/apm.c b/sys/platform/pc32/apm/apm.c index c8629b81cd..d2ee2f0d49 100644 --- a/sys/platform/pc32/apm/apm.c +++ b/sys/platform/pc32/apm/apm.c @@ -16,7 +16,7 @@ * Sep, 1994 Implemented on FreeBSD 1.1.5.1R (Toshiba AVS001WD) * * $FreeBSD: src/sys/i386/apm/apm.c,v 1.114.2.5 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/platform/pc32/apm/apm.c,v 1.20 2006/12/05 23:31:57 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/apm/apm.c,v 1.21 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -100,7 +100,7 @@ static int apm_debug = 0; #define APM_DPRINT(args...) do { \ if (apm_debug) { \ - printf(args); \ + kprintf(args); \ } \ } while (0) @@ -246,7 +246,7 @@ apm_suspend_system(int state) sc->bios.r.edx = 0; if (apm_bioscall()) { - printf("Entire system suspend failure: errcode = %d\n", + kprintf("Entire system suspend failure: errcode = %d\n", 0xff & (sc->bios.r.eax >> 8)); return 1; } @@ -280,7 +280,7 @@ apm_display(int newstate) if (apm_bioscall() == 0) { return 0; } - printf("Display off failure: errcode = %d\n", + kprintf("Display off failure: errcode = %d\n", 0xff & (sc->bios.r.eax >> 8)); return 1; } @@ -307,7 +307,7 @@ apm_power_off(void *junk, int howto) static void apm_battery_low(void) { - printf("\007\007 * * * BATTERY IS LOW * * * \007\007"); + kprintf("\007\007 * * * BATTERY IS LOW * * * \007\007"); } /* APM hook manager */ @@ -368,7 +368,7 @@ apm_execute_hook(struct apmhook *list) for (p = list; p != NULL; p = p->ah_next) { APM_DPRINT("Execute APM hook \"%s.\"\n", p->ah_name); if ((*(p->ah_fun))(p->ah_arg)) - printf("Warning: APM hook \"%s\" failed", p->ah_name); + kprintf("Warning: APM hook \"%s\" failed", p->ah_name); } } @@ -572,7 +572,7 @@ apm_suspend(int state) sc->standby_countdown = apm_standby_delay; break; default: - printf("apm_suspend: Unknown Suspend state 0x%x\n", state); + kprintf("apm_suspend: Unknown Suspend state 0x%x\n", state); return; } @@ -810,7 +810,7 @@ apm_probe(device_t dev) device_set_desc(dev, "APM BIOS"); if ( device_get_unit(dev) > 0 ) { - printf("apm: Only one APM driver supported.\n"); + kprintf("apm: Only one APM driver supported.\n"); return ENXIO; } @@ -825,11 +825,11 @@ apm_probe(device_t dev) if (vm86_intcall(APM_INT, &vmf)) return ENXIO; /* APM not found */ if (vmf.vmf_bx != 0x504d) { - printf("apm: incorrect signature (0x%x)\n", vmf.vmf_bx); + kprintf("apm: incorrect signature (0x%x)\n", vmf.vmf_bx); return ENXIO; } if ((vmf.vmf_cx & (APM_32BIT_SUPPORT | APM_16BIT_SUPPORT)) == 0) { - printf("apm: protected mode connections are not supported\n"); + kprintf("apm: protected mode connections are not supported\n"); return ENXIO; } @@ -848,7 +848,7 @@ apm_probe(device_t dev) vmf.vmf_al = APM_PROT32CONNECT; vmf.vmf_bx = 0; if (vm86_intcall(APM_INT, &vmf)) { - printf("apm: 32-bit connection error.\n"); + kprintf("apm: 32-bit connection error.\n"); return (ENXIO); } sc->bios.seg.code32.base = (vmf.vmf_ax << 4) + APM_KERNBASE; @@ -865,7 +865,7 @@ apm_probe(device_t dev) vmf.vmf_al = APM_PROT16CONNECT; vmf.vmf_bx = 0; if (vm86_intcall(APM_INT, &vmf)) { - printf("apm: 16-bit connection error.\n"); + kprintf("apm: 16-bit connection error.\n"); return (ENXIO); } sc->bios.seg.code16.base = (vmf.vmf_ax << 4) + APM_KERNBASE; @@ -985,7 +985,7 @@ apm_processevent(void) case PMEV_NOEVENT: break; default: - printf("Unknown Original APM Event 0x%x\n", apm_event); + kprintf("Unknown Original APM Event 0x%x\n", apm_event); break; } } while (apm_event != PMEV_NOEVENT); diff --git a/sys/platform/pc32/gnu/isa/dgb.c b/sys/platform/pc32/gnu/isa/dgb.c index 72b2220af1..18798a5de0 100644 --- a/sys/platform/pc32/gnu/isa/dgb.c +++ b/sys/platform/pc32/gnu/isa/dgb.c @@ -1,6 +1,6 @@ /*- * dgb.c $FreeBSD: src/sys/gnu/i386/isa/dgb.c,v 1.56.2.1 2001/02/26 04:23:09 jlemon Exp $ - * dgb.c $DragonFly: src/sys/platform/pc32/gnu/isa/dgb.c,v 1.18 2006/09/10 01:26:38 dillon Exp $ + * dgb.c $DragonFly: src/sys/platform/pc32/gnu/isa/dgb.c,v 1.19 2006/12/23 00:27:03 swildner Exp $ * * Digiboard driver. * @@ -453,22 +453,22 @@ dgbprobe(dev) case 0: sc->mem_seg=0xF000; win_size=0x10000; - printf("dgb%d: PC/Xi 64K\n",dev->id_unit); + kprintf("dgb%d: PC/Xi 64K\n",dev->id_unit); break; case 0x10: sc->mem_seg=0xE000; win_size=0x20000; - printf("dgb%d: PC/Xi 128K\n",dev->id_unit); + kprintf("dgb%d: PC/Xi 128K\n",dev->id_unit); break; case 0x20: sc->mem_seg=0xC000; win_size=0x40000; - printf("dgb%d: PC/Xi 256K\n",dev->id_unit); + kprintf("dgb%d: PC/Xi 256K\n",dev->id_unit); break; default: /* case 0x30: */ sc->mem_seg=0x8000; win_size=0x80000; - printf("dgb%d: PC/Xi 512K\n",dev->id_unit); + kprintf("dgb%d: PC/Xi 512K\n",dev->id_unit); break; } sc->type=PCXI; @@ -477,7 +477,7 @@ dgbprobe(dev) v=inb(sc->port); if( v & 0x1 ) { - printf("dgb%d: PC/Xm isn't supported\n",dev->id_unit); + kprintf("dgb%d: PC/Xm isn't supported\n",dev->id_unit); sc->status=DISABLED; return 0; } @@ -486,14 +486,14 @@ dgbprobe(dev) if(dev->id_flags==DGBFLAG_NOWIN || ( v&0xC0 )==0) { win_size=0x10000; - printf("dgb%d: PC/Xe 64K\n",dev->id_unit); + kprintf("dgb%d: PC/Xe 64K\n",dev->id_unit); sc->type=PCXE; } else { win_size=0x2000; - printf("dgb%d: PC/Xe 64/8K (windowed)\n",dev->id_unit); + kprintf("dgb%d: PC/Xe 64/8K (windowed)\n",dev->id_unit); sc->type=PCXEVE; if((u_long)sc->pmem & ~0xFFE000) { - printf("dgb%d: warning: address 0x%lx truncated to 0x%lx\n", + kprintf("dgb%d: warning: address 0x%lx truncated to 0x%lx\n", dev->id_unit, sc->pmem, sc->pmem & 0xFFE000); @@ -550,7 +550,7 @@ dgbattach(dev) for(i=0; (inb(sc->port) & FEPMASK) != FEPRST ; i++) { if(i>10000) { - printf("dgb%d: 1st reset failed\n",dev->id_unit); + kprintf("dgb%d: 1st reset failed\n",dev->id_unit); sc->status=DISABLED; hidewin(sc); return 0; @@ -579,7 +579,7 @@ dgbattach(dev) for(i=0; (inb(sc->port) & FEPMASK) != (FEPRST|FEPMEM) ; i++) { if(i>10000) { - printf("dgb%d: 2nd reset failed\n",dev->id_unit); + kprintf("dgb%d: 2nd reset failed\n",dev->id_unit); sc->status=DISABLED; hidewin(sc); return 0; @@ -597,7 +597,7 @@ dgbattach(dev) addr=setinitwin(sc,BOTWIN); *(u_long volatile *)(mem+addr) = 0xA55A3CC3; if(*(u_long volatile *)(mem+addr)!=0xA55A3CC3) { - printf("dgb%d: 1st memory test failed\n",dev->id_unit); + kprintf("dgb%d: 1st memory test failed\n",dev->id_unit); sc->status=DISABLED; hidewin(sc); return 0; @@ -606,7 +606,7 @@ dgbattach(dev) addr=setinitwin(sc,TOPWIN); *(u_long volatile *)(mem+addr) = 0x5AA5C33C; if(*(u_long volatile *)(mem+addr)!=0x5AA5C33C) { - printf("dgb%d: 2nd memory test failed\n",dev->id_unit); + kprintf("dgb%d: 2nd memory test failed\n",dev->id_unit); sc->status=DISABLED; hidewin(sc); return 0; @@ -615,7 +615,7 @@ dgbattach(dev) addr=setinitwin(sc,BIOSCODE+((0xF000-sc->mem_seg)<<4)); *(u_long volatile *)(mem+addr) = 0x5AA5C33C; if(*(u_long volatile *)(mem+addr)!=0x5AA5C33C) { - printf("dgb%d: 3rd (BIOS) memory test failed\n",dev->id_unit); + kprintf("dgb%d: 3rd (BIOS) memory test failed\n",dev->id_unit); } addr=setinitwin(sc,MISCGLOBAL); @@ -643,7 +643,7 @@ dgbattach(dev) 0x%x instead of 0x%x\n", unit, ptr-(mem+addr), *ptr, pcxx_bios[i] ); if(++nfails>=5) { - printf("dgb%d: 4th memory test (BIOS load) fails\n",unit); + kprintf("dgb%d: 4th memory test (BIOS load) fails\n",unit); break; } } @@ -652,7 +652,7 @@ dgbattach(dev) for(i=0; (inb(sc->port) & FEPMASK) != FEPMEM ; i++) { if(i>10000) { - printf("dgb%d: BIOS start failed\n",dev->id_unit); + kprintf("dgb%d: BIOS start failed\n",dev->id_unit); sc->status=DISABLED; hidewin(sc); return 0; @@ -667,7 +667,7 @@ dgbattach(dev) goto load_fep; DELAY(1); } - printf("dgb%d: BIOS download failed\n",dev->id_unit); + kprintf("dgb%d: BIOS download failed\n",dev->id_unit); DPRINT4(DB_EXCEPT,"dgb%d: code=0x%x must be 0x%x\n", dev->id_unit, *((ushort volatile *)(mem+MISCGLOBAL)), @@ -696,7 +696,7 @@ dgbattach(dev) 0x%x instead of 0x%x\n", unit, ptr-(mem+addr), *ptr, pcxx_bios[i] ); if(++nfails>=5) { - printf("dgb%d: 4th memory test (BIOS load) fails\n",unit); + kprintf("dgb%d: 4th memory test (BIOS load) fails\n",unit); break; } } @@ -707,7 +707,7 @@ dgbattach(dev) for(i=0; (inb(sc->port) & FEPMASK) != FEPCLR ; i++) { if(i>10000) { - printf("dgb%d: BIOS start failed\n",dev->id_unit); + kprintf("dgb%d: BIOS start failed\n",dev->id_unit); sc->status=DISABLED; hidewin(sc); return 0; @@ -724,7 +724,7 @@ dgbattach(dev) goto load_fep; DELAY(1); } - printf("dgb%d: BIOS download failed\n",dev->id_unit); + kprintf("dgb%d: BIOS download failed\n",dev->id_unit); DPRINT5(DB_EXCEPT,"dgb%d: Error#(0x%x,0x%x) code=0x%x\n", dev->id_unit, *(ushort volatile *)(mem+0xC12), @@ -759,7 +759,7 @@ load_fep: for(i=0; *(ushort volatile *)(mem+addr)!=0; i++) { if(i>200000) { - printf("dgb%d: FEP code download failed\n",unit); + kprintf("dgb%d: FEP code download failed\n",unit); DPRINT3(DB_EXCEPT,"dgb%d: code=0x%x must be 0\n", unit, *(ushort volatile *)(mem+addr)); sc->status=DISABLED; @@ -782,7 +782,7 @@ load_fep: addr=setwin(sc,FEPSTAT); for(i=0; *(ushort volatile *)(mem+addr)!= *(ushort *)"OS"; i++) { if(i>200000) { - printf("dgb%d: FEP/OS start failed\n",dev->id_unit); + kprintf("dgb%d: FEP/OS start failed\n",dev->id_unit); sc->status=DISABLED; hidewin(sc); return 0; @@ -793,17 +793,17 @@ load_fep: sc->numports= *(ushort volatile *)(mem+setwin(sc,NPORT)); - printf("dgb%d: %d ports\n",unit,sc->numports); + kprintf("dgb%d: %d ports\n",unit,sc->numports); if(sc->numports > MAX_DGB_PORTS) { - printf("dgb%d: too many ports\n",unit); + kprintf("dgb%d: too many ports\n",unit); sc->status=DISABLED; hidewin(sc); return 0; } if(nports+sc->numports>NDGBPORTS) { - printf("dgb%d: only %d ports are usable\n", unit, NDGBPORTS-nports); + kprintf("dgb%d: only %d ports are usable\n", unit, NDGBPORTS-nports); sc->numports=NDGBPORTS-nports; } @@ -820,7 +820,7 @@ load_fep: sc->ports[i].status=ENABLED; else { sc->ports[i].status=DISABLED; - printf("dgb%d: port%d is broken\n", unit, i); + kprintf("dgb%d: port%d is broken\n", unit, i); } /* We should now init per-port structures */ @@ -1045,7 +1045,7 @@ open_top: bc->rout=bc->rin; /* clear input queue */ bc->idata=1; #ifdef PRINT_BUFSIZE - printf("dgb buffers tx=%x:%x rx=%x:%x\n",bc->tseg,bc->tmax,bc->rseg,bc->rmax); + kprintf("dgb buffers tx=%x:%x rx=%x:%x\n",bc->tseg,bc->tmax,bc->rseg,bc->rmax); #endif hidewin(sc); @@ -1222,7 +1222,7 @@ dgbpoll(unit_c) BoardMemWinState ws=bmws_get(); if(sc->status==DISABLED) { - printf("dgb%d: polling of disabled board stopped\n",unit); + kprintf("dgb%d: polling of disabled board stopped\n",unit); return; } @@ -1235,7 +1235,7 @@ dgbpoll(unit_c) if(head >= FEP_IMAX-FEP_ISTART || tail >= FEP_IMAX-FEP_ISTART || (head|tail) & 03 ) { - printf("dgb%d: event queue's head or tail is wrong! hd=%d,tl=%d\n", unit,head,tail); + kprintf("dgb%d: event queue's head or tail is wrong! hd=%d,tl=%d\n", unit,head,tail); break; } @@ -1250,13 +1250,13 @@ dgbpoll(unit_c) tp=&sc->ttys[pnum]; if(pnum>=sc->numports || port->status==DISABLED) { - printf("dgb%d: port%d: got event on nonexisting port\n",unit,pnum); + kprintf("dgb%d: port%d: got event on nonexisting port\n",unit,pnum); } else if(port->used || port->wopeners>0 ) { int wrapmask=port->rxbufsize-1; if( !(event & ALL_IND) ) - printf("dgb%d: port%d: ? event 0x%x mstat 0x%x lstat 0x%x\n", + kprintf("dgb%d: port%d: ? event 0x%x mstat 0x%x lstat 0x%x\n", unit, pnum, event, mstat, lstat); if(event & DATA_IND) { @@ -1271,7 +1271,7 @@ dgbpoll(unit_c) } if(bc->orun) { - printf("dgb%d: port%d: overrun\n", unit, pnum); + kprintf("dgb%d: port%d: overrun\n", unit, pnum); bc->orun=0; } @@ -2131,7 +2131,7 @@ fepcmd(port, cmd, op1, op2, ncmds, bytecmd) int count, n; if(port->status==DISABLED) { - printf("dgb%d: port%d: FEP command on disabled port\n", + kprintf("dgb%d: port%d: FEP command on disabled port\n", port->unit, port->pnum); return; } @@ -2140,7 +2140,7 @@ fepcmd(port, cmd, op1, op2, ncmds, bytecmd) head=sc->mailbox->cin; if(head>=(FEP_CMAX-FEP_CSTART) || (head & 3)) { - printf("dgb%d: port%d: wrong pointer head of command queue : 0x%x\n", + kprintf("dgb%d: port%d: wrong pointer head of command queue : 0x%x\n", port->unit, port->pnum, head); return; } @@ -2171,7 +2171,7 @@ fepcmd(port, cmd, op1, op2, ncmds, bytecmd) if(n <= ncmds * (sizeof(ushort)*4)) return; } - printf("dgb%d(%d): timeout on FEP cmd=0x%x\n", port->unit, port->pnum, cmd); + kprintf("dgb%d(%d): timeout on FEP cmd=0x%x\n", port->unit, port->pnum, cmd); } static void diff --git a/sys/platform/pc32/gnu/isa/dgreg.h b/sys/platform/pc32/gnu/isa/dgreg.h index 61518144cf..8c58c6ca43 100644 --- a/sys/platform/pc32/gnu/isa/dgreg.h +++ b/sys/platform/pc32/gnu/isa/dgreg.h @@ -1,6 +1,6 @@ /*- * dgreg.h $FreeBSD: src/sys/gnu/i386/isa/dgreg.h,v 1.9 1999/08/28 00:43:05 peter Exp $ - * dgreg.h $DragonFly: src/sys/platform/pc32/gnu/isa/dgreg.h,v 1.2 2003/06/17 04:28:34 dillon Exp $ + * dgreg.h $DragonFly: src/sys/platform/pc32/gnu/isa/dgreg.h,v 1.3 2006/12/23 00:27:03 swildner Exp $ * * Digiboard driver. * @@ -361,13 +361,13 @@ struct channel { /* debugging printout */ #ifdef DGB_DEBUG -#define DPRINT1(l,a1) (dgbdebug&l ? printf(a1) : 0) -#define DPRINT2(l,a1,a2) (dgbdebug&l ? printf(a1,a2) : 0) -#define DPRINT3(l,a1,a2,a3) (dgbdebug&l ? printf(a1,a2,a3) : 0) -#define DPRINT4(l,a1,a2,a3,a4) (dgbdebug&l ? printf(a1,a2,a3,a4) : 0) -#define DPRINT5(l,a1,a2,a3,a4,a5) (dgbdebug&l ? printf(a1,a2,a3,a4,a5) : 0) -#define DPRINT6(l,a1,a2,a3,a4,a5,a6) (dgbdebug&l ? printf(a1,a2,a3,a4,a5,a6) : 0) -#define DPRINT7(l,a1,a2,a3,a4,a5,a6,a7) (dgbdebug&l ? printf(a1,a2,a3,a4,a5,a6,a7) : 0) +#define DPRINT1(l,a1) (dgbdebug&l ? kprintf(a1) : 0) +#define DPRINT2(l,a1,a2) (dgbdebug&l ? kprintf(a1,a2) : 0) +#define DPRINT3(l,a1,a2,a3) (dgbdebug&l ? kprintf(a1,a2,a3) : 0) +#define DPRINT4(l,a1,a2,a3,a4) (dgbdebug&l ? kprintf(a1,a2,a3,a4) : 0) +#define DPRINT5(l,a1,a2,a3,a4,a5) (dgbdebug&l ? kprintf(a1,a2,a3,a4,a5) : 0) +#define DPRINT6(l,a1,a2,a3,a4,a5,a6) (dgbdebug&l ? kprintf(a1,a2,a3,a4,a5,a6) : 0) +#define DPRINT7(l,a1,a2,a3,a4,a5,a6,a7) (dgbdebug&l ? kprintf(a1,a2,a3,a4,a5,a6,a7) : 0) #else #define DPRINT1(l,a1) #define DPRINT2(l,a1,a2) diff --git a/sys/platform/pc32/i386/autoconf.c b/sys/platform/pc32/i386/autoconf.c index bd19274552..45f4c48226 100644 --- a/sys/platform/pc32/i386/autoconf.c +++ b/sys/platform/pc32/i386/autoconf.c @@ -35,7 +35,7 @@ * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/i386/autoconf.c,v 1.146.2.2 2001/06/07 06:05:58 dd Exp $ - * $DragonFly: src/sys/platform/pc32/i386/autoconf.c,v 1.33 2006/12/20 18:14:42 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/autoconf.c,v 1.34 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -170,7 +170,7 @@ configure_final(void *dummy) /* * Print out the BIOS's idea of the disk geometries. */ - printf("BIOS Geometries:\n"); + kprintf("BIOS Geometries:\n"); for (i = 0; i < N_BIOS_GEOM; i++) { unsigned long bios_geom; int max_cylinder, max_head, max_sector; @@ -185,19 +185,19 @@ configure_final(void *dummy) if (bios_geom == 0x4f010f) continue; - printf(" %x:%08lx ", i, bios_geom); + kprintf(" %x:%08lx ", i, bios_geom); max_cylinder = bios_geom >> 16; max_head = (bios_geom >> 8) & 0xff; max_sector = bios_geom & 0xff; - printf( + kprintf( "0..%d=%d cylinders, 0..%d=%d heads, 1..%d=%d sectors\n", max_cylinder, max_cylinder + 1, max_head, max_head + 1, max_sector, max_sector); } - printf(" %d accounted for\n", bootinfo.bi_n_bios_used); + kprintf(" %d accounted for\n", bootinfo.bi_n_bios_used); - printf("Device configuration finished.\n"); + kprintf("Device configuration finished.\n"); } cold = 0; } @@ -271,12 +271,12 @@ setroot(void) char *sname; if ((bootdev & B_MAGICMASK) != B_DEVMAGIC) { - printf("no B_DEVMAGIC (bootdev=%#lx)\n", bootdev); + kprintf("no B_DEVMAGIC (bootdev=%#lx)\n", bootdev); return; } majdev = boot_translate_majdev(B_TYPE(bootdev)); if (bootverbose) { - printf("bootdev: %08lx type=%ld unit=%ld " + kprintf("bootdev: %08lx type=%ld unit=%ld " "slice=%ld part=%ld major=%d\n", bootdev, B_TYPE(bootdev), B_UNIT(bootdev), B_SLICE(bootdev), B_PARTITION(bootdev), majdev); @@ -289,7 +289,7 @@ setroot(void) if (slice == WHOLE_DISK_SLICE) slice = COMPATIBILITY_SLICE; if (slice < 0 || slice >= MAX_SLICES) { - printf("bad slice\n"); + kprintf("bad slice\n"); return; } @@ -447,7 +447,7 @@ pxe_setup_nfsdiskless(void) if (inaddr_to_sockaddr("boot.netif.ip", &myaddr)) return; if (inaddr_to_sockaddr("boot.netif.netmask", &netmask)) { - printf("PXE: no netmask\n"); + kprintf("PXE: no netmask\n"); return; } bcopy(&myaddr, &nd->myif.ifra_addr, sizeof(myaddr)); @@ -457,7 +457,7 @@ pxe_setup_nfsdiskless(void) bcopy(&netmask, &nd->myif.ifra_mask, sizeof(netmask)); if (hwaddr_to_sockaddr("boot.netif.hwaddr", &ourdl)) { - printf("PXE: no hardware address\n"); + kprintf("PXE: no hardware address\n"); return; } ifa = NULL; @@ -475,7 +475,7 @@ pxe_setup_nfsdiskless(void) } } } - printf("PXE: no interface\n"); + kprintf("PXE: no interface\n"); return; /* no matching interface */ match_done: strlcpy(nd->myif.ifra_name, ifp->if_xname, sizeof(nd->myif.ifra_name)); @@ -491,7 +491,7 @@ match_done: nd->root_args.sotype = SOCK_DGRAM; nd->root_args.flags = (NFSMNT_WSIZE | NFSMNT_RSIZE | NFSMNT_RESVPORT); if (inaddr_to_sockaddr("boot.nfsroot.server", &nd->root_saddr)) { - printf("PXE: no server\n"); + kprintf("PXE: no server\n"); return; } nd->root_saddr.sin_port = htons(NFS_PORT); @@ -501,7 +501,7 @@ match_done: * root handle. Generate a warning but continue configuring. */ if (decode_nfshandle("boot.nfsroot.nfshandle", &nd->root_fh[0]) == 0) { - printf("PXE: Warning, no NFS handle passed from loader\n"); + kprintf("PXE: Warning, no NFS handle passed from loader\n"); } if ((cp = kgetenv("boot.nfsroot.path")) != NULL) strncpy(nd->root_hostnam, cp, MNAMELEN - 1); diff --git a/sys/platform/pc32/i386/bios.c b/sys/platform/pc32/i386/bios.c index 543d09caf2..03b857dfb0 100644 --- a/sys/platform/pc32/i386/bios.c +++ b/sys/platform/pc32/i386/bios.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/bios.c,v 1.29.2.3 2001/07/19 18:07:35 imp Exp $ - * $DragonFly: src/sys/platform/pc32/i386/bios.c,v 1.12 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/bios.c,v 1.13 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -87,8 +87,8 @@ bios32_init(void *junk) ) { bios32_SDCI = BIOS_PADDRTOVADDR(sdh->entry); if (bootverbose) { - printf("bios32: Found BIOS32 Service Directory header at %p\n", sdh); - printf("bios32: Entry = 0x%x (%x) Rev = %d Len = %d\n", + kprintf("bios32: Found BIOS32 Service Directory header at %p\n", sdh); + kprintf("bios32: Entry = 0x%x (%x) Rev = %d Len = %d\n", sdh->entry, bios32_SDCI, sdh->revision, sdh->len); } @@ -97,12 +97,12 @@ bios32_init(void *junk) /* See if there's a PCI BIOS entrypoint here */ PCIbios.ident.id = 0x49435024; /* PCI systems should have this */ if (!bios32_SDlookup(&PCIbios) && bootverbose) - printf("pcibios: PCI BIOS entry at 0x%x\n", PCIbios.entry); + kprintf("pcibios: PCI BIOS entry at 0x%x\n", PCIbios.entry); } if (p != NULL) freeenv(p); } else { - printf("bios32: Bad BIOS32 Service Directory\n"); + kprintf("bios32: Bad BIOS32 Service Directory\n"); } } @@ -123,24 +123,24 @@ bios32_init(void *junk) if (ck == 0) { PnPBIOStable = pt; if (bootverbose) { - printf("pnpbios: Found PnP BIOS data at %p\n", pt); - printf("pnpbios: Entry = %x:%x Rev = %d.%d\n", + kprintf("pnpbios: Found PnP BIOS data at %p\n", pt); + kprintf("pnpbios: Entry = %x:%x Rev = %d.%d\n", pt->pmentrybase, pt->pmentryoffset, pt->version >> 4, pt->version & 0xf); if ((pt->control & 0x3) == 0x01) - printf("pnpbios: Event flag at %x\n", pt->evflagaddr); + kprintf("pnpbios: Event flag at %x\n", pt->evflagaddr); if (pt->oemdevid != 0) - printf("pnpbios: OEM ID %x\n", pt->oemdevid); + kprintf("pnpbios: OEM ID %x\n", pt->oemdevid); } } else { - printf("pnpbios: Bad PnP BIOS data checksum\n"); + kprintf("pnpbios: Bad PnP BIOS data checksum\n"); } } if (p != NULL) freeenv(p); if (bootverbose) { /* look for other know signatures */ - printf("Other BIOS signatures found:\n"); + kprintf("Other BIOS signatures found:\n"); } } diff --git a/sys/platform/pc32/i386/busdma_machdep.c b/sys/platform/pc32/i386/busdma_machdep.c index f1f74e58a5..df65132e0f 100644 --- a/sys/platform/pc32/i386/busdma_machdep.c +++ b/sys/platform/pc32/i386/busdma_machdep.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/busdma_machdep.c,v 1.16.2.2 2003/01/23 00:55:27 scottl Exp $ - * $DragonFly: src/sys/platform/pc32/i386/busdma_machdep.c,v 1.17 2006/10/25 20:55:51 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/busdma_machdep.c,v 1.18 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -508,7 +508,7 @@ bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf, } while (buflen > 0); if (buflen != 0) { - printf("bus_dmamap_load: Too many segs! buf_len = 0x%lx\n", + kprintf("bus_dmamap_load: Too many segs! buf_len = 0x%lx\n", (u_long)buflen); error = EFBIG; } diff --git a/sys/platform/pc32/i386/db_interface.c b/sys/platform/pc32/i386/db_interface.c index d66bc743ba..6b7759c9c4 100644 --- a/sys/platform/pc32/i386/db_interface.c +++ b/sys/platform/pc32/i386/db_interface.c @@ -24,7 +24,7 @@ * rights to redistribute these changes. * * $FreeBSD: src/sys/i386/i386/db_interface.c,v 1.48.2.1 2000/07/07 00:38:46 obrien Exp $ - * $DragonFly: src/sys/platform/pc32/i386/db_interface.c,v 1.13 2006/09/13 18:45:12 swildner Exp $ + * $DragonFly: src/sys/platform/pc32/i386/db_interface.c,v 1.14 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -96,7 +96,7 @@ kdb_trap(int type, int code, struct i386_saved_state *regs) * XXX this is almost useless now. In most cases, * trap_fatal() has already printed a much more verbose * message. However, it is dangerous to print things in - * trap_fatal() - printf() might be reentered and trap. + * trap_fatal() - kprintf() might be reentered and trap. * The debugger should be given control first. */ if (ddb_mode) diff --git a/sys/platform/pc32/i386/elan-mmcr.c b/sys/platform/pc32/i386/elan-mmcr.c index b9ee0e8f0d..f84d2d3e4b 100644 --- a/sys/platform/pc32/i386/elan-mmcr.c +++ b/sys/platform/pc32/i386/elan-mmcr.c @@ -7,7 +7,7 @@ * ---------------------------------------------------------------------------- * * $FreeBSD: src/sys/i386/i386/elan-mmcr.c,v 1.6.2.1 2002/09/17 22:39:53 sam Exp $ - * $DragonFly: src/sys/platform/pc32/i386/elan-mmcr.c,v 1.8 2006/07/28 02:17:39 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/elan-mmcr.c,v 1.9 2006/12/23 00:27:03 swildner Exp $ * The AMD Elan sc520 is a system-on-chip gadget which is used in embedded * kind of things, see www.soekris.com for instance, and it has a few quirks * we need to deal with. @@ -60,7 +60,7 @@ init_AMD_Elan_sc520(void) int i; if (bootverbose) - printf("Doing h0h0magic for AMD Elan sc520\n"); + kprintf("Doing h0h0magic for AMD Elan sc520\n"); elan_mmcr = pmap_mapdev(0xfffef000, 0x1000); /*- @@ -76,7 +76,7 @@ init_AMD_Elan_sc520(void) &new, sizeof new, NULL); if (bootverbose) - printf("sysctl machdep.i8254_freq=%d returns %d\n", new, i); + kprintf("sysctl machdep.i8254_freq=%d returns %d\n", new, i); #if 0 /* Start GP timer #2 and use it as timecounter, hz permitting */ @@ -137,7 +137,7 @@ elan_drvinit(void) if (elan_mmcr == NULL) return; - printf("Elan-mmcr driver: MMCR at %p\n", elan_mmcr); + kprintf("Elan-mmcr driver: MMCR at %p\n", elan_mmcr); dev_ops_add(&elan_ops, 0, 0); make_dev(&elan_ops, 0, UID_ROOT, GID_WHEEL, 0600, "elan-mmcr"); return; diff --git a/sys/platform/pc32/i386/est.c b/sys/platform/pc32/i386/est.c index f3876f340d..75ff91a806 100644 --- a/sys/platform/pc32/i386/est.c +++ b/sys/platform/pc32/i386/est.c @@ -85,7 +85,7 @@ * ACPI objects: _PCT is MSR location, _PSS is freq/voltage, _PPC is caps. * * $NetBSD: est.c,v 1.24 2006/03/15 22:56:38 dogcow Exp $ - * $DragonFly: src/sys/platform/pc32/i386/est.c,v 1.3 2006/12/20 18:14:42 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/est.c,v 1.4 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -587,24 +587,24 @@ est_init(void) do_cpuid(1, regs); #endif if ((cpu_feature2 & CPUID2_EST) == 0) { - printf("Enhanced SpeedStep unsupported on this hardware.\n"); + kprintf("Enhanced SpeedStep unsupported on this hardware.\n"); return(EOPNOTSUPP); } modellen = sizeof(hwmodel); err = kernel_sysctl(mib, 2, hwmodel, &modellen, NULL, 0, NULL); if (err) { - printf("kernel_sysctl hw.model failed\n"); + kprintf("kernel_sysctl hw.model failed\n"); return(err); } msr = rdmsr(MSR_PERF_STATUS); mv = MSR2MV(msr); - printf("%s (%d mV) ", est_desc, mv); + kprintf("%s (%d mV) ", est_desc, mv); est_fqlist = findcpu(hwmodel, mv); if (est_fqlist == NULL) { - printf(" - unknown CPU or operating point" + kprintf(" - unknown CPU or operating point" "(cpu_id:%#x, msr:%#llx).\n", cpu_id, msr); return(EOPNOTSUPP); } @@ -613,11 +613,11 @@ est_init(void) * OK, tell the user the available frequencies. */ fsbmult = est_fqlist->fsbmult; - printf("%d MHz\n", MSR2MHZ(msr)); + kprintf("%d MHz\n", MSR2MHZ(msr)); freq_len = est_fqlist->tablec * (sizeof("9999 ")-1) + 1; if (freq_len >= sizeof(freqs_available)) { - printf("increase the size of freqs_available[]\n"); + kprintf("increase the size of freqs_available[]\n"); return(ENOMEM); } freqs_available[0] = '\0'; @@ -627,7 +627,7 @@ est_init(void) est_fqlist->table[i].mhz, i < est_fqlist->tablec - 1 ? " " : ""); } - printf("%s frequencies available (MHz): %s\n", est_desc, + kprintf("%s frequencies available (MHz): %s\n", est_desc, freqs_available); /* diff --git a/sys/platform/pc32/i386/i686_mem.c b/sys/platform/pc32/i386/i686_mem.c index bcfae17740..06794ee8bb 100644 --- a/sys/platform/pc32/i386/i686_mem.c +++ b/sys/platform/pc32/i386/i686_mem.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/i686_mem.c,v 1.8.2.4 2002/09/24 08:12:51 mdodd Exp $ - * $DragonFly: src/sys/platform/pc32/i386/i686_mem.c,v 1.6 2006/12/17 20:07:32 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/i686_mem.c,v 1.7 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -559,11 +559,11 @@ i686_mrinit(struct mem_range_softc *sc) /* For now, bail out if MTRRs are not enabled */ if (!(mtrrdef & 0x800)) { if (bootverbose) - printf("CPU supports MTRRs but not enabled\n"); + kprintf("CPU supports MTRRs but not enabled\n"); return; } nmdesc = mtrrcap & 0xff; - printf("Pentium Pro MTRR support enabled\n"); + kprintf("Pentium Pro MTRR support enabled\n"); /* If fixed MTRRs supported and enabled */ if ((mtrrcap & 0x100) && (mtrrdef & 0x400)) { diff --git a/sys/platform/pc32/i386/identcpu.c b/sys/platform/pc32/i386/identcpu.c index f2d6e0cab4..e5d2c128c0 100644 --- a/sys/platform/pc32/i386/identcpu.c +++ b/sys/platform/pc32/i386/identcpu.c @@ -39,7 +39,7 @@ * * from: Id: machdep.c,v 1.193 1996/06/18 01:22:04 bde Exp * $FreeBSD: src/sys/i386/i386/identcpu.c,v 1.80.2.15 2003/04/11 17:06:41 jhb Exp $ - * $DragonFly: src/sys/platform/pc32/i386/identcpu.c,v 1.14 2006/12/07 13:33:04 tgen Exp $ + * $DragonFly: src/sys/platform/pc32/i386/identcpu.c,v 1.15 2006/12/23 00:27:03 swildner Exp $ */ #include "opt_cpu.h" @@ -166,7 +166,7 @@ printcpuinfo(void) char *brand; cpu_class = i386_cpus[cpu].cpu_class; - printf("CPU: "); + kprintf("CPU: "); strncpy(cpu_model, i386_cpus[cpu].cpu_name, sizeof (cpu_model)); #if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) @@ -592,47 +592,47 @@ printcpuinfo(void) #endif - printf("%s (", cpu_model); + kprintf("%s (", cpu_model); switch(cpu_class) { case CPUCLASS_286: - printf("286"); + kprintf("286"); break; #if defined(I386_CPU) case CPUCLASS_386: - printf("386"); + kprintf("386"); break; #endif #if defined(I486_CPU) case CPUCLASS_486: - printf("486"); + kprintf("486"); /* bzero = i486_bzero; */ break; #endif #if defined(I586_CPU) case CPUCLASS_586: - printf("%d.%02d-MHz ", + kprintf("%d.%02d-MHz ", (tsc_freq + 4999) / 1000000, ((tsc_freq + 4999) / 10000) % 100); - printf("586"); + kprintf("586"); break; #endif #if defined(I686_CPU) case CPUCLASS_686: - printf("%d.%02d-MHz ", + kprintf("%d.%02d-MHz ", (tsc_freq + 4999) / 1000000, ((tsc_freq + 4999) / 10000) % 100); - printf("686"); + kprintf("686"); break; #endif default: - printf("Unknown"); /* will panic below... */ + kprintf("Unknown"); /* will panic below... */ } - printf("-class CPU)\n"); + kprintf("-class CPU)\n"); #if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU) if(*cpu_vendor) - printf(" Origin = \"%s\"",cpu_vendor); + kprintf(" Origin = \"%s\"",cpu_vendor); if(cpu_id) - printf(" Id = 0x%x", cpu_id); + kprintf(" Id = 0x%x", cpu_id); if (strcmp(cpu_vendor, "GenuineIntel") == 0 || strcmp(cpu_vendor, "AuthenticAMD") == 0 || @@ -640,9 +640,9 @@ printcpuinfo(void) strcmp(cpu_vendor, "CentaurHauls") == 0 || ((strcmp(cpu_vendor, "CyrixInstead") == 0) && ((cpu_id & 0xf00) > 0x500))) { - printf(" Stepping = %u", cpu_id & 0xf); + kprintf(" Stepping = %u", cpu_id & 0xf); if (strcmp(cpu_vendor, "CyrixInstead") == 0) - printf(" DIR=0x%04x", cyrix_did); + kprintf(" DIR=0x%04x", cyrix_did); if (cpu_high > 0) { /* * Here we should probably set up flags indicating @@ -652,7 +652,7 @@ printcpuinfo(void) * to check that all CPUs >= Pentium have a TSC and * MSRs. */ - printf("\n Features=0x%b", cpu_feature, + kprintf("\n Features=0x%b", cpu_feature, "\020" "\001FPU" /* Integral FPU */ "\002VME" /* Extended VM86 mode support */ @@ -694,24 +694,24 @@ printcpuinfo(void) */ if (cpu_feature & CPUID_HTT && (cpu_procinfo & CPUID_HTT_CORES) >> 16 > 1) - printf("\n Hyperthreading: %d logical CPUs", + kprintf("\n Hyperthreading: %d logical CPUs", (cpu_procinfo & CPUID_HTT_CORES) >> 16); } if (strcmp(cpu_vendor, "AuthenticAMD") == 0 && cpu_exthigh >= 0x80000001) print_AMD_features(); } else if (strcmp(cpu_vendor, "CyrixInstead") == 0) { - printf(" DIR=0x%04x", cyrix_did); - printf(" Stepping=%u", (cyrix_did & 0xf000) >> 12); - printf(" Revision=%u", (cyrix_did & 0x0f00) >> 8); + kprintf(" DIR=0x%04x", cyrix_did); + kprintf(" Stepping=%u", (cyrix_did & 0xf000) >> 12); + kprintf(" Revision=%u", (cyrix_did & 0x0f00) >> 8); #ifndef CYRIX_CACHE_REALLY_WORKS if (cpu == CPU_M1 && (cyrix_did & 0xff00) < 0x1700) - printf("\n CPU cache: write-through mode"); + kprintf("\n CPU cache: write-through mode"); #endif } /* Avoid ugly blank lines: only print newline when we have to. */ if (*cpu_vendor || cpu_id) - printf("\n"); + kprintf("\n"); #endif if (strcmp(cpu_vendor, "GenuineTMx86") == 0 || @@ -720,7 +720,7 @@ printcpuinfo(void) } for (i = 0; i < additional_cpu_info_count; ++i) { - printf(" %s\n", additional_cpu_info_ary[i]); + kprintf(" %s\n", additional_cpu_info_ary[i]); } if (!bootverbose) @@ -998,9 +998,9 @@ static void print_AMD_assoc(int i) { if (i == 255) - printf(", fully associative\n"); + kprintf(", fully associative\n"); else - printf(", %d-way associative\n", i); + kprintf(", %d-way associative\n", i); } static void @@ -1012,17 +1012,17 @@ print_AMD_info(void) u_int regs[4]; do_cpuid(0x80000005, regs); - printf("Data TLB: %d entries", (regs[1] >> 16) & 0xff); + kprintf("Data TLB: %d entries", (regs[1] >> 16) & 0xff); print_AMD_assoc(regs[1] >> 24); - printf("Instruction TLB: %d entries", regs[1] & 0xff); + kprintf("Instruction TLB: %d entries", regs[1] & 0xff); print_AMD_assoc((regs[1] >> 8) & 0xff); - printf("L1 data cache: %d kbytes", regs[2] >> 24); - printf(", %d bytes/line", regs[2] & 0xff); - printf(", %d lines/tag", (regs[2] >> 8) & 0xff); + kprintf("L1 data cache: %d kbytes", regs[2] >> 24); + kprintf(", %d bytes/line", regs[2] & 0xff); + kprintf(", %d lines/tag", (regs[2] >> 8) & 0xff); print_AMD_assoc((regs[2] >> 16) & 0xff); - printf("L1 instruction cache: %d kbytes", regs[3] >> 24); - printf(", %d bytes/line", regs[3] & 0xff); - printf(", %d lines/tag", (regs[3] >> 8) & 0xff); + kprintf("L1 instruction cache: %d kbytes", regs[3] >> 24); + kprintf(", %d bytes/line", regs[3] & 0xff); + kprintf(", %d lines/tag", (regs[3] >> 8) & 0xff); print_AMD_assoc((regs[3] >> 16) & 0xff); if (cpu_exthigh >= 0x80000006) { /* K6-III, or later */ do_cpuid(0x80000006, regs); @@ -1030,13 +1030,13 @@ print_AMD_info(void) * Report right L2 cache size on Duron rev. A0. */ if ((cpu_id & 0xFF0) == 0x630) - printf("L2 internal cache: 64 kbytes"); + kprintf("L2 internal cache: 64 kbytes"); else - printf("L2 internal cache: %d kbytes", + kprintf("L2 internal cache: %d kbytes", regs[2] >> 16); - printf(", %d bytes/line", regs[2] & 0xff); - printf(", %d lines/tag", (regs[2] >> 8) & 0x0f); + kprintf(", %d bytes/line", regs[2] & 0xff); + kprintf(", %d lines/tag", (regs[2] >> 8) & 0x0f); print_AMD_assoc((regs[2] >> 12) & 0x0f); } } @@ -1047,11 +1047,11 @@ print_AMD_info(void) /* K6-2(new core [Stepping 8-F]), K6-III or later */ amd_whcr = rdmsr(0xc0000082); if (!(amd_whcr & (0x3ff << 22))) { - printf("Write Allocate Disable\n"); + kprintf("Write Allocate Disable\n"); } else { - printf("Write Allocate Enable Limit: %dM bytes\n", + kprintf("Write Allocate Enable Limit: %dM bytes\n", (u_int32_t)((amd_whcr & (0x3ff << 22)) >> 22) * 4); - printf("Write Allocate 15-16M bytes: %s\n", + kprintf("Write Allocate 15-16M bytes: %s\n", (amd_whcr & (1 << 16)) ? "Enable" : "Disable"); } } else if (((cpu_id & 0xf00) == 0x500) @@ -1059,13 +1059,13 @@ print_AMD_info(void) /* K6, K6-2(old core) */ amd_whcr = rdmsr(0xc0000082); if (!(amd_whcr & (0x7f << 1))) { - printf("Write Allocate Disable\n"); + kprintf("Write Allocate Disable\n"); } else { - printf("Write Allocate Enable Limit: %dM bytes\n", + kprintf("Write Allocate Enable Limit: %dM bytes\n", (u_int32_t)((amd_whcr & (0x7f << 1)) >> 1) * 4); - printf("Write Allocate 15-16M bytes: %s\n", + kprintf("Write Allocate 15-16M bytes: %s\n", (amd_whcr & 0x0001) ? "Enable" : "Disable"); - printf("Hardware Write Allocate Control: %s\n", + kprintf("Hardware Write Allocate Control: %s\n", (amd_whcr & 0x0100) ? "Enable" : "Disable"); } } @@ -1082,7 +1082,7 @@ print_AMD_features(void) * http://www.amd.com/products/cpg/athlon/techdocs/pdf/20734.pdf */ do_cpuid(0x80000001, regs); - printf("\n AMD Features=0x%b", regs[3] &~ cpu_feature, + kprintf("\n AMD Features=0x%b", regs[3] &~ cpu_feature, "\020" /* in hex */ "\001FPU" /* Integral FPU */ "\002VME" /* Extended VM86 mode support */ @@ -1306,7 +1306,7 @@ print_transmeta_info(void) nreg = regs[0]; if (nreg >= 0x80860001) { do_cpuid(0x80860001, regs); - printf(" Processor revision %u.%u.%u.%u\n", + kprintf(" Processor revision %u.%u.%u.%u\n", (regs[1] >> 24) & 0xff, (regs[1] >> 16) & 0xff, (regs[1] >> 8) & 0xff, @@ -1314,7 +1314,7 @@ print_transmeta_info(void) } if (nreg >= 0x80860002) { do_cpuid(0x80860002, regs); - printf(" Code Morphing Software revision %u.%u.%u-%u-%u\n", + kprintf(" Code Morphing Software revision %u.%u.%u-%u-%u\n", (regs[1] >> 24) & 0xff, (regs[1] >> 16) & 0xff, (regs[1] >> 8) & 0xff, @@ -1328,13 +1328,13 @@ print_transmeta_info(void) do_cpuid(0x80860005, (u_int*) &info[32]); do_cpuid(0x80860006, (u_int*) &info[48]); info[64] = 0; - printf(" %s\n", info); + kprintf(" %s\n", info); } crusoe_longrun = tmx86_get_longrun_mode(); tmx86_get_longrun_status(&crusoe_frequency, &crusoe_voltage, &crusoe_percentage); - printf(" LongRun mode: %d <%dMHz %dmV %d%%>\n", crusoe_longrun, + kprintf(" LongRun mode: %d <%dMHz %dmV %d%%>\n", crusoe_longrun, crusoe_frequency, crusoe_voltage, crusoe_percentage); } diff --git a/sys/platform/pc32/i386/initcpu.c b/sys/platform/pc32/i386/initcpu.c index 6f427401e5..bfc387f968 100644 --- a/sys/platform/pc32/i386/initcpu.c +++ b/sys/platform/pc32/i386/initcpu.c @@ -27,7 +27,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/initcpu.c,v 1.19.2.9 2003/04/05 13:47:19 dwmalone Exp $ - * $DragonFly: src/sys/platform/pc32/i386/initcpu.c,v 1.9 2005/12/24 20:34:04 swildner Exp $ + * $DragonFly: src/sys/platform/pc32/i386/initcpu.c,v 1.10 2006/12/23 00:27:03 swildner Exp $ */ #include "opt_cpu.h" @@ -800,18 +800,18 @@ DB_SHOW_COMMAND(cyrixreg, cyrixreg) write_eflags(eflags); if ((cpu != CPU_M1SC) && (cpu != CPU_CY486DX)) - printf("CCR0=%x, ", (u_int)ccr0); + kprintf("CCR0=%x, ", (u_int)ccr0); - printf("CCR1=%x, CCR2=%x, CCR3=%x", + kprintf("CCR1=%x, CCR2=%x, CCR3=%x", (u_int)ccr1, (u_int)ccr2, (u_int)ccr3); if ((cpu == CPU_M1SC) || (cpu == CPU_M1) || (cpu == CPU_M2)) { - printf(", CCR4=%x, ", (u_int)ccr4); + kprintf(", CCR4=%x, ", (u_int)ccr4); if (cpu == CPU_M1SC) - printf("PCR0=%x\n", pcr0); + kprintf("PCR0=%x\n", pcr0); else - printf("CCR5=%x\n", ccr5); + kprintf("CCR5=%x\n", ccr5); } } - printf("CR0=%x\n", cr0); + kprintf("CR0=%x\n", cr0); } #endif /* DDB */ diff --git a/sys/platform/pc32/i386/k6_mem.c b/sys/platform/pc32/i386/k6_mem.c index dbf5220db7..3cd6a45943 100644 --- a/sys/platform/pc32/i386/k6_mem.c +++ b/sys/platform/pc32/i386/k6_mem.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/k6_mem.c,v 1.4.2.2 2002/09/16 21:58:41 dwmalone Exp $ - * $DragonFly: src/sys/platform/pc32/i386/k6_mem.c,v 1.7 2006/12/17 20:07:32 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/k6_mem.c,v 1.8 2006/12/23 00:27:03 swildner Exp $ * */ @@ -130,7 +130,7 @@ k6_mrinit(struct mem_range_softc *sc) { sc->mr_desc[d].mr_flags |= MDF_UNCACHEABLE; } - printf("K6-family MTRR support enabled (%d registers)\n", sc->mr_ndesc); + kprintf("K6-family MTRR support enabled (%d registers)\n", sc->mr_ndesc); } static int diff --git a/sys/platform/pc32/i386/machdep.c b/sys/platform/pc32/i386/machdep.c index 0fa5785659..f5d92e5a6f 100644 --- a/sys/platform/pc32/i386/machdep.c +++ b/sys/platform/pc32/i386/machdep.c @@ -36,7 +36,7 @@ * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 * $FreeBSD: src/sys/i386/i386/machdep.c,v 1.385.2.30 2003/05/31 08:48:05 alc Exp $ - * $DragonFly: src/sys/platform/pc32/i386/machdep.c,v 1.105 2006/12/04 18:03:28 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/machdep.c,v 1.106 2006/12/23 00:27:03 swildner Exp $ */ #include "use_apm.h" @@ -256,25 +256,25 @@ cpu_startup(void *dummy) /* * Good {morning,afternoon,evening,night}. */ - printf("%s", version); + kprintf("%s", version); startrtclock(); printcpuinfo(); panicifcpuunsupported(); #ifdef PERFMON perfmon_init(); #endif - printf("real memory = %llu (%lluK bytes)\n", ptoa(Maxmem), ptoa(Maxmem) / 1024); + kprintf("real memory = %llu (%lluK bytes)\n", ptoa(Maxmem), ptoa(Maxmem) / 1024); /* * Display any holes after the first chunk of extended memory. */ if (bootverbose) { int indx; - printf("Physical memory chunk(s):\n"); + kprintf("Physical memory chunk(s):\n"); for (indx = 0; phys_avail[indx + 1] != 0; indx += 2) { vm_paddr_t size1 = phys_avail[indx + 1] - phys_avail[indx]; - printf("0x%08llx - 0x%08llx, %llu bytes (%llu pages)\n", + kprintf("0x%08llx - 0x%08llx, %llu bytes (%llu pages)\n", phys_avail[indx], phys_avail[indx + 1] - 1, size1, size1 / PAGE_SIZE); } @@ -335,7 +335,7 @@ again: (BKVASIZE * 2)) { nbuf = (kernel_map->max_offset - kernel_map->min_offset) / (BKVASIZE * 2); - printf("Warning: nbufs capped at %d\n", nbuf); + kprintf("Warning: nbufs capped at %d\n", nbuf); } nswbuf = max(min(nbuf/4, 256), 16); @@ -383,7 +383,7 @@ again: cninit(); /* the preferred console may have changed */ #endif - printf("avail memory = %u (%uK bytes)\n", ptoa(vmstats.v_free_count), + kprintf("avail memory = %u (%uK bytes)\n", ptoa(vmstats.v_free_count), ptoa(vmstats.v_free_count) / 1024); /* @@ -620,7 +620,7 @@ sys_sigreturn(struct sigreturn_args *uap) * one less debugger trap, so allowing it is fairly harmless. */ if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { - printf("sigreturn: eflags = 0x%x\n", eflags); + kprintf("sigreturn: eflags = 0x%x\n", eflags); return(EINVAL); } @@ -631,7 +631,7 @@ sys_sigreturn(struct sigreturn_args *uap) */ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { - printf("sigreturn: cs = 0x%x\n", cs); + kprintf("sigreturn: cs = 0x%x\n", cs); trapsignal(lp->lwp_proc, SIGBUS, T_PROTFLT); return(EINVAL); } @@ -677,7 +677,7 @@ sendupcall(struct vmupcall *vu, int morepending) copyin((char *)upcall.upc_uthread + upcall.upc_critoff, &crit_count, sizeof(int)) ) { vu->vu_pending = 0; - printf("bad upcall address\n"); + kprintf("bad upcall address\n"); return; } @@ -722,7 +722,7 @@ sendupcall(struct vmupcall *vu, int morepending) upc_frame.oldip = regs->tf_eip; if (copyout(&upc_frame, (void *)(regs->tf_esp - sizeof(upc_frame)), sizeof(upc_frame)) != 0) { - printf("bad stack on upcall\n"); + kprintf("bad stack on upcall\n"); } else { regs->tf_eax = (register_t)vu->vu_func; regs->tf_ecx = (register_t)vu->vu_data; @@ -1362,7 +1362,7 @@ getmemsize(int first) vm86_intcall(0x12, &vmf); basemem = vmf.vmf_ax; if (basemem > 640) { - printf("Preposterous BIOS basemem of %uK, " + kprintf("Preposterous BIOS basemem of %uK, " "truncating to < 640K\n", basemem); basemem = 636; } @@ -1429,7 +1429,7 @@ int15e820: if (i || vmf.vmf_eax != SMAP_SIG) break; if (boothowto & RB_VERBOSE) - printf("SMAP type=%02x base=%08x %08x len=%08x %08x\n", + kprintf("SMAP type=%02x base=%08x %08x len=%08x %08x\n", smap->type, *(u_int32_t *)((char *)&smap->base + 4), (u_int32_t)smap->base, @@ -1443,7 +1443,7 @@ int15e820: goto next_run; if (smap->base >= 0xffffffff) { - printf("%uK of memory above 4GB ignored\n", + kprintf("%uK of memory above 4GB ignored\n", (u_int)(smap->length / 1024)); goto next_run; } @@ -1451,7 +1451,7 @@ int15e820: for (i = 0; i <= physmap_idx; i += 2) { if (smap->base < physmap[i + 1]) { if (boothowto & RB_VERBOSE) - printf( + kprintf( "Overlapping or non-montonic memory region, ignoring second region\n"); goto next_run; } @@ -1464,7 +1464,7 @@ int15e820: physmap_idx += 2; if (physmap_idx == PHYSMAP_ENTRIES*2) { - printf( + kprintf( "Too many segments in the physical address map, giving up\n"); break; } @@ -1490,7 +1490,7 @@ next_run: } if (basemem > 640) { - printf("Preposterous BIOS basemem of %uK, truncating to 640K\n", + kprintf("Preposterous BIOS basemem of %uK, truncating to 640K\n", basemem); basemem = 640; } @@ -1600,14 +1600,14 @@ physmap_done: AllowMem = 0; } if (AllowMem == 0) - printf("Ignoring invalid memory size of '%s'\n", cp); + kprintf("Ignoring invalid memory size of '%s'\n", cp); else Maxmem = atop(AllowMem); } if (atop(physmap[physmap_idx + 1]) != Maxmem && (boothowto & RB_VERBOSE)) - printf("Physical memory use set to %lluK\n", Maxmem * 4); + kprintf("Physical memory use set to %lluK\n", Maxmem * 4); /* * If Maxmem has been increased beyond what the system has detected, @@ -1731,7 +1731,7 @@ physmap_done: } else { pa_indx++; if (pa_indx >= PHYSMAP_ENTRIES*2) { - printf("Too many holes in the physical address space, giving up\n"); + kprintf("Too many holes in the physical address space, giving up\n"); pa_indx--; break; } @@ -1947,7 +1947,7 @@ init386(int first) cninit(); if (metadata_missing) - printf("WARNING: loader(8) metadata is missing!\n"); + kprintf("WARNING: loader(8) metadata is missing!\n"); #if NISA >0 isa_defaultirq(); @@ -2085,7 +2085,7 @@ f00f_hack(void *unused) if (!has_f00f_bug) return; - printf("Intel Pentium detected, installing workaround for F00F bug\n"); + kprintf("Intel Pentium detected, installing workaround for F00F bug\n"); r_idt.rd_limit = sizeof(idt0) - 1; @@ -2444,7 +2444,7 @@ user_dbreg_trap(void) void Debugger(const char *msg) { - printf("Debugger(\"%s\") called.\n", msg); + kprintf("Debugger(\"%s\") called.\n", msg); } #endif /* no DDB */ @@ -2604,7 +2604,7 @@ struct spinlock_deprecated mcount_spinlock; /* locks com (tty) data/hardware accesses: a FASTINTR() */ struct spinlock_deprecated com_spinlock; -/* locks kernel printfs */ +/* locks kernel kprintfs */ struct spinlock_deprecated cons_spinlock; /* lock regions around the clock hardware */ diff --git a/sys/platform/pc32/i386/math_emulate.c b/sys/platform/pc32/i386/math_emulate.c index 09f240e885..81790b95f7 100644 --- a/sys/platform/pc32/i386/math_emulate.c +++ b/sys/platform/pc32/i386/math_emulate.c @@ -7,7 +7,7 @@ * * from: 386BSD 0.1 * $FreeBSD: src/sys/i386/i386/math_emulate.c,v 1.35 1999/08/28 00:43:47 peter Exp $ - * $DragonFly: src/sys/platform/pc32/i386/math_emulate.c,v 1.7 2006/11/07 20:48:15 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/math_emulate.c,v 1.8 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -114,7 +114,7 @@ math_emulate(struct trapframe *info) oldeip = info->tf_eip; /* 0x001f means user code space */ if ((u_short)info->tf_cs != 0x001F) { - printf("math_emulate: %04x:%08lx\n", (u_short)info->tf_cs, + kprintf("math_emulate: %04x:%08lx\n", (u_short)info->tf_cs, (u_long)oldeip); panic("?Math emulation needed in kernel?"); } @@ -146,7 +146,7 @@ math_emulate(struct trapframe *info) ftst(PST(0)); return(0); case 0x1e5: /* fxam */ - printf("fxam not implemented\n"); + kprintf("fxam not implemented\n"); math_abort(info,SIGILL); case 0x1e6: case 0x1e7: /* fldenv */ math_abort(info,SIGILL); @@ -314,7 +314,7 @@ for fcom , ??? ATS */ real_to_real(&tmp,&ST(code & 7)); return(0); case 0xb8: /* ffree */ - printf("ffree not implemented\n"); + kprintf("ffree not implemented\n"); math_abort(info,SIGILL); case 0xb9: /* fstp ???? where is the pop ? ATS */ fxchg(&ST(0),&ST(code & 7)); @@ -371,7 +371,7 @@ for fcom , ??? ATS */ fpop(); return(0); case 0xf8: /* fild 16-bit mem ???? ATS */ - printf("ffree not implemented\n"); + kprintf("ffree not implemented\n"); math_abort(info,SIGILL); fpop(); return(0); @@ -546,7 +546,7 @@ for fcom , ??? ATS */ real_to_real(&tmp,&ST(0)); return(0); } - printf("Unknown math-insns: %04x:%08x %04x\n",(u_short)info->tf_cs, + kprintf("Unknown math-insns: %04x:%08x %04x\n",(u_short)info->tf_cs, info->tf_eip,code); math_abort(info,SIGFPE); } @@ -1552,21 +1552,21 @@ fpu_modevent(module_t mod, int type, void *unused) switch (type) { case MOD_LOAD: if (pmath_emulate) { - printf("Another Math emulator already present\n"); + kprintf("Another Math emulator already present\n"); return EBUSY; } pmath_emulate = math_emulate; if (bootverbose) - printf("Math emulator present\n"); + kprintf("Math emulator present\n"); break; case MOD_UNLOAD: if (pmath_emulate != math_emulate) { - printf("Cannot unload another math emulator\n"); + kprintf("Cannot unload another math emulator\n"); return EACCES; } pmath_emulate = 0; if (bootverbose) - printf("Math emulator unloaded\n"); + kprintf("Math emulator unloaded\n"); break; default: break; diff --git a/sys/platform/pc32/i386/mp_machdep.c b/sys/platform/pc32/i386/mp_machdep.c index ecb90a3f99..746ece3896 100644 --- a/sys/platform/pc32/i386/mp_machdep.c +++ b/sys/platform/pc32/i386/mp_machdep.c @@ -23,7 +23,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/mp_machdep.c,v 1.115.2.15 2003/03/14 21:22:35 jhb Exp $ - * $DragonFly: src/sys/platform/pc32/i386/mp_machdep.c,v 1.53 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/mp_machdep.c,v 1.54 2006/12/23 00:27:03 swildner Exp $ */ #include "opt_cpu.h" @@ -177,7 +177,7 @@ typedef struct BASETABLE_ENTRY { CHECK_WRITE(0x39, (D)); #define CHECK_PRINT(S); \ - printf("%s: %d, %d, %d, %d, %d, %d\n", \ + kprintf("%s: %d, %d, %d, %d, %d, %d\n", \ (S), \ CHECK_READ(0x34), \ CHECK_READ(0x35), \ @@ -402,24 +402,24 @@ mp_announce(void) POSTCODE(MP_ANNOUNCE_POST); - printf("DragonFly/MP: Multiprocessor motherboard\n"); - printf(" cpu0 (BSP): apic id: %2d", CPU_TO_ID(0)); - printf(", version: 0x%08x", cpu_apic_versions[0]); - printf(", at 0x%08x\n", cpu_apic_address); + kprintf("DragonFly/MP: Multiprocessor motherboard\n"); + kprintf(" cpu0 (BSP): apic id: %2d", CPU_TO_ID(0)); + kprintf(", version: 0x%08x", cpu_apic_versions[0]); + kprintf(", at 0x%08x\n", cpu_apic_address); for (x = 1; x <= mp_naps; ++x) { - printf(" cpu%d (AP): apic id: %2d", x, CPU_TO_ID(x)); - printf(", version: 0x%08x", cpu_apic_versions[x]); - printf(", at 0x%08x\n", cpu_apic_address); + kprintf(" cpu%d (AP): apic id: %2d", x, CPU_TO_ID(x)); + kprintf(", version: 0x%08x", cpu_apic_versions[x]); + kprintf(", at 0x%08x\n", cpu_apic_address); } #if defined(APIC_IO) for (x = 0; x < mp_napics; ++x) { - printf(" io%d (APIC): apic id: %2d", x, IO_TO_ID(x)); - printf(", version: 0x%08x", io_apic_versions[x]); - printf(", at 0x%08x\n", io_apic_address[x]); + kprintf(" io%d (APIC): apic id: %2d", x, IO_TO_ID(x)); + kprintf(", version: 0x%08x", io_apic_versions[x]); + kprintf(", at 0x%08x\n", io_apic_address[x]); } #else - printf(" Warning: APIC I/O disabled\n"); + kprintf(" Warning: APIC I/O disabled\n"); #endif /* APIC_IO */ } @@ -790,7 +790,7 @@ mptable_pass1(void) /* qualify the numbers */ if (mp_naps > MAXCPU) { - printf("Warning: only using %d of %d available CPUs!\n", + kprintf("Warning: only using %d of %d available CPUs!\n", MAXCPU, mp_naps); mp_naps = MAXCPU; } @@ -1102,7 +1102,7 @@ swap_apic_id(int apic, int oldid, int newid) if (oldid == newid) return; /* Nothing to do */ - printf("Changing APIC ID for IO APIC #%d from %d to %d in MP table\n", + kprintf("Changing APIC ID for IO APIC #%d from %d to %d in MP table\n", apic, oldid, newid); /* Swap physical APIC IDs in interrupt entries */ @@ -1119,7 +1119,7 @@ swap_apic_id(int apic, int oldid, int newid) break; if (oapic < mp_napics) { - printf("Changing APIC ID for IO APIC #%d from " + kprintf("Changing APIC ID for IO APIC #%d from " "%d to %d in MP table\n", oapic, newid, oldid); IO_TO_ID(oapic) = oldid; @@ -1316,7 +1316,7 @@ fix_mp_table(void) #ifdef APIC_IO /* detect and fix broken Compaq MP table */ if (apic_int_type(0, 0) == -1) { - printf("APIC_IO: MP table broken: 8259->APIC entry missing!\n"); + kprintf("APIC_IO: MP table broken: 8259->APIC entry missing!\n"); io_apic_ints[nintrs].int_type = 3; /* ExtInt */ io_apic_ints[nintrs].int_vector = 0xff; /* Unassigned */ /* XXX fixme, set src bus id etc, but it doesn't seem to hurt */ @@ -1324,7 +1324,7 @@ fix_mp_table(void) io_apic_ints[nintrs].dst_apic_int = 0; /* Pin 0 */ nintrs++; } else if (apic_int_type(0, 0) == 0) { - printf("APIC_IO: MP table broken: ExtINT entry corrupt!\n"); + kprintf("APIC_IO: MP table broken: ExtINT entry corrupt!\n"); for (x = 0; x < nintrs; ++x) if ((0 == ID_TO_IO(io_apic_ints[x].dst_apic_id)) && (0 == io_apic_ints[x].dst_apic_int)) { @@ -1344,7 +1344,7 @@ fix_mp_table(void) * ACPI table has an entry for both 14 and 15. */ if (apic_int_type(0, 14) == 0 && apic_int_type(0, 15) == -1) { - printf("APIC_IO: MP table broken: IRQ 15 not ISA when IRQ 14 is!\n"); + kprintf("APIC_IO: MP table broken: IRQ 15 not ISA when IRQ 14 is!\n"); io14 = io_apic_find_int_entry(0, 14); io_apic_ints[nintrs] = *io14; io_apic_ints[nintrs].src_bus_irq = 15; @@ -1536,7 +1536,7 @@ isa_apic_mask(u_int isa_mask) #if defined(SKIP_IRQ15_REDIRECT) if (isa_mask == (1 << 15)) { - printf("skipping ISA IRQ15 redirect\n"); + kprintf("skipping ISA IRQ15 redirect\n"); return isa_mask; } #endif /* SKIP_IRQ15_REDIRECT */ @@ -1687,12 +1687,12 @@ undirect_isa_irq(int rirq) { #if defined(READY) if (bootverbose) - printf("Freeing redirected ISA irq %d.\n", rirq); + kprintf("Freeing redirected ISA irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else if (bootverbose) - printf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); + kprintf("Freeing (NOT implemented) redirected ISA irq %d.\n", rirq); return 0; #endif /* READY */ } @@ -1706,13 +1706,13 @@ undirect_pci_irq(int rirq) { #if defined(READY) if (bootverbose) - printf("Freeing redirected PCI irq %d.\n", rirq); + kprintf("Freeing redirected PCI irq %d.\n", rirq); /** FIXME: tickle the MB redirector chip */ return ???; #else if (bootverbose) - printf("Freeing (NOT implemented) redirected PCI irq %d.\n", + kprintf("Freeing (NOT implemented) redirected PCI irq %d.\n", rirq); return 0; #endif /* READY */ @@ -1876,31 +1876,31 @@ default_mp_table(int type) #endif /* APIC_IO */ #if 0 - printf(" MP default config type: %d\n", type); + kprintf(" MP default config type: %d\n", type); switch (type) { case 1: - printf(" bus: ISA, APIC: 82489DX\n"); + kprintf(" bus: ISA, APIC: 82489DX\n"); break; case 2: - printf(" bus: EISA, APIC: 82489DX\n"); + kprintf(" bus: EISA, APIC: 82489DX\n"); break; case 3: - printf(" bus: EISA, APIC: 82489DX\n"); + kprintf(" bus: EISA, APIC: 82489DX\n"); break; case 4: - printf(" bus: MCA, APIC: 82489DX\n"); + kprintf(" bus: MCA, APIC: 82489DX\n"); break; case 5: - printf(" bus: ISA+PCI, APIC: Integrated\n"); + kprintf(" bus: ISA+PCI, APIC: Integrated\n"); break; case 6: - printf(" bus: EISA+PCI, APIC: Integrated\n"); + kprintf(" bus: EISA+PCI, APIC: Integrated\n"); break; case 7: - printf(" bus: MCA+PCI, APIC: Integrated\n"); + kprintf(" bus: MCA+PCI, APIC: Integrated\n"); break; default: - printf(" future type\n"); + kprintf(" future type\n"); break; /* NOTREACHED */ } @@ -2129,10 +2129,10 @@ start_all_aps(u_int boot_addr) /* attempt to start the Application Processor */ CHECK_INIT(99); /* setup checkpoints */ if (!start_ap(gd, boot_addr)) { - printf("AP #%d (PHY# %d) failed!\n", x, CPU_TO_ID(x)); + kprintf("AP #%d (PHY# %d) failed!\n", x, CPU_TO_ID(x)); CHECK_PRINT("trace"); /* show checkpoints */ /* better panic as the AP may be running loose */ - printf("panic y/n? [y] "); + kprintf("panic y/n? [y] "); if (cngetc() != 'n') panic("bye-bye"); } @@ -2470,14 +2470,14 @@ ap_init(void) /* Build our map of 'other' CPUs. */ mycpu->gd_other_cpus = smp_startup_mask & ~(1 << mycpu->gd_cpuid); - printf("SMP: AP CPU #%d Launched!\n", mycpu->gd_cpuid); + kprintf("SMP: AP CPU #%d Launched!\n", mycpu->gd_cpuid); /* A quick check from sanity claus */ apic_id = (apic_id_to_logical[(lapic.id & 0x0f000000) >> 24]); if (mycpu->gd_cpuid != apic_id) { - printf("SMP: cpuid = %d\n", mycpu->gd_cpuid); - printf("SMP: apic_id = %d\n", apic_id); - printf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]); + kprintf("SMP: cpuid = %d\n", mycpu->gd_cpuid); + kprintf("SMP: apic_id = %d\n", apic_id); + kprintf("PTD[MPPTDI] = %p\n", (void *)PTD[MPPTDI]); panic("cpuid mismatch! boom!!"); } @@ -2518,7 +2518,7 @@ ap_finish(void) { mp_finish = 1; if (bootverbose) - printf("Finish MP startup\n"); + kprintf("Finish MP startup\n"); if (cpu_feature & CPUID_TSC) tsc0_offset = rdtsc(); tsc_offsets[0] = 0; @@ -2531,7 +2531,7 @@ ap_finish(void) while (try_mplock() == 0) ; if (bootverbose) - printf("Active CPU Mask: %08x\n", smp_active_mask); + kprintf("Active CPU Mask: %08x\n", smp_active_mask); } SYSINIT(finishsmp, SI_SUB_FINISH_SMP, SI_ORDER_FIRST, ap_finish, NULL) diff --git a/sys/platform/pc32/i386/nexus.c b/sys/platform/pc32/i386/nexus.c index 80f4b62978..b5c2426e56 100644 --- a/sys/platform/pc32/i386/nexus.c +++ b/sys/platform/pc32/i386/nexus.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/nexus.c,v 1.26.2.10 2003/02/22 13:16:45 imp Exp $ - * $DragonFly: src/sys/platform/pc32/i386/nexus.c,v 1.28 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/nexus.c,v 1.29 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -247,7 +247,7 @@ nexus_print_all_resources(device_t dev) int retval = 0; if (SLIST_FIRST(rl) || ndev->nx_pcibus != -1) - retval += printf(" at"); + retval += kprintf(" at"); retval += resource_list_print_type(rl, "port", SYS_RES_IOPORT, "%#lx"); retval += resource_list_print_type(rl, "iomem", SYS_RES_MEMORY, "%#lx"); @@ -265,8 +265,8 @@ nexus_print_child(device_t bus, device_t child) retval += bus_print_child_header(bus, child); retval += nexus_print_all_resources(child); if (ndev->nx_pcibus != -1) - retval += printf(" pcibus %d", ndev->nx_pcibus); - retval += printf(" on motherboard\n"); + retval += kprintf(" pcibus %d", ndev->nx_pcibus); + retval += kprintf(" on motherboard\n"); return (retval); } diff --git a/sys/platform/pc32/i386/p4tcc.c b/sys/platform/pc32/i386/p4tcc.c index 05c475a9fd..50973ed63b 100644 --- a/sys/platform/pc32/i386/p4tcc.c +++ b/sys/platform/pc32/i386/p4tcc.c @@ -37,7 +37,7 @@ * Workarounds included below. * * $FreeBSD: /repoman/r/ncvs/src/sys/i386/i386/p4tcc.c,v 1.3.2.1 2004/03/03 15:24:15 sobomax Exp $ - * $DragonFly: src/sys/platform/pc32/i386/p4tcc.c,v 1.1 2004/07/27 10:55:57 asmodai Exp $ + * $DragonFly: src/sys/platform/pc32/i386/p4tcc.c,v 1.2 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -222,7 +222,7 @@ setup_p4tcc(void *dummy __unused) p4tcc_performance = tcc[0].rlevel; p4tcc_percentage = p4tcc_getperf(); - printf("Pentium 4 TCC support enabled, current performance %u%%\n", + kprintf("Pentium 4 TCC support enabled, current performance %u%%\n", p4tcc_percentage); sysctl_ctx_init(&p4tcc_sysctl_ctx); diff --git a/sys/platform/pc32/i386/pmap.c b/sys/platform/pc32/i386/pmap.c index c75c53e905..d6627fab86 100644 --- a/sys/platform/pc32/i386/pmap.c +++ b/sys/platform/pc32/i386/pmap.c @@ -40,7 +40,7 @@ * * from: @(#)pmap.c 7.7 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/i386/pmap.c,v 1.250.2.18 2002/03/06 22:48:53 silby Exp $ - * $DragonFly: src/sys/platform/pc32/i386/pmap.c,v 1.62 2006/12/02 23:13:45 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/pmap.c,v 1.63 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -1496,7 +1496,7 @@ pmap_collect(void) return; if (warningdone < 5) { - printf("pmap_collect: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC\n"); + kprintf("pmap_collect: collecting pv entries -- suggest increasing PMAP_SHPGPERPROC\n"); warningdone++; } @@ -1600,7 +1600,7 @@ pmap_remove_pte(struct pmap *pmap, unsigned *ptq, vm_offset_t va, if (oldpte & PG_M) { #if defined(PMAP_DIAGNOSTIC) if (pmap_nw_modified((pt_entry_t) oldpte)) { - printf( + kprintf( "pmap_remove: modified page not writable: va: 0x%x, pte: 0x%x\n", va, oldpte); } @@ -1785,7 +1785,7 @@ pmap_remove_all(vm_page_t m) if (tpte & PG_M) { #if defined(PMAP_DIAGNOSTIC) if (pmap_nw_modified((pt_entry_t) tpte)) { - printf( + kprintf( "pmap_remove_all: modified page not writable: va: 0x%x, pte: 0x%x\n", pv->pv_va, tpte); } @@ -1980,7 +1980,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, #if defined(PMAP_DIAGNOSTIC) if (pmap_nw_modified((pt_entry_t) origpte)) { - printf( + kprintf( "pmap_enter: modified page not writable: va: 0x%x, pte: 0x%x\n", va, origpte); } @@ -2850,7 +2850,7 @@ pmap_testbit(vm_page_t m, int bit) #if defined(PMAP_DIAGNOSTIC) if (!pv->pv_pmap) { - printf("Null pmap (tb) at va: 0x%x\n", pv->pv_va); + kprintf("Null pmap (tb) at va: 0x%x\n", pv->pv_va); continue; } #endif @@ -2895,7 +2895,7 @@ pmap_changebit(vm_page_t m, int bit, boolean_t setem) #if defined(PMAP_DIAGNOSTIC) if (!pv->pv_pmap) { - printf("Null pmap (cb) at va: 0x%x\n", pv->pv_va); + kprintf("Null pmap (cb) at va: 0x%x\n", pv->pv_va); continue; } #endif @@ -3259,7 +3259,7 @@ pads(pmap_t pm) continue; ptep = pmap_pte_quick(pm, va); if (pmap_pte_v(ptep)) - printf("%x:%x ", va, *(int *) ptep); + kprintf("%x:%x ", va, *(int *) ptep); }; } @@ -3270,16 +3270,16 @@ pmap_pvdump(vm_paddr_t pa) pv_entry_t pv; vm_page_t m; - printf("pa %08llx", (long long)pa); + kprintf("pa %08llx", (long long)pa); m = PHYS_TO_VM_PAGE(pa); TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) { #ifdef used_to_be - printf(" -> pmap %p, va %x, flags %x", + kprintf(" -> pmap %p, va %x, flags %x", (void *)pv->pv_pmap, pv->pv_va, pv->pv_flags); #endif - printf(" -> pmap %p, va %x", (void *)pv->pv_pmap, pv->pv_va); + kprintf(" -> pmap %p, va %x", (void *)pv->pv_pmap, pv->pv_va); pads(pv->pv_pmap); } - printf(" "); + kprintf(" "); } #endif diff --git a/sys/platform/pc32/i386/pnpbios.c b/sys/platform/pc32/i386/pnpbios.c index e4d168102d..dfdf3a4d51 100644 --- a/sys/platform/pc32/i386/pnpbios.c +++ b/sys/platform/pc32/i386/pnpbios.c @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/platform/pc32/i386/pnpbios.c,v 1.5 2006/09/05 00:55:45 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/pnpbios.c,v 1.6 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -133,10 +133,10 @@ pnpbios_identify(driver_t *driver, device_t parent) args.entry = pt->pmentryoffset; if ((error = bios16(&args, PNP_COUNT_DEVNODES, &ndevs, &bigdev)) || (args.r.eax & 0xff)) - printf("pnpbios: error %d/%x getting device count/size limit\n", error, args.r.eax); + kprintf("pnpbios: error %d/%x getting device count/size limit\n", error, args.r.eax); ndevs &= 0xff; /* clear high byte garbage */ if (bootverbose) - printf("pnpbios: %d devices, largest %d bytes\n", ndevs, bigdev); + kprintf("pnpbios: %d devices, largest %d bytes\n", ndevs, bigdev); devnodebuf = kmalloc(bigdev + (sizeof(struct pnp_sysdevargs) - sizeof(struct pnp_sysdev)), M_DEVBUF, M_INTWAIT); pda = (struct pnp_sysdevargs *)devnodebuf; @@ -148,21 +148,21 @@ pnpbios_identify(driver_t *driver, device_t parent) /* get current configuration */ if ((error = bios16(&args, PNP_GET_DEVNODE, &pda->next, &pda->node, 1))) { - printf("pnpbios: error %d making BIOS16 call\n", error); + kprintf("pnpbios: error %d making BIOS16 call\n", error); break; } if (bootverbose) - printf("pnp_get_devnode cd=%d nxt=%d size=%d handle=%d devid=%08x type=%02x%02x%02x, attrib=%04x\n", currdev, pda->next, pd->size, pd->handle, pd->devid, pd->type[0], pd->type[1], pd->type[2], pd->attrib); + kprintf("pnp_get_devnode cd=%d nxt=%d size=%d handle=%d devid=%08x type=%02x%02x%02x, attrib=%04x\n", currdev, pda->next, pd->size, pd->handle, pd->devid, pd->type[0], pd->type[1], pd->type[2], pd->attrib); if ((error = (args.r.eax & 0xff))) { if (bootverbose) - printf("pnpbios: %s 0x%x fetching node %d\n", error & 0x80 ? "error" : "warning", error, currdev); + kprintf("pnpbios: %s 0x%x fetching node %d\n", error & 0x80 ? "error" : "warning", error, currdev); if (error & 0x80) break; } currdev = pda->next; if (pd->size < sizeof(struct pnp_sysdev)) { - printf("pnpbios: bogus system node data, aborting scan\n"); + kprintf("pnpbios: bogus system node data, aborting scan\n"); break; } @@ -220,7 +220,7 @@ pnpbios_identify(driver_t *driver, device_t parent) case PNP_TAG_COMPAT_DEVICE: compid = (uint32_t *)(pd->devdata + idx); if (bootverbose) - printf("pnpbios: node %d compat ID 0x%08x\n", pd->handle, *compid); + kprintf("pnpbios: node %d compat ID 0x%08x\n", pd->handle, *compid); /* FALLTHROUGH */ case PNP_TAG_END: idx = left; @@ -234,12 +234,12 @@ pnpbios_identify(driver_t *driver, device_t parent) idx += *(uint16_t *)(pd->devdata + idx) + 2; } if (bootverbose) { - printf("pnpbios: handle %d device ID %s (%08x)", + kprintf("pnpbios: handle %d device ID %s (%08x)", pd->handle, pnp_eisaformat(*devid), *devid); if (compid != NULL) - printf(" compat ID %s (%08x)", + kprintf(" compat ID %s (%08x)", pnp_eisaformat(*compid), *compid); - printf("\n"); + kprintf("\n"); } } return (0); diff --git a/sys/platform/pc32/i386/sys_machdep.c b/sys/platform/pc32/i386/sys_machdep.c index c94c4ff416..160744b0d3 100644 --- a/sys/platform/pc32/i386/sys_machdep.c +++ b/sys/platform/pc32/i386/sys_machdep.c @@ -32,7 +32,7 @@ * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 * $FreeBSD: src/sys/i386/i386/sys_machdep.c,v 1.47.2.3 2002/10/07 17:20:00 jhb Exp $ - * $DragonFly: src/sys/platform/pc32/i386/sys_machdep.c,v 1.27 2006/12/17 20:07:32 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/sys_machdep.c,v 1.28 2006/12/23 00:27:03 swildner Exp $ * */ @@ -362,7 +362,7 @@ ki386_get_ldt(struct lwp *lwp, char *args, int *res) return(error); #ifdef DEBUG - printf("ki386_get_ldt: start=%d num=%d descs=%p\n", + kprintf("ki386_get_ldt: start=%d num=%d descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif @@ -409,7 +409,7 @@ ki386_set_ldt(struct lwp *lp, char *args, int *res) return(error); #ifdef DEBUG - printf("ki386_set_ldt: start=%d num=%d descs=%p\n", + kprintf("ki386_set_ldt: start=%d num=%d descs=%p\n", uap->start, uap->num, (void *)uap->descs); #endif diff --git a/sys/platform/pc32/i386/trap.c b/sys/platform/pc32/i386/trap.c index 78cb7e0a7f..846604b013 100644 --- a/sys/platform/pc32/i386/trap.c +++ b/sys/platform/pc32/i386/trap.c @@ -36,7 +36,7 @@ * * from: @(#)trap.c 7.4 (Berkeley) 5/13/91 * $FreeBSD: src/sys/i386/i386/trap.c,v 1.147.2.11 2003/02/27 19:09:59 luoqi Exp $ - * $DragonFly: src/sys/platform/pc32/i386/trap.c,v 1.86 2006/11/07 18:50:07 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/trap.c,v 1.87 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -432,7 +432,7 @@ trap(struct trapframe frame) type = frame.tf_trapno; if (ISPL(frame.tf_cs)==SEL_UPL || (frame.tf_eflags & PSL_VM)) { MAKEMPSAFE(have_mplock); - printf( + kprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curproc->p_comm, type); } else if (type != T_BPTFLT && type != T_TRCTRAP) { @@ -441,7 +441,7 @@ trap(struct trapframe frame) * multiple fault in user mode. */ MAKEMPSAFE(have_mplock); - printf("kernel trap %d with interrupts disabled\n", + kprintf("kernel trap %d with interrupts disabled\n", type); } cpu_enable_intr(); @@ -595,7 +595,7 @@ restart: * for debugging. */ if (ddb_on_nmi) { - printf ("NMI ... going to debugger\n"); + kprintf ("NMI ... going to debugger\n"); kdb_trap (type, 0, &frame); } #endif /* DDB */ @@ -825,7 +825,7 @@ kernel_trap: * for debugging. */ if (ddb_on_nmi) { - printf ("NMI ... going to debugger\n"); + kprintf ("NMI ... going to debugger\n"); kdb_trap (type, 0, &frame); } #endif /* DDB */ @@ -1115,24 +1115,24 @@ trap_fatal(struct trapframe *frame, vm_offset_t eva) sdtossd(&gdt[mycpu->gd_cpuid * NGDT + IDXSEL(frame->tf_cs & 0xffff)].sd, &softseg); if (type <= MAX_TRAP_MSG) - printf("\n\nFatal trap %d: %s while in %s mode\n", + kprintf("\n\nFatal trap %d: %s while in %s mode\n", type, trap_msg[type], frame->tf_eflags & PSL_VM ? "vm86" : ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel"); #ifdef SMP /* three separate prints in case of a trap on an unmapped page */ - printf("mp_lock = %08x; ", mp_lock); - printf("cpuid = %d; ", mycpu->gd_cpuid); - printf("lapic.id = %08x\n", lapic.id); + kprintf("mp_lock = %08x; ", mp_lock); + kprintf("cpuid = %d; ", mycpu->gd_cpuid); + kprintf("lapic.id = %08x\n", lapic.id); #endif if (type == T_PAGEFLT) { - printf("fault virtual address = 0x%x\n", eva); - printf("fault code = %s %s, %s\n", + kprintf("fault virtual address = 0x%x\n", eva); + kprintf("fault code = %s %s, %s\n", code & PGEX_U ? "user" : "supervisor", code & PGEX_W ? "write" : "read", code & PGEX_P ? "protection violation" : "page not present"); } - printf("instruction pointer = 0x%x:0x%x\n", + kprintf("instruction pointer = 0x%x:0x%x\n", frame->tf_cs & 0xffff, frame->tf_eip); if ((ISPL(frame->tf_cs) == SEL_UPL) || (frame->tf_eflags & PSL_VM)) { ss = frame->tf_ss & 0xffff; @@ -1141,46 +1141,46 @@ trap_fatal(struct trapframe *frame, vm_offset_t eva) ss = GSEL(GDATA_SEL, SEL_KPL); esp = (int)&frame->tf_esp; } - printf("stack pointer = 0x%x:0x%x\n", ss, esp); - printf("frame pointer = 0x%x:0x%x\n", ss, frame->tf_ebp); - printf("code segment = base 0x%x, limit 0x%x, type 0x%x\n", + kprintf("stack pointer = 0x%x:0x%x\n", ss, esp); + kprintf("frame pointer = 0x%x:0x%x\n", ss, frame->tf_ebp); + kprintf("code segment = base 0x%x, limit 0x%x, type 0x%x\n", softseg.ssd_base, softseg.ssd_limit, softseg.ssd_type); - printf(" = DPL %d, pres %d, def32 %d, gran %d\n", + kprintf(" = DPL %d, pres %d, def32 %d, gran %d\n", softseg.ssd_dpl, softseg.ssd_p, softseg.ssd_def32, softseg.ssd_gran); - printf("processor eflags = "); + kprintf("processor eflags = "); if (frame->tf_eflags & PSL_T) - printf("trace trap, "); + kprintf("trace trap, "); if (frame->tf_eflags & PSL_I) - printf("interrupt enabled, "); + kprintf("interrupt enabled, "); if (frame->tf_eflags & PSL_NT) - printf("nested task, "); + kprintf("nested task, "); if (frame->tf_eflags & PSL_RF) - printf("resume, "); + kprintf("resume, "); if (frame->tf_eflags & PSL_VM) - printf("vm86, "); - printf("IOPL = %d\n", (frame->tf_eflags & PSL_IOPL) >> 12); - printf("current process = "); + kprintf("vm86, "); + kprintf("IOPL = %d\n", (frame->tf_eflags & PSL_IOPL) >> 12); + kprintf("current process = "); if (curproc) { - printf("%lu (%s)\n", + kprintf("%lu (%s)\n", (u_long)curproc->p_pid, curproc->p_comm ? curproc->p_comm : ""); } else { - printf("Idle\n"); + kprintf("Idle\n"); } - printf("current thread = pri %d ", curthread->td_pri); + kprintf("current thread = pri %d ", curthread->td_pri); if (curthread->td_pri >= TDPRI_CRIT) - printf("(CRIT)"); - printf("\n"); + kprintf("(CRIT)"); + kprintf("\n"); #ifdef SMP /** * XXX FIXME: * we probably SHOULD have stopped the other CPUs before now! * another CPU COULD have been touching cpl at this moment... */ - printf(" <- SMP: XXX"); + kprintf(" <- SMP: XXX"); #endif - printf("\n"); + kprintf("\n"); #ifdef KDB if (kdb_trap(&psl)) @@ -1190,7 +1190,7 @@ trap_fatal(struct trapframe *frame, vm_offset_t eva) if ((debugger_on_panic || db_active) && kdb_trap(type, code, frame)) return; #endif - printf("trap number = %d\n", type); + kprintf("trap number = %d\n", type); if (type <= MAX_TRAP_MSG) panic("%s", trap_msg[type]); else @@ -1214,15 +1214,15 @@ dblfault_handler(void) { struct mdglobaldata *gd = mdcpu; - printf("\nFatal double fault:\n"); - printf("eip = 0x%x\n", gd->gd_common_tss.tss_eip); - printf("esp = 0x%x\n", gd->gd_common_tss.tss_esp); - printf("ebp = 0x%x\n", gd->gd_common_tss.tss_ebp); + kprintf("\nFatal double fault:\n"); + kprintf("eip = 0x%x\n", gd->gd_common_tss.tss_eip); + kprintf("esp = 0x%x\n", gd->gd_common_tss.tss_esp); + kprintf("ebp = 0x%x\n", gd->gd_common_tss.tss_ebp); #ifdef SMP /* three separate prints in case of a trap on an unmapped page */ - printf("mp_lock = %08x; ", mp_lock); - printf("cpuid = %d; ", mycpu->gd_cpuid); - printf("lapic.id = %08x\n", lapic.id); + kprintf("mp_lock = %08x; ", mp_lock); + kprintf("cpuid = %d; ", mycpu->gd_cpuid); + kprintf("lapic.id = %08x\n", lapic.id); #endif panic("double fault"); } diff --git a/sys/platform/pc32/i386/userconfig.c b/sys/platform/pc32/i386/userconfig.c index 174f8efe3e..00dca3f655 100644 --- a/sys/platform/pc32/i386/userconfig.c +++ b/sys/platform/pc32/i386/userconfig.c @@ -47,7 +47,7 @@ ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** ** $FreeBSD: src/sys/i386/i386/userconfig.c,v 1.175.2.10 2002/10/05 18:31:48 scottl Exp $ - ** $DragonFly: src/sys/platform/pc32/i386/userconfig.c,v 1.11 2006/12/20 18:14:42 dillon Exp $ + ** $DragonFly: src/sys/platform/pc32/i386/userconfig.c,v 1.12 2006/12/23 00:27:03 swildner Exp $ **/ /** @@ -1047,32 +1047,32 @@ collapselist(DEV_LIST *list) static void bold(void) { - printf("\033[1m"); + kprintf("\033[1m"); } static void inverse(void) { - printf("\033[7m"); + kprintf("\033[7m"); } static void normal(void) { - printf("\033[m"); + kprintf("\033[m"); } static void clear(void) { normal(); - printf("\033[H\033[J"); + kprintf("\033[H\033[J"); } static void move(int x, int y) { - printf("\033[%d;%dH",y+1,x+1); + kprintf("\033[%d;%dH",y+1,x+1); } @@ -1353,7 +1353,7 @@ drawline(int row, int detail, DEV_LIST *list, int inverse, char *dhelp) ** Displays (num) lines of the contents of (list) at (row), optionally displaying the ** port and IRQ fields as well if (detail) is nonzero ** - ** printf in the kernel is essentially useless, so we do most of the hard work ourselves here. + ** kprintf in the kernel is essentially useless, so we do most of the hard work ourselves here. **/ static void drawlist(int row, int num, int detail, DEV_LIST *list) @@ -2579,7 +2579,7 @@ userconfig(void) #endif if (banner) { banner = 0; - printf("FreeBSD Kernel Configuration Utility - Version 1.2\n" + kprintf("FreeBSD Kernel Configuration Utility - Version 1.2\n" " Type \"help\" for help" #ifdef VISUAL_USERCONFIG " or \"visual\" to go to the visual\n" @@ -2590,13 +2590,13 @@ userconfig(void) } } - printf("config> "); + kprintf("config> "); cngets(input, 80); if (input[0] == '\0') continue; cmd = parse_cmd(input); if (!cmd) { - printf("Invalid command or syntax. Type `?' for help.\n"); + kprintf("Invalid command or syntax. Type `?' for help.\n"); continue; } rval = (*cmd->handler)(cmd->parms); @@ -2640,7 +2640,7 @@ parse_args(const char *cmd, CmdParm *parms) if (parms == NULL || parms->type == -1) { if (*cmd == '\0') return 0; - printf("Extra arg(s): %s\n", cmd); + kprintf("Extra arg(s): %s\n", cmd); return 1; } if (parms->type == PARM_DEVSPEC) { @@ -2655,7 +2655,7 @@ parse_args(const char *cmd, CmdParm *parms) if (*cmd >= '0' && *cmd <= '9') { unit = strtoul(cmd, &ptr, 10); if (cmd == ptr) { - printf("Invalid device number\n"); + kprintf("Invalid device number\n"); /* XXX should print invalid token here and elsewhere. */ return 1; } @@ -2663,7 +2663,7 @@ parse_args(const char *cmd, CmdParm *parms) cmd = ptr; } if ((parms->parm.dparm = find_device(devname, unit)) == NULL) { - printf("No such device: %s%d\n", devname, unit); + kprintf("No such device: %s%d\n", devname, unit); return 1; } ++parms; @@ -2672,7 +2672,7 @@ parse_args(const char *cmd, CmdParm *parms) if (parms->type == PARM_INT) { parms->parm.iparm = strtoul(cmd, &ptr, 0); if (cmd == ptr) { - printf("Invalid numeric argument\n"); + kprintf("Invalid numeric argument\n"); return 1; } cmd = ptr; @@ -2682,7 +2682,7 @@ parse_args(const char *cmd, CmdParm *parms) if (parms->type == PARM_ADDR) { parms->parm.u.aparm = (void *)(uintptr_t)strtoul(cmd, &ptr, 0); if (cmd == ptr) { - printf("Invalid address argument\n"); + kprintf("Invalid address argument\n"); return 1; } cmd = ptr; @@ -2706,7 +2706,7 @@ list_devices(CmdParm *parms) if (lspnp()) return 0; #endif #if NEISA > 0 - printf("\nNumber of EISA slots to probe: %d\n", num_eisa_slots); + kprintf("\nNumber of EISA slots to probe: %d\n", num_eisa_slots); #endif /* NEISA > 0 */ return 0; } @@ -2726,11 +2726,11 @@ set_device_irq(CmdParm *parms) irq = parms[1].parm.iparm; if (irq == 2) { - printf("Warning: Remapping IRQ 2 to IRQ 9\n"); + kprintf("Warning: Remapping IRQ 2 to IRQ 9\n"); irq = 9; } else if (irq != -1 && irq > 15) { - printf("An IRQ > 15 would be invalid.\n"); + kprintf("An IRQ > 15 would be invalid.\n"); return 0; } parms[0].parm.dparm->id_irq = (irq < 16 ? 1 << irq : 0); @@ -2835,7 +2835,7 @@ set_pnp_parms(CmdParm *parms) ldn=strtoul(q,&q, 0); for (p=q; *p && (*p==' ' || *p=='\t'); p++) ; if (csn < 1 || csn > MAX_PNP_CARDS || ldn >= MAX_PNP_LDN) { - printf("bad csn/ldn %ld:%ld\n", csn, ldn); + kprintf("bad csn/ldn %ld:%ld\n", csn, ldn); return 0; } for (i=0; i < MAX_PNP_LDN; i++) { @@ -2851,7 +2851,7 @@ set_pnp_parms(CmdParm *parms) } } if (i==MAX_PNP_LDN) { - printf("sorry, no PnP entries available, try delete one\n"); + kprintf("sorry, no PnP entries available, try delete one\n"); return 0 ; } d = pnp_ldn_overrides[i] ; @@ -2896,7 +2896,7 @@ set_pnp_parms(CmdParm *parms) if (i==0) pnp_ldn_overrides[i].csn = 255;/* not reinit */ return 0; } else { - printf("unknown command <%s>\n", p); + kprintf("unknown command <%s>\n", p); break; } for (p=q; *p && (*p==' ' || *p=='\t'); p++) ; @@ -2934,7 +2934,7 @@ quitfunc(CmdParm *parms) static int helpfunc(CmdParm *parms) { - printf( + kprintf( "Command\t\t\tDescription\n" "-------\t\t\t-----------\n" "ls\t\t\tList currently configured devices\n" @@ -2947,7 +2947,7 @@ helpfunc(CmdParm *parms) "enable \tEnable device\n" "disable \tDisable device (will not be probed)\n"); #if NPNP > 0 - printf( + kprintf( "pnp [enable|disable]\tenable/disable device\n" "pnp [os|bios]\tset parameters using FreeBSD or BIOS\n" "pnp [portX ]\tset addr for port X (0..7)\n" @@ -2956,15 +2956,15 @@ helpfunc(CmdParm *parms) "pnp [drqX ]\tset drq X (0..1) to number, 4=unused\n"); #endif #if NEISA > 0 - printf("eisa \t\tSet the number of EISA slots to probe\n"); + kprintf("eisa \t\tSet the number of EISA slots to probe\n"); #endif /* NEISA > 0 */ - printf( + kprintf( "quit\t\t\tExit this configuration utility\n" "reset\t\t\tReset CPU\n"); #ifdef VISUAL_USERCONFIG - printf("visual\t\t\tGo to fullscreen mode.\n"); + kprintf("visual\t\t\tGo to fullscreen mode.\n"); #endif - printf( + kprintf( "help\t\t\tThis message\n\n" "Commands may be abbreviated to a unique prefix\n"); return 0; @@ -3134,25 +3134,25 @@ lspnp(void) char buf[256]; if (lineno >= 23) { if (!userconfig_boot_parsing) { - printf(" "); + kprintf(" "); if (kgetchar() == 'q') { - printf("quit\n"); + kprintf("quit\n"); return (1); } - printf("\n"); + kprintf("\n"); } lineno = 0; } if (lineno == 0 || first) - printf("CSN LDN conf en irqs drqs others (PnP devices)\n"); + kprintf("CSN LDN conf en irqs drqs others (PnP devices)\n"); first = 0 ; - printf("%3d %3d %4s %2s %2d %-2d %2d %-2d ", + kprintf("%3d %3d %4s %2s %2d %-2d %2d %-2d ", c->csn, c->ldn, c->override ? "OS ":"BIOS", c->enable ? "Y":"N", c->irq[0], c->irq[1], c->drq[0], c->drq[1]); if (c->flags) - printf("flags 0x%08lx ",c->flags); + kprintf("flags 0x%08lx ",c->flags); for (pmax = 7; pmax >=0 ; pmax--) if (c->port[pmax]!=0) break; for (mmax = 3; mmax >=0 ; mmax--) @@ -3160,18 +3160,18 @@ lspnp(void) if (pmax>=0) { strcpy(buf, pfmt); buf[10 + 5*pmax]='\0'; - printf(buf, + kprintf(buf, c->port[0], c->port[1], c->port[2], c->port[3], c->port[4], c->port[5], c->port[6], c->port[7]); } if (mmax>=0) { strcpy(buf, mfmt); buf[8 + 5*mmax]='\0'; - printf(buf, + kprintf(buf, c->mem[0].base, c->mem[1].base, c->mem[2].base, c->mem[3].base); } - printf("\n"); + kprintf("\n"); } } return 0 ; @@ -3185,24 +3185,24 @@ lsdevtab(struct uc_device *dt) char dname[80]; if (lineno >= 23) { - printf(" "); + kprintf(" "); if (!userconfig_boot_parsing) { if (kgetchar() == 'q') { - printf("quit\n"); + kprintf("quit\n"); return (1); } - printf("\n"); + kprintf("\n"); } lineno = 0; } if (lineno == 0) { - printf( + kprintf( "Device port irq drq iomem iosize unit flags enab\n" ); ++lineno; } ksprintf(dname, "%s%d", dt->id_name, dt->id_unit); - printf("%-9.9s%-#11x%-6d%-6d%-8p%-9d%-6d%-#11x%-5s\n", + kprintf("%-9.9s%-#11x%-6d%-6d%-8p%-9d%-6d%-#11x%-5s\n", dname, /* dt->id_id, dt->id_driver(by name), */ dt->id_iobase, ffs(dt->id_irq) - 1, dt->id_drq, dt->id_maddr, dt->id_msize, /* dt->id_intr(by name), */ dt->id_unit, dt->id_flags, @@ -3292,7 +3292,7 @@ cngets(char *input, int maxin) /* Treat ^H or ^? as backspace */ if ((c == '\010' || c == '\177')) { if (nchars) { - printf("\010 \010"); + kprintf("\010 \010"); *--input = '\0', --nchars; } continue; @@ -3300,12 +3300,12 @@ cngets(char *input, int maxin) /* Treat ^U or ^X as kill line */ else if ((c == '\025' || c == '\030')) { while (nchars) { - printf("\010 \010"); + kprintf("\010 \010"); *--input = '\0', --nchars; } continue; } - printf("%c", c); + kprintf("%c", c); if ((++nchars == maxin) || (c == '\n') || (c == '\r') || ( c == -1)) { *input = '\0'; break; @@ -3337,12 +3337,12 @@ id_put(char *desc, int id) if (id != SCCONF_UNSPEC) { if (desc) - printf("%s", desc); + kprintf("%s", desc); if (id == SCCONF_ANY) - printf("?"); + kprintf("?"); else - printf("%d", id); + kprintf("%d", id); } } @@ -3351,7 +3351,7 @@ lsscsi(void) { int i; - printf("scsi: (can't be edited):\n"); + kprintf("scsi: (can't be edited):\n"); for (i = 0; scsi_cinit[i].driver; i++) { @@ -3359,16 +3359,16 @@ lsscsi(void) if (scsi_cinit[i].unit != -1) { - printf(" at "); + kprintf(" at "); id_put(scsi_cinit[i].driver, scsi_cinit[i].unit); } - printf("\n"); + kprintf("\n"); } for (i = 0; scsi_dinit[i].name; i++) { - printf("%s ", type_text(scsi_dinit[i].name)); + kprintf("%s ", type_text(scsi_dinit[i].name)); id_put(scsi_dinit[i].name, scsi_dinit[i].unit); id_put(" at scbus", scsi_dinit[i].cunit); @@ -3376,9 +3376,9 @@ lsscsi(void) id_put(" lun ", scsi_dinit[i].lun); if (scsi_dinit[i].flags) - printf(" flags 0x%x\n", scsi_dinit[i].flags); + kprintf(" flags 0x%x\n", scsi_dinit[i].flags); - printf("\n"); + kprintf("\n"); } } diff --git a/sys/platform/pc32/i386/vm86.c b/sys/platform/pc32/i386/vm86.c index bafc01dc11..59b0dd362a 100644 --- a/sys/platform/pc32/i386/vm86.c +++ b/sys/platform/pc32/i386/vm86.c @@ -25,7 +25,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/i386/i386/vm86.c,v 1.31.2.2 2001/10/05 06:18:55 peter Exp $ - * $DragonFly: src/sys/platform/pc32/i386/vm86.c,v 1.22 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/vm86.c,v 1.23 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -640,7 +640,7 @@ vm86_intcall(int intnum, struct vm86frame *vmf) vm86_blew_up_timer = 0; timer_restore(); if (timer_warn) { - printf("Warning: BIOS played with the 8254, " + kprintf("Warning: BIOS played with the 8254, " "resetting it\n"); } } diff --git a/sys/platform/pc32/i386/vm_machdep.c b/sys/platform/pc32/i386/vm_machdep.c index 1205b15524..5557293c65 100644 --- a/sys/platform/pc32/i386/vm_machdep.c +++ b/sys/platform/pc32/i386/vm_machdep.c @@ -39,7 +39,7 @@ * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ * $FreeBSD: src/sys/i386/i386/vm_machdep.c,v 1.132.2.9 2003/01/25 19:02:23 dillon Exp $ - * $DragonFly: src/sys/platform/pc32/i386/vm_machdep.c,v 1.48 2006/11/07 18:50:07 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/vm_machdep.c,v 1.49 2006/12/23 00:27:03 swildner Exp $ */ #include "use_npx.h" @@ -382,12 +382,12 @@ cpu_reset_proxy(void) ; /* Wait for other cpu to disable interupts */ saved_mp_lock = mp_lock; mp_lock = 0; /* BSP */ - printf("cpu_reset_proxy: Grabbed mp lock for BSP\n"); + kprintf("cpu_reset_proxy: Grabbed mp lock for BSP\n"); cpu_reset_proxy_active = 3; while (cpu_reset_proxy_active == 3) ; /* Wait for other cpu to enable interrupts */ stop_cpus((1<gd_cpuid); + kprintf("cpu_reset called on cpu#%d\n",mycpu->gd_cpuid); map = mycpu->gd_other_cpus & ~stopped_cpus & smp_active_mask; if (map != 0) { - printf("cpu_reset: Stopping other CPUs\n"); + kprintf("cpu_reset: Stopping other CPUs\n"); stop_cpus(map); /* Stop all other CPUs */ } @@ -421,21 +421,21 @@ cpu_reset(void) cpu_reset_proxyid = mycpu->gd_cpuid; cpustop_restartfunc = cpu_reset_proxy; - printf("cpu_reset: Restarting BSP\n"); + kprintf("cpu_reset: Restarting BSP\n"); started_cpus = (1<<0); /* Restart CPU #0 */ cnt = 0; while (cpu_reset_proxy_active == 0 && cnt < 10000000) cnt++; /* Wait for BSP to announce restart */ if (cpu_reset_proxy_active == 0) - printf("cpu_reset: Failed to restart BSP\n"); + kprintf("cpu_reset: Failed to restart BSP\n"); __asm __volatile("cli" : : : "memory"); cpu_reset_proxy_active = 2; cnt = 0; while (cpu_reset_proxy_active == 2 && cnt < 10000000) cnt++; /* Do nothing */ if (cpu_reset_proxy_active == 2) { - printf("cpu_reset: BSP did not grab mp lock\n"); + kprintf("cpu_reset: BSP did not grab mp lock\n"); cpu_reset_real(); /* XXX: Bogus ? */ } cpu_reset_proxy_active = 4; @@ -461,8 +461,8 @@ cpu_reset_real(void) #if !defined(BROKEN_KEYBOARD_RESET) outb(IO_KBD + 4, 0xFE); DELAY(500000); /* wait 0.5 sec to see if that did it */ - printf("Keyboard reset did not work, attempting CPU shutdown\n"); - DELAY(1000000); /* wait 1 sec for printf to complete */ + kprintf("Keyboard reset did not work, attempting CPU shutdown\n"); + DELAY(1000000); /* wait 1 sec for kprintf to complete */ #endif /* force a shutdown by unmapping entire address space ! */ bzero((caddr_t) PTD, PAGE_SIZE); diff --git a/sys/platform/pc32/isa/asc.c b/sys/platform/pc32/isa/asc.c index b671d988d1..029b6d1a35 100644 --- a/sys/platform/pc32/isa/asc.c +++ b/sys/platform/pc32/isa/asc.c @@ -35,7 +35,7 @@ */ /* * $FreeBSD: src/sys/i386/isa/asc.c,v 1.42.2.2 2001/03/01 03:22:39 jlemon Exp $ - * $DragonFly: src/sys/platform/pc32/isa/asc.c,v 1.16 2006/12/20 18:14:42 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/asc.c,v 1.17 2006/12/23 00:27:03 swildner Exp $ */ #include "use_asc.h" @@ -73,7 +73,7 @@ #define DMA1_READY 0x08 #define ASCDEBUG #ifdef ASCDEBUG -# define lprintf if(scu->flags & FLAG_DEBUG) printf +# define lprintf if(scu->flags & FLAG_DEBUG) kprintf #else # define lprintf (void) #endif @@ -445,7 +445,7 @@ ascattach(struct isa_device *isdp) isdp->id_intr = (inthand2_t *)ascintr; scu->flags |= FLAG_DEBUG; - printf("asc%d: [GI1904/Trust Ami-Scan Grey/Color]\n", unit); + kprintf("asc%d: [GI1904/Trust Ami-Scan Grey/Color]\n", unit); /* * Initialize buffer structure. @@ -544,7 +544,7 @@ ascopen(struct dev_open_args *ap) { #ifdef ASCDEBUG /* XXX lprintf isn't valid here since there is no scu. */ - printf("asc%d.open: unconfigured unit number (max %d)\n", unit, NASC); + kprintf("asc%d.open: unconfigured unit number (max %d)\n", unit, NASC); #endif return ENXIO; } diff --git a/sys/platform/pc32/isa/clock.c b/sys/platform/pc32/isa/clock.c index 3ead7c1691..931c06df93 100644 --- a/sys/platform/pc32/isa/clock.c +++ b/sys/platform/pc32/isa/clock.c @@ -35,7 +35,7 @@ * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/clock.c,v 1.149.2.6 2002/11/02 04:41:50 iwasaki Exp $ - * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.49 2006/12/20 18:14:42 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/clock.c,v 1.50 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -265,7 +265,7 @@ rtcintr(void *dummy, void *frame) DB_SHOW_COMMAND(rtc, rtc) { - printf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", + kprintf("%02x/%02x/%02x %02x:%02x:%02x, A = %02x, B = %02x, C = %02x\n", rtcin(RTC_YEAR), rtcin(RTC_MONTH), rtcin(RTC_DAY), rtcin(RTC_HRS), rtcin(RTC_MIN), rtcin(RTC_SEC), rtcin(RTC_STATUSA), rtcin(RTC_STATUSB), rtcin(RTC_INTR)); @@ -384,7 +384,7 @@ DELAY(int n) state = 2; } if (state == 1) - printf("DELAY(%d)...", n); + kprintf("DELAY(%d)...", n); #endif /* * Guard against the timer being uninitialized if we are called @@ -419,7 +419,7 @@ DELAY(int n) } #ifdef DELAYDEBUG if (state == 1) - printf(" %d calls to getit() at %d usec each\n", + kprintf(" %d calls to getit() at %d usec each\n", getit_calls, (n + 5) / getit_calls); #endif } @@ -495,7 +495,7 @@ calibrate_clocks(void) int sec, start_sec, timeout; if (bootverbose) - printf("Calibrating clock(s) ... "); + kprintf("Calibrating clock(s) ... "); if (!(rtcin(RTC_STATUSD) & RTCSD_PWR)) goto fail; timeout = 100000000; @@ -564,12 +564,12 @@ calibrate_clocks(void) } if (tsc_present) - printf("TSC clock: %u Hz, ", tsc_freq); - printf("i8254 clock: %u Hz\n", tot_count); + kprintf("TSC clock: %u Hz, ", tsc_freq); + kprintf("i8254 clock: %u Hz\n", tot_count); return (tot_count); fail: - printf("failed, using default i8254 clock of %u Hz\n", + kprintf("failed, using default i8254 clock of %u Hz\n", i8254_cputimer.freq); return (i8254_cputimer.freq); } @@ -715,7 +715,7 @@ startrtclock(void) freq = calibrate_clocks(); #ifdef CLK_CALIBRATION_LOOP if (bootverbose) { - printf( + kprintf( "Press a key on the console to abort clock calibration\n"); while (cncheckc() == -1) calibrate_clocks(); @@ -732,14 +732,14 @@ startrtclock(void) if (delta < i8254_cputimer.freq / 100) { #ifndef CLK_USE_I8254_CALIBRATION if (bootverbose) - printf( + kprintf( "CLK_USE_I8254_CALIBRATION not specified - using default frequency\n"); freq = i8254_cputimer.freq; #endif cputimer_set_frequency(&i8254_cputimer, freq); } else { if (bootverbose) - printf( + kprintf( "%d Hz differs from default of %d Hz by more than 1%%\n", freq, i8254_cputimer.freq); tsc_freq = 0; @@ -749,7 +749,7 @@ startrtclock(void) #ifndef CLK_USE_TSC_CALIBRATION if (tsc_freq != 0) { if (bootverbose) - printf( + kprintf( "CLK_USE_TSC_CALIBRATION not specified - using old calibration method\n"); tsc_freq = 0; tsc_frequency = 0; @@ -768,7 +768,7 @@ startrtclock(void) tsc_freq = (u_int)tsc_frequency; #ifdef CLK_USE_TSC_CALIBRATION if (bootverbose) - printf("TSC clock: %u Hz (Method B)\n", tsc_freq); + kprintf("TSC clock: %u Hz (Method B)\n", tsc_freq); #endif } @@ -884,8 +884,8 @@ inittodr(time_t base) return; wrong_time: - printf("Invalid time in real time clock.\n"); - printf("Check and reset the date immediately!\n"); + kprintf("Invalid time in real time clock.\n"); + kprintf("Check and reset the date immediately!\n"); } /* @@ -1018,7 +1018,7 @@ cpu_initclocks(void) if (statclock_disable == 0) { diag = rtcin(RTC_DIAG); if (diag != 0) - printf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); + kprintf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); #ifdef APIC_IO if (isa_apic_irq(8) != 8) @@ -1045,7 +1045,7 @@ cpu_initclocks(void) * 8254 Timer0 interrupt and wait 1/100s for it to happen, * then see if we got it. */ - printf("APIC_IO: Testing 8254 interrupt delivery\n"); + kprintf("APIC_IO: Testing 8254 interrupt delivery\n"); cputimer_intr_reload(2); /* XXX assumes 8254 */ base = sys_cputimer->count(); while (sys_cputimer->count() - base < sys_cputimer->freq / 100) @@ -1059,7 +1059,7 @@ cpu_initclocks(void) */ machintr_intrdis(apic_8254_intr); unregister_int(clkdesc); - printf("APIC_IO: Broken MP table detected: " + kprintf("APIC_IO: Broken MP table detected: " "8254 is not connected to " "IOAPIC #%d intpin %d\n", int_to_apicintpin[apic_8254_intr].ioapic, @@ -1089,11 +1089,11 @@ cpu_initclocks(void) if (apic_int_type(0, 0) != 3 || int_to_apicintpin[apic_8254_intr].ioapic != 0 || int_to_apicintpin[apic_8254_intr].int_pin != 0) { - printf("APIC_IO: routing 8254 via IOAPIC #%d intpin %d\n", + kprintf("APIC_IO: routing 8254 via IOAPIC #%d intpin %d\n", int_to_apicintpin[apic_8254_intr].ioapic, int_to_apicintpin[apic_8254_intr].int_pin); } else { - printf("APIC_IO: " + kprintf("APIC_IO: " "routing 8254 via 8259 and IOAPIC #0 intpin 0\n"); } #endif diff --git a/sys/platform/pc32/isa/npx.c b/sys/platform/pc32/isa/npx.c index 4acfa7af89..c7f6949f92 100644 --- a/sys/platform/pc32/isa/npx.c +++ b/sys/platform/pc32/isa/npx.c @@ -33,7 +33,7 @@ * * from: @(#)npx.c 7.2 (Berkeley) 5/12/91 * $FreeBSD: src/sys/i386/isa/npx.c,v 1.80.2.3 2001/10/20 19:04:38 tegge Exp $ - * $DragonFly: src/sys/platform/pc32/isa/npx.c,v 1.37 2006/11/07 06:43:24 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/isa/npx.c,v 1.38 2006/12/23 00:27:03 swildner Exp $ */ #include "opt_cpu.h" @@ -327,10 +327,10 @@ npx_probe1(device_t dev) DELAY(1000); /* wait for any IRQ13 */ #ifdef DIAGNOSTIC if (npx_intrs_while_probing != 0) - printf("fninit caused %u bogus npx interrupt(s)\n", + kprintf("fninit caused %u bogus npx interrupt(s)\n", npx_intrs_while_probing); if (npx_traps_while_probing != 0) - printf("fninit caused %u bogus npx trap(s)\n", + kprintf("fninit caused %u bogus npx trap(s)\n", npx_traps_while_probing); #endif /* @@ -469,7 +469,7 @@ npx_attach(device_t dev) bcopy_vector = (void **)asm_xmm_bcopy; ovbcopy_vector = (void **)asm_xmm_bcopy; memcpy_vector = (void **)asm_xmm_memcpy; - printf("Using XMM optimized bcopy/copyin/copyout\n"); + kprintf("Using XMM optimized bcopy/copyin/copyout\n"); } if ((flags & NPX_DISABLE_I586_OPTIMIZED_BZERO) == 0) { /* XXX */ @@ -481,7 +481,7 @@ npx_attach(device_t dev) bcopy_vector = (void **)asm_mmx_bcopy; ovbcopy_vector = (void **)asm_mmx_bcopy; memcpy_vector = (void **)asm_mmx_memcpy; - printf("Using MMX optimized bcopy/copyin/copyout\n"); + kprintf("Using MMX optimized bcopy/copyin/copyout\n"); } if ((flags & NPX_DISABLE_I586_OPTIMIZED_BZERO) == 0) { /* XXX */ @@ -777,13 +777,13 @@ npx_intr(void *dummy) } if (mdcpu->gd_npxthread == NULL || !npx_exists) { get_mplock(); - printf("npxintr: npxthread = %p, curthread = %p, npx_exists = %d\n", + kprintf("npxintr: npxthread = %p, curthread = %p, npx_exists = %d\n", mdcpu->gd_npxthread, curthread, npx_exists); panic("npxintr from nowhere"); } if (mdcpu->gd_npxthread != curthread) { get_mplock(); - printf("npxintr: npxthread = %p, curthread = %p, npx_exists = %d\n", + kprintf("npxintr: npxthread = %p, curthread = %p, npx_exists = %d\n", mdcpu->gd_npxthread, curthread, npx_exists); panic("npxintr from non-current process"); } @@ -857,7 +857,7 @@ npxdna(void) if (!npx_exists) return (0); if (mdcpu->gd_npxthread != NULL) { - printf("npxdna: npxthread = %p, curthread = %p\n", + kprintf("npxdna: npxthread = %p, curthread = %p\n", mdcpu->gd_npxthread, curthread); panic("npxdna"); } diff --git a/sys/platform/vkernel/i386/autoconf.c b/sys/platform/vkernel/i386/autoconf.c index ff7cb7505d..c2c4c9410c 100644 --- a/sys/platform/vkernel/i386/autoconf.c +++ b/sys/platform/vkernel/i386/autoconf.c @@ -35,7 +35,7 @@ * * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91 * $FreeBSD: src/sys/i386/i386/autoconf.c,v 1.146.2.2 2001/06/07 06:05:58 dd Exp $ - * $DragonFly: src/sys/platform/vkernel/i386/autoconf.c,v 1.4 2006/12/20 18:14:42 dillon Exp $ + * $DragonFly: src/sys/platform/vkernel/i386/autoconf.c,v 1.5 2006/12/23 00:27:03 swildner Exp $ */ /* @@ -158,7 +158,7 @@ configure_final(void *dummy) cninit_finish(); if (bootverbose) - printf("Device configuration finished.\n"); + kprintf("Device configuration finished.\n"); cold = 0; } @@ -229,12 +229,12 @@ setroot(void) char *sname; if ((bootdev & B_MAGICMASK) != B_DEVMAGIC) { - printf("no B_DEVMAGIC (bootdev=%#lx)\n", bootdev); + kprintf("no B_DEVMAGIC (bootdev=%#lx)\n", bootdev); return; } majdev = boot_translate_majdev(B_TYPE(bootdev)); if (bootverbose) { - printf("bootdev: %08lx type=%ld unit=%ld " + kprintf("bootdev: %08lx type=%ld unit=%ld " "slice=%ld part=%ld major=%d\n", bootdev, B_TYPE(bootdev), B_UNIT(bootdev), B_SLICE(bootdev), B_PARTITION(bootdev), majdev); @@ -247,7 +247,7 @@ setroot(void) if (slice == WHOLE_DISK_SLICE) slice = COMPATIBILITY_SLICE; if (slice < 0 || slice >= MAX_SLICES) { - printf("bad slice\n"); + kprintf("bad slice\n"); return; } @@ -395,7 +395,7 @@ pxe_setup_nfsdiskless(void) if (inaddr_to_sockaddr("boot.netif.ip", &myaddr)) return; if (inaddr_to_sockaddr("boot.netif.netmask", &netmask)) { - printf("PXE: no netmask\n"); + kprintf("PXE: no netmask\n"); return; } bcopy(&myaddr, &nd->myif.ifra_addr, sizeof(myaddr)); @@ -405,7 +405,7 @@ pxe_setup_nfsdiskless(void) bcopy(&netmask, &nd->myif.ifra_mask, sizeof(netmask)); if (hwaddr_to_sockaddr("boot.netif.hwaddr", &ourdl)) { - printf("PXE: no hardware address\n"); + kprintf("PXE: no hardware address\n"); return; } ifa = NULL; @@ -423,7 +423,7 @@ pxe_setup_nfsdiskless(void) } } } - printf("PXE: no interface\n"); + kprintf("PXE: no interface\n"); return; /* no matching interface */ match_done: strlcpy(nd->myif.ifra_name, ifp->if_xname, sizeof(nd->myif.ifra_name)); @@ -439,7 +439,7 @@ match_done: nd->root_args.sotype = SOCK_DGRAM; nd->root_args.flags = (NFSMNT_WSIZE | NFSMNT_RSIZE | NFSMNT_RESVPORT); if (inaddr_to_sockaddr("boot.nfsroot.server", &nd->root_saddr)) { - printf("PXE: no server\n"); + kprintf("PXE: no server\n"); return; } nd->root_saddr.sin_port = htons(NFS_PORT); @@ -449,7 +449,7 @@ match_done: * root handle. Generate a warning but continue configuring. */ if (decode_nfshandle("boot.nfsroot.nfshandle", &nd->root_fh[0]) == 0) { - printf("PXE: Warning, no NFS handle passed from loader\n"); + kprintf("PXE: Warning, no NFS handle passed from loader\n"); } if ((cp = kgetenv("boot.nfsroot.path")) != NULL) strncpy(nd->root_hostnam, cp, MNAMELEN - 1); diff --git a/sys/platform/vkernel/platform/init.c b/sys/platform/vkernel/platform/init.c index 82d4798354..ba0f9099da 100644 --- a/sys/platform/vkernel/platform/init.c +++ b/sys/platform/vkernel/platform/init.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/platform/vkernel/platform/init.c,v 1.2 2006/12/05 23:14:54 dillon Exp $ + * $DragonFly: src/sys/platform/vkernel/platform/init.c,v 1.3 2006/12/23 00:27:03 swildner Exp $ */ #include @@ -176,7 +176,7 @@ init_sys_memory(char *imageFile) char *zmem; off_t off = st.st_size & ~SEG_MASK; - printf("%s: Reserving blocks for memory image\n", imageFile); + kprintf("%s: Reserving blocks for memory image\n", imageFile); zmem = malloc(SEG_SIZE); bzero(zmem, SEG_SIZE); lseek(fd, off, 0); diff --git a/sys/sys/ckpt.h b/sys/sys/ckpt.h index 5f664a2a8b..145a8fdb6b 100644 --- a/sys/sys/ckpt.h +++ b/sys/sys/ckpt.h @@ -22,7 +22,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/sys/ckpt.h,v 1.8 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/ckpt.h,v 1.9 2006/12/23 00:27:03 swildner Exp $ */ #ifndef _SYS_CKPT_H_ #define _SYS_CKPT_H_ @@ -99,10 +99,10 @@ struct vn_hdr { #ifdef _KERNEL #ifdef DEBUG -#define TRACE_ENTER printf("entering %s at %s:%d\n", __func__, __FILE__, __LINE__) -#define TRACE_EXIT printf("exiting %s at %s:%d\n", __func__, __FILE__, __LINE__) -#define TRACE_ERR printf("failure encountered in %s at %s:%d\n", __func__, __FILE__, __LINE__) -#define PRINTF(args) printf args +#define TRACE_ENTER kprintf("entering %s at %s:%d\n", __func__, __FILE__, __LINE__) +#define TRACE_EXIT kprintf("exiting %s at %s:%d\n", __func__, __FILE__, __LINE__) +#define TRACE_ERR kprintf("failure encountered in %s at %s:%d\n", __func__, __FILE__, __LINE__) +#define PRINTF(args) kprintf args #else #define TRACE_ENTER #define TRACE_EXIT diff --git a/sys/sys/exec.h b/sys/sys/exec.h index 7da052f096..a5431bf0de 100644 --- a/sys/sys/exec.h +++ b/sys/sys/exec.h @@ -37,7 +37,7 @@ * * @(#)exec.h 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/sys/exec.h,v 1.26 1999/12/29 04:24:40 peter Exp $ - * $DragonFly: src/sys/sys/exec.h,v 1.4 2004/06/08 10:14:45 hsu Exp $ + * $DragonFly: src/sys/sys/exec.h,v 1.5 2006/12/23 00:27:03 swildner Exp $ */ #ifndef _SYS_EXEC_H_ @@ -97,16 +97,16 @@ int exec_unregister (const struct execsw *); int error = 0; \ switch (type) { \ case MOD_LOAD: \ - /* printf(#name " module loaded\n"); */ \ + /* kprintf(#name " module loaded\n"); */ \ error = exec_register(exec); \ if (error) \ - printf(#name "register failed\n"); \ + kprintf(#name "register failed\n"); \ break; \ case MOD_UNLOAD: \ - /* printf(#name " module unloaded\n"); */ \ + /* kprintf(#name " module unloaded\n"); */ \ error = exec_unregister(exec); \ if (error) \ - printf(#name " unregister failed\n"); \ + kprintf(#name " unregister failed\n"); \ break; \ default: \ break; \ diff --git a/sys/sys/iconv.h b/sys/sys/iconv.h index 50b6afdcb7..3dbaa8683c 100644 --- a/sys/sys/iconv.h +++ b/sys/sys/iconv.h @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/iconv.h,v 1.1.2.1 2001/05/21 08:28:07 bp Exp $ - * $DragonFly: src/sys/sys/iconv.h,v 1.4 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/iconv.h,v 1.5 2006/12/23 00:27:03 swildner Exp $ */ #ifndef _SYS_ICONV_H_ #define _SYS_ICONV_H_ @@ -151,7 +151,7 @@ int iconv_converter_donestub(struct iconv_converter_class *dp); int iconv_converter_handler(module_t mod, int type, void *data); #ifdef ICONV_DEBUG -#define ICDEBUG(format, args...) printf("%s: "format, __func__ ,## args) +#define ICDEBUG(format, args...) kprintf("%s: "format, __func__ ,## args) #else #define ICDEBUG(format, args...) #endif diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 3b7265b05a..bb310b67df 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -40,7 +40,7 @@ * * @(#)kernel.h 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/sys/kernel.h,v 1.63.2.9 2002/07/02 23:00:30 archie Exp $ - * $DragonFly: src/sys/sys/kernel.h,v 1.23 2006/09/03 17:43:59 dillon Exp $ + * $DragonFly: src/sys/sys/kernel.h,v 1.24 2006/12/23 00:27:03 swildner Exp $ */ #ifndef _SYS_KERNEL_H_ @@ -346,11 +346,11 @@ struct tunable_str { void (*initfunc)(void *) = (void (*)(void *))data; \ switch (type) { \ case MOD_LOAD: \ - /* printf(#name " module load\n"); */ \ + /* kprintf(#name " module load\n"); */ \ initfunc(NULL); \ break; \ case MOD_UNLOAD: \ - printf(#name " module unload - not possible for this module type\n"); \ + kprintf(#name " module unload - not possible for this module type\n"); \ return EINVAL; \ } \ return 0; \ diff --git a/sys/sys/linker.h b/sys/sys/linker.h index a1bf4cc4ec..2f57a1b55b 100644 --- a/sys/sys/linker.h +++ b/sys/sys/linker.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/linker.h,v 1.17.2.1 2002/03/11 01:13:53 dd Exp $ - * $DragonFly: src/sys/sys/linker.h,v 1.9 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/linker.h,v 1.10 2006/12/23 00:27:03 swildner Exp $ */ #ifndef _SYS_LINKER_H_ @@ -284,7 +284,7 @@ extern int kld_debug; #define KLD_DPF(cat, args) \ do { \ - if (kld_debug & KLD_DEBUG_##cat) printf args; \ + if (kld_debug & KLD_DEBUG_##cat) kprintf args; \ } while (0) #else diff --git a/sys/sys/module.h b/sys/sys/module.h index 77a1e6fff2..64077caa0c 100644 --- a/sys/sys/module.h +++ b/sys/sys/module.h @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/sys/module.h,v 1.14.2.3 2002/03/17 11:07:45 alfred Exp $ - * $DragonFly: src/sys/sys/module.h,v 1.10 2006/05/20 02:42:13 dillon Exp $ + * $DragonFly: src/sys/sys/module.h,v 1.11 2006/12/23 00:27:03 swildner Exp $ */ #ifndef _SYS_MODULE_H_ @@ -157,7 +157,7 @@ extern int mod_debug; #define MOD_DPF(cat, args) \ do { \ - if (mod_debug & MOD_DEBUG_##cat) printf args; \ + if (mod_debug & MOD_DEBUG_##cat) kprintf args; \ } while (0) #else diff --git a/sys/sys/syslog.h b/sys/sys/syslog.h index 0ddc6f3160..2908173eae 100644 --- a/sys/sys/syslog.h +++ b/sys/sys/syslog.h @@ -32,7 +32,7 @@ * * @(#)syslog.h 8.1 (Berkeley) 6/2/93 * $FreeBSD: src/sys/sys/syslog.h,v 1.19.2.2 2001/05/29 13:15:08 dwmalone Exp $ - * $DragonFly: src/sys/sys/syslog.h,v 1.4 2003/11/09 02:22:37 dillon Exp $ + * $DragonFly: src/sys/sys/syslog.h,v 1.5 2006/12/23 00:27:03 swildner Exp $ */ #ifndef _SYS_SYSLOG_H_ @@ -156,7 +156,7 @@ CODE facilitynames[] = { #endif #ifdef _KERNEL -#define LOG_PRINTF -1 /* pseudo-priority to indicate use of printf */ +#define LOG_PRINTF -1 /* pseudo-priority to indicate use of kprintf */ #endif /* diff --git a/sys/sys/thread2.h b/sys/sys/thread2.h index ab02dfdc95..ebac5f53ac 100644 --- a/sys/sys/thread2.h +++ b/sys/sys/thread2.h @@ -8,7 +8,7 @@ * on a different cpu will not be immediately scheduled by a yield() on * this cpu. * - * $DragonFly: src/sys/sys/thread2.h,v 1.27 2006/05/21 03:43:47 dillon Exp $ + * $DragonFly: src/sys/sys/thread2.h,v 1.28 2006/12/23 00:27:03 swildner Exp $ */ #ifndef _SYS_THREAD2_H_ @@ -92,7 +92,7 @@ _debug_crit_exit(thread_t td, const char *id) if ((gid = td->td_crit_debug_array[wi & CRIT_DEBUG_ARRAY_MASK]) != id) { if (td->td_in_crit_report == 0) { td->td_in_crit_report = 1; - printf("crit_exit(%s) expected id %s\n", id, gid); + kprintf("crit_exit(%s) expected id %s\n", id, gid); td->td_in_crit_report = 0; } } -- 2.41.0