When reentrant hw mult is desired, core multiplication commands
(mov with registers 0130...013E)
need to be protected from being interrupted by wrapping
dint
eint
assembly commands.
Since this should not add to much isr latency, the best
way of inserting these dint and eint is directly into
the "__muldi3:"
0000a908 <__muldi3>:
a908: 04 12 push r4 ;
a90a: 05 12 push r5 ;
a90c: 06 12 push r6 ;
a90e: 07 12 push r7 ;
a910: 08 12 push r8 ;
a912: 09 12 push r9 ;
a914: 0a 12 push r10 ;
a916: 0b 12 push r11 ;
a918: 14 41 12 00 mov 18(r1), r4 ;
a91c: 15 41 14 00 mov 20(r1), r5 ;
a920: 16 41 16 00 mov 22(r1), r6 ;
a924: 17 41 18 00 mov 24(r1), r7 ;
a928: 82 4c 30 01 mov r12, &0x0130 ;
a92c: 82 44 38 01 mov r4, &0x0138 ;
a930: 18 42 3a 01 mov &0x013a,r8 ;0x013a
a934: 92 42 3c 01 mov &0x013c,&0x013a ;0x013c
a938: 3a 01
a93a: 92 42 3e 01 mov &0x013e,&0x013c ;0x013e
a93e: 3c 01
a940: 82 4c 34 01 mov r12, &0x0134 ;
a944: 82 45 38 01 mov r5, &0x0138 ;
a948: 82 4d 34 01 mov r13, &0x0134 ;
a94c: 82 44 38 01 mov r4, &0x0138 ;
a950: 19 42 3a 01 mov &0x013a,r9 ;0x013a
a954: 92 42 3c 01 mov &0x013c,&0x013a ;0x013c
a958: 3a 01
a95a: 92 42 3e 01 mov &0x013e,&0x013c ;0x013e
a95e: 3c 01
a960: 82 45 38 01 mov r5, &0x0138 ;
a964: 82 4c 34 01 mov r12, &0x0134 ;
a968: 82 46 38 01 mov r6, &0x0138 ;
a96c: 82 4e 34 01 mov r14, &0x0134 ;
a970: 82 44 38 01 mov r4, &0x0138 ;
a974: 1a 42 3a 01 mov &0x013a,r10 ;0x013a
a978: 92 42 3c 01 mov &0x013c,&0x013a ;0x013c
a97c: 3a 01
a97e: 82 45 38 01 mov r5, &0x0138 ;
a982: 82 4c 34 01 mov r12, &0x0134 ;
a986: 82 47 38 01 mov r7, &0x0138 ;
a98a: 82 4d 34 01 mov r13, &0x0134 ;
a98e: 82 46 38 01 mov r6, &0x0138 ;
a992: 82 4f 34 01 mov r15, &0x0134 ;
a996: 82 44 38 01 mov r4, &0x0138 ;
a99a: 1b 42 3a 01 mov &0x013a,r11 ;0x013a
a99e: 0c 48 mov r8, r12 ;
a9a0: 0d 49 mov r9, r13 ;
a9a2: 0e 4a mov r10, r14 ;
a9a4: 0f 4b mov r11, r15 ;
a9a6: 3b 41 pop r11 ;
a9a8: 3a 41 pop r10 ;
a9aa: 39 41 pop r9 ;
a9ac: 38 41 pop r8 ;
a9ae: 37 41 pop r7 ;
a9b0: 36 41 pop r6 ;
a9b2: 35 41 pop r5 ;
a9b4: 34 41 pop r4 ;
a9b6: 30 41 ret
Is there any way to generate the reentrant capable hw multiplication code
automatically (compiler switch, etc.)?
Else, where to find the source code to this __muldi3 (module libfp.a)?
Best regards, Volker.