bus.h (523ab3b440fb342ad2bd61c8a1a17dbdc002af12) | bus.h (06db52b6098b8904169760c6b005f5175b6ad6b1) |
---|---|
1/*- 2 * Copyright (c) KATO Takenori, 1999. 3 * 4 * All rights reserved. Unpublished rights reserved under the copyright 5 * laws of Japan. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 90 unchanged lines hidden (view full) --- 99 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 100 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 101 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 102 */ 103 104#ifndef _I386_BUS_H_ 105#define _I386_BUS_H_ 106 | 1/*- 2 * Copyright (c) KATO Takenori, 1999. 3 * 4 * All rights reserved. Unpublished rights reserved under the copyright 5 * laws of Japan. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 90 unchanged lines hidden (view full) --- 99 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 100 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 101 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 102 */ 103 104#ifndef _I386_BUS_H_ 105#define _I386_BUS_H_ 106 |
107#include <machine/_bus.h> |
|
107#include <machine/cpufunc.h> 108 109/* 110 * To remain compatible with NetBSD's interface, default to both memio and 111 * pio when neither of them is defined. 112 */ 113#if !defined(_I386_BUS_PIO_H_) && !defined(_I386_BUS_MEMIO_H_) 114#define _I386_BUS_PIO_H_ 115#define _I386_BUS_MEMIO_H_ 116#endif 117 118/* 119 * Values for the i386 bus space tag, not to be used directly by MI code. 120 */ 121#define I386_BUS_SPACE_IO 0 /* space is i/o space */ 122#define I386_BUS_SPACE_MEM 1 /* space is mem space */ 123 | 108#include <machine/cpufunc.h> 109 110/* 111 * To remain compatible with NetBSD's interface, default to both memio and 112 * pio when neither of them is defined. 113 */ 114#if !defined(_I386_BUS_PIO_H_) && !defined(_I386_BUS_MEMIO_H_) 115#define _I386_BUS_PIO_H_ 116#define _I386_BUS_MEMIO_H_ 117#endif 118 119/* 120 * Values for the i386 bus space tag, not to be used directly by MI code. 121 */ 122#define I386_BUS_SPACE_IO 0 /* space is i/o space */ 123#define I386_BUS_SPACE_MEM 1 /* space is mem space */ 124 |
124/* 125 * Bus address and size types 126 */ 127#ifdef PAE 128typedef uint64_t bus_addr_t; 129#else 130typedef uint32_t bus_addr_t; 131#endif 132typedef uint32_t bus_size_t; 133 | |
134#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF 135#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF 136#define BUS_SPACE_MAXSIZE 0xFFFFFFFF 137#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF 138#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF 139#ifdef PAE 140#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFULL 141#else 142#define BUS_SPACE_MAXADDR 0xFFFFFFFF 143#endif 144 145#define BUS_SPACE_UNRESTRICTED (~0) 146 147/* | 125#define BUS_SPACE_MAXSIZE_24BIT 0xFFFFFF 126#define BUS_SPACE_MAXSIZE_32BIT 0xFFFFFFFF 127#define BUS_SPACE_MAXSIZE 0xFFFFFFFF 128#define BUS_SPACE_MAXADDR_24BIT 0xFFFFFF 129#define BUS_SPACE_MAXADDR_32BIT 0xFFFFFFFF 130#ifdef PAE 131#define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFULL 132#else 133#define BUS_SPACE_MAXADDR 0xFFFFFFFF 134#endif 135 136#define BUS_SPACE_UNRESTRICTED (~0) 137 138/* |
148 * Access methods for bus resources and address space. 149 */ 150typedef int bus_space_tag_t; 151typedef u_int bus_space_handle_t; 152 153/* | |
154 * Map a region of device bus space into CPU virtual address space. 155 */ 156 157static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, 158 bus_size_t size, int flags, 159 bus_space_handle_t *bshp); 160 161static __inline int --- 1256 unchanged lines hidden --- | 139 * Map a region of device bus space into CPU virtual address space. 140 */ 141 142static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, 143 bus_size_t size, int flags, 144 bus_space_handle_t *bshp); 145 146static __inline int --- 1256 unchanged lines hidden --- |