Re: [PATCH 2.6.12-rc1-mm1 3/3] perfctr: 64-bit values in registerdescriptors

From: Stephen Rothwell
Date: Tue Mar 22 2005 - 22:45:46 EST


On Wed, 23 Mar 2005 04:00:03 +0100 (MET) Mikael Pettersson <mikpe@xxxxxxxxx> wrote:
>
> diff -rupN linux-2.6.12-rc1-mm1/include/linux/perfctr.h linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h
> --- linux-2.6.12-rc1-mm1/include/linux/perfctr.h 2005-03-22 21:59:08.000000000 +0100
> +++ linux-2.6.12-rc1-mm1.perfctr-update-common/include/linux/perfctr.h 2005-03-23 02:19:45.000000000 +0100
> @@ -27,10 +27,10 @@ struct vperfctr_control {
> #define VPERFCTR_CONTROL_RESUME 0x03
> #define VPERFCTR_CONTROL_CLEAR 0x04
>
> -/* common description of an arch-specific 32-bit control register */
> +/* common description of an arch-specific control register */
> struct perfctr_cpu_reg {
> __u32 nr;
> - __u32 value;
> + __u64 value;
> };

I don't know if you support 32 bit binaries on x86_64, but if you do (or
intend to), then this structure will need translating. The x86 compiler
aligns 64 bit quantities on 32 bit boundaries (as far as I am aware)
whereas (I am pretty sure) the x86_64 compiler aligns them to 64 bit
boundaries. This is fine for ppc/ppc64 as both align 64bit quantities on
64 bit boundaries.

--
Cheers,
Stephen Rothwell sfr@xxxxxxxxxxxxxxxx
http://www.canb.auug.org.au/~sfr/

Attachment: pgp00000.pgp
Description: PGP signature