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