xref: /netbsd-src/sys/arch/x86/include/apicvar.h (revision c24c993fe4cf289234b8ce9b47d92eb1278cfbda)
1*c24c993fSbouyer /* 	$NetBSD: apicvar.h,v 1.8 2020/04/25 15:26:18 bouyer Exp $ */
28375b2d9Sfvdl 
38375b2d9Sfvdl /*-
48375b2d9Sfvdl  * Copyright (c) 2000 The NetBSD Foundation, Inc.
58375b2d9Sfvdl  * All rights reserved.
68375b2d9Sfvdl  *
78375b2d9Sfvdl  * This code is derived from software contributed to The NetBSD Foundation
88375b2d9Sfvdl  * by RedBack Networks Inc.
98375b2d9Sfvdl  *
108375b2d9Sfvdl  * Author: Bill Sommerfeld
118375b2d9Sfvdl  *
128375b2d9Sfvdl  * Redistribution and use in source and binary forms, with or without
138375b2d9Sfvdl  * modification, are permitted provided that the following conditions
148375b2d9Sfvdl  * are met:
158375b2d9Sfvdl  * 1. Redistributions of source code must retain the above copyright
168375b2d9Sfvdl  *    notice, this list of conditions and the following disclaimer.
178375b2d9Sfvdl  * 2. Redistributions in binary form must reproduce the above copyright
188375b2d9Sfvdl  *    notice, this list of conditions and the following disclaimer in the
198375b2d9Sfvdl  *    documentation and/or other materials provided with the distribution.
208375b2d9Sfvdl  *
218375b2d9Sfvdl  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
228375b2d9Sfvdl  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
238375b2d9Sfvdl  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
248375b2d9Sfvdl  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
258375b2d9Sfvdl  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
268375b2d9Sfvdl  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
278375b2d9Sfvdl  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
288375b2d9Sfvdl  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
298375b2d9Sfvdl  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
308375b2d9Sfvdl  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
318375b2d9Sfvdl  * POSSIBILITY OF SUCH DAMAGE.
328375b2d9Sfvdl  */
338375b2d9Sfvdl 
348375b2d9Sfvdl #ifndef _X86_APICVAR_H_
358375b2d9Sfvdl #define _X86_APICVAR_H_
368375b2d9Sfvdl 
378375b2d9Sfvdl struct apic_attach_args {
388375b2d9Sfvdl 	int apic_id;
398375b2d9Sfvdl 	int apic_version;
408375b2d9Sfvdl 	int flags;
418375b2d9Sfvdl #define IOAPIC_PICMODE		0x01
428375b2d9Sfvdl #define IOAPIC_VWIRE		0x02
438375b2d9Sfvdl 	paddr_t apic_address;
448375b2d9Sfvdl 	int apic_vecbase;
458375b2d9Sfvdl };
468375b2d9Sfvdl 
4761bd4906Smsaitoh /*
4861bd4906Smsaitoh  * Dump function for both LAPIC and I/O APIC.
4961bd4906Smsaitoh  * The 3rd argument is APIC_VECTYPE_*.
5061bd4906Smsaitoh  */
5161bd4906Smsaitoh #define APIC_VECTYPE_LAPIC_LVT	1
5261bd4906Smsaitoh #define APIC_VECTYPE_LAPIC_ICR	2
5361bd4906Smsaitoh #define APIC_VECTYPE_IOAPIC	3
5461bd4906Smsaitoh void apic_format_redir(const char *, const char *, int, int, uint32_t,
5561bd4906Smsaitoh     uint32_t);
568375b2d9Sfvdl 
570360a7d3Smsaitoh /* For lapic.c */
580360a7d3Smsaitoh extern uint32_t lapic_per_second;
590360a7d3Smsaitoh 
608375b2d9Sfvdl #endif /* !_X86_APICVAR_H_ */
61