Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jul 2015 18:40:53 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Justin Hibbits <jhibbits@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r285227 - head/sys/powerpc/powerpc
Message-ID:  <20150707174511.I1878@besplex.bde.org>
In-Reply-To: <201507070237.t672bToa061000@repo.freebsd.org>
References:  <201507070237.t672bToa061000@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 7 Jul 2015, Justin Hibbits wrote:

> Log:
>  style(9) cleanups.
>
>  Don't use PRIxPTR, these registers are 32-bits, cast to u_long instead.
>
>  Pointed out by:	bde

Thanks.

This could actually cast to u_int if values are really 32 bits even
when the arch is 64 bits.  I don't know if that is the best way to
think of them.

Registers smaller than the arch width are rare.  x86 has some for
segment registers.  These are 16 bits, and I think of them like that.
The difference actually causes minor problems: when you push these
registers or move them to a wider integer register, they get extended
in unclear MD ways.  I don't like some recent changes that pessimize
the pushes of segment registers to pushs of $0 followed by a 16-bit
store.  This pessimizes code that is executed on every entry to the
kernel, to do little more than fix printing of the registers in
debuggers.  Uninitialized bits should be part of the ABI, and printing
routines should cast to uint16_t to remove them.  Better ABIs would
only use 16 bits for them, and pack them in structs, but it is
convenient to use register_t for all registers, and not pack trap
frames.

Several bad examples of PRI* remain.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150707174511.I1878>