Path: blob/master/arch/powerpc/kernel/idle_power4.S
10817 views
/*1* This file contains the power_save function for 970-family CPUs.2*3* This program is free software; you can redistribute it and/or4* modify it under the terms of the GNU General Public License5* as published by the Free Software Foundation; either version6* 2 of the License, or (at your option) any later version.7*/89#include <linux/threads.h>10#include <asm/processor.h>11#include <asm/page.h>12#include <asm/cputable.h>13#include <asm/thread_info.h>14#include <asm/ppc_asm.h>15#include <asm/asm-offsets.h>1617#undef DEBUG1819.text2021_GLOBAL(power4_idle)22BEGIN_FTR_SECTION23blr24END_FTR_SECTION_IFCLR(CPU_FTR_CAN_NAP)25/* Now check if user or arch enabled NAP mode */26LOAD_REG_ADDRBASE(r3,powersave_nap)27lwz r4,ADDROFF(powersave_nap)(r3)28cmpwi 0,r4,029beqlr3031/* Go to NAP now */32mfmsr r733rldicl r0,r7,48,134rotldi r0,r0,1635mtmsrd r0,1 /* hard-disable interrupts */36li r0,137stb r0,PACASOFTIRQEN(r13) /* we'll hard-enable shortly */38stb r0,PACAHARDIRQEN(r13)39BEGIN_FTR_SECTION40DSSALL41sync42END_FTR_SECTION_IFSET(CPU_FTR_ALTIVEC)43clrrdi r9,r1,THREAD_SHIFT /* current thread_info */44ld r8,TI_LOCAL_FLAGS(r9) /* set napping bit */45ori r8,r8,_TLF_NAPPING /* so when we take an exception */46std r8,TI_LOCAL_FLAGS(r9) /* it will return to our caller */47ori r7,r7,MSR_EE48oris r7,r7,MSR_POW@h491: sync50isync51mtmsrd r752isync53b 1b54555657