freebsd-skq/sys/arm/include/smp.h
Adrian Chadd 2b3ad18853 [intrng] Migrate the intrng code from sys/arm/arm to sys/kern/subr_intr.c.
The ci20 port (by kan@) is going to reuse almost all of the intrng code
since the SoC in question looks suspiciously like someone took an ARM
SoC design and replaced the ARM core with a MIPS core.

* migrate out the code;
* rename ARM_ -> INTR_;
* rename arm_ -> intr_;
* move the interrupt flush routine from intr.c / intrng.c into
  arm/machdep_intr.c - removing the code duplication and removing
  the ARM specific bits from here.

Thanks to the Star Wars: The Force Awakens premiere line for allowing
me a couple hours of quiet time to finish the universe builds.

Tested:

* make universe

TODO:

* The structure definitions in subr_intr.c still includes machine/intr.h
  which requires one duplicates all of the intrng definitions in
  the platform code (which kan has done, and I think we don't have to.)

  Instead I should break out the generic things (function declarations,
  common intr structures, etc) into a separate header.

* Kan has requested I make the PIC based IPI stuff optional.
2015-12-18 05:43:59 +00:00

58 lines
1.1 KiB
C

/* $FreeBSD$ */
#ifndef _MACHINE_SMP_H_
#define _MACHINE_SMP_H_
#include <sys/_cpuset.h>
#include <machine/pcb.h>
#ifdef ARM_INTRNG
enum {
IPI_AST,
IPI_PREEMPT,
IPI_RENDEZVOUS,
IPI_STOP,
IPI_STOP_HARD = IPI_STOP, /* These are synonyms on arm. */
IPI_HARDCLOCK,
IPI_TLB,
IPI_CACHE,
INTR_IPI_COUNT
};
#else
#define IPI_AST 0
#define IPI_PREEMPT 2
#define IPI_RENDEZVOUS 3
#define IPI_STOP 4
#define IPI_STOP_HARD 4
#define IPI_HARDCLOCK 6
#define IPI_TLB 7
#define IPI_CACHE 8
#endif /* INTRNG */
void init_secondary(int cpu);
void mpentry(void);
void ipi_all_but_self(u_int ipi);
void ipi_cpu(int cpu, u_int ipi);
void ipi_selected(cpuset_t cpus, u_int ipi);
/* PIC interface */
void pic_ipi_send(cpuset_t cpus, u_int ipi);
#ifndef ARM_INTRNG
void pic_ipi_clear(int ipi);
int pic_ipi_read(int arg);
#endif
/* Platform interface */
void platform_mp_setmaxid(void);
int platform_mp_probe(void);
void platform_mp_start_ap(void);
void platform_mp_init_secondary(void);
void platform_ipi_send(cpuset_t cpus, u_int ipi);
/* global data in mp_machdep.c */
extern struct pcb stoppcbs[];
#endif /* !_MACHINE_SMP_H_ */