Skip to content
  • Paul Mackerras's avatar
    powerpc: Use correct sequence for putting CPU into nap mode · f39224a8
    Paul Mackerras authored
    
    
    We weren't using the recommended sequence for putting the CPU into
    nap mode.  When I changed the idle loop, for some reason 7447A cpus
    started hanging when we put them into nap mode.  Changing to the
    recommended sequence fixes that.
    
    The complexity here is that the recommended sequence is a loop that
    keeps putting the cpu back into nap mode.  Clearly we need some way
    to break out of the loop when an interrupt (external interrupt,
    decrementer, performance monitor) occurs.  Here we use a bit in
    the thread_info struct to indicate that we need this, and the exception
    entry code notices this and arranges for the exception to return
    to the value in the link register, thus breaking out of the loop.
    We use a new `local_flags' field in the thread_info which we can
    alter without needing to use an atomic update sequence.
    
    The PPC970 has the same recommended sequence, so we do the same thing
    there too.
    
    This also fixes a bug in the kernel stack overflow handling code on
    32-bit, since it was causing a value that we needed in a register to
    get trashed.
    
    Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
    f39224a8