1997-04-26 11:46:25 +00:00
|
|
|
/*
|
|
|
|
* ----------------------------------------------------------------------------
|
|
|
|
* "THE BEER-WARE LICENSE" (Revision 42):
|
|
|
|
* <phk@FreeBSD.org> wrote this file. As long as you retain this notice you
|
|
|
|
* can do whatever you want with this stuff. If we meet some day, and you think
|
|
|
|
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
|
|
|
|
* ----------------------------------------------------------------------------
|
|
|
|
*
|
1999-08-28 01:08:13 +00:00
|
|
|
* $FreeBSD$
|
1997-04-26 11:46:25 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MACHINE_SMP_H_
|
|
|
|
#define _MACHINE_SMP_H_
|
|
|
|
|
1999-12-29 04:46:21 +00:00
|
|
|
#ifdef _KERNEL
|
1997-04-26 11:46:25 +00:00
|
|
|
|
2003-11-03 22:32:04 +00:00
|
|
|
#ifdef SMP
|
1997-04-26 11:46:25 +00:00
|
|
|
|
1997-07-28 03:59:54 +00:00
|
|
|
#ifndef LOCORE
|
|
|
|
|
1997-06-27 23:12:31 +00:00
|
|
|
/*
|
|
|
|
* For sending values to POST displays.
|
1997-07-06 23:40:15 +00:00
|
|
|
* XXX FIXME: where does this really belong, isa.h/isa.c perhaps?
|
1997-06-27 23:12:31 +00:00
|
|
|
*/
|
1997-07-06 23:40:15 +00:00
|
|
|
extern int current_postcode; /** XXX currently in mp_machdep.c */
|
|
|
|
#define POSTCODE(X) current_postcode = (X), \
|
|
|
|
outb(0x80, current_postcode)
|
|
|
|
#define POSTCODE_LO(X) current_postcode &= 0xf0, \
|
|
|
|
current_postcode |= ((X) & 0x0f), \
|
|
|
|
outb(0x80, current_postcode)
|
|
|
|
#define POSTCODE_HI(X) current_postcode &= 0x0f, \
|
|
|
|
current_postcode |= (((X) << 4) & 0xf0), \
|
|
|
|
outb(0x80, current_postcode)
|
|
|
|
|
2003-11-03 22:32:04 +00:00
|
|
|
#include <sys/bus.h>
|
2001-04-27 19:28:25 +00:00
|
|
|
#include <machine/frame.h>
|
2003-11-03 22:32:04 +00:00
|
|
|
#include <machine/intr_machdep.h>
|
|
|
|
#include <machine/apicvar.h>
|
1997-05-29 05:57:43 +00:00
|
|
|
|
1997-04-26 11:46:25 +00:00
|
|
|
/* global data in mpboot.s */
|
|
|
|
extern int bootMP_size;
|
|
|
|
|
|
|
|
/* functions in mpboot.s */
|
2002-03-23 15:09:35 +00:00
|
|
|
void bootMP(void);
|
1997-04-26 11:46:25 +00:00
|
|
|
|
|
|
|
/* global data in mp_machdep.c */
|
|
|
|
extern int mp_naps;
|
|
|
|
extern int boot_cpu_id;
|
1998-05-17 22:12:14 +00:00
|
|
|
extern struct pcb stoppcbs[];
|
2003-11-03 22:32:04 +00:00
|
|
|
extern struct mtx smp_tlb_mtx;
|
|
|
|
|
|
|
|
/* IPI handlers */
|
|
|
|
inthand_t
|
|
|
|
IDTVEC(invltlb), /* TLB shootdowns - global */
|
|
|
|
IDTVEC(invlpg), /* TLB shootdowns - 1 page */
|
|
|
|
IDTVEC(invlrng), /* TLB shootdowns - page range */
|
|
|
|
IDTVEC(hardclock), /* Forward hardclock() */
|
|
|
|
IDTVEC(statclock), /* Forward statclock() */
|
|
|
|
IDTVEC(cpuast), /* Additional software trap on other cpu */
|
|
|
|
IDTVEC(cpustop), /* CPU stops & waits to be restarted */
|
|
|
|
IDTVEC(rendezvous), /* handle CPU rendezvous */
|
|
|
|
IDTVEC(lazypmap); /* handle lazy pmap release */
|
1997-04-26 11:46:25 +00:00
|
|
|
|
|
|
|
/* functions in mp_machdep.c */
|
2003-11-03 22:32:04 +00:00
|
|
|
void cpu_add(u_int apic_id, char boot_cpu);
|
2002-03-23 15:09:35 +00:00
|
|
|
void init_secondary(void);
|
|
|
|
void ipi_selected(u_int cpus, u_int ipi);
|
|
|
|
void ipi_all(u_int ipi);
|
|
|
|
void ipi_all_but_self(u_int ipi);
|
|
|
|
void ipi_self(u_int ipi);
|
2003-11-03 22:32:04 +00:00
|
|
|
void forward_statclock(void);
|
|
|
|
void forwarded_statclock(struct clockframe frame);
|
|
|
|
void forward_hardclock(void);
|
|
|
|
void forwarded_hardclock(struct clockframe frame);
|
|
|
|
u_int mp_bootaddress(u_int);
|
|
|
|
int mp_grab_cpu_hlt(void);
|
2003-12-11 03:48:31 +00:00
|
|
|
void mp_topology(void);
|
2002-07-12 07:56:11 +00:00
|
|
|
void smp_invlpg(vm_offset_t addr);
|
|
|
|
void smp_masked_invlpg(u_int mask, vm_offset_t addr);
|
|
|
|
void smp_invlpg_range(vm_offset_t startva, vm_offset_t endva);
|
|
|
|
void smp_masked_invlpg_range(u_int mask, vm_offset_t startva,
|
|
|
|
vm_offset_t endva);
|
|
|
|
void smp_invltlb(void);
|
|
|
|
void smp_masked_invltlb(u_int mask);
|
1997-04-26 11:46:25 +00:00
|
|
|
|
1997-07-28 03:59:54 +00:00
|
|
|
#endif /* !LOCORE */
|
2003-11-03 22:32:04 +00:00
|
|
|
#endif /* SMP */
|
2000-03-28 18:06:49 +00:00
|
|
|
|
1999-12-29 04:46:21 +00:00
|
|
|
#endif /* _KERNEL */
|
1997-04-26 11:46:25 +00:00
|
|
|
#endif /* _MACHINE_SMP_H_ */
|