/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* The intent of this file is to contain any data that must remain
* resident in the kernel.
*
* space_store(), space_fetch(), and space_free() have been added to
* easily store and retrieve kernel resident data.
* These functions are recommended rather than adding new variables to
* this file.
*
* Note that it's possible for name collisions to occur. In order to
* prevent collisions, it's recommended that the convention in
* PSARC/1997/389 be used. If a collision occurs, then space_store will
* fail.
*/
#include <sys/strredir.h>
#include <sys/bootprops.h>
#ifdef lint
#endif
/*
* The following describe the physical memory configuration.
*
* physmem - The amount of physical memory configured
* in pages. ptob(physmem) is the amount
* of physical memory in bytes. Defined in
*
* physmax - The highest numbered physical page in memory.
*
* maxmem - Maximum available memory, in pages. Defined
* in main.c.
*
* physinstalled
* - Pages of physical memory installed;
* physmem.
*/
struct var v;
#include <sys/sysmacros.h>
#include <sys/bootconf.h>
/*
* Data for segkmem pages that should be resident
*/
/*
* Data from swapgeneric.c that must be resident.
*/
/*
* dhcp
*/
int netboot;
int obpdebug;
int dhcacklen;
/*
* Data from arp.c that must be resident.
*/
#include <netinet/if_ether.h>
/*
* Data from timod that must be resident
*/
/*
* state transition table for TI interface
*/
/* STATES */
/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
};
static void store_fetch_initspace();
/*
* Allocate tunable structures at runtime.
*/
void
space_init(void)
{
}
/*
* Previously defined in consmsconf.c ...
*/
/*
* moved from cons.c because they must be resident in the kernel.
*/
/*
* serial virtual console vnode pointer.
*/
/*
* terminal emulator, or is using the kernel terminal emulator.
*/
/*
* The following allows systems to disable use of the kernel
* terminal emulator (retreat to PROM terminal emulator if there
* is PROM).
*/
int cons_tem_disable;
/*
* consconfig() in autoconf.c sets this; it's the vnode of the distinguished
*/
/*
* Platform console abort policy.
* Platforms may override the default software policy, if such hardware
* (e.g. keyswitches with a secure position) exists.
*/
/* from cpc.c */
/*
* storing and retrieving data by string key
*
* this mechanism allows a consumer to store and retrieve by name a pointer
* to some space maintained by the consumer.
* For example, a driver or module may want to have persistent data
* kmem_alloced space and it should not be pointing to data that will
* be destroyed when the module is unloaded.
*/
static void
{
}
int
{
char *s;
int rval;
size_t l;
/* some sanity checks first */
return (-1);
}
if (l == 0) {
return (-1);
}
/* increment for null terminator */
l++;
/* alloc space for the string, mod_hash_insert will deallocate */
s = kmem_alloc(l, KM_SLEEP);
switch (rval) {
case 0:
break;
#ifdef DEBUG
case MH_ERR_DUPLICATE:
rval = -1;
break;
case MH_ERR_NOMEM:
rval = -1;
break;
default:
key);
rval = -1;
break;
#else
default:
rval = -1;
break;
#endif
}
return (rval);
}
{
int rval;
if (key) {
if (rval == 0) {
}
}
return (ptr);
}
void
{
if (key) {
}
}
/*
* Support for CRC32. At present all calculations are done in simple
* macros, so all we need is somewhere to declare the global lookup table.
*/
/*
* We need to fanout load from NIC which can overwhelm a single CPU.
* This becomes especially important on systems having slow CPUs
* (sun4v architecture). mac_soft_ring_enable is false on all
* systems except sun4v. On sun4v, they get enabled by default (see
* sun4v/os/mach_startup.c).
*/
/*
* Global iscsi boot prop
*/