Home | History | Annotate | Line # | Download | only in include
sysarch.h revision 1.6
      1  1.6   simonb /* $NetBSD: sysarch.h,v 1.6 2000/06/30 18:19:28 simonb Exp $ */
      2  1.4  thorpej 
      3  1.4  thorpej /*-
      4  1.4  thorpej  * Copyright (c) 2000 The NetBSD Foundation, Inc.
      5  1.4  thorpej  * All rights reserved.
      6  1.4  thorpej  *
      7  1.4  thorpej  * This code is derived from software contributed to The NetBSD Foundation
      8  1.4  thorpej  * by Jason R. Thorpe.
      9  1.4  thorpej  *
     10  1.4  thorpej  * Redistribution and use in source and binary forms, with or without
     11  1.4  thorpej  * modification, are permitted provided that the following conditions
     12  1.4  thorpej  * are met:
     13  1.4  thorpej  * 1. Redistributions of source code must retain the above copyright
     14  1.4  thorpej  *    notice, this list of conditions and the following disclaimer.
     15  1.4  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.4  thorpej  *    notice, this list of conditions and the following disclaimer in the
     17  1.4  thorpej  *    documentation and/or other materials provided with the distribution.
     18  1.4  thorpej  * 3. All advertising materials mentioning features or use of this software
     19  1.4  thorpej  *    must display the following acknowledgement:
     20  1.4  thorpej  *	This product includes software developed by the NetBSD
     21  1.4  thorpej  *	Foundation, Inc. and its contributors.
     22  1.4  thorpej  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.4  thorpej  *    contributors may be used to endorse or promote products derived
     24  1.4  thorpej  *    from this software without specific prior written permission.
     25  1.4  thorpej  *
     26  1.4  thorpej  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.4  thorpej  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.4  thorpej  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.4  thorpej  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.4  thorpej  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.4  thorpej  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.4  thorpej  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.4  thorpej  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.4  thorpej  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.4  thorpej  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.4  thorpej  * POSSIBILITY OF SUCH DAMAGE.
     37  1.4  thorpej  */
     38  1.3     ross 
     39  1.3     ross #ifndef _ALPHA_SYSARCH_H_
     40  1.3     ross #define _ALPHA_SYSARCH_H_
     41  1.3     ross 
     42  1.4  thorpej #include <machine/bus.h>
     43  1.3     ross #include <machine/ieeefp.h>
     44  1.1      cgd 
     45  1.1      cgd /*
     46  1.3     ross  * Architecture specific syscalls (ALPHA)
     47  1.1      cgd  */
     48  1.1      cgd 
     49  1.4  thorpej #define	ALPHA_FPGETMASK			0
     50  1.4  thorpej #define	ALPHA_FPSETMASK			1
     51  1.4  thorpej #define	ALPHA_FPSETSTICKY		2
     52  1.3     ross struct alpha_fp_except_args {
     53  1.3     ross 	fp_except mask;
     54  1.3     ross };
     55  1.1      cgd 
     56  1.4  thorpej #define	ALPHA_BUS_GET_WINDOW_COUNT	3
     57  1.4  thorpej struct alpha_bus_get_window_count_args {
     58  1.4  thorpej 	u_int type;
     59  1.4  thorpej 	u_int count;	/* output */
     60  1.4  thorpej };
     61  1.4  thorpej 
     62  1.4  thorpej #define	ALPHA_BUS_GET_WINDOW		4
     63  1.4  thorpej struct alpha_bus_get_window_args {
     64  1.4  thorpej 	u_int type;
     65  1.4  thorpej 	u_int window;
     66  1.4  thorpej 	struct alpha_bus_space_translation *translation; /* output */
     67  1.4  thorpej };
     68  1.4  thorpej 
     69  1.4  thorpej #define	ALPHA_BUS_TYPE_PCI_IO		0
     70  1.4  thorpej #define	ALPHA_BUS_TYPE_PCI_MEM		1
     71  1.4  thorpej #define	ALPHA_BUS_TYPE_MAX		1
     72  1.4  thorpej 
     73  1.4  thorpej #define	ALPHA_PCI_CONF_READWRITE	5
     74  1.4  thorpej struct alpha_pci_conf_readwrite_args {
     75  1.4  thorpej 	int write;
     76  1.4  thorpej 	u_int bus;
     77  1.4  thorpej 	u_int device;
     78  1.4  thorpej 	u_int function;
     79  1.4  thorpej 	u_int reg;
     80  1.4  thorpej 	u_int32_t val;
     81  1.4  thorpej };
     82  1.4  thorpej 
     83  1.4  thorpej #ifdef _KERNEL
     84  1.4  thorpej extern	u_int alpha_bus_window_count[];
     85  1.5  thorpej extern	int (*alpha_bus_get_window)(int, int,
     86  1.5  thorpej 	    struct alpha_bus_space_translation *);
     87  1.4  thorpej extern	struct alpha_pci_chipset *alpha_pci_chipset;
     88  1.4  thorpej #else
     89  1.4  thorpej struct alpha_bus_window {
     90  1.4  thorpej 	caddr_t		abw_addr;
     91  1.4  thorpej 	size_t		abw_size;
     92  1.4  thorpej 	struct alpha_bus_space_translation abw_abst;
     93  1.4  thorpej };
     94  1.4  thorpej 
     95  1.5  thorpej int	alpha_bus_getwindows(int, struct alpha_bus_window **);
     96  1.5  thorpej int	alpha_bus_mapwindow(struct alpha_bus_window *);
     97  1.5  thorpej void	alpha_bus_unmapwindow(struct alpha_bus_window *);
     98  1.5  thorpej 
     99  1.5  thorpej void	*alpha_pci_mem_map(bus_addr_t, bus_size_t, int,
    100  1.5  thorpej 	    struct alpha_bus_space_translation *);
    101  1.6   simonb void	alpha_pci_mem_unmap(struct alpha_bus_space_translation *,
    102  1.6   simonb 	    void *addr, bus_size_t);
    103  1.4  thorpej 
    104  1.5  thorpej u_int32_t alpha_pci_conf_read(u_int, u_int, u_int, u_int);
    105  1.5  thorpej void	alpha_pci_conf_write(u_int, u_int, u_int, u_int, u_int32_t);
    106  1.4  thorpej 
    107  1.5  thorpej int	sysarch(int, void *);
    108  1.4  thorpej #endif /* _KERNEL */
    109  1.1      cgd 
    110  1.3     ross #endif /* !_ALPHA_SYSARCH_H_ */
    111