From owner-cvs-all@FreeBSD.ORG Fri Aug 27 19:42:35 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C35E16A4CE; Fri, 27 Aug 2004 19:42:35 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7435043D70; Fri, 27 Aug 2004 19:42:35 +0000 (GMT) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i7RJgZXI072836; Fri, 27 Aug 2004 19:42:35 GMT (envelope-from marcel@repoman.freebsd.org) Received: (from marcel@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i7RJgZbN072835; Fri, 27 Aug 2004 19:42:35 GMT (envelope-from marcel) Message-Id: <200408271942.i7RJgZbN072835@repoman.freebsd.org> From: Marcel Moolenaar Date: Fri, 27 Aug 2004 19:42:35 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/alpha/include profile.h src/sys/amd64/include profile.h src/sys/arm/include profile.h src/sys/i386/include profile.h src/sys/ia64/include profile.h src/sys/powerpc/include profile.h src/sys/sparc64/include profile.h src/sys/libkern ... X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2004 19:42:35 -0000 marcel 2004-08-27 19:42:35 UTC FreeBSD src repository Modified files: sys/alpha/include profile.h sys/amd64/include profile.h sys/arm/include profile.h sys/i386/include profile.h sys/ia64/include profile.h sys/powerpc/include profile.h sys/sparc64/include profile.h sys/libkern mcount.c Log: Move the kernel-specific logic to adjust frompc from MI to MD. For these two reasons: 1. On ia64 a function pointer does not hold the address of the first instruction of a functions implementation. It holds the address of a function descriptor. Hence the user(), btrap(), eintr() and bintr() prototypes are wrong for getting the actual code address. 2. The logic forces interrupt, trap and exception entry points to be layed-out contiguously. This can not be achieved on ia64 and is generally just bad programming. The MCOUNT_FROMPC_USER macro is used to set the frompc argument to some kernel address which represents any frompc that falls outside the kernel text range. The macro can expand to ~0U to bail out in that case. The MCOUNT_FROMPC_INTR macro is used to set the frompc argument to some kernel address to represent a call to a trap or interrupt handler. This to avoid that the trap or interrupt handler appear to be called from everywhere in the call graph. The macro can expand to ~0U to prevent adjusting frompc. Note that the argument is selfpc, not frompc. This commit defines the macros on all architectures equivalently to the original code in sys/libkern/mcount.c. People can take it from here... Compile-tested on: alpha, amd64, i386, ia64 and sparc64 Boot-tested on: i386 Revision Changes Path 1.7 +21 -5 src/sys/alpha/include/profile.h 1.42 +13 -0 src/sys/amd64/include/profile.h 1.4 +13 -0 src/sys/arm/include/profile.h 1.38 +13 -0 src/sys/i386/include/profile.h 1.11 +15 -0 src/sys/ia64/include/profile.h 1.23 +21 -33 src/sys/libkern/mcount.c 1.3 +14 -0 src/sys/powerpc/include/profile.h 1.7 +13 -0 src/sys/sparc64/include/profile.h