|
From: | Michael Schulze |
Subject: | Re: [avr-libc-dev] Interrupt vector redirection scheme |
Date: | Tue, 04 Sep 2007 09:20:58 +0200 |
User-agent: | Thunderbird 1.5.0.12 (X11/20070719) |
Dmitry K. wrote:
I can't see a discrepancy. I save the SREG and restore it at the end of the function, because of the called function could it change. However, the interrupt have to ensure that the state of all registers is the same like before.On Monday 03 September 2007 19:59, Michael Schulze wrote:Hi,Very interesting idea. Though there is a discrepancy: function redir_func() keeps the SREG already after it is scratched (sbiw, eor).I can't find the definition of that function. Where is it defined?Your file redirvec.S: redir_func: sbiw ZL, 0 ; test for zero ... eor r1, r1 ; clear zero register, as assumed to ... in r0, _SFR_IO_ADDR(SREG) ; load status. SREG is a SFR macro push r0 ; save loaded status. Assumes irqs are
Yes, correct. We have a system that executes different applications on top of a small HAL and middleware, which resides at the start of the flash. This region should not be flashed ever, because it can act as a boot loader or is used for recovery. That's the reason why we don't want to flash the lower parts of the flash. And if we want to support the application with ISRs, we have to redirect it.[...]You have a very thin HAL or small operating system which offers the possibility of loading and executing of different applications (one at a time) depending on the actual state or environment.[...] Aha, I have understood. Yes, it is an absolutely other level of program design. The simplest decision with the 'if' operator is not so convinient here.
Regards, Michael
[Prev in Thread] | Current Thread | [Next in Thread] |