xref: /netbsd/sys/arch/usermode/include/bus.h (revision 8a06b90d)
1*8a06b90dSskrll /* $NetBSD: bus.h,v 1.5 2019/09/23 16:17:58 skrll Exp $ */
240478d28Sjmcneill 
340478d28Sjmcneill /*-
440478d28Sjmcneill  * Copyright (c) 2011 Jared D. McNeill <jmcneill@invisible.ca>
540478d28Sjmcneill  * All rights reserved.
640478d28Sjmcneill  *
740478d28Sjmcneill  * Redistribution and use in source and binary forms, with or without
840478d28Sjmcneill  * modification, are permitted provided that the following conditions
940478d28Sjmcneill  * are met:
1040478d28Sjmcneill  * 1. Redistributions of source code must retain the above copyright
1140478d28Sjmcneill  *    notice, this list of conditions and the following disclaimer.
1240478d28Sjmcneill  * 2. Redistributions in binary form must reproduce the above copyright
1340478d28Sjmcneill  *    notice, this list of conditions and the following disclaimer in the
1440478d28Sjmcneill  *    documentation and/or other materials provided with the distribution.
1540478d28Sjmcneill  *
1640478d28Sjmcneill  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
1740478d28Sjmcneill  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1840478d28Sjmcneill  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1940478d28Sjmcneill  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2040478d28Sjmcneill  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2140478d28Sjmcneill  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2240478d28Sjmcneill  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2340478d28Sjmcneill  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2440478d28Sjmcneill  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2540478d28Sjmcneill  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2640478d28Sjmcneill  * POSSIBILITY OF SUCH DAMAGE.
2740478d28Sjmcneill  */
2840478d28Sjmcneill 
2940478d28Sjmcneill #ifndef _ARCH_USERMODE_INCLUDE_BUS_H
3040478d28Sjmcneill #define _ARCH_USERMODE_INCLUDE_BUS_H
3140478d28Sjmcneill 
3240478d28Sjmcneill struct bus_space_tag;
3340478d28Sjmcneill typedef struct bus_space_tag *bus_space_tag_t;
3440478d28Sjmcneill 
3540478d28Sjmcneill typedef vaddr_t bus_space_handle_t;
36*8a06b90dSskrll 
37*8a06b90dSskrll #define PRIxBSH		PRIxVADDR
38*8a06b90dSskrll 
39261ae2e8Sjmcneill typedef paddr_t bus_addr_t;
4040478d28Sjmcneill 
41*8a06b90dSskrll #define PRIxBUSADDR	PRIxPADDR
42*8a06b90dSskrll 
435ab6a080Sreinoud bool bus_space_is_equal(bus_space_tag_t, bus_space_tag_t);
445ab6a080Sreinoud bool bus_space_handle_is_equal(bus_space_tag_t, bus_space_handle_t,
455ab6a080Sreinoud     bus_space_handle_t);
465ab6a080Sreinoud 
4740478d28Sjmcneill #endif /* !_ARCH_USERMODE_INCLUDE_BUS_H */
48