本文整理汇总了C++中register_cpu函数的典型用法代码示例。如果您正苦于以下问题:C++ register_cpu函数的具体用法?C++ register_cpu怎么用?C++ register_cpu使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了register_cpu函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: topology_init
static int __init topology_init(void)
{
int cpu;
register_nodes();
register_cpu_notifier(&sysfs_cpu_nb);
for_each_possible_cpu(cpu) {
struct cpu *c = &per_cpu(cpu_devices, cpu);
if (ppc_md.cpu_die)
c->hotpluggable = 1;
if (cpu_online(cpu) || c->hotpluggable) {
register_cpu(c, cpu);
device_create_file(&c->dev, &dev_attr_physical_id);
}
if (cpu_online(cpu))
register_cpu_online(cpu);
}
#ifdef CONFIG_PPC64
sysfs_create_dscr_default();
#endif
return 0;
}
开发者ID:masterdroid,项目名称:B14CKB1RD_kernel_m8,代码行数:28,代码来源:sysfs.c
示例2: topology_init
static int __init topology_init(void)
{
int cpu;
register_nodes();
register_cpu_notifier(&sysfs_cpu_nb);
for_each_possible_cpu(cpu) {
struct cpu *c = &per_cpu(cpu_devices, cpu);
/*
* For now, we just see if the system supports making
* the RTAS calls for CPU hotplug. But, there may be a
* more comprehensive way to do this for an individual
* CPU. For instance, the boot cpu might never be valid
* for hotplugging.
*/
if (!ppc_md.cpu_die)
c->no_control = 1;
if (cpu_online(cpu) || (c->no_control == 0)) {
register_cpu(c, cpu);
sysdev_create_file(&c->sysdev, &attr_physical_id);
}
if (cpu_online(cpu))
register_cpu_online(cpu);
}
return 0;
}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:32,代码来源:sysfs.c
示例3: topology_init
static int __init topology_init(void)
{
int i, ret;
#ifdef CONFIG_NEED_MULTIPLE_NODES
for_each_online_node(i)
register_one_node(i);
#endif
for_each_present_cpu(i) {
struct cpu *c = &per_cpu(cpu_devices, i);
c->hotpluggable = 1;
ret = register_cpu(c, i);
if (unlikely(ret))
printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n",
__func__, i, ret);
}
#if defined(CONFIG_NUMA) && !defined(CONFIG_SMP)
for_each_online_node(i)
if (i != numa_node_id())
register_cpu_under_node(raw_smp_processor_id(), i);
#endif
return 0;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:28,代码来源:topology.c
示例4: topology_init
static int __init topology_init(void)
{
int i, ret;
#ifdef CONFIG_NEED_MULTIPLE_NODES
for_each_online_node(i)
register_one_node(i);
#endif
for_each_present_cpu(i) {
ret = register_cpu(&per_cpu(cpu_devices, i), i);
if (unlikely(ret))
printk(KERN_WARNING "%s: register_cpu %d failed (%d)\n",
__FUNCTION__, i, ret);
}
#if defined(CONFIG_NUMA) && !defined(CONFIG_SMP)
/*
* In the UP case, make sure the CPU association is still
* registered under each node. Without this, sysfs fails
* to make the connection between nodes other than node0
* and cpu0.
*/
for_each_online_node(i)
if (i != numa_node_id())
register_cpu_under_node(raw_smp_processor_id(), i);
#endif
return 0;
}
开发者ID:PennPanda,项目名称:linux-repo,代码行数:30,代码来源:topology.c
示例5: topology_init
static int __init topology_init(void)
{
int num;
for_each_present_cpu(num) {
register_cpu(&per_cpu(cpu_devices, num), num);
}
return 0;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:9,代码来源:topology.c
示例6: topology_init
static int __init topology_init(void)
{
int cpu;
for_each_present_cpu(cpu)
register_cpu(&per_cpu(cpu_topology, cpu), cpu);
return 0;
}
开发者ID:1youhun1,项目名称:linux,代码行数:9,代码来源:setup.c
示例7: topology_init
static int __init topology_init(void)
{
int i;
for_each_present_cpu(i)
register_cpu(&cpu_devices[i], i);
return 0;
}
开发者ID:spacex,项目名称:kernel-centos5,代码行数:9,代码来源:setup.c
示例8: topology_init
static int __init topology_init(void)
{
int i;
for_each_possible_cpu(i) {
return register_cpu(&cpu_devices[i], i);
}
return 0;
}
开发者ID:10x-Amin,项目名称:nAa-kernel,代码行数:10,代码来源:setup.c
示例9: arch_register_cpu
int arch_register_cpu(int num) {
struct node *parent = NULL;
#ifdef CONFIG_NUMA
int node = cpu_to_node(num);
if (node_online(node))
parent = &node_devices[node].node;
#endif /* CONFIG_NUMA */
return register_cpu(&cpu_devices[num].cpu, num, parent);
}
开发者ID:Dronevery,项目名称:JetsonTK1-kernel,代码行数:11,代码来源:topology.c
示例10: topology_init
static int __init topology_init(void)
{
int i;
for_each_possible_cpu(i) {
struct cpu *cpu = &per_cpu(cpu_data, i);
cpu->hotpluggable = !!i;
register_cpu(cpu, i);
}
return 0;
}
开发者ID:AK101111,项目名称:linux,代码行数:12,代码来源:setup.c
示例11: arch_register_cpu
int __ref arch_register_cpu(int num)
{
#ifdef CONFIG_ACPI
/*
* If CPEI can be re-targetted or if this is not
* CPEI target, then it is hotpluggable
*/
if (can_cpei_retarget() || !is_cpu_cpei_target(num))
sysfs_cpus[num].cpu.hotpluggable = 1;
map_cpu_to_node(num, node_cpuid[num].nid);
#endif
return register_cpu(&sysfs_cpus[num].cpu, num);
}
开发者ID:12019,项目名称:linux-2.6.34-ts471x,代码行数:13,代码来源:topology.c
示例12: arch_register_cpu
int arch_register_cpu(int num)
{
/*
* CPU0 cannot be offlined due to several
* restrictions and assumptions in kernel. This basically
* doesnt add a control file, one cannot attempt to offline
* BSP.
*/
if (!num)
cpu_devices[num].cpu.no_control = 1;
return register_cpu(&cpu_devices[num].cpu, num);
}
开发者ID:Broadcom,项目名称:stblinux-2.6.18,代码行数:13,代码来源:topology.c
示例13: arch_register_cpu
int arch_register_cpu(int num)
{
#if defined (CONFIG_ACPI) && defined (CONFIG_HOTPLUG_CPU)
/*
* If CPEI cannot be re-targetted, and this is
* CPEI target, then dont create the control file
*/
if (!can_cpei_retarget() && is_cpu_cpei_target(num))
sysfs_cpus[num].cpu.no_control = 1;
map_cpu_to_node(num, node_cpuid[num].nid);
#endif
return register_cpu(&sysfs_cpus[num].cpu, num);
}
开发者ID:Broadcom,项目名称:stblinux-2.6.18,代码行数:14,代码来源:topology.c
示例14: topology_init
static int __init topology_init(void)
{
int cpu;
int ret;
for_each_cpu(cpu) {
ret = register_cpu(&per_cpu(cpu_devices, cpu), cpu, NULL);
if (ret)
printk(KERN_WARNING "topology_init: register_cpu %d "
"failed (%d)\n", cpu, ret);
}
return 0;
}
开发者ID:KrisChaplin,项目名称:LRT2x4_v1.0.2.06_GPL_source,代码行数:14,代码来源:smp.c
示例15: topology_init
static int __init topology_init(void)
{
int i, ret;
for_each_present_cpu(i) {
ret = register_cpu(&per_cpu(cpu_devices, i), i);
if (ret)
printk(KERN_WARNING "topology_init: register_cpu %d "
"failed (%d)\n", i, ret);
}
return 0;
}
开发者ID:Blackburn29,项目名称:PsycoKernel,代码行数:15,代码来源:topology.c
示例16: arch_register_cpu
int arch_register_cpu(int num)
{
/*
* CPU0 cannot be offlined due to several
* restrictions and assumptions in kernel. This basically
* doesnt add a control file, one cannot attempt to offline
* BSP.
*
* Also certain PCI quirks require not to enable hotplug control
* for all CPU's.
*/
if (num && enable_cpu_hotplug)
cpu_devices[num].cpu.hotpluggable = 1;
return register_cpu(&cpu_devices[num].cpu, num);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:16,代码来源:topology.c
示例17: topology_init
static int __init topology_init(void)
{
int i, ret;
#ifdef CONFIG_NUMA
for_each_online_node(i)
register_one_node(i);
#endif /* CONFIG_NUMA */
for_each_present_cpu(i) {
ret = register_cpu(&per_cpu(cpu_devices, i), i);
if (ret)
printk(KERN_WARNING "topology_init: register_cpu %d "
"failed (%d)\n", i, ret);
}
return 0;
}
开发者ID:ClarkChen633,项目名称:rtl819x-toolchain,代码行数:17,代码来源:topology.c
示例18: ppc_init
int __init ppc_init(void)
{
int i;
/* clear the progress line */
if ( ppc_md.progress ) ppc_md.progress(" ", 0xffff);
/* register CPU devices */
for (i = 0; i < NR_CPUS; i++)
if (cpu_possible(i))
register_cpu(&cpu_devices[i], i, NULL);
/* call platform init */
if (ppc_md.init != NULL) {
ppc_md.init();
}
return 0;
}
开发者ID:1x23,项目名称:unifi-gpl,代码行数:18,代码来源:setup_32.c
示例19: topology_init
static int __init topology_init(void)
{
int i, ret;
for_each_present_cpu(i) {
/*
* register_cpu takes a per_cpu pointer and
* just points it at another per_cpu struct...
*/
ret = register_cpu(&per_cpu(cpu_devices, i), i);
if (ret)
printk(KERN_WARNING "topology_init: register_cpu %d "
"failed (%d)\n", i, ret);
}
return 0;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:19,代码来源:topology.c
示例20: arch_register_cpu
int arch_register_cpu(int num)
{
struct node *parent = NULL;
#ifdef CONFIG_NUMA
parent = &sysfs_nodes[cpu_to_node(num)];
#endif /* CONFIG_NUMA */
#ifdef CONFIG_ACPI_BOOT
/*
* If CPEI cannot be re-targetted, and this is
* CPEI target, then dont create the control file
*/
if (!can_cpei_retarget() && is_cpu_cpei_target(num))
sysfs_cpus[num].cpu.no_control = 1;
#endif
return register_cpu(&sysfs_cpus[num].cpu, num, parent);
}
开发者ID:kzlin129,项目名称:tt-gpl,代码行数:19,代码来源:topology.c
注:本文中的register_cpu函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论