NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-arm/55239: _atomic_cas_8_mp broken on evbarm (armv5)



The following reply was made to PR port-arm/55239; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-arm/55239: _atomic_cas_8_mp broken on evbarm (armv5)
Date: Wed, 6 May 2020 13:11:13 +0200

 Wondering why it uses the MP version on a single CPU machine I found a
 bug in the init section, patch to fix it below.
 
 I'm not committing it right now to make it easier to fix the real issue
 in this PR first.
 
 Martin
 
 Index: atomic_init_testset.c
 ===================================================================
 RCS file: /cvsroot/src/common/lib/libc/atomic/atomic_init_testset.c,v
 retrieving revision 1.16
 diff -u -p -r1.16 atomic_init_testset.c
 --- atomic_init_testset.c	18 Feb 2019 11:22:56 -0000	1.16
 +++ atomic_init_testset.c	6 May 2020 11:08:34 -0000
 @@ -296,30 +296,28 @@ __libc_atomic_init(void)
  		return;
  	if (ncpu > 1)
  		return;
 +
  	if (rasctl(RAS_ADDR(_atomic_cas), RAS_SIZE(_atomic_cas),
  	    RAS_INSTALL) == 0) {
  		_atomic_cas_fn = _atomic_cas_up;
 -		return;
  	}
  
 +
  #ifdef	__HAVE_ATOMIC_CAS_64_UP
  	if (rasctl(RAS_ADDR(_atomic_cas_64), RAS_SIZE(_atomic_cas_64),
  	    RAS_INSTALL) == 0) {
  		_atomic_cas_64_fn = _atomic_cas_64_up;
 -		return;
  	}
  #endif
  
  	if (rasctl(RAS_ADDR(_atomic_cas_16), RAS_SIZE(_atomic_cas_16),
  	    RAS_INSTALL) == 0) {
  		_atomic_cas_16_fn = _atomic_cas_16_up;
 -		return;
  	}
  
  	if (rasctl(RAS_ADDR(_atomic_cas_8), RAS_SIZE(_atomic_cas_8),
  	    RAS_INSTALL) == 0) {
  		_atomic_cas_8_fn = _atomic_cas_8_up;
 -		return;
  	}
  }
  
 


Home | Main Index | Thread Index | Old Index