From owner-svn-src-all@freebsd.org Thu Aug 22 21:43:24 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 464EED370E; Thu, 22 Aug 2019 21:43:24 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DyhD0HhTz3y5M; Thu, 22 Aug 2019 21:43:24 +0000 (UTC) (envelope-from kevans@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B772CA7BC; Thu, 22 Aug 2019 21:43:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x7MLhNOV041518; Thu, 22 Aug 2019 21:43:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x7MLhMhS041510; Thu, 22 Aug 2019 21:43:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201908222143.x7MLhMhS041510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 22 Aug 2019 21:43:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r351409 - in head: lib/libc/mips/gen lib/libproc lib/libthread_db/arch/mips sys/mips/include tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: lib/libc/mips/gen lib/libproc lib/libthread_db/arch/mips sys/mips/include tests/sys/kern X-SVN-Commit-Revision: 351409 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Aug 2019 21:43:24 -0000 Author: kevans Date: Thu Aug 22 21:43:21 2019 New Revision: 351409 URL: https://svnweb.freebsd.org/changeset/base/351409 Log: mips: hide regnum definitions behind _KERNEL/_WANT_MIPS_REGNUM machine/regnum.h ends up being included by sys/procfs.h and sys/ptrace.h via machine/reg.h. Many of the regnum definitions are too short and too generic to be exposing to any userland application including one of these two headers. Moreover, these actively cause build failures in googletest (template expanding to template ). Hide the definitions behind _KERNEL or _WANT_MIPS_REGNUM, and patch all of the userland consumers to define as needed. Discussed with: imp, jhb Reviewed by: imp, jhb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D21330 Modified: head/lib/libc/mips/gen/_setjmp.S head/lib/libc/mips/gen/makecontext.c head/lib/libc/mips/gen/setjmp.S head/lib/libc/mips/gen/sigsetjmp.S head/lib/libproc/proc_regs.c head/lib/libthread_db/arch/mips/libpthread_md.c head/sys/mips/include/regnum.h head/tests/sys/kern/ptrace_test.c Modified: head/lib/libc/mips/gen/_setjmp.S ============================================================================== --- head/lib/libc/mips/gen/_setjmp.S Thu Aug 22 21:42:11 2019 (r351408) +++ head/lib/libc/mips/gen/_setjmp.S Thu Aug 22 21:43:21 2019 (r351409) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include "SYS.h" Modified: head/lib/libc/mips/gen/makecontext.c ============================================================================== --- head/lib/libc/mips/gen/makecontext.c Thu Aug 22 21:42:11 2019 (r351408) +++ head/lib/libc/mips/gen/makecontext.c Thu Aug 22 21:43:21 2019 (r351409) @@ -39,6 +39,7 @@ __RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07 #include #include +#define _WANT_MIPS_REGNUM #include #include Modified: head/lib/libc/mips/gen/setjmp.S ============================================================================== --- head/lib/libc/mips/gen/setjmp.S Thu Aug 22 21:42:11 2019 (r351408) +++ head/lib/libc/mips/gen/setjmp.S Thu Aug 22 21:43:21 2019 (r351409) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") Modified: head/lib/libc/mips/gen/sigsetjmp.S ============================================================================== --- head/lib/libc/mips/gen/sigsetjmp.S Thu Aug 22 21:42:11 2019 (r351408) +++ head/lib/libc/mips/gen/sigsetjmp.S Thu Aug 22 21:43:21 2019 (r351409) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include #if defined(LIBC_SCCS) && !defined(lint) ASMSTR("from: @(#)setjmp.s 8.1 (Berkeley) 6/4/93") ASMSTR("$NetBSD: sigsetjmp.S,v 1.8 2005/09/17 11:49:39 tsutsui Exp $") Modified: head/lib/libproc/proc_regs.c ============================================================================== --- head/lib/libproc/proc_regs.c Thu Aug 22 21:42:11 2019 (r351408) +++ head/lib/libproc/proc_regs.c Thu Aug 22 21:43:21 2019 (r351409) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include +#define _WANT_MIPS_REGNUM #include #include Modified: head/lib/libthread_db/arch/mips/libpthread_md.c ============================================================================== --- head/lib/libthread_db/arch/mips/libpthread_md.c Thu Aug 22 21:42:11 2019 (r351408) +++ head/lib/libthread_db/arch/mips/libpthread_md.c Thu Aug 22 21:43:21 2019 (r351409) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include +#define _WANT_MIPS_REGNUM #include #include #include Modified: head/sys/mips/include/regnum.h ============================================================================== --- head/sys/mips/include/regnum.h Thu Aug 22 21:42:11 2019 (r351408) +++ head/sys/mips/include/regnum.h Thu Aug 22 21:43:21 2019 (r351409) @@ -44,11 +44,15 @@ #ifndef _MACHINE_REGNUM_H_ #define _MACHINE_REGNUM_H_ +#define NUMSAVEREGS 40 +#define NUMFPREGS 34 + /* * Location of the saved registers relative to ZERO. * This must match struct trapframe defined in frame.h exactly. * This must also match regdef.h. */ +#if defined(_KERNEL) || defined(_WANT_MIPS_REGNUM) #define ZERO 0 #define AST 1 #define V0 2 @@ -105,7 +109,6 @@ */ #define IC 38 #define DUMMY 39 /* for 8 byte alignment */ -#define NUMSAVEREGS 40 /* * Pseudo registers so we save a complete set of registers regardless of @@ -164,10 +167,6 @@ #define FSR (FPBASE+32) #define FIR (FPBASE+33) -#define NUMFPREGS 34 - -#define NREGS (NUMSAVEREGS + NUMFPREGS) - /* * Index of FP registers in 'struct frame', relative to the base * of the FP registers in frame (i.e., *not* including the general @@ -207,5 +206,7 @@ #define F31_NUM (31) #define FSR_NUM (32) #define FIR_NUM (33) + +#endif /* _KERNEL || _WANT_MIPS_REGNUM */ #endif /* !_MACHINE_REGNUM_H_ */ Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Thu Aug 22 21:42:11 2019 (r351408) +++ head/tests/sys/kern/ptrace_test.c Thu Aug 22 21:43:21 2019 (r351409) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WANT_MIPS_REGNUM #include #include #include