/* * arch/xtensa/kernel/coprocessor.S * * Xtensa processor configuration-specific table of coprocessor and * other custom register layout information. * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2003 - 2007 Tensilica Inc.
*/
/* * Rules for coprocessor state manipulation on SMP: * * - a task may have live coprocessors only on one CPU. * * - whether coprocessor context of task T is live on some CPU is * denoted by T's thread_info->cpenable. * * - non-zero thread_info->cpenable means that thread_info->cp_owner_cpu * is valid in the T's thread_info. Zero thread_info->cpenable means that * coprocessor context is valid in the T's thread_info. * * - if a coprocessor context of task T is live on CPU X, only CPU X changes * T's thread_info->cpenable, cp_owner_cpu and coprocessor save area. * This is done by making sure that for the task T with live coprocessor * on CPU X cpenable SR is 0 when T runs on any other CPU Y. * When fast_coprocessor exception is taken on CPU Y it goes to the * C-level do_coprocessor that uses IPI to make CPU X flush T's coprocessors.
*/
/* * Entry condition: * * a0: trashed, original value saved on stack (PT_AREG0) * a1: a1 * a2: new stack pointer, original in DEPC * a3: a3 * depc: a2, original value saved on stack (PT_DEPC) * excsave_1: dispatch table * * PT_DEPC >= VALID_DOUBLE_EXCEPTION_ADDRESS: double exception, DEPC * < VALID_DOUBLE_EXCEPTION_ADDRESS: regular exception
*/
ENTRY(fast_coprocessor)
s32i a3, a2, PT_AREG3
#ifdef CONFIG_SMP /* * Check if any coprocessor context is live on another CPU * and if so go through the C-level coprocessor exception handler * to flush it to memory.
*/
GET_THREAD_INFO (a0, a2)
l32i a3, a0, THREAD_CPENABLE
beqz a3, .Lload_local
/* * Pairs with smp_wmb in local_coprocessor_release_all * and with both memws below.
*/
memw
l32i a3, a0, THREAD_CPU
l32i a0, a0, THREAD_CP_OWNER_CPU
beq a0, a3, .Lload_local
/* * Enable coprocessor for the new owner. (a2 = 1 << CP number) * This can be done before loading context into the coprocessor.
*/
l32i a4, a9, THREAD_CPENABLE
or a4, a4, a2
/* * Make sure THREAD_CP_OWNER_CPU is in memory before updating * THREAD_CPENABLE
*/
memw # (2)
s32i a4, a9, THREAD_CPENABLE
/* * Make sure coprocessor context and THREAD_CP_OWNER_CPU are in memory * before updating THREAD_CPENABLE
*/
memw # (3)
s32i a10, a8, THREAD_CPENABLE
1: /* Get context save area and call load routine. */
/* * coprocessor_flush(struct thread_info*, index) * a2 a3 * * Save coprocessor registers for coprocessor 'index'. * The register values are saved to or loaded from the coprocessor area * inside the task_info structure. * * Note that this function doesn't update the coprocessor_owner information! *
*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.