xref: /illumos-gate/usr/src/uts/sparc/v9/sys/prom_isa.h (revision fa9e4066)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23*fa9e4066Sahrens  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_SYS_PROM_ISA_H
287c478bd9Sstevel@tonic-gate #define	_SYS_PROM_ISA_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
337c478bd9Sstevel@tonic-gate #include <sys/obpdefs.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate /*
367c478bd9Sstevel@tonic-gate  * This file contains external ISA-specific promif interface definitions.
377c478bd9Sstevel@tonic-gate  * There may be none.  This file is included by reference in <sys/promif.h>
387c478bd9Sstevel@tonic-gate  *
397c478bd9Sstevel@tonic-gate  * This version of the file contains definitions for a 64-bit client program
407c478bd9Sstevel@tonic-gate  * calling the 64-bit cell-sized SPARC v9 firmware client interface handler.
417c478bd9Sstevel@tonic-gate  *
427c478bd9Sstevel@tonic-gate  */
437c478bd9Sstevel@tonic-gate 
447c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
457c478bd9Sstevel@tonic-gate extern "C" {
467c478bd9Sstevel@tonic-gate #endif
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate #if !defined(_LONGLONG_TYPE)
497c478bd9Sstevel@tonic-gate #error "This header won't work without long long support"
507c478bd9Sstevel@tonic-gate #endif
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate typedef	unsigned long long cell_t;
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate #define	p1275_ptr2cell(p)	((cell_t)((uintptr_t)((void *)(p))))
557c478bd9Sstevel@tonic-gate #define	p1275_int2cell(i)	((cell_t)((int)(i)))
567c478bd9Sstevel@tonic-gate #define	p1275_uint2cell(u)	((cell_t)((unsigned int)(u)))
577c478bd9Sstevel@tonic-gate #define	p1275_size2cell(u)	((cell_t)((size_t)(u)))
587c478bd9Sstevel@tonic-gate #define	p1275_phandle2cell(ph)	((cell_t)((unsigned int)((phandle_t)(ph))))
59*fa9e4066Sahrens #define	p1275_dnode2cell(d)	((cell_t)((unsigned int)((pnode_t)(d))))
607c478bd9Sstevel@tonic-gate #define	p1275_ihandle2cell(ih)	((cell_t)((unsigned int)((ihandle_t)(ih))))
617c478bd9Sstevel@tonic-gate #define	p1275_ull2cell_high(ll)	(0LL)
627c478bd9Sstevel@tonic-gate #define	p1275_ull2cell_low(ll)	((cell_t)(ll))
637c478bd9Sstevel@tonic-gate #define	p1275_uintptr2cell(i)	((cell_t)((uintptr_t)(i)))
647c478bd9Sstevel@tonic-gate 
657c478bd9Sstevel@tonic-gate #define	p1275_cell2ptr(p)	((void *)((cell_t)(p)))
667c478bd9Sstevel@tonic-gate #define	p1275_cell2int(i)	((int)((cell_t)(i)))
677c478bd9Sstevel@tonic-gate #define	p1275_cell2uint(u)	((unsigned int)((cell_t)(u)))
687c478bd9Sstevel@tonic-gate #define	p1275_cell2size(u)	((size_t)((cell_t)(u)))
697c478bd9Sstevel@tonic-gate #define	p1275_cell2phandle(ph)	((phandle_t)((cell_t)(ph)))
70*fa9e4066Sahrens #define	p1275_cell2dnode(d)	((pnode_t)((cell_t)(d)))
717c478bd9Sstevel@tonic-gate #define	p1275_cell2ihandle(ih)	((ihandle_t)((cell_t)(ih)))
727c478bd9Sstevel@tonic-gate #define	p1275_cells2ull(h, l)	((unsigned long long)(cell_t)(l))
737c478bd9Sstevel@tonic-gate #define	p1275_cell2uintptr(i)	((uintptr_t)((cell_t)(i)))
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate /*
767c478bd9Sstevel@tonic-gate  * Define default cif handlers:  This port uses SPARC V8 32 bit semantics
777c478bd9Sstevel@tonic-gate  * on the calling side and the prom side.
787c478bd9Sstevel@tonic-gate  */
797c478bd9Sstevel@tonic-gate #define	p1275_cif_init			p1275_sparc_cif_init
807c478bd9Sstevel@tonic-gate #define	p1275_cif_handler		p1275_sparc_cif_handler
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate extern void	*p1275_sparc_cif_init(void *);
837c478bd9Sstevel@tonic-gate extern int	p1275_cif_handler(void *);
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
867c478bd9Sstevel@tonic-gate }
877c478bd9Sstevel@tonic-gate #endif
887c478bd9Sstevel@tonic-gate 
897c478bd9Sstevel@tonic-gate #endif /* _SYS_PROM_ISA_H */
90