diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-08 16:22:50 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-06-08 16:22:50 +0000 |
commit | 583f057b1912513fce544714949e29fbe8bdf253 (patch) | |
tree | 6fa6c2633c96ae9f0267ac9a756de81634ea1500 /nuttx/arch/avr/include | |
parent | b2c3a559c7701728526026fcd64e85d9004715f2 (diff) | |
download | nuttx-583f057b1912513fce544714949e29fbe8bdf253.tar.gz nuttx-583f057b1912513fce544714949e29fbe8bdf253.tar.bz2 nuttx-583f057b1912513fce544714949e29fbe8bdf253.zip |
Add basic context switching logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3682 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/avr/include')
-rw-r--r-- | nuttx/arch/avr/include/at90usb/irq.h | 2 | ||||
-rw-r--r-- | nuttx/arch/avr/include/avr/irq.h | 44 | ||||
-rw-r--r-- | nuttx/arch/avr/include/avr/types.h | 14 |
3 files changed, 47 insertions, 13 deletions
diff --git a/nuttx/arch/avr/include/at90usb/irq.h b/nuttx/arch/avr/include/at90usb/irq.h index c2f9db4e6..8e6412125 100644 --- a/nuttx/arch/avr/include/at90usb/irq.h +++ b/nuttx/arch/avr/include/at90usb/irq.h @@ -63,7 +63,7 @@ #define AT90USB_IRQ_INT5 5 /* 0x000c External Interrupt Request 5 */ #define AT90USB_IRQ_INT6 6 /* 0x000e External Interrupt Request 6 */ #define AT90USB_IRQ_INT7 7 /* 0x0010 External Interrupt Request 7 */ -#define AT90USB_IRQ_PCINT0 8 /* 0x0012 PCINT0 Pin Change Interrupt Request 0 */ +#define AT90USB_IRQ_PCINT0 8 /* 0x0012 Pin Change Interrupt Request 0 */ #define AT90USB_IRQ_USBGEN 9 /* 0x0014 USB General USB General Interrupt request */ #define AT90USB_IRQ_USBEP 10 /* 0x0016 USB Endpoint/Pipe USB ENdpoint/Pipe Interrupt request */ #define AT90USB_IRQ_WDT 11 /* 0x0018 Watchdog Time-out Interrupt */ diff --git a/nuttx/arch/avr/include/avr/irq.h b/nuttx/arch/avr/include/avr/irq.h index 07b875a0a..b387be671 100644 --- a/nuttx/arch/avr/include/avr/irq.h +++ b/nuttx/arch/avr/include/avr/irq.h @@ -52,12 +52,46 @@ ****************************************************************************/ /* Register state save array indices */ - -#define REG_Rx 0 /* Just a placeholder */ -/* Size of the register state save array (in bytes?) */ - -#define XCPTCONTEXT_REGS 1 +#define REG_SPH 0 /* Stack pointer on exception entry */ +#define REG_SPL 1 +#define REG_R27 2 /* r26-r27 */ +#define REG_R26 3 +#define REG_R31 4 /* r18-r31 */ +#define REG_R30 5 +#define REG_R29 6 +#define REG_R28 7 +#define REG_R25 8 /* r25 */ +#define REG_R23 9 /* r2-r23 */ +#define REG_R22 10 +#define REG_R21 11 +#define REG_R20 12 +#define REG_R19 13 +#define REG_R18 14 +#define REG_R17 15 +#define REG_R16 16 +#define REG_R15 17 +#define REG_R14 18 +#define REG_R13 19 +#define REG_R12 20 +#define REG_R11 21 +#define REG_R10 22 +#define REG_R9 23 +#define REG_R8 24 +#define REG_R7 25 +#define REG_R6 26 +#define REG_R5 27 +#define REG_R4 28 +#define REG_R3 29 +#define REG_R2 30 +#define REG_R1 31 /* r1 - the "zero" register */ +#define REG_SREG 32 /* Status register */ +#define REG_R0 33 /* r0 */ +#define REG_R24 34 /* r24 */ + +/* Size of the register state save array (in bytes) */ + +#define XCPTCONTEXT_REGS 35 /**************************************************************************** * Public Types diff --git a/nuttx/arch/avr/include/avr/types.h b/nuttx/arch/avr/include/avr/types.h index 2e30414c4..0ff769576 100644 --- a/nuttx/arch/avr/include/avr/types.h +++ b/nuttx/arch/avr/include/avr/types.h @@ -63,20 +63,20 @@ * files */ -typedef signed char _int8_t; +typedef signed char _int8_t; /* char is 8-bits */ typedef unsigned char _uint8_t; -typedef signed short _int16_t; -typedef unsigned short _uint16_t; +typedef signed int _int16_t; /* int is 16-bits */ +typedef unsigned int _uint16_t; -typedef signed int _int32_t; -typedef unsigned int _uint32_t; +typedef signed long _int32_t; /* long is 32-bits */ +typedef unsigned long _uint32_t; -typedef signed long long _int64_t; +typedef signed long long _int64_t; /* long long is 64-bits */ typedef unsigned long long _uint64_t; #define __INT64_DEFINED -/* A pointer is 4 bytes */ +/* A pointer is 2 bytes */ typedef signed int _intptr_t; typedef unsigned int _uintptr_t; |