/* SPDX-License-Identifier: GPL-2.0-only */ /* * Spinlock support for the Hexagon architecture * * Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
*/
/* * This file is pulled in for SMP builds. * Really need to check all the barrier stuff for "true" SMP
*/
/* * Read locks: * - load the lock value * - increment it * - if the lock value is still negative, go back and try again. * - unsuccessful store is unsuccessful. Go back and try again. Loser. * - successful store new lock value if positive -> lock acquired
*/ staticinlinevoid arch_read_lock(arch_rwlock_t *lock)
{
__asm__ __volatile__( "1: R6 = memw_locked(%0);\n" " { P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n" " { if (!P3) jump 1b; }\n" " memw_locked(%0,P3) = R6;\n" " { if (!P3) jump 1b; }\n"
:
: "r" (&lock->lock)
: "memory", "r6", "p3"
);
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.