From b89569c54d6b8b9b33b766cebc05aac649d44396 Mon Sep 17 00:00:00 2001 From: Yoichi Yuasa Date: Tue, 7 Aug 2007 00:09:17 +0900 Subject: [PATCH] --- yaml --- r: 66137 b: refs/heads/master c: 61a33168bebb6ce5343a5f34ab421971dbfae9fa h: refs/heads/master i: 66135: ada84aec801f8dba5a1ee524e295411c37158792 v: v3 --- [refs] | 2 +- trunk/arch/mips/vr41xx/common/pmu.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 7de7c6e2b51c..1b8ab3feafe5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f571eff0a24ed97a919f2b61bb4afdeab4b43002 +refs/heads/master: 61a33168bebb6ce5343a5f34ab421971dbfae9fa diff --git a/trunk/arch/mips/vr41xx/common/pmu.c b/trunk/arch/mips/vr41xx/common/pmu.c index 5e469796413f..e0ffbe9a9844 100644 --- a/trunk/arch/mips/vr41xx/common/pmu.c +++ b/trunk/arch/mips/vr41xx/common/pmu.c @@ -1,7 +1,7 @@ /* * pmu.c, Power Management Unit routines for NEC VR4100 series. * - * Copyright (C) 2003-2005 Yoichi Yuasa + * Copyright (C) 2003-2007 Yoichi Yuasa * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,11 +22,12 @@ #include #include #include -#include +#include #include #include #include +#include #include #include @@ -44,6 +45,18 @@ static void __iomem *pmu_base; #define pmu_read(offset) readw(pmu_base + (offset)) #define pmu_write(offset, value) writew((value), pmu_base + (offset)) +static void vr41xx_cpu_wait(void) +{ + local_irq_disable(); + if (!need_resched()) + /* + * "standby" sets IE bit of the CP0_STATUS to 1. + */ + __asm__("standby;\n"); + else + local_irq_enable(); +} + static inline void software_reset(void) { uint16_t pmucnt2; @@ -113,6 +126,7 @@ static int __init vr41xx_pmu_init(void) return -EBUSY; } + cpu_wait = vr41xx_cpu_wait; _machine_restart = vr41xx_restart; _machine_halt = vr41xx_halt; pm_power_off = vr41xx_power_off;