From bc01a4047a3efbc83f7fea28abbde9426f32dba5 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 3 Sep 2006 17:43:59 +0000 Subject: [PATCH] Rename functions to avoid conflicts with libc. --- sys/dev/acpica5/acpi.c | 32 +++++++++++++++---------------- sys/dev/acpica5/acpi_pci_link.c | 4 ++-- sys/dev/disk/isp/isp_pci.c | 30 ++++++++++++++--------------- sys/dev/disk/mpt/mpt_pci.c | 6 +++--- sys/dev/misc/dcons/dcons_os.c | 6 +++--- sys/dev/raid/vinum/vinum.c | 6 +++--- sys/i386/acpica5/madt.c | 6 +++--- sys/i386/apm/apm.c | 4 ++-- sys/i386/i386/autoconf.c | 10 +++++----- sys/i386/i386/bios.c | 6 +++--- sys/i386/i386/machdep.c | 8 ++++---- sys/kern/init_main.c | 6 +++--- sys/kern/kern_environment.c | 16 ++++++++-------- sys/kern/kern_shutdown.c | 4 ++-- sys/kern/kern_usched.c | 4 ++-- sys/kern/vfs_conf.c | 10 +++++----- sys/platform/pc32/acpica5/madt.c | 6 +++--- sys/platform/pc32/apm/apm.c | 4 ++-- sys/platform/pc32/i386/autoconf.c | 10 +++++----- sys/platform/pc32/i386/bios.c | 6 +++--- sys/platform/pc32/i386/machdep.c | 8 ++++---- sys/sys/conf.h | 4 ++-- sys/sys/kernel.h | 8 ++++---- sys/sys/systm.h | 12 ++++++------ 24 files changed, 108 insertions(+), 108 deletions(-) diff --git a/sys/dev/acpica5/acpi.c b/sys/dev/acpica5/acpi.c index 469d0d0893..3c6f4514fd 100644 --- a/sys/dev/acpica5/acpi.c +++ b/sys/dev/acpica5/acpi.c @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi.c,v 1.157 2004/06/05 09:56:04 njl Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi.c,v 1.20 2006/07/28 02:17:35 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi.c,v 1.21 2006/09/03 17:43:55 dillon Exp $ */ #include "opt_acpi.h" @@ -267,7 +267,7 @@ acpi_Startup(void) /* Start up the ACPI CA subsystem. */ #ifdef ACPI_DEBUGGER - debugpoint = getenv("debug.acpi.debugger"); + debugpoint = kgetenv("debug.acpi.debugger"); if (debugpoint) { if (!strcmp(debugpoint, "init")) acpi_EnterDebugger(); @@ -279,7 +279,7 @@ acpi_Startup(void) return_VALUE (error); } #ifdef ACPI_DEBUGGER - debugpoint = getenv("debug.acpi.debugger"); + debugpoint = kgetenv("debug.acpi.debugger"); if (debugpoint) { if (!strcmp(debugpoint, "tables")) acpi_EnterDebugger(); @@ -407,7 +407,7 @@ acpi_attach(device_t dev) callout_init(&sc->acpi_sleep_timer); #ifdef ACPI_DEBUGGER - debugpoint = getenv("debug.acpi.debugger"); + debugpoint = kgetenv("debug.acpi.debugger"); if (debugpoint) { if (!strcmp(debugpoint, "spaces")) acpi_EnterDebugger(); @@ -455,7 +455,7 @@ acpi_attach(device_t dev) * all our child devices, but on many systems it works here. */ #ifdef ACPI_DEBUGGER - debugpoint = getenv("debug.acpi.debugger"); + debugpoint = kgetenv("debug.acpi.debugger"); if (debugpoint) { if (!strcmp(debugpoint, "enable")) acpi_EnterDebugger(); @@ -531,7 +531,7 @@ acpi_attach(device_t dev) sc->acpi_disable_on_poweroff = 0; if (bootverbose) sc->acpi_verbose = 1; - if ((env = getenv("hw.acpi.verbose")) && strcmp(env, "0")) { + if ((env = kgetenv("hw.acpi.verbose")) && strcmp(env, "0")) { sc->acpi_verbose = 1; freeenv(env); } @@ -563,7 +563,7 @@ acpi_attach(device_t dev) * Scan the namespace and attach/initialise children. */ #ifdef ACPI_DEBUGGER - debugpoint = getenv("debug.acpi.debugger"); + debugpoint = kgetenv("debug.acpi.debugger"); if (debugpoint) { if (!strcmp(debugpoint, "probe")) acpi_EnterDebugger(); @@ -598,7 +598,7 @@ acpi_attach(device_t dev) sc->acpi_dev_t->si_drv1 = sc; #ifdef ACPI_DEBUGGER - debugpoint = getenv("debug.acpi.debugger"); + debugpoint = kgetenv("debug.acpi.debugger"); if (debugpoint) { if (strcmp(debugpoint, "running") == 0) acpi_EnterDebugger(); @@ -649,13 +649,13 @@ acpi_quirks_set(void) * the settings alone. */ len = 0; - if ((env = getenv("acpi_dsdt_load")) != NULL) { + if ((env = kgetenv("acpi_dsdt_load")) != NULL) { /* XXX No strcasecmp but this is good enough. */ if (*env == 'Y' || *env == 'y') goto out; freeenv(env); } - if ((env = getenv("debug.acpi.disabled")) != NULL) { + if ((env = kgetenv("debug.acpi.disabled")) != NULL) { if (strstr("quirks", env) != NULL) goto out; len = strlen(env); @@ -2278,8 +2278,8 @@ acpi_avoid(ACPI_HANDLE handle) np = acpi_name(handle); if (*np == '\\') np++; - if ((env = getenv("debug.acpi.avoid.paths")) == NULL && - (env = getenv("debug.acpi.avoid")) == NULL) + if ((env = kgetenv("debug.acpi.avoid.paths")) == NULL && + (env = kgetenv("debug.acpi.avoid")) == NULL) return (0); /* Scan the avoid list checking for a match */ @@ -2314,7 +2314,7 @@ acpi_disabled(char *subsys) char *cp, *env; int len; - if ((env = getenv("debug.acpi.disabled")) == NULL) + if ((env = kgetenv("debug.acpi.disabled")) == NULL) return (0); if (strcmp(env, "all") == 0) { freeenv(env); @@ -2353,7 +2353,7 @@ acpi_enabled(char *subsys) char *cp, *env; int len; - if ((env = getenv("debug.acpi.enabled")) == NULL) + if ((env = kgetenv("debug.acpi.enabled")) == NULL) return (0); if (strcmp(env, "all") == 0) { freeenv(env); @@ -2732,8 +2732,8 @@ acpi_set_debugging(void *junk) AcpiDbgLevel = 0; } - layer = getenv("debug.acpi.layer"); - level = getenv("debug.acpi.level"); + layer = kgetenv("debug.acpi.layer"); + level = kgetenv("debug.acpi.level"); if (layer == NULL && level == NULL) return; diff --git a/sys/dev/acpica5/acpi_pci_link.c b/sys/dev/acpica5/acpi_pci_link.c index 9bd8e86c7b..2383ea57c6 100644 --- a/sys/dev/acpica5/acpi_pci_link.c +++ b/sys/dev/acpica5/acpi_pci_link.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.16 2004/06/14 18:54:14 jhb Exp $ - * $DragonFly: src/sys/dev/acpica5/acpi_pci_link.c,v 1.4 2004/08/02 18:41:50 dillon Exp $ + * $DragonFly: src/sys/dev/acpica5/acpi_pci_link.c,v 1.5 2006/09/03 17:43:55 dillon Exp $ */ #include "opt_acpi.h" @@ -971,7 +971,7 @@ acpi_pci_link_config(device_t dev, ACPI_BUFFER *prtbuf, int busno) (int)((entry->prt.Address & 0xffff0000) >> 16), (int)entry->prt.Pin); - if (getenv_int(prthint, &irq) == 0) + if (kgetenv_int(prthint, &irq) == 0) continue; if (acpi_pci_link_is_valid_irq(entry->pci_link, irq)) { diff --git a/sys/dev/disk/isp/isp_pci.c b/sys/dev/disk/isp/isp_pci.c index 4cf8bb1d4f..1f895d1c81 100644 --- a/sys/dev/disk/isp/isp_pci.c +++ b/sys/dev/disk/isp/isp_pci.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/isp/isp_pci.c,v 1.78.2.4 2002/10/11 18:50:53 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/isp/isp_pci.c,v 1.8 2005/10/12 17:35:50 dillon Exp $ */ +/* $DragonFly: src/sys/dev/disk/isp/isp_pci.c,v 1.9 2006/09/03 17:43:56 dillon Exp $ */ /* * PCI specific probe and attach routines for Qlogic ISP SCSI adapters. * FreeBSD Version. @@ -356,7 +356,7 @@ isp_pci_attach(device_t dev) * Figure out if we're supposed to skip this one. */ unit = device_get_unit(dev); - if (getenv_int("isp_disable", &bitmap)) { + if (kgetenv_int("isp_disable", &bitmap)) { if (bitmap & (1 << unit)) { device_printf(dev, "not configuring\n"); /* @@ -374,14 +374,14 @@ isp_pci_attach(device_t dev) m1 = PCIM_CMD_PORTEN; m2 = PCIM_CMD_MEMEN; bitmap = 0; - if (getenv_int("isp_mem_map", &bitmap)) { + if (kgetenv_int("isp_mem_map", &bitmap)) { if (bitmap & (1 << unit)) { m1 = PCIM_CMD_MEMEN; m2 = PCIM_CMD_PORTEN; } } bitmap = 0; - if (getenv_int("isp_io_map", &bitmap)) { + if (kgetenv_int("isp_io_map", &bitmap)) { if (bitmap & (1 << unit)) { m1 = PCIM_CMD_PORTEN; m2 = PCIM_CMD_MEMEN; @@ -581,31 +581,31 @@ isp_pci_attach(device_t dev) goto bad; } - if (getenv_int("isp_no_fwload", &bitmap)) { + if (kgetenv_int("isp_no_fwload", &bitmap)) { if (bitmap & (1 << unit)) isp->isp_confopts |= ISP_CFG_NORELOAD; } - if (getenv_int("isp_fwload", &bitmap)) { + if (kgetenv_int("isp_fwload", &bitmap)) { if (bitmap & (1 << unit)) isp->isp_confopts &= ~ISP_CFG_NORELOAD; } - if (getenv_int("isp_no_nvram", &bitmap)) { + if (kgetenv_int("isp_no_nvram", &bitmap)) { if (bitmap & (1 << unit)) isp->isp_confopts |= ISP_CFG_NONVRAM; } - if (getenv_int("isp_nvram", &bitmap)) { + if (kgetenv_int("isp_nvram", &bitmap)) { if (bitmap & (1 << unit)) isp->isp_confopts &= ~ISP_CFG_NONVRAM; } - if (getenv_int("isp_fcduplex", &bitmap)) { + if (kgetenv_int("isp_fcduplex", &bitmap)) { if (bitmap & (1 << unit)) isp->isp_confopts |= ISP_CFG_FULL_DUPLEX; } - if (getenv_int("isp_no_fcduplex", &bitmap)) { + if (kgetenv_int("isp_no_fcduplex", &bitmap)) { if (bitmap & (1 << unit)) isp->isp_confopts &= ~ISP_CFG_FULL_DUPLEX; } - if (getenv_int("isp_nport", &bitmap)) { + if (kgetenv_int("isp_nport", &bitmap)) { if (bitmap & (1 << unit)) isp->isp_confopts |= ISP_CFG_NPORT; } @@ -618,7 +618,7 @@ isp_pci_attach(device_t dev) * hint replacement to specify WWN strings with a leading * 'w' (e..g w50000000aaaa0001). Sigh. */ - if (getenv_quad("isp_portwwn", &wwn)) { + if (kgetenv_quad("isp_portwwn", &wwn)) { isp->isp_osinfo.default_port_wwn = wwn; isp->isp_confopts |= ISP_CFG_OWNWWPN; } @@ -626,7 +626,7 @@ isp_pci_attach(device_t dev) isp->isp_osinfo.default_port_wwn = 0x400000007F000009ull; } - if (getenv_quad("isp_nodewwn", &wwn)) { + if (kgetenv_quad("isp_nodewwn", &wwn)) { isp->isp_osinfo.default_node_wwn = wwn; isp->isp_confopts |= ISP_CFG_OWNWWNN; } @@ -635,7 +635,7 @@ isp_pci_attach(device_t dev) } isp_debug = 0; - (void) getenv_int("isp_debug", &isp_debug); + (void) kgetenv_int("isp_debug", &isp_debug); if (bus_setup_intr(dev, irq, 0, isp_pci_intr, isp, &pcs->ih, NULL)) { device_printf(dev, "could not setup interrupt\n"); @@ -644,7 +644,7 @@ isp_pci_attach(device_t dev) #ifdef ISP_FW_CRASH_DUMP bitmap = 0; - if (getenv_int("isp_fw_dump_enable", &bitmap)) { + if (kgetenv_int("isp_fw_dump_enable", &bitmap)) { if (bitmap & (1 << unit) { size_t amt = 0; if (IS_2200(isp)) { diff --git a/sys/dev/disk/mpt/mpt_pci.c b/sys/dev/disk/mpt/mpt_pci.c index 6da3551c4c..5b8083ca28 100644 --- a/sys/dev/disk/mpt/mpt_pci.c +++ b/sys/dev/disk/mpt/mpt_pci.c @@ -1,5 +1,5 @@ /* $FreeBSD: src/sys/dev/mpt/mpt_pci.c,v 1.3.2.3 2002/09/24 21:37:25 mjacob Exp $ */ -/* $DragonFly: src/sys/dev/disk/mpt/mpt_pci.c,v 1.6 2006/08/12 05:19:46 swildner Exp $ */ +/* $DragonFly: src/sys/dev/disk/mpt/mpt_pci.c,v 1.7 2006/09/03 17:43:57 dillon Exp $ */ /* * PCI specific probe and attach routines for LSI '909 FC adapters. * FreeBSD Version. @@ -153,14 +153,14 @@ mpt_set_options(mpt_softc_t *mpt) int bitmap; bitmap = 0; - if (getenv_int("mpt_disable", &bitmap)) { + if (kgetenv_int("mpt_disable", &bitmap)) { if (bitmap & (1 << mpt->unit)) { mpt->disabled = 1; } } bitmap = 0; - if (getenv_int("mpt_debug", &bitmap)) { + if (kgetenv_int("mpt_debug", &bitmap)) { if (bitmap & (1 << mpt->unit)) { mpt->verbose = 2; } diff --git a/sys/dev/misc/dcons/dcons_os.c b/sys/dev/misc/dcons/dcons_os.c index 9c0354d69a..309965a88f 100644 --- a/sys/dev/misc/dcons/dcons_os.c +++ b/sys/dev/misc/dcons/dcons_os.c @@ -32,7 +32,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/dev/dcons/dcons_os.c,v 1.4 2004/10/24 12:41:04 simokawa Exp $ - * $DragonFly: src/sys/dev/misc/dcons/dcons_os.c,v 1.4 2006/09/03 17:31:52 dillon Exp $ + * $DragonFly: src/sys/dev/misc/dcons/dcons_os.c,v 1.5 2006/09/03 17:43:58 dillon Exp $ */ #include @@ -486,8 +486,8 @@ dcons_drv_init(int stage) dg.size = DCONS_BUF_SIZE; #ifdef __i386__ - if (getenv_quad("dcons.addr", &addr) > 0 && - getenv_quad("dcons.size", &size) > 0) { + if (kgetenv_quad("dcons.addr", &addr) > 0 && + kgetenv_quad("dcons.size", &size) > 0) { vm_paddr_t pa; /* * Allow read/write access to dcons buffer. diff --git a/sys/dev/raid/vinum/vinum.c b/sys/dev/raid/vinum/vinum.c index dbfdb55749..66abcb5f55 100644 --- a/sys/dev/raid/vinum/vinum.c +++ b/sys/dev/raid/vinum/vinum.c @@ -37,7 +37,7 @@ * * $Id: vinum.c,v 1.33 2001/01/09 06:19:15 grog Exp grog $ * $FreeBSD: src/sys/dev/vinum/vinum.c,v 1.38.2.3 2003/01/07 12:14:16 joerg Exp $ - * $DragonFly: src/sys/dev/raid/vinum/vinum.c,v 1.14 2006/07/28 02:17:38 dillon Exp $ + * $DragonFly: src/sys/dev/raid/vinum/vinum.c,v 1.15 2006/09/03 17:43:59 dillon Exp $ */ #define STATIC static /* nothing while we're testing XXX */ @@ -132,7 +132,7 @@ vinumattach(void *dummy) * See if the loader has passed us a disk to * read the initial configuration from. */ - if ((cp = getenv("vinum.drives")) != NULL) { + if ((cp = kgetenv("vinum.drives")) != NULL) { for (cp1 = cp, i = 0, drives = 0; *cp1 != '\0'; i++) { cp2 = cp1; while (*cp1 != '\0' && *cp1 != ',' && *cp1 != ' ') @@ -151,7 +151,7 @@ vinumattach(void *dummy) bailout: free(drives, M_TEMP); } - if ((cp = getenv("vinum.root")) != NULL) { + if ((cp = kgetenv("vinum.root")) != NULL) { for (i = 0; i < vinum_conf.volumes_used; i++) { vol = &vinum_conf.volume[i]; if ((vol->state == volume_up) diff --git a/sys/i386/acpica5/madt.c b/sys/i386/acpica5/madt.c index 8a5bc03a75..7c58b595f4 100644 --- a/sys/i386/acpica5/madt.c +++ b/sys/i386/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/i386/acpica5/Attic/madt.c,v 1.5 2005/11/02 08:33:23 dillon Exp $ + * $DragonFly: src/sys/i386/acpica5/Attic/madt.c,v 1.6 2006/09/03 17:43:59 dillon Exp $ */ #include @@ -619,7 +619,7 @@ madt_parse_interrupt_override(MADT_INTERRUPT_OVERRIDE *intr) */ if (intr->Source == AcpiGbl_FADT->SciInt) { madt_found_sci_override = 1; - if (getenv_string("hw.acpi.sci.trigger", buf, sizeof(buf))) { + if (kgetenv_string("hw.acpi.sci.trigger", buf, sizeof(buf))) { if (tolower(buf[0]) == 'e') trig = INTR_TRIGGER_EDGE; else if (tolower(buf[0]) == 'l') @@ -631,7 +631,7 @@ madt_parse_interrupt_override(MADT_INTERRUPT_OVERRIDE *intr) printf("MADT: Forcing SCI to %s trigger\n", trig == INTR_TRIGGER_EDGE ? "edge" : "level"); } - if (getenv_string("hw.acpi.sci.polarity", buf, sizeof(buf))) { + if (kgetenv_string("hw.acpi.sci.polarity", buf, sizeof(buf))) { if (tolower(buf[0]) == 'h') pol = INTR_POLARITY_HIGH; else if (tolower(buf[0]) == 'l') diff --git a/sys/i386/apm/apm.c b/sys/i386/apm/apm.c index 169e81a8e5..9d3139862f 100644 --- a/sys/i386/apm/apm.c +++ b/sys/i386/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/i386/apm/Attic/apm.c,v 1.15 2006/07/28 02:17:39 dillon Exp $ + * $DragonFly: src/sys/i386/apm/Attic/apm.c,v 1.16 2006/09/03 17:43:59 dillon Exp $ */ #include @@ -1015,7 +1015,7 @@ apm_attach(device_t dev) /* Always call HLT in idle loop */ sc->always_halt_cpu = 1; - getenv_int("debug.apm_debug", &apm_debug); + kgetenv_int("debug.apm_debug", &apm_debug); /* print bootstrap messages */ APM_DPRINT("apm: APM BIOS version %04lx\n", apm_version); diff --git a/sys/i386/i386/autoconf.c b/sys/i386/i386/autoconf.c index b00434ea7c..9bd14e6fe5 100644 --- a/sys/i386/i386/autoconf.c +++ b/sys/i386/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/i386/i386/Attic/autoconf.c,v 1.23 2005/11/04 08:57:27 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/autoconf.c,v 1.24 2006/09/03 17:43:59 dillon Exp $ */ /* @@ -364,7 +364,7 @@ inaddr_to_sockaddr(char *ev, struct sockaddr_in *sa) bzero(sa, sizeof(*sa)); - if ((cp = getenv(ev)) == NULL) + if ((cp = kgetenv(ev)) == NULL) return(1); if (sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) != 4) return(1); @@ -388,7 +388,7 @@ hwaddr_to_sockaddr(char *ev, struct sockaddr_dl *sa) sa->sdl_family = AF_LINK; sa->sdl_type = IFT_ETHER; sa->sdl_alen = ETHER_ADDR_LEN; - if ((cp = getenv(ev)) == NULL) + if ((cp = kgetenv(ev)) == NULL) return(1); if (sscanf(cp, "%x:%x:%x:%x:%x:%x", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]) != 6) return(1); @@ -407,7 +407,7 @@ decode_nfshandle(char *ev, u_char *fh) u_char *cp; int len, val; - if (((cp = getenv(ev)) == NULL) || (strlen(cp) < 2) || (*cp != 'X')) + if (((cp = kgetenv(ev)) == NULL) || (strlen(cp) < 2) || (*cp != 'X')) return(0); len = 0; cp++; @@ -507,7 +507,7 @@ match_done: if (decode_nfshandle("boot.nfsroot.nfshandle", &nd->root_fh[0]) == 0) { printf("PXE: Warning, no NFS handle passed from loader\n"); } - if ((cp = getenv("boot.nfsroot.path")) != NULL) + if ((cp = kgetenv("boot.nfsroot.path")) != NULL) strncpy(nd->root_hostnam, cp, MNAMELEN - 1); nfs_diskless_valid = 1; diff --git a/sys/i386/i386/bios.c b/sys/i386/i386/bios.c index 65b50f6322..95dd269a6a 100644 --- a/sys/i386/i386/bios.c +++ b/sys/i386/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/i386/i386/Attic/bios.c,v 1.10 2004/04/29 12:11:16 joerg Exp $ + * $DragonFly: src/sys/i386/i386/Attic/bios.c,v 1.11 2006/09/03 17:43:59 dillon Exp $ */ /* @@ -93,7 +93,7 @@ bios32_init(void *junk) } /* Allow user override of PCI BIOS search */ - if (((p = getenv("machdep.bios.pci")) == NULL) || strcmp(p, "disable")) { + if (((p = kgetenv("machdep.bios.pci")) == NULL) || strcmp(p, "disable")) { /* See if there's a PCI BIOS entrypoint here */ PCIbios.ident.id = 0x49435024; /* PCI systems should have this */ if (!bios32_SDlookup(&PCIbios) && bootverbose) @@ -111,7 +111,7 @@ bios32_init(void *junk) * * Allow user override of PnP BIOS search */ - if (((p = getenv("machdep.bios.pnp")) == NULL || strcmp(p, "disable")) && + if (((p = kgetenv("machdep.bios.pnp")) == NULL || strcmp(p, "disable")) && (sigaddr = bios_sigsearch(0, "$PnP", 4, 16, 0)) != 0 ) { /* get a virtual pointer to the structure */ diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 09b9f636ad..4192cb5eaa 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/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/i386/i386/Attic/machdep.c,v 1.94 2006/06/07 03:02:10 dillon Exp $ + * $DragonFly: src/sys/i386/i386/Attic/machdep.c,v 1.95 2006/09/03 17:43:59 dillon Exp $ */ #include "use_apm.h" @@ -1574,7 +1574,7 @@ physmap_done: * hw.physmem is a size in bytes; we also allow k, m, and g suffixes * for the appropriate modifiers. This overrides MAXMEM. */ - if ((cp = getenv("hw.physmem")) != NULL) { + if ((cp = kgetenv("hw.physmem")) != NULL) { u_int64_t AllowMem, sanity; char *ep; @@ -1629,8 +1629,8 @@ physmap_done: /* * Get dcons buffer address */ - if (getenv_quad("dcons.addr", &dcons_addr) == 0 || - getenv_quad("dcons.size", &dcons_size) == 0) + if (kgetenv_quad("dcons.addr", &dcons_addr) == 0 || + kgetenv_quad("dcons.size", &dcons_size) == 0) dcons_addr = 0; /* diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index b8c5b10e66..0f10e33ca7 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -40,7 +40,7 @@ * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/init_main.c,v 1.134.2.8 2003/06/06 20:21:32 tegge Exp $ - * $DragonFly: src/sys/kern/init_main.c,v 1.59 2006/08/12 00:26:20 dillon Exp $ + * $DragonFly: src/sys/kern/init_main.c,v 1.60 2006/09/03 17:43:59 dillon Exp $ */ #include "opt_init_path.h" @@ -475,11 +475,11 @@ start_init(void *dummy) p->p_vmspace->vm_maxsaddr = (caddr_t)addr; p->p_vmspace->vm_ssize = 1; - if ((var = getenv("init_path")) != NULL) { + if ((var = kgetenv("init_path")) != NULL) { strncpy(init_path, var, sizeof init_path); init_path[sizeof init_path - 1] = 0; } - if ((var = getenv("kern.fallback_elf_brand")) != NULL) + if ((var = kgetenv("kern.fallback_elf_brand")) != NULL) fallback_elf_brand = strtol(var, NULL, 0); for (path = init_path; *path != '\0'; path = next) { diff --git a/sys/kern/kern_environment.c b/sys/kern/kern_environment.c index 9cef027818..0127bced9d 100644 --- a/sys/kern/kern_environment.c +++ b/sys/kern/kern_environment.c @@ -24,7 +24,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/kern_environment.c,v 1.10.2.7 2002/05/07 09:57:16 bde Exp $ - * $DragonFly: src/sys/kern/kern_environment.c,v 1.2 2003/06/17 04:28:41 dillon Exp $ + * $DragonFly: src/sys/kern/kern_environment.c,v 1.3 2006/09/03 17:43:59 dillon Exp $ */ /* @@ -51,7 +51,7 @@ static char *kernenv_next(char *cp); * Look up an environment variable by name. */ char * -getenv(const char *name) +kgetenv(const char *name) { char *cp, *ep; int len; @@ -73,11 +73,11 @@ getenv(const char *name) * Return a string value from an environment variable. */ int -getenv_string(const char *name, char *data, int size) +kgetenv_string(const char *name, char *data, int size) { char *tmp; - tmp = getenv(name); + tmp = kgetenv(name); if (tmp != NULL) { strncpy(data, tmp, size); data[size - 1] = 0; @@ -90,12 +90,12 @@ getenv_string(const char *name, char *data, int size) * Return an integer value from an environment variable. */ int -getenv_int(const char *name, int *data) +kgetenv_int(const char *name, int *data) { quad_t tmp; int rval; - rval = getenv_quad(name, &tmp); + rval = kgetenv_quad(name, &tmp); if (rval) { *data = (int) tmp; } @@ -106,13 +106,13 @@ getenv_int(const char *name, int *data) * Return a quad_t value from an environment variable. */ int -getenv_quad(const char *name, quad_t *data) +kgetenv_quad(const char *name, quad_t *data) { const char *value; char *vtp; quad_t iv; - if ((value = getenv(name)) == NULL) + if ((value = kgetenv(name)) == NULL) return(0); iv = strtoq(value, &vtp, 0); diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c index 728acc8ec7..641dbf3977 100644 --- a/sys/kern/kern_shutdown.c +++ b/sys/kern/kern_shutdown.c @@ -37,7 +37,7 @@ * * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94 * $FreeBSD: src/sys/kern/kern_shutdown.c,v 1.72.2.12 2002/02/21 19:15:10 dillon Exp $ - * $DragonFly: src/sys/kern/kern_shutdown.c,v 1.31 2006/08/12 05:06:48 swildner Exp $ + * $DragonFly: src/sys/kern/kern_shutdown.c,v 1.32 2006/09/03 17:43:59 dillon Exp $ */ #include "opt_ddb.h" @@ -496,7 +496,7 @@ dump_conf(dummy) path = malloc(MNAMELEN, M_TEMP, M_WAITOK); if (TUNABLE_STR_FETCH("dumpdev", path, MNAMELEN) != 0) { - dev = getdiskbyname(path); + dev = kgetdiskbyname(path); if (dev != NODEV) dumpdev = dev; } diff --git a/sys/kern/kern_usched.c b/sys/kern/kern_usched.c index e683e46c40..37c6497716 100644 --- a/sys/kern/kern_usched.c +++ b/sys/kern/kern_usched.c @@ -31,7 +31,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $DragonFly: src/sys/kern/kern_usched.c,v 1.5 2006/06/05 07:26:10 dillon Exp $ + * $DragonFly: src/sys/kern/kern_usched.c,v 1.6 2006/09/03 17:43:59 dillon Exp $ */ #include @@ -54,7 +54,7 @@ usched_init(void) { const char *defsched; - defsched = getenv("kern.user_scheduler"); + defsched = kgetenv("kern.user_scheduler"); /* * Add various userland schedulers to the system. diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c index 76f305551f..0481523979 100644 --- a/sys/kern/vfs_conf.c +++ b/sys/kern/vfs_conf.c @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * $FreeBSD: src/sys/kern/vfs_conf.c,v 1.49.2.5 2003/01/07 11:56:53 joerg Exp $ - * $DragonFly: src/sys/kern/vfs_conf.c,v 1.16 2006/05/06 18:48:52 dillon Exp $ + * $DragonFly: src/sys/kern/vfs_conf.c,v 1.17 2006/09/03 17:43:59 dillon Exp $ */ /* @@ -142,7 +142,7 @@ vfs_mountroot(void *junk) * supplied via some other means. This is the preferred * mechanism. */ - if (!vfs_mountroot_try(getenv("vfs.root.mountfrom"))) + if (!vfs_mountroot_try(kgetenv("vfs.root.mountfrom"))) return; /* @@ -335,7 +335,7 @@ gets(char *cp) * it refers to. */ dev_t -getdiskbyname(const char *name) +kgetdiskbyname(const char *name) { char *cp; int nlen; @@ -436,7 +436,7 @@ setrootbyname(char *name) { dev_t diskdev; - diskdev = getdiskbyname(name); + diskdev = kgetdiskbyname(name); if (diskdev != NODEV) { rootdev = diskdev; return (0); @@ -454,7 +454,7 @@ DB_SHOW_COMMAND(disk, db_getdiskbyname) db_error("usage: show disk/devicename"); return; } - dev = getdiskbyname(modif); + dev = kgetdiskbyname(modif); if (dev != NODEV) db_printf("dev_t = %p\n", dev); else diff --git a/sys/platform/pc32/acpica5/madt.c b/sys/platform/pc32/acpica5/madt.c index 72a88affd5..5fbb71ffa7 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.5 2005/11/02 08:33:23 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/acpica5/madt.c,v 1.6 2006/09/03 17:43:59 dillon Exp $ */ #include @@ -619,7 +619,7 @@ madt_parse_interrupt_override(MADT_INTERRUPT_OVERRIDE *intr) */ if (intr->Source == AcpiGbl_FADT->SciInt) { madt_found_sci_override = 1; - if (getenv_string("hw.acpi.sci.trigger", buf, sizeof(buf))) { + if (kgetenv_string("hw.acpi.sci.trigger", buf, sizeof(buf))) { if (tolower(buf[0]) == 'e') trig = INTR_TRIGGER_EDGE; else if (tolower(buf[0]) == 'l') @@ -631,7 +631,7 @@ madt_parse_interrupt_override(MADT_INTERRUPT_OVERRIDE *intr) printf("MADT: Forcing SCI to %s trigger\n", trig == INTR_TRIGGER_EDGE ? "edge" : "level"); } - if (getenv_string("hw.acpi.sci.polarity", buf, sizeof(buf))) { + if (kgetenv_string("hw.acpi.sci.polarity", buf, sizeof(buf))) { if (tolower(buf[0]) == 'h') pol = INTR_POLARITY_HIGH; else if (tolower(buf[0]) == 'l') diff --git a/sys/platform/pc32/apm/apm.c b/sys/platform/pc32/apm/apm.c index 5ec46ed301..4dfa44a004 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.15 2006/07/28 02:17:39 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/apm/apm.c,v 1.16 2006/09/03 17:43:59 dillon Exp $ */ #include @@ -1015,7 +1015,7 @@ apm_attach(device_t dev) /* Always call HLT in idle loop */ sc->always_halt_cpu = 1; - getenv_int("debug.apm_debug", &apm_debug); + kgetenv_int("debug.apm_debug", &apm_debug); /* print bootstrap messages */ APM_DPRINT("apm: APM BIOS version %04lx\n", apm_version); diff --git a/sys/platform/pc32/i386/autoconf.c b/sys/platform/pc32/i386/autoconf.c index f7371d7ac3..647aae435f 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.23 2005/11/04 08:57:27 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/autoconf.c,v 1.24 2006/09/03 17:43:59 dillon Exp $ */ /* @@ -364,7 +364,7 @@ inaddr_to_sockaddr(char *ev, struct sockaddr_in *sa) bzero(sa, sizeof(*sa)); - if ((cp = getenv(ev)) == NULL) + if ((cp = kgetenv(ev)) == NULL) return(1); if (sscanf(cp, "%d.%d.%d.%d", &a[0], &a[1], &a[2], &a[3]) != 4) return(1); @@ -388,7 +388,7 @@ hwaddr_to_sockaddr(char *ev, struct sockaddr_dl *sa) sa->sdl_family = AF_LINK; sa->sdl_type = IFT_ETHER; sa->sdl_alen = ETHER_ADDR_LEN; - if ((cp = getenv(ev)) == NULL) + if ((cp = kgetenv(ev)) == NULL) return(1); if (sscanf(cp, "%x:%x:%x:%x:%x:%x", &a[0], &a[1], &a[2], &a[3], &a[4], &a[5]) != 6) return(1); @@ -407,7 +407,7 @@ decode_nfshandle(char *ev, u_char *fh) u_char *cp; int len, val; - if (((cp = getenv(ev)) == NULL) || (strlen(cp) < 2) || (*cp != 'X')) + if (((cp = kgetenv(ev)) == NULL) || (strlen(cp) < 2) || (*cp != 'X')) return(0); len = 0; cp++; @@ -507,7 +507,7 @@ match_done: if (decode_nfshandle("boot.nfsroot.nfshandle", &nd->root_fh[0]) == 0) { printf("PXE: Warning, no NFS handle passed from loader\n"); } - if ((cp = getenv("boot.nfsroot.path")) != NULL) + if ((cp = kgetenv("boot.nfsroot.path")) != NULL) strncpy(nd->root_hostnam, cp, MNAMELEN - 1); nfs_diskless_valid = 1; diff --git a/sys/platform/pc32/i386/bios.c b/sys/platform/pc32/i386/bios.c index c784f85ceb..57c0c24c68 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.10 2004/04/29 12:11:16 joerg Exp $ + * $DragonFly: src/sys/platform/pc32/i386/bios.c,v 1.11 2006/09/03 17:43:59 dillon Exp $ */ /* @@ -93,7 +93,7 @@ bios32_init(void *junk) } /* Allow user override of PCI BIOS search */ - if (((p = getenv("machdep.bios.pci")) == NULL) || strcmp(p, "disable")) { + if (((p = kgetenv("machdep.bios.pci")) == NULL) || strcmp(p, "disable")) { /* See if there's a PCI BIOS entrypoint here */ PCIbios.ident.id = 0x49435024; /* PCI systems should have this */ if (!bios32_SDlookup(&PCIbios) && bootverbose) @@ -111,7 +111,7 @@ bios32_init(void *junk) * * Allow user override of PnP BIOS search */ - if (((p = getenv("machdep.bios.pnp")) == NULL || strcmp(p, "disable")) && + if (((p = kgetenv("machdep.bios.pnp")) == NULL || strcmp(p, "disable")) && (sigaddr = bios_sigsearch(0, "$PnP", 4, 16, 0)) != 0 ) { /* get a virtual pointer to the structure */ diff --git a/sys/platform/pc32/i386/machdep.c b/sys/platform/pc32/i386/machdep.c index c25138b60e..7cefde6d0c 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.94 2006/06/07 03:02:10 dillon Exp $ + * $DragonFly: src/sys/platform/pc32/i386/machdep.c,v 1.95 2006/09/03 17:43:59 dillon Exp $ */ #include "use_apm.h" @@ -1574,7 +1574,7 @@ physmap_done: * hw.physmem is a size in bytes; we also allow k, m, and g suffixes * for the appropriate modifiers. This overrides MAXMEM. */ - if ((cp = getenv("hw.physmem")) != NULL) { + if ((cp = kgetenv("hw.physmem")) != NULL) { u_int64_t AllowMem, sanity; char *ep; @@ -1629,8 +1629,8 @@ physmap_done: /* * Get dcons buffer address */ - if (getenv_quad("dcons.addr", &dcons_addr) == 0 || - getenv_quad("dcons.size", &dcons_size) == 0) + if (kgetenv_quad("dcons.addr", &dcons_addr) == 0 || + kgetenv_quad("dcons.size", &dcons_size) == 0) dcons_addr = 0; /* diff --git a/sys/sys/conf.h b/sys/sys/conf.h index fb099276d5..4c5655b60b 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -37,7 +37,7 @@ * * @(#)conf.h 8.5 (Berkeley) 1/9/95 * $FreeBSD: src/sys/sys/conf.h,v 1.103.2.6 2002/03/11 01:14:55 dd Exp $ - * $DragonFly: src/sys/sys/conf.h,v 1.11 2006/07/28 02:17:41 dillon Exp $ + * $DragonFly: src/sys/sys/conf.h,v 1.12 2006/09/03 17:43:59 dillon Exp $ */ #ifndef _SYS_CONF_H_ @@ -198,7 +198,7 @@ int iszerodev (dev_t dev); dev_t make_sub_dev (dev_t dev, int minor); int lminor (dev_t dev); void setconf (void); -dev_t getdiskbyname(const char *name); +dev_t kgetdiskbyname(const char *name); int dev_is_good(dev_t dev); /* diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 6c9c1ea832..3b7265b05a 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.22 2006/08/23 06:45:40 dillon Exp $ + * $DragonFly: src/sys/sys/kernel.h,v 1.23 2006/09/03 17:43:59 dillon Exp $ */ #ifndef _SYS_KERNEL_H_ @@ -279,7 +279,7 @@ struct tunable_int { SYSINIT(__Tunable_init_ ## line, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, \ tunable_int_init, &__tunable_int_ ## line) -#define TUNABLE_INT_FETCH(path, var) getenv_int((path), (var)) +#define TUNABLE_INT_FETCH(path, var) kgetenv_int((path), (var)) /* Backwards compatibility with the old deprecated TUNABLE_INT_DECL API */ #define TUNABLE_INT_DECL(path, defval, var) \ @@ -308,7 +308,7 @@ struct tunable_quad { SYSINIT(__Tunable_init_ ## line, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, \ tunable_quad_init, &__tunable_quad_ ## line) -#define TUNABLE_QUAD_FETCH(path, var) getenv_quad((path), (var)) +#define TUNABLE_QUAD_FETCH(path, var) kgetenv_quad((path), (var)) extern void tunable_str_init(void *); struct tunable_str { @@ -331,7 +331,7 @@ struct tunable_str { tunable_str_init, &__tunable_str_ ## line) #define TUNABLE_STR_FETCH(path, var, size) \ - getenv_string((path), (var), (size)) + kgetenv_string((path), (var), (size)) /* * Compatibility. To be deprecated after LKM is removed. diff --git a/sys/sys/systm.h b/sys/sys/systm.h index f514b30d1d..c05a6738f0 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -37,7 +37,7 @@ * * @(#)systm.h 8.7 (Berkeley) 3/29/95 * $FreeBSD: src/sys/sys/systm.h,v 1.111.2.18 2002/12/17 18:04:02 sam Exp $ - * $DragonFly: src/sys/sys/systm.h,v 1.39 2006/07/28 02:17:41 dillon Exp $ + * $DragonFly: src/sys/sys/systm.h,v 1.40 2006/09/03 17:43:59 dillon Exp $ */ #ifndef _SYS_SYSTM_H_ @@ -194,12 +194,12 @@ void startprofclock (struct proc *); void stopprofclock (struct proc *); void setstatclockrate (int hzrate); -char *getenv (const char *name); -#define testenv getenv +char *kgetenv (const char *name); +#define testenv kgetenv #define freeenv(p) -int getenv_int (const char *name, int *data); -int getenv_string (const char *name, char *data, int size); -int getenv_quad (const char *name, quad_t *data); +int kgetenv_int (const char *name, int *data); +int kgetenv_string (const char *name, char *data, int size); +int kgetenv_quad (const char *name, quad_t *data); extern char *kern_envp; #ifdef APM_FIXUP_CALLTODO -- 2.41.0