[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/smp.h

Version: -  FREEBSD  -  FREEBSD10  -  FREEBSD9  -  FREEBSD92  -  FREEBSD91  -  FREEBSD90  -  FREEBSD8  -  FREEBSD82  -  FREEBSD81  -  FREEBSD80  -  FREEBSD7  -  FREEBSD74  -  FREEBSD73  -  FREEBSD72  -  FREEBSD71  -  FREEBSD70  -  FREEBSD6  -  FREEBSD64  -  FREEBSD63  -  FREEBSD62  -  FREEBSD61  -  FREEBSD60  -  FREEBSD5  -  FREEBSD55  -  FREEBSD54  -  FREEBSD53  -  FREEBSD52  -  FREEBSD51  -  FREEBSD50  -  FREEBSD4  -  FREEBSD3  -  FREEBSD22  -  cheribsd  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1  -  FREEBSD-LIBC  -  FREEBSD8-LIBC  -  FREEBSD7-LIBC  -  FREEBSD6-LIBC  -  GLIBC27 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * ----------------------------------------------------------------------------
    3  * "THE BEER-WARE LICENSE" (Revision 42):
    4  * <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
    5  * can do whatever you want with this stuff. If we meet some day, and you think
    6  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
    7  * ----------------------------------------------------------------------------
    8  *
    9  * $FreeBSD: src/sys/sys/smp.h,v 1.76 2003/12/03 14:57:25 jhb Exp $
   10  */
   11 
   12 #ifndef _SYS_SMP_H_
   13 #define _SYS_SMP_H_
   14 
   15 #ifdef _KERNEL
   16 
   17 #ifndef LOCORE
   18 
   19 #ifdef SMP
   20 
   21 /*
   22  * Topology of a NUMA or HTT system.
   23  *
   24  * The top level topology is an array of pointers to groups.  Each group
   25  * contains a bitmask of cpus in its group or subgroups.  It may also
   26  * contain a pointer to an array of child groups.
   27  *
   28  * The bitmasks at non leaf groups may be used by consumers who support
   29  * a smaller depth than the hardware provides.
   30  *
   31  * The topology may be omitted by systems where all CPUs are equal.
   32  */
   33 
   34 struct cpu_group {
   35         u_int   cg_mask;                /* Mask of cpus in this group. */
   36         int     cg_count;               /* Count of cpus in this group. */
   37         int     cg_children;            /* Number of children groups. */
   38         struct cpu_group *cg_child;     /* Optional child group. */
   39 };
   40 
   41 struct cpu_top {
   42         int     ct_count;               /* Count of groups. */
   43         struct cpu_group *ct_group;     /* Array of pointers to cpu groups. */
   44 };
   45 
   46 extern struct cpu_top *smp_topology;
   47 extern void (*cpustop_restartfunc)(void);
   48 extern int smp_active;
   49 extern int smp_cpus;
   50 extern volatile u_int started_cpus;
   51 extern volatile u_int stopped_cpus;
   52 #endif /* SMP */
   53 
   54 extern u_int all_cpus;
   55 extern u_int mp_maxid;
   56 extern int mp_ncpus;
   57 extern volatile int smp_started;
   58 
   59 /*
   60  * Macro allowing us to determine whether a CPU is absent at any given
   61  * time, thus permitting us to configure sparse maps of cpuid-dependent
   62  * (per-CPU) structures.
   63  */
   64 #define CPU_ABSENT(x_cpu)       ((all_cpus & (1 << (x_cpu))) == 0)
   65 
   66 #ifdef SMP
   67 /*
   68  * Machine dependent functions used to initialize MP support.
   69  *
   70  * The cpu_mp_probe() should check to see if MP support is present and return
   71  * zero if it is not or non-zero if it is.  If MP support is present, then
   72  * cpu_mp_start() will be called so that MP can be enabled.  This function
   73  * should do things such as startup secondary processors.  It should also
   74  * setup mp_ncpus, all_cpus, and smp_cpus.  It should also ensure that
   75  * smp_active and smp_started are initialized at the appropriate time.
   76  * Once cpu_mp_start() returns, machine independent MP startup code will be
   77  * executed and a simple message will be output to the console.  Finally,
   78  * cpu_mp_announce() will be called so that machine dependent messages about
   79  * the MP support may be output to the console if desired.
   80  *
   81  * The cpu_setmaxid() function is called very early during the boot process
   82  * so that the MD code may set mp_maxid to provide an upper bound on CPU IDs
   83  * that other subsystems may use.  If a platform is not able to determine
   84  * the exact maximum ID that early, then it may set mp_maxid to MAXCPU - 1.
   85  */
   86 struct thread;
   87 
   88 void    cpu_mp_announce(void);
   89 int     cpu_mp_probe(void);
   90 void    cpu_mp_setmaxid(void);
   91 void    cpu_mp_start(void);
   92 
   93 void    forward_signal(struct thread *);
   94 void    forward_roundrobin(void);
   95 int     restart_cpus(u_int);
   96 int     stop_cpus(u_int);
   97 void    smp_rendezvous_action(void);
   98 #endif /* SMP */
   99 void    smp_rendezvous(void (*)(void *), 
  100                        void (*)(void *),
  101                        void (*)(void *),
  102                        void *arg);
  103 #endif /* !LOCORE */
  104 #endif /* _KERNEL */
  105 #endif /* _SYS_SMP_H_ */

Cache object: 5521ba1bd4d5bb79cce72512217265d0


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.