From owner-svn-src-head@freebsd.org Thu Dec 21 23:39:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBCCDE9362E; Thu, 21 Dec 2017 23:39:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B28617E001; Thu, 21 Dec 2017 23:39:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLNd0cR004112; Thu, 21 Dec 2017 23:39:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLNd0nE004110; Thu, 21 Dec 2017 23:39:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712212339.vBLNd0nE004110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Dec 2017 23:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327074 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 327074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 23:39:02 -0000 Author: kib Date: Thu Dec 21 23:39:00 2017 New Revision: 327074 URL: https://svnweb.freebsd.org/changeset/base/327074 Log: Fix mips build after introduction of MD definitions of atomic_load_64 and atomic_store_64. The MD definitions are provided for LP64 only, while mips also uses them for 32bit and n32. Only define mips variants for 32bit and n32 and change the syntax to match common definitions. Note that this commit does not fix 32bit asm implementation to follow new KBI, this will be fixed later. The functions are only used for 8 byte ddb accesses so the known bug does not prevent normal kernel operations. Sponsored by: The FreeBSD Foundation Modified: head/sys/mips/include/atomic.h head/sys/mips/mips/db_interface.c Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Thu Dec 21 23:08:10 2017 (r327073) +++ head/sys/mips/include/atomic.h Thu Dec 21 23:39:00 2017 (r327074) @@ -342,20 +342,21 @@ atomic_store_rel_##WIDTH(__volatile uint##WIDTH##_t *p ATOMIC_STORE_LOAD(32) ATOMIC_STORE_LOAD(64) #if !defined(__mips_n64) && !defined(__mips_n32) -void atomic_store_64(__volatile uint64_t *, uint64_t *); -void atomic_load_64(__volatile uint64_t *, uint64_t *); -#else +void atomic_store_64(__volatile uint64_t *, uint64_t); +uint64_t atomic_load_64(__volatile uint64_t *); +#elif defined (__mips_n32) static __inline void -atomic_store_64(__volatile uint64_t *p, uint64_t *v) +atomic_store_64(__volatile uint64_t *p, uint64_t v) { - *p = *v; + *p = v; } -static __inline void -atomic_load_64(__volatile uint64_t *p, uint64_t *v) +static __inline uint64_t +atomic_load_64(__volatile uint64_t *p) { - *v = *p; + return (*p); } +/* #else atomic_common.h definitions of atomic_load/store_64 are used */ #endif #undef ATOMIC_STORE_LOAD Modified: head/sys/mips/mips/db_interface.c ============================================================================== --- head/sys/mips/mips/db_interface.c Thu Dec 21 23:08:10 2017 (r327073) +++ head/sys/mips/mips/db_interface.c Thu Dec 21 23:39:00 2017 (r327074) @@ -164,9 +164,9 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat *(uint32_t *)data = *(uint32_t *)addr; break; case 8: - atomic_load_64((volatile u_int64_t *)addr, - (u_int64_t *)data); - break; + *(uint64_t *)data = atomic_load_64( + (void *)addr); + break; } } else { char *src; @@ -207,9 +207,9 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da *(uint32_t *)addr = *(uint32_t *)data; break; case 8: - atomic_store_64((volatile u_int64_t *)addr, - (u_int64_t *)data); - break; + atomic_store_64((uint64_t *)addr, + *(uint64_t *)data); + break; } } else { char *dst;