libbus.h revision 265056
1265056Smarcel/*- 2265056Smarcel * Copyright (c) 2014 Marcel Moolenaar 3265056Smarcel * All rights reserved. 4265056Smarcel * 5265056Smarcel * Redistribution and use in source and binary forms, with or without 6265056Smarcel * modification, are permitted provided that the following conditions 7265056Smarcel * are met: 8265056Smarcel * 9265056Smarcel * 1. Redistributions of source code must retain the above copyright 10265056Smarcel * notice, this list of conditions and the following disclaimer. 11265056Smarcel * 2. Redistributions in binary form must reproduce the above copyright 12265056Smarcel * notice, this list of conditions and the following disclaimer in the 13265056Smarcel * documentation and/or other materials provided with the distribution. 14265056Smarcel * 15265056Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16265056Smarcel * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17265056Smarcel * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18265056Smarcel * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19265056Smarcel * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20265056Smarcel * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21265056Smarcel * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22265056Smarcel * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23265056Smarcel * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24265056Smarcel * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25265056Smarcel * 26265056Smarcel * $FreeBSD: head/tools/bus_space/C/libbus_space.h 265056 2014-04-28 18:06:11Z marcel $ 27265056Smarcel */ 28265056Smarcel 29265056Smarcel#ifndef _LIBBUS_SPACE_H_ 30265056Smarcel#define _LIBBUS_SPACE_H_ 31265056Smarcel 32265056Smarcelint bus_space_map(const char *dev); 33265056Smarcelint bus_space_read_1(int rid, long ofs); 34265056Smarcelint bus_space_read_2(int rid, long ofs); 35265056Smarcelint64_t bus_space_read_4(int rid, long ofs); 36265056Smarcelint bus_space_subregion(int rid, long ofs, long sz); 37265056Smarcelint bus_space_unmap(int rid); 38265056Smarcelint bus_space_write_1(int rid, long ofs, uint8_t val); 39265056Smarcelint bus_space_write_2(int rid, long ofs, uint16_t val); 40265056Smarcelint bus_space_write_4(int rid, long ofs, uint32_t val); 41265056Smarcel 42265056Smarcel#endif /* _LIBBUS_SPACE_H_ */ 43