zz9kvar.h revision 1.1 1 1.1 phx /* $NetBSD: zz9kvar.h,v 1.1 2023/05/03 13:49:30 phx Exp $ */
2 1.1 phx
3 1.1 phx /*
4 1.1 phx * Copyright (c) 2020 The NetBSD Foundation, Inc.
5 1.1 phx * All rights reserved.
6 1.1 phx *
7 1.1 phx * This code is derived from software contributed to The NetBSD Foundation
8 1.1 phx * by Alain Runa.
9 1.1 phx *
10 1.1 phx * Redistribution and use in source and binary forms, with or without
11 1.1 phx * modification, are permitted provided that the following conditions
12 1.1 phx * are met:
13 1.1 phx * 1. Redistributions of source code must retain the above copyright
14 1.1 phx * notice, this list of conditions and the following disclaimer.
15 1.1 phx * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 phx * notice, this list of conditions and the following disclaimer in the
17 1.1 phx * documentation and/or other materials provided with the distribution.
18 1.1 phx *
19 1.1 phx * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 1.1 phx * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 1.1 phx * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 1.1 phx * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 1.1 phx * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 1.1 phx * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 1.1 phx * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 1.1 phx * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 1.1 phx * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 1.1 phx * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 1.1 phx */
30 1.1 phx
31 1.1 phx #ifndef ZZ9KVAR_H
32 1.1 phx #define ZZ9KVAR_H
33 1.1 phx
34 1.1 phx #include <sys/types.h> /* size_t, char */
35 1.1 phx #include <sys/bus.h> /* bus_space_xxx, bus_addr_t */
36 1.1 phx #include <sys/device.h> /* device_t */
37 1.1 phx #include <amiga/dev/zbusvar.h> /* zbus_args */
38 1.1 phx
39 1.1 phx #define ZZREG_R(r) bus_space_read_2(sc->sc_iot, sc->sc_regh, (r))
40 1.1 phx #define ZZREG_W(r, v) bus_space_write_2(sc->sc_iot, sc->sc_regh, (r), (v))
41 1.1 phx
42 1.1 phx struct zz9k_softc {
43 1.1 phx device_t sc_dev;
44 1.1 phx struct bus_space_tag sc_bst;
45 1.1 phx bus_space_tag_t sc_iot;
46 1.1 phx bus_space_handle_t sc_regh;
47 1.1 phx
48 1.1 phx size_t sc_zsize;
49 1.1 phx };
50 1.1 phx
51 1.1 phx struct zz9kbus_attach_args {
52 1.1 phx char zzaa_name[32];
53 1.1 phx bus_addr_t zzaa_base;
54 1.1 phx };
55 1.1 phx
56 1.1 phx #endif /* ZZ9KVAR_H */
57