smp.h revision 184224
1139790Simp/*- 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 * 950477Speter * $FreeBSD: head/sys/i386/include/smp.h 184224 2008-10-24 07:58:38Z kmacy $ 1025164Speter * 1125164Speter */ 1225164Speter 1325164Speter#ifndef _MACHINE_SMP_H_ 1425164Speter#define _MACHINE_SMP_H_ 1525164Speter 1655205Speter#ifdef _KERNEL 1725164Speter 18121996Sjhb#ifdef SMP 1925517Sfsmp 2027728Sfsmp#ifndef LOCORE 2127728Sfsmp 22121996Sjhb#include <sys/bus.h> 2376078Sjhb#include <machine/frame.h> 24121996Sjhb#include <machine/intr_machdep.h> 25121996Sjhb#include <machine/apicvar.h> 26169730Skan#include <machine/pcb.h> 2726269Sfsmp 2825164Speter/* global data in mpboot.s */ 2925164Speterextern int bootMP_size; 3025164Speter 3125164Speter/* functions in mpboot.s */ 3293018Sbdevoid bootMP(void); 3325164Speter 3425164Speter/* global data in mp_machdep.c */ 3525164Speterextern int mp_naps; 3625164Speterextern int boot_cpu_id; 3736135Steggeextern struct pcb stoppcbs[]; 38167273Sjhbextern int cpu_apic_ids[]; 39153141Sjhb#ifdef COUNT_IPIS 40153141Sjhbextern u_long *ipi_invltlb_counts[MAXCPU]; 41153141Sjhbextern u_long *ipi_invlrng_counts[MAXCPU]; 42153141Sjhbextern u_long *ipi_invlpg_counts[MAXCPU]; 43158236Sjhbextern u_long *ipi_invlcache_counts[MAXCPU]; 44153141Sjhbextern u_long *ipi_rendezvous_counts[MAXCPU]; 45153141Sjhbextern u_long *ipi_lazypmap_counts[MAXCPU]; 46153141Sjhb#endif 4725164Speter 48176734Sjeff/* global data in identcpu.c */ 49176734Sjeffextern int cpu_cores; 50176734Sjeffextern int cpu_logical; 51176734Sjeff 52121996Sjhb/* IPI handlers */ 53121996Sjhbinthand_t 54121996Sjhb IDTVEC(invltlb), /* TLB shootdowns - global */ 55121996Sjhb IDTVEC(invlpg), /* TLB shootdowns - 1 page */ 56121996Sjhb IDTVEC(invlrng), /* TLB shootdowns - page range */ 57158236Sjhb IDTVEC(invlcache), /* Write back and invalidate cache */ 58138528Sups IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ 59121996Sjhb IDTVEC(cpustop), /* CPU stops & waits to be restarted */ 60121996Sjhb IDTVEC(rendezvous), /* handle CPU rendezvous */ 61121996Sjhb IDTVEC(lazypmap); /* handle lazy pmap release */ 62121996Sjhb 6325164Speter/* functions in mp_machdep.c */ 64121996Sjhbvoid cpu_add(u_int apic_id, char boot_cpu); 65153141Sjhbvoid cpustop_handler(void); 6693018Sbdevoid init_secondary(void); 67121996Sjhbvoid ipi_selected(u_int cpus, u_int ipi); 68121996Sjhbvoid ipi_all_but_self(u_int ipi); 69184113Skmacy#ifndef XEN 70153666Sjhbvoid ipi_bitmap_handler(struct trapframe frame); 71184113Skmacy#endif 72121996Sjhbu_int mp_bootaddress(u_int); 73121996Sjhbint mp_grab_cpu_hlt(void); 74158236Sjhbvoid smp_cache_flush(void); 7599862Spetervoid smp_invlpg(vm_offset_t addr); 7699862Spetervoid smp_masked_invlpg(u_int mask, vm_offset_t addr); 7799862Spetervoid smp_invlpg_range(vm_offset_t startva, vm_offset_t endva); 7899862Spetervoid smp_masked_invlpg_range(u_int mask, vm_offset_t startva, 7999862Speter vm_offset_t endva); 8099862Spetervoid smp_invltlb(void); 8199862Spetervoid smp_masked_invltlb(u_int mask); 8225164Speter 83151634Sjhb#ifdef STOP_NMI 84151634Sjhbint ipi_nmi_handler(void); 85145727Sdwhite#endif 86183344Skmacy#ifdef XEN 87183344Skmacyvoid ipi_to_irq_init(void); 88184110Skmacy 89184224Skmacy#define RESCHEDULE_VECTOR 0 90184224Skmacy#define CALL_FUNCTION_VECTOR 1 91184110Skmacy#define NR_IPIS 2 92184110Skmacy 93183344Skmacy#endif 9427728Sfsmp#endif /* !LOCORE */ 95121996Sjhb#endif /* SMP */ 9658755Sdillon 9755205Speter#endif /* _KERNEL */ 9825164Speter#endif /* _MACHINE_SMP_H_ */ 99