summaryrefslogtreecommitdiff
path: root/sys/arch/luna88k/cbus/cbusvar.h
blob: aad773127161b5852dbe67d4830f3fad9b3b4268 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*	$OpenBSD: cbusvar.h,v 1.5 2019/06/29 04:33:11 aoyama Exp $	*/

/*
 * Copyright (c) 2014 Kenji Aoyama.
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * PC-9801 extension board slot bus ('C-bus') driver for LUNA-88K2.
 */

#include <sys/evcount.h>
#include <sys/queue.h>

/*
 * Currently 7 level C-bus interrupts (INT0 - INT6) are supported.
 */
#define NCBUSISR	7

/*
 * C-bus interrupt handler
 */
struct cbus_isr_t {
	int		(*isr_func)(void *);
	void		*isr_arg;
	int		isr_intlevel;
	int		isr_ipl;
	struct evcount	isr_count;
};

int	cbus_isrlink(int (*)(void *), void *, int, int, const char *);
int	cbus_isrunlink(int (*)(void *), int);
u_int8_t	cbus_intr_registered(void);

struct cbus_attach_args {
	char		*ca_name;
	u_int32_t	ca_iobase;
	u_int32_t	ca_iosize;
	u_int32_t	ca_maddr;
	u_int32_t	ca_msize;
	u_int32_t	ca_int;
};

#define	cf_iobase	cf_loc[0]
#define	cf_iosize	cf_loc[1]
#define	cf_maddr	cf_loc[2]
#define	cf_msize	cf_loc[3]
#define	cf_int		cf_loc[4]