Multiplication while keeping interrupts disabled

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Multiplication while keeping interrupts disabled

Postby ralisi » Thu Nov 13, 2014 7:54 pm

Hello,

I have a section of code where I need to have all interrupts disabled. Within this section, I want to do a multiplication. In order to do this multiplication, the function ___muldi3 is automatically called. This function has two sections where interrupts are temporarily disabled. While this makes sense in general, the later "gie"-instruction breaks my code.

Is there some compiler attribute to prevent the usage of code that will enable interrupts against my will or do I need to replace that function with something that checks if interrupts are actally disabled?

best regards
Raphael
ralisi
 
Posts: 15
Joined: Fri Apr 11, 2014 12:00 pm

Re: Multiplication while keeping interrupts disabled

Postby notzed » Fri Nov 14, 2014 3:43 am

You're supposed to be able to use an attribute (__attribute__((disinterrupt)) iirc, it's in the epiphany section of the gcc manual) on a function to block interrupts for the whole function, but I've seen it not work even without calling other functions. Try it I guess.

Of course, assembly is always an option: where you have full control, or find a way to move the multiply outside of the critical section.
notzed
 
Posts: 331
Joined: Mon Dec 17, 2012 12:28 am
Location: Australia


Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 23 guests

cron