[llvm-dev] How to add new AVR targets?
Dylan McKay via llvm-dev
llvm-dev at lists.llvm.org
Wed Mar 11 00:13:17 PDT 2020
Here you go Wilhelm,
https://github.com/dylanmckay/clang-avr-libc-interrupt-example
On Thu, Mar 5, 2020 at 4:05 AM Wilhelm Meier <wilhelm.meier at hs-kl.de> wrote:
> Am 04.03.20 um 13:28 schrieb Dylan McKay:
>
> >
> > * *The C/C++ function needs to be declared with either the calling
> > convention avr-interrupt or avr-non-blocking-interrupt.* Skipping
> > this step will cause regular ret instructions to be emitted for
> > return-from-subroutine, instead of the required reti for interrupt
> > handlers. ISRs also have stricter requirements on which registers
> > must not be clobbered after execution, which the backend will handle
> > properly by restoring all clobbered registers in the interrupt
> > handler epilogue
> > * *The symbol names of the ISR function handlers must match those
> > referred to in avr-libc/avr-libgcc/crt*. This is because the ISR
> > table is specified in assembly inside the GCC AVR CRT. The way it
> > works is that the external symbol references in the CRT object files
> > are declared with an exotic linkage type that causes the linker to
> > skip linking of the symbols if they are undefined references. If you
> > chose a custom ISR table in a custom CRT or runtime library, you
> > would be free to choose ISR names as you pleased.
> >
> Thank you for your explanation. But I suspect I didn't get it right. Can
> you please provide an example?
>
> Thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200311/ab94a19c/attachment.html>
More information about the llvm-dev
mailing list