xref: /onnv-gate/usr/src/uts/sparc/v9/sys/prom_isa.h (revision 789:b348f31ed315)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*789Sahrens  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_SYS_PROM_ISA_H
280Sstevel@tonic-gate #define	_SYS_PROM_ISA_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate #include <sys/feature_tests.h>
330Sstevel@tonic-gate #include <sys/obpdefs.h>
340Sstevel@tonic-gate 
350Sstevel@tonic-gate /*
360Sstevel@tonic-gate  * This file contains external ISA-specific promif interface definitions.
370Sstevel@tonic-gate  * There may be none.  This file is included by reference in <sys/promif.h>
380Sstevel@tonic-gate  *
390Sstevel@tonic-gate  * This version of the file contains definitions for a 64-bit client program
400Sstevel@tonic-gate  * calling the 64-bit cell-sized SPARC v9 firmware client interface handler.
410Sstevel@tonic-gate  *
420Sstevel@tonic-gate  */
430Sstevel@tonic-gate 
440Sstevel@tonic-gate #ifdef	__cplusplus
450Sstevel@tonic-gate extern "C" {
460Sstevel@tonic-gate #endif
470Sstevel@tonic-gate 
480Sstevel@tonic-gate #if !defined(_LONGLONG_TYPE)
490Sstevel@tonic-gate #error "This header won't work without long long support"
500Sstevel@tonic-gate #endif
510Sstevel@tonic-gate 
520Sstevel@tonic-gate typedef	unsigned long long cell_t;
530Sstevel@tonic-gate 
540Sstevel@tonic-gate #define	p1275_ptr2cell(p)	((cell_t)((uintptr_t)((void *)(p))))
550Sstevel@tonic-gate #define	p1275_int2cell(i)	((cell_t)((int)(i)))
560Sstevel@tonic-gate #define	p1275_uint2cell(u)	((cell_t)((unsigned int)(u)))
570Sstevel@tonic-gate #define	p1275_size2cell(u)	((cell_t)((size_t)(u)))
580Sstevel@tonic-gate #define	p1275_phandle2cell(ph)	((cell_t)((unsigned int)((phandle_t)(ph))))
59*789Sahrens #define	p1275_dnode2cell(d)	((cell_t)((unsigned int)((pnode_t)(d))))
600Sstevel@tonic-gate #define	p1275_ihandle2cell(ih)	((cell_t)((unsigned int)((ihandle_t)(ih))))
610Sstevel@tonic-gate #define	p1275_ull2cell_high(ll)	(0LL)
620Sstevel@tonic-gate #define	p1275_ull2cell_low(ll)	((cell_t)(ll))
630Sstevel@tonic-gate #define	p1275_uintptr2cell(i)	((cell_t)((uintptr_t)(i)))
640Sstevel@tonic-gate 
650Sstevel@tonic-gate #define	p1275_cell2ptr(p)	((void *)((cell_t)(p)))
660Sstevel@tonic-gate #define	p1275_cell2int(i)	((int)((cell_t)(i)))
670Sstevel@tonic-gate #define	p1275_cell2uint(u)	((unsigned int)((cell_t)(u)))
680Sstevel@tonic-gate #define	p1275_cell2size(u)	((size_t)((cell_t)(u)))
690Sstevel@tonic-gate #define	p1275_cell2phandle(ph)	((phandle_t)((cell_t)(ph)))
70*789Sahrens #define	p1275_cell2dnode(d)	((pnode_t)((cell_t)(d)))
710Sstevel@tonic-gate #define	p1275_cell2ihandle(ih)	((ihandle_t)((cell_t)(ih)))
720Sstevel@tonic-gate #define	p1275_cells2ull(h, l)	((unsigned long long)(cell_t)(l))
730Sstevel@tonic-gate #define	p1275_cell2uintptr(i)	((uintptr_t)((cell_t)(i)))
740Sstevel@tonic-gate 
750Sstevel@tonic-gate /*
760Sstevel@tonic-gate  * Define default cif handlers:  This port uses SPARC V8 32 bit semantics
770Sstevel@tonic-gate  * on the calling side and the prom side.
780Sstevel@tonic-gate  */
790Sstevel@tonic-gate #define	p1275_cif_init			p1275_sparc_cif_init
800Sstevel@tonic-gate #define	p1275_cif_handler		p1275_sparc_cif_handler
810Sstevel@tonic-gate 
820Sstevel@tonic-gate extern void	*p1275_sparc_cif_init(void *);
830Sstevel@tonic-gate extern int	p1275_cif_handler(void *);
840Sstevel@tonic-gate 
850Sstevel@tonic-gate #ifdef	__cplusplus
860Sstevel@tonic-gate }
870Sstevel@tonic-gate #endif
880Sstevel@tonic-gate 
890Sstevel@tonic-gate #endif /* _SYS_PROM_ISA_H */
90