/* Is sp valid as the address of the next kernel stack frame after prev_sp? The next frame may be in a different stack area but should not go back down in the same stack area.  */
static int valid_next_sp(unsigned long sp, unsigned long prev_sp)
/* Is sp valid as the address of the next kernel stack frame after prev_sp? The next frame may be in a different stack area but should not go back down in the same stack area.  */
static int valid_next_sp(unsigned long sp, unsigned long prev_sp)
{
	if (sp & 0xf)
		return 0;
	if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD))
		return 0;
	if (sp >= prev_sp + STACK_FRAME_OVERHEAD)
		return 1;
	if ((sp & ~(THREAD_SIZE - 1)) != (prev_sp & ~(THREAD_SIZE - 1)))
		return 1;
	return 0;
}