1*e75674c8Smiod /* $OpenBSD: openfirm.h,v 1.7 2024/11/08 12:48:00 miod Exp $ */ 2908fd733Sjason /* $NetBSD: openfirm.h,v 1.8 2001/07/20 00:07:14 eeh Exp $ */ 3908fd733Sjason 4908fd733Sjason /* 5908fd733Sjason * Copyright (C) 1995, 1996 Wolfgang Solfrank. 6908fd733Sjason * Copyright (C) 1995, 1996 TooLs GmbH. 7908fd733Sjason * All rights reserved. 8908fd733Sjason * 9908fd733Sjason * Redistribution and use in source and binary forms, with or without 10908fd733Sjason * modification, are permitted provided that the following conditions 11908fd733Sjason * are met: 12908fd733Sjason * 1. Redistributions of source code must retain the above copyright 13908fd733Sjason * notice, this list of conditions and the following disclaimer. 14908fd733Sjason * 2. Redistributions in binary form must reproduce the above copyright 15908fd733Sjason * notice, this list of conditions and the following disclaimer in the 16908fd733Sjason * documentation and/or other materials provided with the distribution. 17908fd733Sjason * 3. All advertising materials mentioning features or use of this software 18908fd733Sjason * must display the following acknowledgement: 19908fd733Sjason * This product includes software developed by TooLs GmbH. 20908fd733Sjason * 4. The name of TooLs GmbH may not be used to endorse or promote products 21908fd733Sjason * derived from this software without specific prior written permission. 22908fd733Sjason * 23908fd733Sjason * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR 24908fd733Sjason * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 25908fd733Sjason * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 26908fd733Sjason * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27908fd733Sjason * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 28908fd733Sjason * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 29908fd733Sjason * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 30908fd733Sjason * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 31908fd733Sjason * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 32908fd733Sjason * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33908fd733Sjason */ 34908fd733Sjason /* 35908fd733Sjason * Prototypes for additional OpenFirmware Interface Routines 36908fd733Sjason */ 37908fd733Sjason 38908fd733Sjason #include <dev/ofw/openfirm.h> 39908fd733Sjason 40908fd733Sjason /* All cells are 8 byte slots */ 41908fd733Sjason typedef u_int64_t cell_t; 42908fd733Sjason #define HDL2CELL(x) (cell_t)(u_int)(int)(x) 43908fd733Sjason #define ADR2CELL(x) (cell_t)(x) 44908fd733Sjason 45f5d7638bSkettenis #define HDQ2CELL_HI(x) (cell_t)(0) 46f5d7638bSkettenis #define HDQ2CELL_LO(x) (cell_t)(x) 47f5d7638bSkettenis 48f5d7638bSkettenis #define CELL2HDQ(hi, lo) (lo) 49f5d7638bSkettenis 50908fd733Sjason int OF_test(char *service); 51908fd733Sjason int OF_test_method(int handle, char *method); 52908fd733Sjason 53908fd733Sjason int OF_stdin(void); 54908fd733Sjason int OF_stdout(void); 55908fd733Sjason void OF_set_symbol_lookup(void (*s2v)(void *), void (*v2s)(void *)); 5607427cacSmiod void OF_poweroff(void); 57908fd733Sjason void OF_sym2val(void *); 58908fd733Sjason void OF_val2sym(void *); 59908fd733Sjason int OF_milliseconds(void); 60908fd733Sjason int OF_searchprop(int node, char *prop, void *buf, int buflen); 61908fd733Sjason int OF_mapintr(int node, int *interrupt, int validlen, int buflen); 62*e75674c8Smiod int OF_instance_to_path(int ihandle, char *buf, int buflen); 63*e75674c8Smiod int OF_package_to_path(int phandle, char *buf, int buflen); 64d5333d97Sart 65d5333d97Sart void (*OF_set_callback(void (*)(void *)))(void *); 66