From: mpi Date: Fri, 23 Jun 2017 09:55:10 +0000 (+0000) Subject: Unbreak profiling assembly functions in userland by defining the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f5d1667bf0e24058e36dad81d4697d95de6d4192;p=openbsd Unbreak profiling assembly functions in userland by defining the correct prologue if compiled with -DPROF. ok deraadt@ --- diff --git a/sys/arch/amd64/include/asm.h b/sys/arch/amd64/include/asm.h index 989f98e5fc5..26156035ca3 100644 --- a/sys/arch/amd64/include/asm.h +++ b/sys/arch/amd64/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.6 2015/05/13 05:29:57 uebayasi Exp $ */ +/* $OpenBSD: asm.h,v 1.7 2017/06/23 09:55:10 mpi Exp $ */ /* $NetBSD: asm.h,v 1.2 2003/05/02 18:05:47 yamt Exp $ */ /*- @@ -85,7 +85,7 @@ #endif -#ifdef GPROF +#if defined(PROF) || defined(GPROF) # define _PROF_PROLOGUE \ pushq %rbp; leaq (%rsp),%rbp; call PIC_PLT(__mcount); popq %rbp #else diff --git a/sys/arch/arm/include/asm.h b/sys/arch/arm/include/asm.h index 339564c1e18..bc48fe6e23e 100644 --- a/sys/arch/arm/include/asm.h +++ b/sys/arch/arm/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.7 2016/09/21 11:33:05 kettenis Exp $ */ +/* $OpenBSD: asm.h,v 1.8 2017/06/23 09:55:10 mpi Exp $ */ /* $NetBSD: asm.h,v 1.4 2001/07/16 05:43:32 matt Exp $ */ /* @@ -64,7 +64,7 @@ #define _ENTRY(x) \ .text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x: -#ifdef GPROF +#if defined(PROF) || defined(GPROF) # define _PROF_PROLOGUE \ mov ip, lr; bl __mcount #else diff --git a/sys/arch/arm64/include/asm.h b/sys/arch/arm64/include/asm.h index 1aacb7fc68e..84afdbfc29f 100644 --- a/sys/arch/arm64/include/asm.h +++ b/sys/arch/arm64/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.1 2016/12/17 23:38:33 patrick Exp $ */ +/* $OpenBSD: asm.h,v 1.2 2017/06/23 09:55:10 mpi Exp $ */ /* $NetBSD: asm.h,v 1.4 2001/07/16 05:43:32 matt Exp $ */ /* @@ -72,7 +72,7 @@ #define _ENTRY(x) \ .text; _ALIGN_TEXT; .globl x; .type x,_ASM_TYPE_FUNCTION; x: -#ifdef GPROF +#if defined(PROF) || defined(GPROF) # define _PROF_PROLOGUE \ stp x29, x30, [sp, #-16]!; \ mov fp, sp; \ diff --git a/sys/arch/hppa/include/asm.h b/sys/arch/hppa/include/asm.h index bac790a7631..1ca875cb8a2 100644 --- a/sys/arch/hppa/include/asm.h +++ b/sys/arch/hppa/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.18 2013/03/28 17:41:04 martynas Exp $ */ +/* $OpenBSD: asm.h,v 1.19 2017/06/23 09:55:10 mpi Exp $ */ /* * Copyright (c) 1990,1991,1994 The University of Utah and @@ -225,7 +225,7 @@ tf4 .reg %fr8 #define __CONCAT(a,b) a/**/b #endif -#ifdef PROF +#if defined(PROF) || defined(GPROF) #define _PROF_PROLOGUE !\ 1: !\ stw rp, HPPA_FRAME_CRP(sr0,sp) !\ diff --git a/sys/arch/powerpc/include/asm.h b/sys/arch/powerpc/include/asm.h index 9d397259f29..532c2f1adb9 100644 --- a/sys/arch/powerpc/include/asm.h +++ b/sys/arch/powerpc/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.12 2015/08/30 10:19:49 guenther Exp $ */ +/* $OpenBSD: asm.h,v 1.13 2017/06/23 09:55:10 mpi Exp $ */ /* $NetBSD: asm.h,v 1.1 1996/09/30 16:34:20 ws Exp $ */ /* @@ -72,7 +72,7 @@ #define _ENTRY(x) \ .text; .align 2; .globl x; .type x,@function; x: -#ifdef PROF +#if defined(PROF) || defined(GPROF) # define _PROF_PROLOGUE(y) \ .section ".data"; \ .align 2; \ diff --git a/sys/arch/sh/include/asm.h b/sys/arch/sh/include/asm.h index 3429ba67bc8..01468d29e7b 100644 --- a/sys/arch/sh/include/asm.h +++ b/sys/arch/sh/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.5 2016/05/27 16:32:38 deraadt Exp $ */ +/* $OpenBSD: asm.h,v 1.6 2017/06/23 09:55:10 mpi Exp $ */ /* $NetBSD: asm.h,v 1.25 2006/01/20 22:02:40 christos Exp $ */ /*- @@ -61,7 +61,7 @@ .type x,@function ;\ x: -#ifdef GPROF +#if defined(PROF) || defined(GPROF) #define _PROF_PROLOGUE \ mov.l 1f,r1 ; \ mova 2f,r0 ; \ diff --git a/sys/arch/sparc64/include/asm.h b/sys/arch/sparc64/include/asm.h index ac3c003a8fb..21fda1a9c8d 100644 --- a/sys/arch/sparc64/include/asm.h +++ b/sys/arch/sparc64/include/asm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asm.h,v 1.11 2016/09/25 14:58:00 fcambus Exp $ */ +/* $OpenBSD: asm.h,v 1.12 2017/06/23 09:55:10 mpi Exp $ */ /* $NetBSD: asm.h,v 1.15 2000/08/02 22:24:39 eeh Exp $ */ /* @@ -81,7 +81,7 @@ #define _ENTRY(name) \ .align 4; .globl name; .proc 1; FTYPE(name); name: -#ifdef GPROF +#if defined(PROF) || defined(GPROF) #define _PROF_PROLOGUE \ .data; .align 8; 1: .uaword 0; .uaword 0; \ .text; save %sp,-CC64FSZ,%sp; sethi %hi(1b),%o0; call _mcount; \