1*fabcfecbSjsg /* $OpenBSD: mpbiosvar.h,v 1.13 2024/10/22 21:50:02 jsg Exp $ */ 2012ea299Sniklas /* $NetBSD: mpbiosvar.h,v 1.1.2.3 2000/02/29 13:17:20 sommerfeld Exp $ */ 3012ea299Sniklas 4012ea299Sniklas /*- 5012ea299Sniklas * Copyright (c) 2000 The NetBSD Foundation, Inc. 6012ea299Sniklas * All rights reserved. 7012ea299Sniklas * 8012ea299Sniklas * This code is derived from software contributed to The NetBSD Foundation 9012ea299Sniklas * by RedBack Networks Inc. 10012ea299Sniklas * 11012ea299Sniklas * Author: Bill Sommerfeld 12012ea299Sniklas * 13012ea299Sniklas * Redistribution and use in source and binary forms, with or without 14012ea299Sniklas * modification, are permitted provided that the following conditions 15012ea299Sniklas * are met: 16012ea299Sniklas * 1. Redistributions of source code must retain the above copyright 17012ea299Sniklas * notice, this list of conditions and the following disclaimer. 18012ea299Sniklas * 2. Redistributions in binary form must reproduce the above copyright 19012ea299Sniklas * notice, this list of conditions and the following disclaimer in the 20012ea299Sniklas * documentation and/or other materials provided with the distribution. 21012ea299Sniklas * 22012ea299Sniklas * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 23012ea299Sniklas * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 24012ea299Sniklas * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 25012ea299Sniklas * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 26012ea299Sniklas * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27012ea299Sniklas * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28012ea299Sniklas * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29012ea299Sniklas * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30012ea299Sniklas * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31012ea299Sniklas * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32012ea299Sniklas * POSSIBILITY OF SUCH DAMAGE. 33012ea299Sniklas */ 34012ea299Sniklas 35012ea299Sniklas 362fa72412Spirofti #ifndef _MACHINE_MPBIOSVAR_H_ 372fa72412Spirofti #define _MACHINE_MPBIOSVAR_H_ 38012ea299Sniklas 3971ce0f95Smlarkin #define MP_TRAMPOLINE (16 * PAGE_SIZE) 40f70598beSmlarkin #define MP_TRAMP_DATA (17 * PAGE_SIZE) 41012ea299Sniklas 42012ea299Sniklas #if !defined(_LOCORE) 43012ea299Sniklas 44012ea299Sniklas #include <machine/mpbiosreg.h> 45012ea299Sniklas 46*fabcfecbSjsg struct mp_bus { 47012ea299Sniklas char *mb_name; /* XXX bus name */ 48012ea299Sniklas int mb_idx; /* XXX bus index */ 49012ea299Sniklas void (*mb_intr_print) (int); 50012ea299Sniklas void (*mb_intr_cfg)(const struct mpbios_int *, u_int32_t *); 51012ea299Sniklas struct mp_intr_map *mb_intrs; 52012ea299Sniklas u_int32_t mb_data; /* random bus-specific datum. */ 53012ea299Sniklas }; 54012ea299Sniklas 55*fabcfecbSjsg struct mp_intr_map { 56012ea299Sniklas struct mp_intr_map *next; 57012ea299Sniklas struct mp_bus *bus; 58012ea299Sniklas int bus_pin; 59012ea299Sniklas struct ioapic_softc *ioapic; 60012ea299Sniklas int ioapic_pin; 61012ea299Sniklas int ioapic_ih; /* int handle, for apic_intr_est */ 62012ea299Sniklas int type; /* from mp spec intr record */ 63012ea299Sniklas int flags; /* from mp spec intr record */ 64012ea299Sniklas u_int32_t redir; 6518452af1Skettenis int cpu_id; 66012ea299Sniklas }; 67012ea299Sniklas 68012ea299Sniklas #if defined(_KERNEL) 69012ea299Sniklas extern int mp_verbose; 70012ea299Sniklas extern struct mp_bus *mp_busses; 71ff012551Skettenis extern int mp_nbusses; 72012ea299Sniklas extern struct mp_intr_map *mp_intrs; 7318452af1Skettenis extern int mp_nintrs; 748077ac6cSkettenis extern struct mp_bus *mp_isa_bus; 758077ac6cSkettenis extern struct mp_bus *mp_eisa_bus; 76012ea299Sniklas 77012ea299Sniklas void mpbios_scan(struct device *); 78012ea299Sniklas int mpbios_probe(struct device *); 79a25c7806Smickey int mpbios_invent(int, int, int); 80a8ae4dddSkettenis 81a8ae4dddSkettenis void mpbios_intr_fixup(void); 82012ea299Sniklas #endif 83012ea299Sniklas 84012ea299Sniklas #endif 85012ea299Sniklas 862fa72412Spirofti #endif /* !_MACHINE_MPBIOSVAR_H_ */ 87