mach_mp_startup.c revision 183ef8a1713ca188e24d970f22c6f9cc333007fd
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/machsystm.h>
#include <sys/cpu_module.h>
#include <sys/cpu_sgnblk_defs.h>
#include <sys/mach_descrip.h>
#include <sys/hypervisor_api.h>
#include <sys/soft_state.h>
/*
* Useful for disabling MP bring-up for an MP capable kernel
* (a kernel that was built with MP defined)
*/
/*
* Init CPU info - get CPU type info for processor_info system call.
*/
void
{
/*
* Get clock-frequency property from cpunodes[] for the CPU.
*/
/*
* Current frequency in Hz.
*/
/*
* Supported frequencies.
*/
/*
* StarFire requires the signature block stuff setup here
*/
/*
* cpu0 starts out running. Other cpus are
* still in OBP land and we will leave them
* alone for now.
*/
/*
* On first cpu setup, tell hv we are booting
*/
#ifdef lint
#endif /* lint */
}
}
/*
* Routine used to cleanup a CPU that has been powered off. This will
* destroy all per-cpu information related to this cpu.
*/
int
mp_cpu_unconfigure(int cpuid)
{
int retval;
extern void empty_cpu(int);
extern int cleanup_cpu_common(int);
return (retval);
}
struct mp_find_cpu_arg {
int cpuid; /* set by mp_cpu_configure() */
};
int
{
char *type;
int rv = DDI_WALK_CONTINUE;
int cpuid;
return (DDI_WALK_CONTINUE);
goto out;
if (cpuid == -1) {
}
goto out;
/* Found it */
out:
return (rv);
}
/*
* Routine used to setup a newly inserted CPU in preparation for starting
* it running code.
*/
int
mp_cpu_configure(int cpuid)
{
int listsz, i;
int num_nodes;
return (ENODEV);
if (num_nodes < 0)
return (ENODEV);
for (i = 0; i < num_nodes; i++) {
break;
break;
}
}
if (cpunode == MDE_INVAL_ELEM_COOKIE)
return (ENODEV);
/*
* Note: uses cpu_lock to protect cpunodes
* which will be modified inside of fill_cpu and
* setup_exec_unit_mappings.
*/
/*
* Adding a CPU may cause the execution unit sharing
* relationships to change. Update the mappings in
* the cpunode structures.
*/
/* propagate the updated mappings to the CPU structures */
continue;
}
(void) md_fini_handle(mdp);
if ((i = setup_cpu_common(cpuid)) != 0) {
(void) cleanup_cpu_common(cpuid);
return (i);
}
return (0);
}
/*
* Platform-specific actions to be taken when all cpus are running
* in the OS.
*/
void
cpu_mp_init(void)
{
extern void recalc_xc_timeouts();
extern int cif_cpu_mp_ready;
/* N.B. This must happen after xc_init() has run. */
if (!domaining_enabled())
return;
cif_cpu_mp_ready = 1;
}
void
{
char buf[CPU_IDSTRLEN];
"%s (cpuid %d, clock %d MHz)",
} else {
"%s (chipid %d, clock %d MHz)",
}
}