Enable LR/SC tests, even for uniprocessors
[riscv-tests.git] / isa / rv64ui / lrsc.S
index b3544f44a3559aff01b24171fdda940a07dadcbe..9422739c6c5b6768617ad93459434916c1c22148 100644 (file)
@@ -1,3 +1,5 @@
+# See LICENSE for license details.
+
 #*****************************************************************************
 # lrsr.S
 #-----------------------------------------------------------------------------
 RVTEST_RV64U
 RVTEST_CODE_BEGIN
 
-# wait for all cores to boot
+# get a unique core id
 la a0, coreid
 li a1, 1
 amoadd.w a2, a1, (a0)
-lw a3, 4(x0)
+
+# for now, only run this on core 0
+1:li a3, 1
+bgeu a2, a3, 1b
+
 1: lw a1, (a0)
-blt a1, a3, 1b
+bltu a1, a3, 1b
 
 # make sure that sc without a reservation fails.
 TEST_CASE( 2, a4, 1, \
@@ -26,6 +32,7 @@ TEST_CASE( 2, a4, 1, \
 )
 
 # make sure that sc with the wrong reservation fails.
+# TODO is this actually mandatory behavior?
 TEST_CASE( 3, a4, 1, \
   la a0, foo; \
   add a1, a0, 1024; \