smp.h revision 192114
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 192114 2009-05-14 17:43:00Z attilio $ 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 48121996Sjhb/* IPI handlers */ 49121996Sjhbinthand_t 50121996Sjhb IDTVEC(invltlb), /* TLB shootdowns - global */ 51121996Sjhb IDTVEC(invlpg), /* TLB shootdowns - 1 page */ 52121996Sjhb IDTVEC(invlrng), /* TLB shootdowns - page range */ 53158236Sjhb IDTVEC(invlcache), /* Write back and invalidate cache */ 54138528Sups IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ 55121996Sjhb IDTVEC(cpustop), /* CPU stops & waits to be restarted */ 56121996Sjhb IDTVEC(rendezvous), /* handle CPU rendezvous */ 57121996Sjhb IDTVEC(lazypmap); /* handle lazy pmap release */ 58121996Sjhb 5925164Speter/* functions in mp_machdep.c */ 60121996Sjhbvoid cpu_add(u_int apic_id, char boot_cpu); 61153141Sjhbvoid cpustop_handler(void); 6293018Sbdevoid init_secondary(void); 63121996Sjhbvoid ipi_selected(u_int cpus, u_int ipi); 64121996Sjhbvoid ipi_all_but_self(u_int ipi); 65184113Skmacy#ifndef XEN 66153666Sjhbvoid ipi_bitmap_handler(struct trapframe frame); 67184113Skmacy#endif 68121996Sjhbu_int mp_bootaddress(u_int); 69121996Sjhbint mp_grab_cpu_hlt(void); 70158236Sjhbvoid smp_cache_flush(void); 7199862Spetervoid smp_invlpg(vm_offset_t addr); 72192114Sattiliovoid smp_masked_invlpg(cpumask_t mask, vm_offset_t addr); 7399862Spetervoid smp_invlpg_range(vm_offset_t startva, vm_offset_t endva); 74192114Sattiliovoid smp_masked_invlpg_range(cpumask_t mask, vm_offset_t startva, 7599862Speter vm_offset_t endva); 7699862Spetervoid smp_invltlb(void); 77192114Sattiliovoid smp_masked_invltlb(cpumask_t mask); 7825164Speter 79151634Sjhb#ifdef STOP_NMI 80151634Sjhbint ipi_nmi_handler(void); 81145727Sdwhite#endif 82183344Skmacy#ifdef XEN 83183344Skmacyvoid ipi_to_irq_init(void); 84184110Skmacy 85184224Skmacy#define RESCHEDULE_VECTOR 0 86184224Skmacy#define CALL_FUNCTION_VECTOR 1 87184110Skmacy#define NR_IPIS 2 88184110Skmacy 89183344Skmacy#endif 9027728Sfsmp#endif /* !LOCORE */ 91121996Sjhb#endif /* SMP */ 9258755Sdillon 9355205Speter#endif /* _KERNEL */ 9425164Speter#endif /* _MACHINE_SMP_H_ */ 95