exit_thread (void)
{

	ia64_drop_fpu(current);
#ifdef CONFIG_PERFMON
       /* if needed, stop monitoring and flush state to perfmon context */
	if (current->thread.pfm_context)
		pfm_exit_thread(current);

	/* free debug register resources */
	if (current->thread.flags & IA64_THREAD_DBG_VALID)
		pfm_release_debug_registers(current);
#endif
	if (IS_IA32_PROCESS(task_pt_regs(current)))
		ia32_drop_ia64_partial_page_list(current);
}
exit_thread (void)
{

	ia64_drop_fpu(current);
#ifdef CONFIG_PERFMON
        
	if (current->thread.pfm_context)
		pfm_exit_thread(current);

	 
	if (current->thread.flags & IA64_THREAD_DBG_VALID)
		pfm_release_debug_registers(current);
#endif
	if (IS_IA32_PROCESS(task_pt_regs(current)))
		ia32_drop_ia64_partial_page_list(current);
}