Re: [RFC PATCH v3 14/35] drivers/irqchip: Add SH7751 Internal INTC drivers.

Geert Uytterhoeven <[email protected]>
Newsgroups gmane.linux.ports.sh.devel
Message-ID <CAMuHMdVZaaoD8HEYzOSDjZBXiGj2M9srFHewfO=YrfgF-zc5aQ@mail.gmail.com>
On Wed, Oct 18, 2023 at 10:02 AM Thomas Gleixner <[email protected]> wrote:
> On Sat, Oct 14 2023 at 23:53, Yoshinori Sato wrote:
> > +config RENESAS_SH7751_INTC
> > +     bool "Renesas SH7751 Interrupt Controller"
> > +     depends on SH_DEVICE_TREE || COMPILE_TEST

> > +static inline void set_interrupt_registers(int ip)
> > +{
> > +     unsigned long __dummy;
> > +
> > +     asm volatile(
> > +#ifdef CONFIG_CPU_HAS_SR_RB
> > +                  "ldc       %2, r6_bank\n\t"
> > +#endif
> > +                  "stc       sr, %0\n\t"
> > +                  "and       #0xf0, %0\n\t"
> > +                  "shlr2     %0\n\t"
> > +                  "cmp/eq    #0x3c, %0\n\t"
> > +                  "bt/s      1f      ! CLI-ed\n\t"
> > +                  " stc      sr, %0\n\t"
> > +                  "and       %1, %0\n\t"
> > +                  "or        %2, %0\n\t"
> > +                  "ldc       %0, sr\n"
> > +                  "1:"
> > +                  : "=&z" (__dummy)
> > +                  : "r" (~0xf0), "r" (ip << 4)
> > +                  : "t");
>
> Why has this to be ASM and cannot be done in C with the existing
> accessors? Also this really lacks a comment what this is actually doing.

This will play not very well with the "|| COMPILE_TEST" ;-)

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.