[PATCH 2/3] [v4] ARM64: TTY: hvc_dcc: Add support for ARM64 dcc
sboyd at codeaurora.org
sboyd at codeaurora.org
Mon Aug 24 16:51:44 PDT 2015
On 08/19, Dave Martin wrote:
> On Wed, Aug 19, 2015 at 11:16:52AM -0500, Timur Tabi wrote:
> > On 08/19/2015 05:14 AM, Dave Martin wrote:
> > >>>So does that mean that ldrb will zero-extend the byte to all 64 bits of x3?
> > >Yes. No extra operation is required.
> >
> > So my patch is actually correct as-is?
>
> +static inline void __dcc_putchar(char c)
> +{
> + asm volatile("msr dbgdtrtx_el0, %0"
> + : /* No output register */
> + : "r" (c));
>
> For safety, you still need to make sure that c is appropriately masked
> before passing it to the asm. Something like this should definitely be
> safe:
>
> : "r" ((unsigned long)(unsigned char)c)
>
> GCC can then emit uxtb or not, depending on whether it's needed in each
> context where the asm is inlined.
Does this mean we ought to do the same thing in the arm header
file too?
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
More information about the linux-arm-kernel
mailing list