Moved the definition of the machine-independent macro UNITS_TO_CODE
from <number of machines> machine-dependent headers to the one non-header here it is used so that it is easier to fix. This macro just divides the machine-dependent offset OFFSET_OF_CODE by the machine-independent scale factor sizeof(UNIT), as required for bug for bug compatibility with the scaling of pc's in gprof.c. UNIT is the type of a profiling counter, and its size has nothing to do with the correct scale factor except both are usually 2.
This commit is contained in:
parent
9fe42a4fee
commit
118c70fed9
@ -31,6 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)i386.h 8.1 (Berkeley) 6/6/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -38,7 +39,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 0
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
enum opermodes { dummy };
|
||||
typedef enum opermodes operandenum;
|
||||
|
@ -31,6 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)i386.h 8.1 (Berkeley) 6/6/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -38,7 +39,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 0
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
enum opermodes { dummy };
|
||||
typedef enum opermodes operandenum;
|
||||
|
@ -48,6 +48,8 @@ static const char rcsid[] =
|
||||
#include <err.h>
|
||||
#include "gprof.h"
|
||||
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
static int valcmp(const void *, const void *);
|
||||
|
||||
|
||||
|
@ -87,6 +87,8 @@ typedef int64_t UNIT;
|
||||
#else
|
||||
typedef u_short UNIT; /* unit of profiling */
|
||||
#endif
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
char *a_outname;
|
||||
#define A_OUTNAME "a.out"
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)hp300.h 8.1 (Berkeley) 6/6/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -38,7 +39,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 0
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
enum opermodes { dummy };
|
||||
typedef enum opermodes operandenum;
|
||||
|
@ -31,6 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)i386.h 8.1 (Berkeley) 6/6/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -38,7 +39,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 0
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
enum opermodes { dummy };
|
||||
typedef enum opermodes operandenum;
|
||||
|
@ -39,7 +39,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 0
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
enum opermodes { dummy };
|
||||
typedef enum opermodes operandenum;
|
||||
|
@ -37,6 +37,7 @@
|
||||
* @(#)mips.h 8.1 (Berkeley) 6/6/93
|
||||
*
|
||||
* From: @(#)sparc.h 5.1 (Berkeley) 7/8/92
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -44,7 +45,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 0
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
enum opermodes { dummy };
|
||||
typedef enum opermodes operandenum;
|
||||
|
@ -35,6 +35,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)sparc.h 8.1 (Berkeley) 6/6/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -42,7 +43,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 0
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
enum opermodes { dummy };
|
||||
typedef enum opermodes operandenum;
|
||||
|
@ -31,6 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)tahoe.h 8.1 (Berkeley) 6/6/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -43,7 +44,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 2
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
/*
|
||||
* register for pc relative addressing
|
||||
|
@ -31,6 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vax.h 8.1 (Berkeley) 6/6/93
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -43,7 +44,6 @@
|
||||
* (see asgnsamples for use and explanation.)
|
||||
*/
|
||||
#define OFFSET_OF_CODE 2
|
||||
#define UNITS_TO_CODE (OFFSET_OF_CODE / sizeof(UNIT))
|
||||
|
||||
/*
|
||||
* register for pc relative addressing
|
||||
|
Loading…
Reference in New Issue
Block a user