Home | History | Annotate | Line # | Download | only in include
cpu_topology.h revision 1.2.4.2
      1  1.2.4.2  martin /*	$NetBSD: cpu_topology.h,v 1.2.4.2 2020/04/08 14:07:29 martin Exp $	*/
      2  1.2.4.2  martin 
      3  1.2.4.2  martin /*
      4  1.2.4.2  martin  * Copyright (c) 2020 Matthew R. Green
      5  1.2.4.2  martin  * All rights reserved.
      6  1.2.4.2  martin  *
      7  1.2.4.2  martin  * Redistribution and use in source and binary forms, with or without
      8  1.2.4.2  martin  * modification, are permitted provided that the following conditions
      9  1.2.4.2  martin  * are met:
     10  1.2.4.2  martin  * 1. Redistributions of source code must retain the above copyright
     11  1.2.4.2  martin  *    notice, this list of conditions and the following disclaimer.
     12  1.2.4.2  martin  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.2.4.2  martin  *    notice, this list of conditions and the following disclaimer in the
     14  1.2.4.2  martin  *    documentation and/or other materials provided with the distribution.
     15  1.2.4.2  martin  * 3. The name of the author may not be used to endorse or promote products
     16  1.2.4.2  martin  *    derived from this software without specific prior written permission.
     17  1.2.4.2  martin  *
     18  1.2.4.2  martin  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19  1.2.4.2  martin  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20  1.2.4.2  martin  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21  1.2.4.2  martin  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22  1.2.4.2  martin  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
     23  1.2.4.2  martin  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
     24  1.2.4.2  martin  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
     25  1.2.4.2  martin  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
     26  1.2.4.2  martin  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     27  1.2.4.2  martin  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     28  1.2.4.2  martin  * SUCH DAMAGE.
     29  1.2.4.2  martin  */
     30  1.2.4.2  martin 
     31  1.2.4.2  martin #ifndef _ARM_CPU_TOPOLOGY_H_
     32  1.2.4.2  martin #define _ARM_CPU_TOPOLOGY_H_
     33  1.2.4.2  martin 
     34  1.2.4.2  martin /*
     35  1.2.4.2  martin  * ARMv7 and ARMv8 compatible CPU topology support.
     36  1.2.4.2  martin  *
     37  1.2.4.2  martin  * arm_cpu_do_topology(cpuinfo)
     38  1.2.4.2  martin  *
     39  1.2.4.2  martin  * Call arm_cpu_do_topology() in cpu_attach(). It will update the topology
     40  1.2.4.2  martin  * view of relative speed.
     41  1.2.4.2  martin  *
     42  1.2.4.2  martin  * The CPU frontend can set the "capacity_dmips_mhz" property for this CPU,
     43  1.2.4.2  martin  * and arm_cpu_do_topology() will update the system view of this and other
     44  1.2.4.2  martin  * CPUs relative speeds
     45  1.2.4.2  martin  *
     46  1.2.4.2  martin  * arm_cpu_topology_set(cpuinfo, mpidr)
     47  1.2.4.2  martin  *
     48  1.2.4.2  martin  * arm_cpu_topology_set() is provided for locore and the boot CPU,
     49  1.2.4.2  martin  * and application CPUs.  It updates data for the current CPU.
     50  1.2.4.2  martin  */
     51  1.2.4.2  martin 
     52  1.2.4.2  martin #include <sys/param.h>
     53  1.2.4.2  martin #include <sys/cpu.h>
     54  1.2.4.2  martin 
     55  1.2.4.2  martin void arm_cpu_do_topology(struct cpu_info * const);
     56  1.2.4.2  martin void arm_cpu_topology_set(struct cpu_info * const, mpidr_t);
     57  1.2.4.2  martin 
     58  1.2.4.2  martin #endif /* _ARM_CPU_TOPOLOGY_H_ */
     59