[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] Suggested ISR function
From: |
Björn Haase |
Subject: |
Re: [avr-libc-dev] Suggested ISR function |
Date: |
Fri, 9 Sep 2005 12:18:25 +0200 |
User-agent: |
KMail/1.7.1 |
James A.R. Koehler wrote on Donnerstag, 8. September 2005 18:19 :
> I'd vote for depreciating both SIGNAL and INTERRUPT in favour of ISR.
> Indeed, I'd go further and suggest that it intrinsically be the given
> the attribute of '__naked__' as, for the life of me, I can't see why it
> is useful to have r0 and r1 set every time an interrupt occurs.
IMO, using __naked__ is no solution a good idea. It is almost sure that it
will break your code if you are writing a C-Function since you never know
which registers you would have to save.
Handling r0 and r1 is necessary because given the structure of the compiler,
the back-end never knows if an operation relies on __zero_reg__ to be zero or
not or if the __tmp_reg__ is modified. In order to guarantee this, one needs
to make sure that they are not clobbered. Maybe within half a year we will be
having an improvement.
Also r0/r1 is not the only problem. One would also need to teach the register
allocator to work with as few registers as possible. Presently the register
allocator does not try to avoid to use an additional call-clobbered register,
IIUC.
Yours,
Bjoern