smp.h revision 222853
10SN/A/*- 20SN/A * ---------------------------------------------------------------------------- 30SN/A * "THE BEER-WARE LICENSE" (Revision 42): 42362SN/A * <phk@FreeBSD.org> wrote this file. As long as you retain this notice you 50SN/A * can do whatever you want with this stuff. If we meet some day, and you think 60SN/A * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 70SN/A * ---------------------------------------------------------------------------- 80SN/A * 90SN/A * $FreeBSD: head/sys/i386/include/smp.h 222853 2011-06-08 08:12:15Z avg $ 100SN/A * 110SN/A */ 120SN/A 130SN/A#ifndef _MACHINE_SMP_H_ 140SN/A#define _MACHINE_SMP_H_ 150SN/A 160SN/A#ifdef _KERNEL 172362SN/A 180SN/A#ifdef SMP 190SN/A 200SN/A#ifndef LOCORE 210SN/A 220SN/A#include <sys/bus.h> 230SN/A#include <machine/frame.h> 240SN/A#include <machine/intr_machdep.h> 250SN/A#include <machine/apicvar.h> 260SN/A#include <machine/pcb.h> 270SN/A 280SN/A/* global data in mpboot.s */ 290SN/Aextern int bootMP_size; 300SN/A 310SN/A/* functions in mpboot.s */ 320SN/Avoid bootMP(void); 330SN/A 340SN/A/* global data in mp_machdep.c */ 350SN/Aextern int mp_naps; 360SN/Aextern int boot_cpu_id; 370SN/Aextern struct pcb stoppcbs[]; 380SN/Aextern int cpu_apic_ids[]; 390SN/A#ifdef COUNT_IPIS 400SN/Aextern u_long *ipi_invltlb_counts[MAXCPU]; 410SN/Aextern u_long *ipi_invlrng_counts[MAXCPU]; 420SN/Aextern u_long *ipi_invlpg_counts[MAXCPU]; 430SN/Aextern u_long *ipi_invlcache_counts[MAXCPU]; 440SN/Aextern u_long *ipi_rendezvous_counts[MAXCPU]; 450SN/Aextern u_long *ipi_lazypmap_counts[MAXCPU]; 460SN/A#endif 470SN/A 480SN/A/* IPI handlers */ 490SN/Ainthand_t 500SN/A IDTVEC(invltlb), /* TLB shootdowns - global */ 510SN/A IDTVEC(invlpg), /* TLB shootdowns - 1 page */ 520SN/A IDTVEC(invlrng), /* TLB shootdowns - page range */ 530SN/A IDTVEC(invlcache), /* Write back and invalidate cache */ 540SN/A IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ 550SN/A IDTVEC(cpustop), /* CPU stops & waits to be restarted */ 560SN/A IDTVEC(rendezvous), /* handle CPU rendezvous */ 570SN/A IDTVEC(lazypmap); /* handle lazy pmap release */ 580SN/A 590SN/A/* functions in mp_machdep.c */ 600SN/Avoid cpu_add(u_int apic_id, char boot_cpu); 610SN/Avoid cpustop_handler(void); 620SN/Avoid init_secondary(void); 630SN/Avoid ipi_all_but_self(u_int ipi); 640SN/A#ifndef XEN 650SN/Avoid ipi_bitmap_handler(struct trapframe frame); 660SN/A#endif 670SN/Avoid ipi_cpu(int cpu, u_int ipi); 680SN/Aint ipi_nmi_handler(void); 690SN/Avoid ipi_selected(cpuset_t cpus, u_int ipi); 700SN/Au_int mp_bootaddress(u_int); 710SN/Avoid smp_cache_flush(void); 720SN/Avoid smp_invlpg(vm_offset_t addr); 730SN/Avoid smp_masked_invlpg(cpuset_t mask, vm_offset_t addr); 740SN/Avoid smp_invlpg_range(vm_offset_t startva, vm_offset_t endva); 750SN/Avoid smp_masked_invlpg_range(cpuset_t mask, vm_offset_t startva, 760SN/A vm_offset_t endva); 770SN/Avoid smp_invltlb(void); 780SN/Avoid smp_masked_invltlb(cpuset_t mask); 790SN/A 800SN/A#ifdef XEN 810SN/Avoid ipi_to_irq_init(void); 820SN/A 830SN/A#define RESCHEDULE_VECTOR 0 840SN/A#define CALL_FUNCTION_VECTOR 1 850SN/A#define NR_IPIS 2 860SN/A 870SN/A#endif 880SN/A#endif /* !LOCORE */ 890SN/A#endif /* SMP */ 900SN/A 910SN/A#endif /* _KERNEL */ 92#endif /* _MACHINE_SMP_H_ */ 93