当前位置: 首页>>代码示例>>C++>>正文


C++ cpu_do_idle函数代码示例

本文整理汇总了C++中cpu_do_idle函数的典型用法代码示例。如果您正苦于以下问题:C++ cpu_do_idle函数的具体用法?C++ cpu_do_idle怎么用?C++ cpu_do_idle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了cpu_do_idle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: arch_cpu_idle

/*
 * This is our default idle handler.
 */
void arch_cpu_idle(void)
{
	/*
	 * This should do all the clock switching and wait for interrupt
	 * tricks
	 */
	trace_cpu_idle_rcuidle(1, smp_processor_id());
	cpu_do_idle();
	local_irq_enable();
	trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:14,代码来源:process.c

示例2: s5p64x0_idle

static void s5p64x0_idle(void)
{
	unsigned long val;

	val = __raw_readl(S5P64X0_PWR_CFG);
	val &= ~(0x3 << 5);
	val |= (0x1 << 5);
	__raw_writel(val, S5P64X0_PWR_CFG);

	cpu_do_idle();
}
开发者ID:Emerson3074,项目名称:linux,代码行数:11,代码来源:common.c

示例3: xilinx_enter_idle

/* Actual code that puts the SoC in different idle states */
static int xilinx_enter_idle(struct cpuidle_device *dev,
		struct cpuidle_driver *drv, int index)
{
	struct timeval before, after;
	int idle_time;

	local_irq_disable();
	do_gettimeofday(&before);

	if (index == 0)
		/* Wait for interrupt state */
		cpu_do_idle();

	else if (index == 1) {
		unsigned int cpu_id = smp_processor_id();

		clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_ENTER, &cpu_id);

		/* Devices must be stopped here */
		cpu_pm_enter();

		/* Add code for DDR self refresh start */

		cpu_do_idle();
		/*cpu_suspend(foo, bar);*/

		/* Add code for DDR self refresh stop */

		cpu_pm_exit();

		clockevents_notify(CLOCK_EVT_NOTIFY_BROADCAST_EXIT, &cpu_id);
	}

	do_gettimeofday(&after);
	local_irq_enable();
	idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
			(after.tv_usec - before.tv_usec);

	dev->last_residency = idle_time;
	return index;
}
开发者ID:Analias,项目名称:SNOWLeo-SDR-1,代码行数:42,代码来源:cpuidle.c

示例4: rk3288_cpuidle_enter

static int rk3288_cpuidle_enter(struct cpuidle_device *dev,
		struct cpuidle_driver *drv, int index)
{
	void *sel = RK_CRU_VIRT + RK3288_CRU_CLKSELS_CON(36);
	u32 con = readl_relaxed(sel);
	u32 cpu = MPIDR_AFFINITY_LEVEL(read_cpuid_mpidr(), 0);
	writel_relaxed(0x70007 << (cpu << 2), sel);
	cpu_do_idle();
	writel_relaxed((0x70000 << (cpu << 2)) | con, sel);
	dsb();
	return index;
}
开发者ID:Astralix,项目名称:kernel,代码行数:12,代码来源:rk3288.c

示例5: zynq_cpu_die

/**
 * zynq_cpu_die - Let a CPU core die
 * @cpu:	Dying CPU
 *
 * Platform-specific code to shutdown a CPU.
 * Called with IRQs disabled on the dying CPU.
 */
static void zynq_cpu_die(unsigned int cpu)
{
	zynq_slcr_cpu_state_write(cpu, true);

	/*
	 * there is no power-control hardware on this platform, so all
	 * we can do is put the core into WFI; this is safe as the calling
	 * code will have already disabled interrupts
	 */
	for (;;)
		cpu_do_idle();
}
开发者ID:020gzh,项目名称:linux,代码行数:19,代码来源:platsmp.c

示例6: mxs_suspend_enter

static int mxs_suspend_enter(suspend_state_t state)
{
    switch (state) {
    case PM_SUSPEND_MEM:
        cpu_do_idle();
        break;

    default:
        return -EINVAL;
    }
    return 0;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:12,代码来源:pm.c

示例7: highbank_cpu_die

/*
 * platform-specific code to shutdown a CPU
 *
 */
void __ref highbank_cpu_die(unsigned int cpu)
{
	flush_cache_all();

	highbank_set_cpu_jump(cpu, secondary_startup);
	highbank_set_core_pwr();

	cpu_do_idle();

	/* We should never return from idle */
	panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu);
}
开发者ID:BaoleiSu,项目名称:linux,代码行数:16,代码来源:hotplug.c

示例8: arch_idle

/*!
 * This function puts the CPU into idle mode. It is called by default_idle()
 * in process.c file.
 */
void arch_idle(void)
{
	/*
	 * This should do all the clock switching
	 * and wait for interrupt tricks.
	 */
	if (!mxc_jtag_enabled) {
		/* set as Wait mode */
		mxc_cpu_lp_set(WAIT_UNCLOCKED);
		cpu_do_idle();
	}
}
开发者ID:despierto,项目名称:imx_233_linux,代码行数:16,代码来源:system.c

示例9: platform_cpu_die

/*
 * platform-specific code to shutdown a CPU
 *
 */
void platform_cpu_die(unsigned int cpu)
{
	flush_cache_all();

	highbank_set_cpu_jump(cpu, secondary_startup);
	scu_power_mode(scu_base_addr, SCU_PM_POWEROFF);

	cpu_do_idle();

	/* We should never return from idle */
	panic("highbank: cpu %d unexpectedly exit from shutdown\n", cpu);
}
开发者ID:08opt,项目名称:linux,代码行数:16,代码来源:hotplug.c

示例10: mt6735_rgidle_enter

static int mt6735_rgidle_enter(struct cpuidle_device *dev,
			      struct cpuidle_driver *drv, int index)
{
    if (printk_ratelimit())
        printk(KERN_WARNING "MT6735 cpuidle rgidle\n");

	cpu_do_idle();

    idle_cnt_inc(IDLE_TYPE_RG, smp_processor_id());

	return index;
}
开发者ID:Jlsmily,项目名称:android_kernel_meilan2,代码行数:12,代码来源:cpuidle-mt6735.c

示例11: mt6735_soidle_enter

static int mt6735_soidle_enter(struct cpuidle_device *dev,
			      struct cpuidle_driver *drv, int index)
{
    if (printk_ratelimit())
        printk(KERN_WARNING "MT6735 cpuidle SODI\n");

	cpu_do_idle();

    idle_cnt_inc(IDLE_TYPE_SO, 0);

	return index;
}
开发者ID:Jlsmily,项目名称:android_kernel_meilan2,代码行数:12,代码来源:cpuidle-mt6735.c

示例12: highbank_suspend_finish

static int highbank_suspend_finish(unsigned long val)
{
	outer_flush_all();
	outer_disable();

	highbank_set_pwr_suspend();

	cpu_do_idle();

	highbank_clear_pwr_request();
	return 0;
}
开发者ID:Abhinav1997,项目名称:kernel-personal,代码行数:12,代码来源:pm.c

示例13: socfpga_cpu_die

/*
 * platform-specific code to shutdown a CPU
 *
 * Called with IRQs disabled
 */
static void socfpga_cpu_die(unsigned int cpu)
{
	/* Flush the L1 data cache. */
	flush_cache_all();

	/* This will put CPU #1 into reset.*/
	__raw_writel(RSTMGR_MPUMODRST_CPU1, rst_manager_base_addr + 0x10);

	cpu_do_idle();

	/* We should have never returned from idle */
	panic("cpu %d unexpectedly exit from shutdown\n", cpu);
}
开发者ID:coliby,项目名称:terasic_MTL,代码行数:18,代码来源:platsmp.c

示例14: meson_enter_idle_simple

int meson_enter_idle_simple(struct cpuidle_device *dev,
			struct cpuidle_driver *drv,
			int index)
{
	local_fiq_disable();
//	printk("enter wfi.\n");
	cpu_do_idle();
//	printk("exit wfi.\n");

	local_fiq_enable();

	return index;
}
开发者ID:OpenLD,项目名称:linux-wetek-3.10.y,代码行数:13,代码来源:plat-cpuidle.c

示例15: s3c2412_idle

static void s3c2412_idle(void)
{
    unsigned long tmp;

    /* ensure our idle mode is to go to idle */

    tmp = __raw_readl(S3C2412_PWRCFG);
    tmp &= ~S3C2412_PWRCFG_STANDBYWFI_MASK;
    tmp |= S3C2412_PWRCFG_STANDBYWFI_IDLE;
    __raw_writel(tmp, S3C2412_PWRCFG);

    cpu_do_idle();
}
开发者ID:274914765,项目名称:C,代码行数:13,代码来源:s3c2412.c


注:本文中的cpu_do_idle函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。