11.9Sthorpej/*	$NetBSD: openfirm.h,v 1.9 2021/02/28 20:27:40 thorpej Exp $	*/
21.1Stsubai
31.1Stsubai/*
41.1Stsubai * Copyright (C) 1995, 1996 Wolfgang Solfrank.
51.1Stsubai * Copyright (C) 1995, 1996 TooLs GmbH.
61.1Stsubai * All rights reserved.
71.1Stsubai *
81.1Stsubai * Redistribution and use in source and binary forms, with or without
91.1Stsubai * modification, are permitted provided that the following conditions
101.1Stsubai * are met:
111.1Stsubai * 1. Redistributions of source code must retain the above copyright
121.1Stsubai *    notice, this list of conditions and the following disclaimer.
131.1Stsubai * 2. Redistributions in binary form must reproduce the above copyright
141.1Stsubai *    notice, this list of conditions and the following disclaimer in the
151.1Stsubai *    documentation and/or other materials provided with the distribution.
161.1Stsubai * 3. All advertising materials mentioning features or use of this software
171.1Stsubai *    must display the following acknowledgement:
181.1Stsubai *	This product includes software developed by TooLs GmbH.
191.1Stsubai * 4. The name of TooLs GmbH may not be used to endorse or promote products
201.1Stsubai *    derived from this software without specific prior written permission.
211.1Stsubai *
221.1Stsubai * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
231.1Stsubai * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
241.1Stsubai * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
251.1Stsubai * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
261.1Stsubai * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
271.1Stsubai * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
281.1Stsubai * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
291.1Stsubai * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
301.1Stsubai * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
311.1Stsubai * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
321.1Stsubai */
331.1Stsubai/*
341.1Stsubai * Prototypes for Openfirmware Interface Routines
351.1Stsubai */
361.1Stsubai
371.1Stsubai#include <sys/cdefs.h>
381.1Stsubai#include <sys/types.h>
391.1Stsubai
401.3Saymeric#include "boot.h"
411.3Saymeric
421.9Sthorpejextern int	ofw_real_mode;
431.9Sthorpejextern int	ofw_address_cells;
441.9Sthorpejextern int	ofw_size_cells;
451.9Sthorpejextern int	ofw_root;
461.9Sthorpejextern int	ofw_chosen;
471.9Sthorpejextern int	ofw_options;
481.9Sthorpejextern int	ofw_openprom;
491.9Sthorpejextern int	ofw_stdin;
501.9Sthorpejextern int	ofw_stdout;
511.9Sthorpejextern int	ofw_memory_ihandle;
521.9Sthorpejextern int	ofw_mmu_ihandle;
531.9Sthorpej
541.9Sthorpejbool	ofw_option_truefalse(const char *, int);
551.9Sthorpej
561.8Suwevoid OF_enter(void);
571.7Sperry__dead void OF_exit(void);
581.5Suweint OF_finddevice(const char *);
591.3Saymericint OF_instance_to_package(int);
601.5Suweint OF_getprop(int, const char *, void *, int);
611.1Stsubai#ifdef	__notyet__
621.6Suweint OF_setprop(int, const char *, void *, int);
631.1Stsubai#endif
641.6Suweint OF_open(const char *);
651.3Saymericvoid OF_close(int);
661.3Saymericint OF_write(int, void *, int);
671.3Saymericint OF_read(int, void *, int);
681.3Saymericint OF_seek(int, u_quad_t);
691.3Saymericvoid *OF_claim(void *, u_int, u_int);
701.3Saymericvoid OF_release(void *, u_int);
711.3Saymericint OF_milliseconds(void);
721.3Saymericvoid OF_chain(void *, u_int, boot_entry_t, void *, u_int);
731.9Sthorpejint OF_call_method(const char *, int, int, int, int *);
74