smp.h revision 151634
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 151634 2005-10-24 21:04:19Z jhb $ 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 2227002Sfsmp/* 2327002Sfsmp * For sending values to POST displays. 2427252Sfsmp * XXX FIXME: where does this really belong, isa.h/isa.c perhaps? 2527002Sfsmp */ 2627252Sfsmpextern int current_postcode; /** XXX currently in mp_machdep.c */ 2727252Sfsmp#define POSTCODE(X) current_postcode = (X), \ 2827252Sfsmp outb(0x80, current_postcode) 2927252Sfsmp#define POSTCODE_LO(X) current_postcode &= 0xf0, \ 3027252Sfsmp current_postcode |= ((X) & 0x0f), \ 3127252Sfsmp outb(0x80, current_postcode) 3227252Sfsmp#define POSTCODE_HI(X) current_postcode &= 0x0f, \ 3327252Sfsmp current_postcode |= (((X) << 4) & 0xf0), \ 3427252Sfsmp outb(0x80, current_postcode) 3527002Sfsmp 36121996Sjhb#include <sys/bus.h> 3776078Sjhb#include <machine/frame.h> 38121996Sjhb#include <machine/intr_machdep.h> 39121996Sjhb#include <machine/apicvar.h> 4026269Sfsmp 4125164Speter/* global data in mpboot.s */ 4225164Speterextern int bootMP_size; 4325164Speter 4425164Speter/* functions in mpboot.s */ 4593018Sbdevoid bootMP(void); 4625164Speter 4725164Speter/* global data in mp_machdep.c */ 4825164Speterextern int mp_naps; 4925164Speterextern int boot_cpu_id; 5036135Steggeextern struct pcb stoppcbs[]; 51121996Sjhbextern struct mtx smp_tlb_mtx; 5225164Speter 53121996Sjhb/* IPI handlers */ 54121996Sjhbinthand_t 55121996Sjhb IDTVEC(invltlb), /* TLB shootdowns - global */ 56121996Sjhb IDTVEC(invlpg), /* TLB shootdowns - 1 page */ 57121996Sjhb IDTVEC(invlrng), /* TLB shootdowns - page range */ 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); 6593018Sbdevoid init_secondary(void); 66121996Sjhbvoid ipi_selected(u_int cpus, u_int ipi); 67121996Sjhbvoid ipi_all(u_int ipi); 68121996Sjhbvoid ipi_all_but_self(u_int ipi); 69121996Sjhbvoid ipi_self(u_int ipi); 70138528Supsvoid ipi_bitmap_handler(struct clockframe frame); 71121996Sjhbu_int mp_bootaddress(u_int); 72121996Sjhbint mp_grab_cpu_hlt(void); 73123431Sjeffvoid mp_topology(void); 7499862Spetervoid smp_invlpg(vm_offset_t addr); 7599862Spetervoid smp_masked_invlpg(u_int mask, vm_offset_t addr); 7699862Spetervoid smp_invlpg_range(vm_offset_t startva, vm_offset_t endva); 7799862Spetervoid smp_masked_invlpg_range(u_int mask, vm_offset_t startva, 7899862Speter vm_offset_t endva); 7999862Spetervoid smp_invltlb(void); 8099862Spetervoid smp_masked_invltlb(u_int mask); 8125164Speter 82151634Sjhb#ifdef STOP_NMI 83151634Sjhbint ipi_nmi_handler(void); 84145727Sdwhite#endif 85145727Sdwhite 8627728Sfsmp#endif /* !LOCORE */ 87121996Sjhb#endif /* SMP */ 8858755Sdillon 8955205Speter#endif /* _KERNEL */ 9025164Speter#endif /* _MACHINE_SMP_H_ */ 91