mpconfig.h revision 1.14 1 1.14 yamt /* $NetBSD: mpconfig.h,v 1.14 2012/06/15 13:57:59 yamt Exp $ */
2 1.1 fvdl
3 1.1 fvdl /*
4 1.1 fvdl * Definitions originally from the mpbios code, but now used for ACPI
5 1.1 fvdl * MP config as well.
6 1.1 fvdl */
7 1.1 fvdl
8 1.7 yamt #ifndef _X86_MPCONFIG_H_
9 1.7 yamt #define _X86_MPCONFIG_H_
10 1.1 fvdl
11 1.5 fvdl /*
12 1.5 fvdl * XXX
13 1.5 fvdl */
14 1.13 dyoung #include <sys/bus.h>
15 1.5 fvdl #include <dev/pci/pcivar.h>
16 1.5 fvdl #include <machine/pci_machdep.h>
17 1.5 fvdl
18 1.1 fvdl /*
19 1.14 yamt * Interrupt types
20 1.1 fvdl */
21 1.1 fvdl #define MPS_INTTYPE_INT 0
22 1.1 fvdl #define MPS_INTTYPE_NMI 1
23 1.1 fvdl #define MPS_INTTYPE_SMI 2
24 1.1 fvdl #define MPS_INTTYPE_ExtINT 3
25 1.1 fvdl
26 1.1 fvdl #define MPS_INTPO_DEF 0
27 1.1 fvdl #define MPS_INTPO_ACTHI 1
28 1.1 fvdl #define MPS_INTPO_ACTLO 3
29 1.1 fvdl
30 1.1 fvdl #define MPS_INTTR_DEF 0
31 1.1 fvdl #define MPS_INTTR_EDGE 1
32 1.1 fvdl #define MPS_INTTR_LEVEL 3
33 1.1 fvdl
34 1.1 fvdl #ifndef _LOCORE
35 1.1 fvdl
36 1.1 fvdl struct mpbios_int;
37 1.1 fvdl
38 1.1 fvdl struct mp_bus
39 1.1 fvdl {
40 1.8 christos const char *mb_name; /* XXX bus name */
41 1.1 fvdl int mb_idx; /* XXX bus index */
42 1.6 junyoung void (*mb_intr_print)(int);
43 1.10 cegger void (*mb_intr_cfg)(const struct mpbios_int *, uint32_t *);
44 1.1 fvdl struct mp_intr_map *mb_intrs;
45 1.10 cegger uint32_t mb_data; /* random bus-specific datum. */
46 1.11 dyoung device_t mb_dev; /* has been autoconfigured if mb_dev != NULL */
47 1.5 fvdl pcitag_t *mb_pci_bridge_tag;
48 1.5 fvdl pci_chipset_tag_t mb_pci_chipset_tag;
49 1.1 fvdl };
50 1.1 fvdl
51 1.1 fvdl struct mp_intr_map
52 1.1 fvdl {
53 1.1 fvdl struct mp_intr_map *next;
54 1.1 fvdl struct mp_bus *bus;
55 1.14 yamt /*
56 1.14 yamt * encoding of bus_pin is mp_bus dependant.
57 1.14 yamt * for pci, bus_pin = (pci_device_number << 2) | pin
58 1.14 yamt * where pin is 0=INTA ... 3=INTD.
59 1.14 yamt */
60 1.1 fvdl int bus_pin;
61 1.14 yamt struct pic *ioapic; /* NULL for local apic */
62 1.1 fvdl int ioapic_pin;
63 1.14 yamt int ioapic_ih; /* int handle, see i82093var.h for encoding */
64 1.1 fvdl int type; /* from mp spec intr record */
65 1.1 fvdl int flags; /* from mp spec intr record */
66 1.10 cegger uint32_t redir;
67 1.12 cegger uint32_t cpu_id;
68 1.2 fvdl int global_int; /* ACPI global interrupt number */
69 1.4 fvdl int sflags; /* other, software flags (see below) */
70 1.9 christos void *linkdev;
71 1.9 christos int sourceindex;
72 1.1 fvdl };
73 1.4 fvdl
74 1.4 fvdl #define MPI_OVR 0x0001 /* Was overridden by an ACPI OVR */
75 1.1 fvdl
76 1.1 fvdl #if defined(_KERNEL)
77 1.1 fvdl extern int mp_verbose;
78 1.1 fvdl extern struct mp_bus *mp_busses;
79 1.1 fvdl extern struct mp_intr_map *mp_intrs;
80 1.1 fvdl extern int mp_nintr;
81 1.1 fvdl extern int mp_isa_bus, mp_eisa_bus;
82 1.1 fvdl extern int mp_nbus;
83 1.11 dyoung int mp_pci_scan(device_t, struct pcibus_attach_args *, cfprint_t);
84 1.11 dyoung void mp_pci_childdetached(device_t, device_t);
85 1.1 fvdl #endif
86 1.1 fvdl #endif
87 1.1 fvdl
88 1.7 yamt #endif /* _X86_MPCONFIG_H_ */
89