smp.h revision 26812
125164Speter/* 225164Speter * ---------------------------------------------------------------------------- 325164Speter * "THE BEER-WARE LICENSE" (Revision 42): 425164Speter * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 525164Speter * can do whatever you want with this stuff. If we meet some day, and you think 625164Speter * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 725164Speter * ---------------------------------------------------------------------------- 825164Speter * 926812Speter * $Id: smp.h,v 1.10 1997/05/29 05:57:43 fsmp Exp $ 1025164Speter * 1125164Speter */ 1225164Speter 1325164Speter#ifndef _MACHINE_SMP_H_ 1425164Speter#define _MACHINE_SMP_H_ 1525164Speter 1625164Speter#ifdef KERNEL 1725164Speter 1825517Sfsmp#if defined(SMP) && !defined(APIC_IO) 1925517Sfsmp# error APIC_IO required for SMP, add "options APIC_IO" to your config file. 2025517Sfsmp#endif /* SMP && NCPU */ 2125517Sfsmp 2225164Speter#if defined(SMP) && !defined(NCPU) 2325164Speter# define NCPU 2 2425164Speter#endif /* SMP && NCPU */ 2525164Speter 2625164Speter#if defined(SMP) || defined(APIC_IO) 2725164Speter 2826269Sfsmp#include <machine/apic.h> 2926269Sfsmp 3025164Speter/* global data in mpboot.s */ 3125164Speterextern int bootMP_size; 3225164Speter 3325164Speter/* functions in mpboot.s */ 3425164Spetervoid bootMP __P((void)); 3525164Speter 3625164Speter/* global data in mplock.s */ 3725164Speterextern u_int mp_lock; 3825164Speter 3925164Speter/* functions in mplock.s */ 4025164Spetervoid get_mplock __P((void)); 4125164Spetervoid rel_mplock __P((void)); 4225320Sfsmpvoid try_mplock __P((void)); 4325164Speter 4425164Speter/* global data in mp_machdep.c */ 4525164Speterextern int mp_ncpus; 4625164Speterextern int mp_naps; 4725164Speterextern int mp_nbusses; 4825164Speterextern int mp_napics; 4925164Speterextern int mp_picmode; 5025164Speterextern int mpenabled; 5125164Speterextern int boot_cpu_id; 5225164Speterextern vm_offset_t cpu_apic_address; 5325164Speterextern vm_offset_t io_apic_address[]; 5425164Speterextern u_int32_t cpu_apic_versions[]; 5525164Speterextern u_int32_t io_apic_versions[]; 5625164Speterextern int cpu_num_to_apic_id[]; 5725164Speterextern int io_num_to_apic_id[]; 5825164Speterextern int apic_id_to_logical[]; 5926812Speterextern u_int SMP_prvpt[]; 6026812Speterextern u_char SMP_ioapic[]; 6125164Speter 6225164Speter/* functions in mp_machdep.c */ 6325164Speteru_int mp_bootaddress __P((u_int)); 6426252Sfsmpint mp_probe __P((void)); 6525164Spetervoid mp_start __P((void)); 6625164Spetervoid mp_announce __P((void)); 6725164Speterint get_isa_apic_irq __P((int)); 6825499Sfsmpu_int get_isa_apic_mask __P((u_int)); 6925499Sfsmpint undirect_isa_irq __P((int)); 7025164Speterint get_eisa_apic_irq __P((int)); 7125164Speterint get_pci_apic_irq __P((int, int, int)); 7225164Speterint undirect_pci_irq __P((int)); 7325164Speterint apic_bus_type __P((int)); 7425164Speterint apic_src_bus_id __P((int, int)); 7525164Speterint apic_src_bus_irq __P((int, int)); 7625164Speterint apic_int_type __P((int, int)); 7725164Speterint apic_trigger __P((int, int)); 7825164Speterint apic_polarity __P((int, int)); 7925164Spetervoid configure_local_apic __P((void)); 8025164Spetervoid init_secondary __P((void)); 8125164Spetervoid smp_invltlb __P((void)); 8225164Speter 8325164Speter/* global data in mpapic.c */ 8426812Speterextern volatile lapic_t lapic; 8525164Speter 8625164Speter#if defined(MULTIPLE_IOAPICS) 8725164Speter#error MULTIPLE_IOAPICSXXX 8825164Speter#else 8926812Speterextern volatile ioapic_t *ioapic[]; 9025164Speter#endif /* MULTIPLE_IOAPICS */ 9125164Speter 9225164Speter/* functions in mpapic.c */ 9325164Spetervoid apic_initialize __P((int)); 9425362Sfsmpint apic_ipi __P((int, int, int)); 9525164Speterint selected_apic_ipi __P((u_int, int, int)); 9625164Speterint io_apic_setup __P((int)); 9725164Speterint ext_int_setup __P((int, int)); 9825164Spetervoid write_io_apic_mask24 __P((int, u_int32_t)); 9925164Speter 10025164Speter#if defined(READY) 10125164Spetervoid clr_io_apic_mask24 __P((int, u_int32_t)); 10225164Spetervoid set_io_apic_mask24 __P((int, u_int32_t)); 10325164Speter#endif /* READY */ 10425164Speter 10525164Spetervoid set_apic_timer __P((int)); 10625164Speterint read_apic_timer __P((void)); 10725164Spetervoid u_sleep __P((int)); 10825164Speter 10925164Speter/* global data in init_smp.c */ 11025164Speterextern int smp_active; 11125215Sfsmpextern int invltlb_ok; 11225164Speter 11326812Speterextern volatile u_int cpuid; 11426812Speterextern volatile u_int cpu_lockid; 11525164Speter 11625164Speter#endif /* SMP || APIC_IO */ 11725164Speter#endif /* KERNEL */ 11825164Speter#endif /* _MACHINE_SMP_H_ */ 119