lkml.org 
[lkml]   [2012]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] hvc_dcc : add support to armv4 and armv5 core
Date
On Tuesday 25 September 2012, Matthieu CASTET wrote:
> > static inline char __dcc_getchar(void)
> > {
> > char __c;
> >
> > if (__LINUX_ARM_ARCH >= 6)
> > asm volatile("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
> > : "=r" (__c));
> > else
> > asm volatile ("mrc p14, 0, %0, c1, c0 @ read comms data reg"
> > : "=r" (ret));
> > isb();
> >
> > return __c;
> > }
> >
> > Arnd
> >
> Yes doing that will be great!
>
> But Alan wanted "all be runtime handled".
>
> May be we can do something like:
>
>
> static int cpu_arch;
>
> static inline char __dcc_getchar(void)
> {
> char __c;
>
> if (cpu_arch >= 6)
> asm volatile("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
> : "=r" (__c));
> else
> asm volatile ("mrc p14, 0, %0, c1, c0 @ read comms data reg"
> : "=r" (ret));
> isb();
>
> return __c;
> }

It's not possible to build a kernel that runs on ARMv5 (or below) and also on
ARMv6 (or above), so the effect would be exactly the same. While we are putting
a lot of effort into making all sorts of ARMv6 and ARMv7 based systems work
with the same kernel binary, it's highly unlikely we would ever need the
above to be runtime selected, because there are a lot of other differences
at assembly level.

Arnd



\
 
 \ /
  Last update: 2012-09-25 20:01    [W:0.044 / U:1.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site