Fix some AVR context save errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3704 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
c1a208af8b
commit
6b09d97765
@ -377,7 +377,7 @@ void usart1_configure(void)
|
|||||||
#elif CONFIG_USART1_BITS == 8
|
#elif CONFIG_USART1_BITS == 8
|
||||||
ucsr1c |= ((1 << UCSZ10) | (1 << UCSZ11));
|
ucsr1c |= ((1 << UCSZ10) | (1 << UCSZ11));
|
||||||
#elif CONFIG_USART1_BITS == 9
|
#elif CONFIG_USART1_BITS == 9
|
||||||
ucsr1c |= (U(1 << CSZ10) | (1 << UCSZ11));
|
ucsr1c |= ((1 << CSZ10) | (1 << UCSZ11));
|
||||||
ucsr1b |= (1 << UCSZ12);
|
ucsr1b |= (1 << UCSZ12);
|
||||||
#else
|
#else
|
||||||
# error "Unsupported word size"
|
# error "Unsupported word size"
|
||||||
|
@ -150,34 +150,36 @@
|
|||||||
* handler.
|
* handler.
|
||||||
*
|
*
|
||||||
* On Entry:
|
* On Entry:
|
||||||
* r0 - has already been pushed onto the stack and now holds the IRQ number
|
* r24 - has already been pushed onto the stack and now holds the IRQ number
|
||||||
* sp - Points to the top of the stack
|
* sp - Points to the top of the stack
|
||||||
* Only the stack is available for storage
|
* Only the stack is available for storage
|
||||||
*
|
*
|
||||||
* PCL
|
* PCL
|
||||||
* PCH
|
* PCH
|
||||||
* R0
|
* R24
|
||||||
* --- <- SP
|
* --- <- SP
|
||||||
*
|
*
|
||||||
* At completion:
|
* At completion:
|
||||||
* Register state is saved on the stack; All registers are available for usage except sp.
|
* Register state is saved on the stack; All registers are available for usage except sp and
|
||||||
|
* r24 which still contains the IRQ number as set by the HANDLER macro.
|
||||||
*
|
*
|
||||||
********************************************************************************************/
|
********************************************************************************************/
|
||||||
|
|
||||||
.macro EXCPT_PROLOGUE
|
.macro EXCPT_PROLOGUE
|
||||||
|
|
||||||
/* Save R1 - The zero register (but might not be zero) */
|
/* Save R0 -- the scratch register */
|
||||||
|
|
||||||
push r1
|
push r0
|
||||||
|
|
||||||
/* Save the status register on the stack */
|
/* Save the status register on the stack */
|
||||||
|
|
||||||
in r1, __SREG__ /* Save the status register */
|
in r0, __SREG__ /* Save the status register */
|
||||||
cli /* Disable interrupts */
|
cli /* Disable interrupts */
|
||||||
|
push r0
|
||||||
|
|
||||||
|
/* Save R1 -- the zero register (which may not be zero). R1 must be zero for our purposes */
|
||||||
|
|
||||||
push r1
|
push r1
|
||||||
|
|
||||||
/* R1 must be zero for our purposes */
|
|
||||||
|
|
||||||
clr r1
|
clr r1
|
||||||
|
|
||||||
/* Save r2-r17 - Call-saved, "static" registers */
|
/* Save r2-r17 - Call-saved, "static" registers */
|
||||||
@ -230,12 +232,12 @@
|
|||||||
* it was on entry into this macro. We'll have to subtract to get that value.
|
* it was on entry into this macro. We'll have to subtract to get that value.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
in r24, __SP_L__
|
in r26, __SP_L__
|
||||||
in r25, __SP_H__
|
in r27, __SP_H__
|
||||||
adiw r24, XCPTCONTEXT_REGS
|
adiw r26, XCPTCONTEXT_REGS
|
||||||
|
|
||||||
push r24
|
push r26
|
||||||
push r25
|
push r27
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
/********************************************************************************************
|
/********************************************************************************************
|
||||||
|
Loading…
Reference in New Issue
Block a user