prom_io.c revision e20e22c9fb9e2f586b0b23e03f75830e3cece213
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. 2N/A * Returns 0 on error. Otherwise returns a handle. ci[
4] = (
cell_t)0;
/* Res1: Prime result */ ci[
1] = (
cell_t)
3;
/* #argument cells */ ci[
6] = (
cell_t)-
1;
/* Res1: Prime result */ ci[
1] = (
cell_t)
3;
/* #argument cells */ ci[
6] = (
cell_t)-
1;
/* Res1: Prime result */ * prom_write is the only prom_*() function we have to intercept * because all the other prom_*() io interfaces eventually call * If the callback address is set, attempt to redirect * console output back into kernel terminal emulator. * 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 * promplat_alloc() can block on a mutex and so * is called here before calling promif_preprom(). * Normally we'd call promif_preprom() just before * calling into the prom (to enforce single-threaded * access) but here we need to call it before accessing * smallbuf, since smallbuf is statically allocated and * hence can only be accessed by one thread at a time. * 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 ci[
1] = (
cell_t)
3;
/* #argument cells */ ci[
6] = (
cell_t)-
1;
/* Res1: Prime result */ ci[
1] = (
cell_t)
1;
/* #argument cells */