/* * S32C1I selftest. * * 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) 2016 Cadence Design Systems Inc.
*/
/* * Basic atomic compare-and-swap, that records PC of S32C1I for probing. * * If *v == cmp, set *v = set. Return previous *v.
*/ staticinlineint probed_compare_swap(int *v, int cmp, int set)
{ int tmp;
/* First try an S32C1I that does not store: */
rcw_exc = 0;
rcw_word = 1;
n = probed_compare_swap(&rcw_word, 0, 2);
cause1 = rcw_exc;
/* took exception? */ if (cause1 != 0) { /* unclean exception? */ if (n != 2 || rcw_word != 1)
panic("S32C1I exception error");
} elseif (rcw_word != 1 || n != 1) {
panic("S32C1I compare error");
}
/* Then an S32C1I that stores: */
rcw_exc = 0;
rcw_word = 0x1234567;
n = probed_compare_swap(&rcw_word, 0x1234567, 0xabcde);
cause2 = rcw_exc;
if (cause2 != 0) { /* unclean exception? */ if (n != 0xabcde || rcw_word != 0x1234567)
panic("S32C1I exception error (b)");
} elseif (rcw_word != 0xabcde || n != 0x1234567) {
panic("S32C1I store error");
}
/* Verify consistency of exceptions: */ if (cause1 || cause2) {
pr_warn("S32C1I took exception %d, %d\n", cause1, cause2); /* If emulation of S32C1I upon bus error gets implemented, * we can get rid of this panic for single core (not SMP)
*/
panic("S32C1I exceptions not currently supported");
} if (cause1 != cause2)
panic("inconsistent S32C1I exceptions");
/* This condition should not occur with a commercially deployed processor. * Display reminder for early engr test or demo chips / FPGA bitstreams
*/ staticint __init check_s32c1i(void)
{
pr_warn("Processor configuration lacks atomic compare-and-swap support!\n"); return 0;
}
#endif/* XCHAL_HAVE_S32C1I */
early_initcall(check_s32c1i);
Messung V0.5
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
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.