xref: /freebsd/tools/bus_space/bus.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1c0027d73SMarcel Moolenaar /*-
2c0027d73SMarcel Moolenaar  * Copyright (c) 2014 Marcel Moolenaar
3c0027d73SMarcel Moolenaar  * All rights reserved.
4c0027d73SMarcel Moolenaar  *
5c0027d73SMarcel Moolenaar  * Redistribution and use in source and binary forms, with or without
6c0027d73SMarcel Moolenaar  * modification, are permitted provided that the following conditions
7c0027d73SMarcel Moolenaar  * are met:
8c0027d73SMarcel Moolenaar  *
9c0027d73SMarcel Moolenaar  * 1. Redistributions of source code must retain the above copyright
10c0027d73SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer.
11c0027d73SMarcel Moolenaar  * 2. Redistributions in binary form must reproduce the above copyright
12c0027d73SMarcel Moolenaar  *    notice, this list of conditions and the following disclaimer in the
13c0027d73SMarcel Moolenaar  *    documentation and/or other materials provided with the distribution.
14c0027d73SMarcel Moolenaar  *
15c0027d73SMarcel Moolenaar  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16c0027d73SMarcel Moolenaar  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17c0027d73SMarcel Moolenaar  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18c0027d73SMarcel Moolenaar  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19c0027d73SMarcel Moolenaar  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20c0027d73SMarcel Moolenaar  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21c0027d73SMarcel Moolenaar  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22c0027d73SMarcel Moolenaar  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23c0027d73SMarcel Moolenaar  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24c0027d73SMarcel Moolenaar  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25c0027d73SMarcel Moolenaar  */
26c0027d73SMarcel Moolenaar 
27c0027d73SMarcel Moolenaar #ifndef _TOOLS_BUS_SPACE_H_
28c0027d73SMarcel Moolenaar #define	_TOOLS_BUS_SPACE_H_
29c0027d73SMarcel Moolenaar 
30*71d80fbaSMarcel Moolenaar int bs_map(const char *dev, const char *res);
31c0027d73SMarcel Moolenaar int bs_read(int rid, off_t ofs, void *buf, ssize_t bufsz);
32c0027d73SMarcel Moolenaar int bs_subregion(int rid0, long ofs, long sz);
33c0027d73SMarcel Moolenaar int bs_unmap(int rid);
34c0027d73SMarcel Moolenaar int bs_write(int rid, off_t ofs, void *buf, ssize_t bufsz);
35c0027d73SMarcel Moolenaar 
36c0027d73SMarcel Moolenaar #endif /* _TOOLS_BUS_SPACE_H_ */
37