From 9586f34bf3f97459cd908f092be3507b7a4e1f10 Mon Sep 17 00:00:00 2001 From: Hidetoshi Shimokawa Date: Fri, 16 Jul 1999 06:45:52 +0000 Subject: [PATCH] * Restore register correctly. * Add missing bits for profiling. --- sys/alpha/include/asm.h | 4 ++-- sys/alpha/include/profile.h | 30 +++++++++++++++++++++++++----- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/sys/alpha/include/asm.h b/sys/alpha/include/asm.h index f5044df6277..8be98c10e0c 100644 --- a/sys/alpha/include/asm.h +++ b/sys/alpha/include/asm.h @@ -1,4 +1,4 @@ -/* $Id: asm.h,v 1.1 1998/01/10 22:09:52 jb Exp $ */ +/* $Id: asm.h,v 1.2 1998/06/10 10:54:23 dfr Exp $ */ /* From: NetBSD: asm.h,v 1.18 1997/11/03 04:22:06 ross Exp */ /* @@ -226,7 +226,7 @@ * MCOUNT */ -#ifndef GPROF +#if !defined(GPROF) && !defined(PROF) #define MCOUNT /* nothing */ #else #define MCOUNT \ diff --git a/sys/alpha/include/profile.h b/sys/alpha/include/profile.h index e0eb101b41b..065ae3f090c 100644 --- a/sys/alpha/include/profile.h +++ b/sys/alpha/include/profile.h @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: profile.h,v 1.1.1.1 1998/03/09 05:43:16 jb Exp $ */ /* From: NetBSD: profile.h,v 1.9 1997/04/06 08:47:37 cgd Exp */ /* @@ -30,6 +30,10 @@ #define _MCOUNT_DECL void mcount +#define FUNCTION_ALIGNMENT 32 + +typedef u_long fptrdiff_t; + #if 0 /* * XXX The definition of MCOUNT below is really the following code, run @@ -192,17 +196,18 @@ LX98: ldgp $29,0($27); \ ldq $23, 144($30); \ ldq $24, 152($30); \ ldq $25, 160($30); \ - ldq $25, 160($30); \ ldq $26, 168($30); \ ldq $27, 176($30); \ ldq $29, 184($30); \ \ + ldq $28, 0($30); \ + \ lda $30, 192($30); \ ret $31, ($28), 1; \ \ .end _mcount"); -#ifdef _KERNEL +#ifdef KERNEL /* * The following two macros do splhigh and splx respectively. * _alpha_pal_swpipl is a special version of alpha_pal_swpipl which @@ -210,8 +215,23 @@ LX98: ldgp $29,0($27); \ * * XXX These macros should probably use inline assembly. */ -#define MCOUNT_ENTER \ +#define MCOUNT_ENTER(s) \ s = _alpha_pal_swpipl(ALPHA_PSL_IPL_HIGH) -#define MCOUNT_EXIT \ +#define MCOUNT_EXIT(s) \ (void)_alpha_pal_swpipl(s); +#define MCOUNT_DECL(s) u_long s; +#ifdef GUPROF +struct gmonparam; + +void nullfunc_loop_profiled __P((void)); +void nullfunc_profiled __P((void)); +void startguprof __P((struct gmonparam *p)); +void stopguprof __P((struct gmonparam *p)); +#else +#define startguprof(p) +#define stopguprof(p) +#endif /* GUPROF */ + +#else /* !KERNEL */ +typedef u_long uintfptr_t; #endif