1/* $OpenBSD: autoconf.h,v 1.13 2024/05/22 05:51:49 jsg Exp $ */
2
3/*
4 * Copyright (c) 1997 Per Fogelstrom
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
16 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
19 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 */
28/*
29 * Machine-dependent structures of autoconfiguration
30 */
31
32#ifndef _MACHINE_AUTOCONF_H_
33#define _MACHINE_AUTOCONF_H_
34
35#include <machine/bus.h>
36
37struct confargs {
38 char *ca_name;
39 bus_space_tag_t ca_iot;
40 bus_dma_tag_t ca_dmat;
41 u_int32_t ca_node;
42 int ca_nreg;
43 u_int32_t *ca_reg;
44 int ca_nintr;
45 int32_t *ca_intr;
46 u_int ca_baseaddr;
47
48};
49
50int badaddr(void *, u_int32_t);
51
52typedef int (time_read_t)(time_t *sec);
53typedef int (time_write_t)(time_t sec);
54
55extern time_read_t *time_read;
56extern time_write_t *time_write;
57
58typedef int mac_intr_handle_t;
59typedef void *(intr_establish_t)(void *, mac_intr_handle_t,
60 int, int, int (*func)(void *), void *, const char *);
61typedef void (intr_disestablish_t)(void *, void *);
62struct cpu_info;
63typedef void (intr_send_ipi_t)(struct cpu_info *, int);
64
65intr_establish_t mac_intr_establish;
66intr_disestablish_t mac_intr_disestablish;
67extern intr_establish_t *intr_establish_func;
68extern intr_disestablish_t *intr_disestablish_func;
69extern intr_send_ipi_t *intr_send_ipi_func;
70
71
72#endif /* _MACHINE_AUTOCONF_H_ */