prom_io.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 1994,1998,2001-2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/promimpl.h>
/*
* Returns 0 on error. Otherwise returns a handle.
*/
int
{
#ifdef PROM_32BIT_ADDRS
return (0);
}
#endif
ow = promif_preout();
(void) p1275_cif_handler(&ci);
#ifdef PROM_32BIT_ADDRS
#endif
}
int
{
(void) p1275_cif_handler(&ci);
}
/*ARGSUSED3*/
{
#ifdef PROM_32BIT_ADDRS
return (-1);
}
#endif
ow = promif_preout();
(void) p1275_cif_handler(&ci);
#ifdef PROM_32BIT_ADDRS
}
#endif
}
/*ARGSUSED3*/
{
#ifdef PROM_32BIT_ADDRS
static char smallbuf[256];
/*
* This is a hack for kernel message output.
* By avoiding calls to promplat_alloc (and
* using smallbuf instead) when memory is low
* we can print shortish kernel messages without
* deadlocking. smallbuf should be at least as
* large as the automatic buffer in
* prom_printf.c:_doprint()'s stack frame.
* promplat_alloc() can block on a mutex and so
* is called here before calling promif_preprom().
*/
return (-1);
}
}
}
#endif
ow = promif_preout();
#ifdef PROM_32BIT_ADDRS
/*
* If buf is small enough, use smallbuf
* instead of promplat_alloc() (see above)
* smallbuf is static, so single thread
* access to it by using it only after
* promif_preprom()
*/
}
}
#endif
(void) p1275_cif_handler(&ci);
#ifdef PROM_32BIT_ADDRS
#endif
}
int
prom_close(int fd)
{
ow = promif_preout();
(void) p1275_cif_handler(&ci);
return (0);
}