Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/arch/asm.h

    r6ecf5b8 r3ee38a9  
    3838
    3939#include <typedefs.h>
     40#include <arch/cp15.h>
    4041#include <arch/stack.h>
    4142#include <config.h>
     
    4344#include <trace.h>
    4445
    45 /** No such instruction on ARM to sleep CPU. */
     46/** CPU specific way to sleep cpu.
     47 *
     48 * ARMv7 introduced wait for event and wait for interrupt (wfe/wfi).
     49 * ARM920T has custom coprocessor action to do the same. See ARM920T Technical
     50 * Reference Manual ch 4.9 p. 4-23 (103 in the PDF)
     51 * ARM926EJ-S uses the same coprocessor instruction as ARM920T. See ARM926EJ-S
     52 * chapter 2.3.8 p.2-22 (52 in the PDF)
     53 *
     54 * @note Although CP15WFI (mcr p15, 0, R0, c7, c0, 4) is defined in ARM
     55 * Architecture reference manual for armv4/5, CP15 implementation is mandatory
     56 * only for armv6+.
     57 */
    4658NO_TRACE static inline void cpu_sleep(void)
    4759{
     60#ifdef PROCESSOR_ARCH_armv7_a
     61        asm volatile ( "wfe" );
     62#elif defined(PROCESSOR_ARCH_armv6) | defined(PROCESSOR_arm926ej_s) | defined(PROCESSOR_arm920t)
     63        WFI_write(0);
     64#endif
    4865}
    4966
Note: See TracChangeset for help on using the changeset viewer.