mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 16:11:56 +08:00
arch: rename arch special function name
This commit is contained in:
@@ -41,12 +41,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: arm_saveusercontext
|
||||
* Name: up_saveusercontext
|
||||
*
|
||||
* Description:
|
||||
* Restore the current thread context. Full prototype is:
|
||||
*
|
||||
* int arm_saveusercontext(uint32_t *saveregs);
|
||||
* int up_saveusercontext(uint32_t *saveregs);
|
||||
*
|
||||
* R0 = saveregs = pinter saved array
|
||||
*
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
/* SYS call 0:
|
||||
*
|
||||
* int arm64_saveusercontext(void *saveregs);
|
||||
* int up_saveusercontext(void *saveregs);
|
||||
*/
|
||||
|
||||
#define SYS_save_context (0)
|
||||
|
||||
@@ -20,23 +20,23 @@
|
||||
|
||||
# The start-up, "head", file
|
||||
|
||||
HEAD_ASRC = up_nommuhead.S
|
||||
HEAD_ASRC = avr_nommuhead.S
|
||||
|
||||
# Common AVR/AVR32 files
|
||||
|
||||
CMN_ASRCS = up_exceptions.S up_fullcontextrestore.S up_switchcontext.S
|
||||
CMN_CSRCS = up_assert.c up_allocateheap.c up_blocktask.c up_copystate.c
|
||||
CMN_CSRCS += up_createstack.c up_mdelay.c up_udelay.c up_exit.c up_idle.c
|
||||
CMN_CSRCS += up_initialize.c up_initialstate.c
|
||||
CMN_CSRCS += up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
|
||||
CMN_CSRCS += up_releasepending.c up_releasestack.c
|
||||
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c up_stackframe.c
|
||||
CMN_CSRCS += up_unblocktask.c up_usestack.c up_doirq.c up_nputs.c
|
||||
CMN_ASRCS = avr_exceptions.S avr_fullcontextrestore.S avr_switchcontext.S
|
||||
CMN_CSRCS = avr_assert.c avr_allocateheap.c avr_blocktask.c avr_copystate.c
|
||||
CMN_CSRCS += avr_createstack.c avr_mdelay.c avr_udelay.c avr_exit.c avr_idle.c
|
||||
CMN_CSRCS += avr_initialize.c avr_initialstate.c
|
||||
CMN_CSRCS += avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c
|
||||
CMN_CSRCS += avr_releasepending.c avr_releasestack.c
|
||||
CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c avr_stackframe.c
|
||||
CMN_CSRCS += avr_unblocktask.c avr_usestack.c avr_doirq.c avr_nputs.c
|
||||
|
||||
# Configuration-dependent common files
|
||||
|
||||
ifeq ($(CONFIG_ARCH_STACKDUMP),y)
|
||||
CMN_CSRCS += up_dumpstate.c
|
||||
CMN_CSRCS += avr_dumpstate.c
|
||||
endif
|
||||
|
||||
# Required AT32UC3 files
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "at32uc3_config.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at32uc3.h"
|
||||
#include "at32uc3_pm.h"
|
||||
#include "at32uc3_flashc.h"
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "at32uc3_config.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at32uc3.h"
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "irq/irq.h"
|
||||
#include "at32uc3.h"
|
||||
#include "at32uc3_gpio.h"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <nuttx/arch.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at32uc3.h"
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <nuttx/irq.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at32uc3.h"
|
||||
#include "at32uc3_pm.h"
|
||||
#include "at32uc3_usart.h"
|
||||
@@ -356,7 +356,7 @@ void up_consoleinit(void)
|
||||
putreg32(regval, AVR32_PM_PBAMASK);
|
||||
|
||||
/* Then configure the console here (if it is not going to be configured
|
||||
* by up_earlyserialinit()).
|
||||
* by avr_earlyserialinit()).
|
||||
*/
|
||||
|
||||
#if defined(HAVE_SERIAL_CONSOLE) && !defined(USE_EARLYSERIALINIT)
|
||||
@@ -367,14 +367,14 @@ void up_consoleinit(void)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_lowputc
|
||||
* Name: avr_lowputc
|
||||
*
|
||||
* Description:
|
||||
* Output one byte on the serial console
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_lowputc(char ch)
|
||||
void avr_lowputc(char ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
/* Wait until the TX to become ready */
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "at32uc3_config.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at32uc3.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -57,7 +57,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_lowinit
|
||||
* Name: avr_lowinit
|
||||
*
|
||||
* Description:
|
||||
* This performs basic initialization of the USART used for the serial
|
||||
@@ -66,7 +66,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_lowinit(void)
|
||||
void avr_lowinit(void)
|
||||
{
|
||||
/* Initialize MCU clocking */
|
||||
|
||||
@@ -81,7 +81,7 @@ void up_lowinit(void)
|
||||
*/
|
||||
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
up_earlyserialinit();
|
||||
avr_earlyserialinit();
|
||||
#endif
|
||||
|
||||
/* Perform board-level initialization */
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include "at32uc3_config.h"
|
||||
#include "chip.h"
|
||||
#include "at32uc3_usart.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at32uc3.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -687,18 +687,18 @@ static bool up_txready(struct uart_dev_s *dev)
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_earlyserialinit
|
||||
* Name: avr_earlyserialinit
|
||||
*
|
||||
* Description:
|
||||
* Performs the low level USART initialization early in debug so that the
|
||||
* serial console will be available during bootup. This must be called
|
||||
* before up_serialinit. NOTE: This function depends on GPIO pin
|
||||
* before avr_serialinit. NOTE: This function depends on GPIO pin
|
||||
* configuration performed in up_consoleinit() and main clock
|
||||
* initialization performed in up_clkinitialize().
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_earlyserialinit(void)
|
||||
void avr_earlyserialinit(void)
|
||||
{
|
||||
/* Disable all USARTS */
|
||||
|
||||
@@ -720,15 +720,15 @@ void up_earlyserialinit(void)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_serialinit
|
||||
* Name: avr_serialinit
|
||||
*
|
||||
* Description:
|
||||
* Register serial console and serial ports. This assumes
|
||||
* that up_earlyserialinit was called previously.
|
||||
* that avr_earlyserialinit was called previously.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_serialinit(void)
|
||||
void avr_serialinit(void)
|
||||
{
|
||||
/* Register the console */
|
||||
|
||||
@@ -769,10 +769,10 @@ int up_putc(int ch)
|
||||
{
|
||||
/* Add CR */
|
||||
|
||||
up_lowputc('\r');
|
||||
avr_lowputc('\r');
|
||||
}
|
||||
|
||||
up_lowputc(ch);
|
||||
avr_lowputc(ch);
|
||||
up_restoreusartint(priv, imr);
|
||||
#endif
|
||||
return ch;
|
||||
@@ -797,10 +797,10 @@ int up_putc(int ch)
|
||||
{
|
||||
/* Add CR */
|
||||
|
||||
up_lowputc('\r');
|
||||
avr_lowputc('\r');
|
||||
}
|
||||
|
||||
up_lowputc(ch);
|
||||
avr_lowputc(ch);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <nuttx/arch.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "chip.h"
|
||||
#include "at32uc3.h"
|
||||
#include "at32uc3_pm.h"
|
||||
|
||||
@@ -24,31 +24,31 @@ HEAD_ASRC = at90usb_head.S
|
||||
|
||||
# Common AVR files
|
||||
|
||||
CMN_ASRCS = up_switchcontext.S
|
||||
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c
|
||||
CMN_CSRCS += up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c
|
||||
CMN_CSRCS += up_initialstate.c up_irq.c up_lowputs.c
|
||||
CMN_CSRCS += up_mdelay.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
|
||||
CMN_CSRCS += up_nputs.c up_releasepending.c up_releasestack.c
|
||||
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c
|
||||
CMN_CSRCS += up_stackframe.c up_udelay.c up_unblocktask.c up_usestack.c
|
||||
CMN_ASRCS = avr_switchcontext.S
|
||||
CMN_CSRCS = avr_allocateheap.c avr_assert.c avr_blocktask.c avr_copystate.c
|
||||
CMN_CSRCS += avr_createstack.c avr_doirq.c avr_exit.c avr_idle.c avr_initialize.c
|
||||
CMN_CSRCS += avr_initialstate.c avr_irq.c avr_lowputs.c
|
||||
CMN_CSRCS += avr_mdelay.c avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c
|
||||
CMN_CSRCS += avr_nputs.c avr_releasepending.c avr_releasestack.c
|
||||
CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c
|
||||
CMN_CSRCS += avr_stackframe.c avr_udelay.c avr_unblocktask.c avr_usestack.c
|
||||
|
||||
# Configuration-dependent common files
|
||||
|
||||
ifeq ($(CONFIG_ARCH_STACKDUMP),y)
|
||||
CMN_CSRCS += up_dumpstate.c
|
||||
CMN_CSRCS += avr_dumpstate.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AVR_SPI),y)
|
||||
CMN_CSRCS += up_spi.c
|
||||
CMN_CSRCS += avr_spi.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_STACK_COLORATION),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
CMN_CSRCS += avr_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_ROMGETC),y)
|
||||
CMN_CSRCS += up_romgetc.c
|
||||
CMN_CSRCS += avr_romgetc.c
|
||||
endif
|
||||
|
||||
# Required AT90USB files
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
********************************************************************************************/
|
||||
|
||||
.file "at90usb_exceptions.S"
|
||||
.global up_doirq
|
||||
.global up_fullcontextrestore
|
||||
.global avr_doirq
|
||||
.global avr_fullcontextrestore
|
||||
|
||||
/********************************************************************************************
|
||||
* Macros
|
||||
@@ -109,7 +109,7 @@ excpt_common:
|
||||
|
||||
EXCPT_PROLOGUE
|
||||
|
||||
/* Call up_doirq with r24 = IRQ number, r22-23 = Pointer to the save structure. The stack
|
||||
/* Call avr_doirq with r24 = IRQ number, r22-23 = Pointer to the save structure. The stack
|
||||
* pointer currently points to the save structure (or maybe the save structure -1 since
|
||||
* the push operation post-decrements -- need to REVISIT this).
|
||||
*/
|
||||
@@ -119,7 +119,7 @@ excpt_common:
|
||||
adiw r28, 1 /* Remembering that push post-decrements */
|
||||
movw r22, r28 /* Pass register save structure as the parameter 2 */
|
||||
USE_INTSTACK rx, ry, rz /* Switch to the interrupt stack */
|
||||
call up_doirq /* Dispatch the interrupt */
|
||||
call avr_doirq /* Dispatch the interrupt */
|
||||
RESTORE_STACK rx, ry /* Undo the operations of USE_INTSTACK */
|
||||
|
||||
/* up_doiq returns with r24-r25 equal to the new save structure. If no context
|
||||
@@ -132,11 +132,11 @@ excpt_common:
|
||||
cpc r29, r25
|
||||
breq .Lnoswitch
|
||||
|
||||
/* A context switch has occurred, jump to up_fullcontextrestore with r24, r25
|
||||
/* A context switch has occurred, jump to avr_fullcontextrestore with r24, r25
|
||||
* equal to the address of the new register save area.
|
||||
*/
|
||||
|
||||
jmp up_fullcontextrestore
|
||||
jmp avr_fullcontextrestore
|
||||
|
||||
/* No context switch occurred.. just return off the stack */
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
.global _edata /* End of .data section in RAM */
|
||||
.global _eronly /* Start of .data section in FLASH */
|
||||
.global _enoinit /* End of uninitialized data. Defined by ld.script */
|
||||
.global up_lowinit /* Perform low level initialization */
|
||||
.global avr_lowinit /* Perform low level initialization */
|
||||
.global nx_start /* NuttX entry point */
|
||||
|
||||
.global vectortab
|
||||
@@ -239,7 +239,7 @@ __do_clear_bss:
|
||||
|
||||
/* Perform any low-level initialization */
|
||||
|
||||
call up_lowinit
|
||||
call avr_lowinit
|
||||
|
||||
/* Now start NuttX */
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <arch/board/board.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at90usb.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -251,14 +251,14 @@ void up_consoleinit(void)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_lowputc
|
||||
* Name: avr_lowputc
|
||||
*
|
||||
* Description:
|
||||
* Output one byte on the serial console
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_lowputc(char ch)
|
||||
void avr_lowputc(char ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
while ((UCSR1A & (1 << UDRE1)) == 0);
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <avr/power.h>
|
||||
|
||||
#include "at90usb_config.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at90usb.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -96,7 +96,7 @@ static inline void up_wdtinit(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_lowinit
|
||||
* Name: avr_lowinit
|
||||
*
|
||||
* Description:
|
||||
* This performs basic initialization of the USART used for the serial
|
||||
@@ -105,7 +105,7 @@ static inline void up_wdtinit(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_lowinit(void)
|
||||
void avr_lowinit(void)
|
||||
{
|
||||
/* Disable the watchdog timer */
|
||||
|
||||
@@ -128,7 +128,7 @@ void up_lowinit(void)
|
||||
*/
|
||||
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
up_earlyserialinit();
|
||||
avr_earlyserialinit();
|
||||
#endif
|
||||
|
||||
/* Perform board-level initialization */
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at90usb.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -507,16 +507,16 @@ static bool usart1_txempty(struct uart_dev_s *dev)
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_earlyserialinit
|
||||
* Name: avr_earlyserialinit
|
||||
*
|
||||
* Description:
|
||||
* Performs the low level USART initialization early in debug so that the
|
||||
* serial console will be available during bootup. This must be called
|
||||
* before up_serialinit.
|
||||
* before avr_serialinit.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_earlyserialinit(void)
|
||||
void avr_earlyserialinit(void)
|
||||
{
|
||||
/* Disable all USARTS */
|
||||
|
||||
@@ -532,15 +532,15 @@ void up_earlyserialinit(void)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_serialinit
|
||||
* Name: avr_serialinit
|
||||
*
|
||||
* Description:
|
||||
* Register serial console and serial ports. This assumes
|
||||
* that up_earlyserialinit was called previously.
|
||||
* that avr_earlyserialinit was called previously.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_serialinit(void)
|
||||
void avr_serialinit(void)
|
||||
{
|
||||
/* Register the console */
|
||||
|
||||
@@ -574,10 +574,10 @@ int up_putc(int ch)
|
||||
{
|
||||
/* Add CR */
|
||||
|
||||
up_lowputc('\r');
|
||||
avr_lowputc('\r');
|
||||
}
|
||||
|
||||
up_lowputc(ch);
|
||||
avr_lowputc(ch);
|
||||
usart1_restoreusartint(imr);
|
||||
#endif
|
||||
return ch;
|
||||
@@ -602,10 +602,10 @@ int up_putc(int ch)
|
||||
{
|
||||
/* Add CR */
|
||||
|
||||
up_lowputc('\r');
|
||||
avr_lowputc('\r');
|
||||
}
|
||||
|
||||
up_lowputc(ch);
|
||||
avr_lowputc(ch);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <arch/board/board.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "at90usb.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -2801,7 +2801,7 @@ static int avr_pullup(struct usbdev_s *dev, bool enable)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_usbinitialize
|
||||
* Name: avr_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize USB hardware.
|
||||
@@ -2815,7 +2815,7 @@ static int avr_pullup(struct usbdev_s *dev, bool enable)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_usbinitialize(void)
|
||||
void avr_usbinitialize(void)
|
||||
{
|
||||
usbtrace(TRACE_DEVINIT, 0);
|
||||
|
||||
@@ -2868,14 +2868,14 @@ void up_usbinitialize(void)
|
||||
return;
|
||||
|
||||
errout:
|
||||
up_usbuninitialize();
|
||||
avr_usbuninitialize();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_usbuninitialize
|
||||
* Name: avr_usbuninitialize
|
||||
****************************************************************************/
|
||||
|
||||
void up_usbuninitialize(void)
|
||||
void avr_usbuninitialize(void)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
||||
|
||||
@@ -24,31 +24,31 @@ HEAD_ASRC = atmega_head.S
|
||||
|
||||
# Common AVR files
|
||||
|
||||
CMN_ASRCS = up_switchcontext.S
|
||||
CMN_CSRCS = up_allocateheap.c up_assert.c up_blocktask.c up_copystate.c
|
||||
CMN_CSRCS += up_createstack.c up_doirq.c up_exit.c up_idle.c up_initialize.c
|
||||
CMN_CSRCS += up_initialstate.c up_irq.c up_lowputs.c
|
||||
CMN_CSRCS += up_mdelay.c up_modifyreg8.c up_modifyreg16.c up_modifyreg32.c
|
||||
CMN_CSRCS += up_nputs.c up_releasepending.c up_releasestack.c
|
||||
CMN_CSRCS += up_schedulesigaction.c up_sigdeliver.c
|
||||
CMN_CSRCS += up_stackframe.c up_udelay.c up_unblocktask.c up_usestack.c
|
||||
CMN_ASRCS = avr_switchcontext.S
|
||||
CMN_CSRCS = avr_allocateheap.c avr_assert.c avr_blocktask.c avr_copystate.c
|
||||
CMN_CSRCS += avr_createstack.c avr_doirq.c avr_exit.c avr_idle.c avr_initialize.c
|
||||
CMN_CSRCS += avr_initialstate.c avr_irq.c avr_lowputs.c
|
||||
CMN_CSRCS += avr_mdelay.c avr_modifyreg8.c avr_modifyreg16.c avr_modifyreg32.c
|
||||
CMN_CSRCS += avr_nputs.c avr_releasepending.c avr_releasestack.c
|
||||
CMN_CSRCS += avr_schedulesigaction.c avr_sigdeliver.c
|
||||
CMN_CSRCS += avr_stackframe.c avr_udelay.c avr_unblocktask.c avr_usestack.c
|
||||
|
||||
# Configuration-dependent common files
|
||||
|
||||
ifeq ($(CONFIG_ARCH_STACKDUMP),y)
|
||||
CMN_CSRCS += up_dumpstate.c
|
||||
CMN_CSRCS += avr_dumpstate.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AVR_SPI),y)
|
||||
CMN_CSRCS += up_spi.c
|
||||
CMN_CSRCS += avr_spi.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_STACK_COLORATION),y)
|
||||
CMN_CSRCS += up_checkstack.c
|
||||
CMN_CSRCS += avr_checkstack.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_ROMGETC),y)
|
||||
CMN_CSRCS += up_romgetc.c
|
||||
CMN_CSRCS += avr_romgetc.c
|
||||
endif
|
||||
|
||||
# Required ATMEGA files
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
********************************************************************************************/
|
||||
|
||||
.file "atmega_exceptions.S"
|
||||
.global up_doirq
|
||||
.global up_fullcontextrestore
|
||||
.global avr_doirq
|
||||
.global avr_fullcontextrestore
|
||||
|
||||
/********************************************************************************************
|
||||
* Macros
|
||||
@@ -198,7 +198,7 @@ excpt_common:
|
||||
|
||||
EXCPT_PROLOGUE
|
||||
|
||||
/* Call up_doirq with r24 = IRQ number, r22-23 = Pointer to the save structure. The stack
|
||||
/* Call avr_doirq with r24 = IRQ number, r22-23 = Pointer to the save structure. The stack
|
||||
* pointer currently points to the save structure (or maybe the save structure -1 since
|
||||
* the push operation post-decrements -- need to REVISIT this).
|
||||
*/
|
||||
@@ -208,7 +208,7 @@ excpt_common:
|
||||
adiw r28, 1 /* Remembering that push post-decrements */
|
||||
movw r22, r28 /* Pass register save structure as the parameter 2 */
|
||||
USE_INTSTACK rx, ry, rz /* Switch to the interrupt stack */
|
||||
call up_doirq /* Dispatch the interrupt */
|
||||
call avr_doirq /* Dispatch the interrupt */
|
||||
RESTORE_STACK rx, ry /* Undo the operations of USE_INTSTACK */
|
||||
|
||||
/* up_doiq returns with r24-r25 equal to the new save structure. If no context
|
||||
@@ -221,11 +221,11 @@ excpt_common:
|
||||
cpc r29, r25
|
||||
breq .Lnoswitch
|
||||
|
||||
/* A context switch has occurred, jump to up_fullcontextrestore with r24, r25
|
||||
/* A context switch has occurred, jump to avr_fullcontextrestore with r24, r25
|
||||
* equal to the address of the new register save ared.
|
||||
*/
|
||||
|
||||
jmp up_fullcontextrestore
|
||||
jmp avr_fullcontextrestore
|
||||
|
||||
/* No context switch occurred.. just return off the stack */
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
.global _edata /* End of .data section in RAM */
|
||||
.global _eronly /* Start of .data section in FLASH */
|
||||
.global _enoinit /* End of uninitilized data. Defined by ld.script */
|
||||
.global up_lowinit /* Perform low level initialization */
|
||||
.global avr_lowinit /* Perform low level initialization */
|
||||
.global nx_start /* NuttX entry point */
|
||||
|
||||
.global vectortab
|
||||
@@ -435,7 +435,7 @@ __do_clear_bss:
|
||||
|
||||
/* Perform any low-level initialization */
|
||||
|
||||
call up_lowinit
|
||||
call avr_lowinit
|
||||
|
||||
/* Now start NuttX */
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <arch/board/board.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "atmega.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -442,14 +442,14 @@ void up_consoleinit(void)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_lowputc
|
||||
* Name: avr_lowputc
|
||||
*
|
||||
* Description:
|
||||
* Output one byte on the serial console
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_lowputc(char ch)
|
||||
void avr_lowputc(char ch)
|
||||
{
|
||||
#ifdef HAVE_SERIAL_CONSOLE
|
||||
# if defined(CONFIG_USART0_SERIAL_CONSOLE)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <avr/power.h>
|
||||
|
||||
#include "atmega_config.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "atmega.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -96,7 +96,7 @@ static inline void up_wdtinit(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_lowinit
|
||||
* Name: avr_lowinit
|
||||
*
|
||||
* Description:
|
||||
* This performs basic initialization of the USART used for the serial
|
||||
@@ -105,7 +105,7 @@ static inline void up_wdtinit(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_lowinit(void)
|
||||
void avr_lowinit(void)
|
||||
{
|
||||
/* Disable the watchdog timer */
|
||||
|
||||
@@ -133,7 +133,7 @@ void up_lowinit(void)
|
||||
*/
|
||||
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
up_earlyserialinit();
|
||||
avr_earlyserialinit();
|
||||
#endif
|
||||
|
||||
/* Perform board-level initialization */
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "atmega.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -823,16 +823,16 @@ static bool usart1_txempty(struct uart_dev_s *dev)
|
||||
#ifdef USE_EARLYSERIALINIT
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_earlyserialinit
|
||||
* Name: avr_earlyserialinit
|
||||
*
|
||||
* Description:
|
||||
* Performs the low level USART initialization early in debug so that the
|
||||
* serial console will be available during bootup. This must be called
|
||||
* before up_serialinit.
|
||||
* before avr_serialinit.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_earlyserialinit(void)
|
||||
void avr_earlyserialinit(void)
|
||||
{
|
||||
/* Disable all USARTS */
|
||||
|
||||
@@ -857,15 +857,15 @@ void up_earlyserialinit(void)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_serialinit
|
||||
* Name: avr_serialinit
|
||||
*
|
||||
* Description:
|
||||
* Register serial console and serial ports. This assumes
|
||||
* that up_earlyserialinit was called previously.
|
||||
* that avr_earlyserialinit was called previously.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_serialinit(void)
|
||||
void avr_serialinit(void)
|
||||
{
|
||||
/* Register the console */
|
||||
|
||||
@@ -906,10 +906,10 @@ int up_putc(int ch)
|
||||
{
|
||||
/* Add CR */
|
||||
|
||||
up_lowputc('\r');
|
||||
avr_lowputc('\r');
|
||||
}
|
||||
|
||||
up_lowputc(ch);
|
||||
avr_lowputc(ch);
|
||||
|
||||
#if defined(CONFIG_USART0_SERIAL_CONSOLE)
|
||||
usart0_restoreusartint(imr);
|
||||
@@ -940,10 +940,10 @@ int up_putc(int ch)
|
||||
{
|
||||
/* Add CR */
|
||||
|
||||
up_lowputc('\r');
|
||||
avr_lowputc('\r');
|
||||
}
|
||||
|
||||
up_lowputc(ch);
|
||||
avr_lowputc(ch);
|
||||
#endif
|
||||
return ch;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <arch/board/board.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "atmega.h"
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
+10
-10
@@ -43,8 +43,8 @@
|
||||
* state from the TCB.
|
||||
*/
|
||||
|
||||
#define up_savestate(regs) up_copystate(regs, (uint8_t*)g_current_regs)
|
||||
#define up_restorestate(regs) (g_current_regs = regs)
|
||||
#define avr_savestate(regs) avr_copystate(regs, (uint8_t*)g_current_regs)
|
||||
#define avr_restorestate(regs) (g_current_regs = regs)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
@@ -77,7 +77,7 @@ extern uint16_t g_idle_topstack;
|
||||
struct spi_dev_s; /* Forward references */
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_copystate
|
||||
* Name: avr_copystate
|
||||
*
|
||||
* Description:
|
||||
* Copy the contents of a register state save structure from one location
|
||||
@@ -85,37 +85,37 @@ struct spi_dev_s; /* Forward references */
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_copystate(uint8_t *dest, uint8_t *src);
|
||||
void avr_copystate(uint8_t *dest, uint8_t *src);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_fullcontextrestore
|
||||
* Name: avr_fullcontextrestore
|
||||
*
|
||||
* Description:
|
||||
* Restore the full context of a saved thread/task.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_fullcontextrestore(uint8_t *restoreregs) noreturn_function;
|
||||
void avr_fullcontextrestore(uint8_t *restoreregs) noreturn_function;
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_switchcontext
|
||||
* Name: avr_switchcontext
|
||||
*
|
||||
* Description:
|
||||
* Switch from one thread/task context to another.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_switchcontext(uint8_t *saveregs, uint8_t *restoreregs);
|
||||
void avr_switchcontext(uint8_t *saveregs, uint8_t *restoreregs);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_doirq
|
||||
* Name: avr_doirq
|
||||
*
|
||||
* Description:
|
||||
* Dispatch an interrupt.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint8_t *up_doirq(uint8_t irq, uint8_t *regs);
|
||||
uint8_t *avr_doirq(uint8_t irq, uint8_t *regs);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: avr_spibus_initialize
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_blocktask.c
|
||||
* arch/avr/src/avr/avr_blocktask.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <nuttx/sched.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -67,7 +67,7 @@ void up_block_task(struct tcb_s *rtcb)
|
||||
* Just copy the g_current_regs into the OLD rtcb.
|
||||
*/
|
||||
|
||||
up_savestate(rtcb->xcp.regs);
|
||||
avr_savestate(rtcb->xcp.regs);
|
||||
|
||||
/* Restore the exception context of the rtcb at the (new) head
|
||||
* of the ready-to-run task list.
|
||||
@@ -81,7 +81,7 @@ void up_block_task(struct tcb_s *rtcb)
|
||||
|
||||
/* Then switch contexts */
|
||||
|
||||
up_restorestate(rtcb->xcp.regs);
|
||||
avr_restorestate(rtcb->xcp.regs);
|
||||
}
|
||||
|
||||
/* No, then we will need to perform the user context switch */
|
||||
@@ -98,9 +98,9 @@ void up_block_task(struct tcb_s *rtcb)
|
||||
* ready to run list.
|
||||
*/
|
||||
|
||||
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||
avr_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||
|
||||
/* up_switchcontext forces a context switch to the task at the
|
||||
/* avr_switchcontext forces a context switch to the task at the
|
||||
* head of the ready-to-run list. It does not 'return' in the
|
||||
* normal sense. When it does return, it is because the blocked
|
||||
* task is again ready to run and has execution priority.
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_checkstack.c
|
||||
* arch/avr/src/avr/avr_checkstack.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "sched/sched.h"
|
||||
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_copystate.c
|
||||
* arch/avr/src/avr/avr_copystate.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <stdint.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -46,12 +46,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_copystate
|
||||
* Name: avr_copystate
|
||||
****************************************************************************/
|
||||
|
||||
/* Really just a memcpy */
|
||||
|
||||
void up_copystate(uint8_t *dest, uint8_t *src)
|
||||
void avr_copystate(uint8_t *dest, uint8_t *src)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_createstack.c
|
||||
* arch/avr/src/avr/avr_createstack.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <nuttx/tls.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_doirq.c
|
||||
* arch/avr/src/avr/avr_doirq.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -54,7 +54,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
uint8_t *up_doirq(uint8_t irq, uint8_t *regs)
|
||||
uint8_t *avr_doirq(uint8_t irq, uint8_t *regs)
|
||||
{
|
||||
board_autoled_on(LED_INIRQ);
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_dumpstate.c
|
||||
* arch/avr/src/avr/avr_dumpstate.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
|
||||
@@ -121,10 +121,10 @@ static inline void avr_registerdump(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_dumpstate
|
||||
* Name: avr_dumpstate
|
||||
****************************************************************************/
|
||||
|
||||
void up_dumpstate(void)
|
||||
void avr_dumpstate(void)
|
||||
{
|
||||
FAR struct tcb_s *rtcb = running_task();
|
||||
uint16_t sp = up_getsp();
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_initialstate.c
|
||||
* arch/avr/src/avr/avr_initialstate.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <arch/irq.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_irq.c
|
||||
* arch/avr/src/avr/avr_irq.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <arch/irq.h>
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_releasepending.c
|
||||
* arch/avr/src/avr/avr_releasepending.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -30,7 +30,7 @@
|
||||
#include <nuttx/sched.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -71,7 +71,7 @@ void up_release_pending(void)
|
||||
* Just copy the g_current_regs into the OLD rtcb.
|
||||
*/
|
||||
|
||||
up_savestate(rtcb->xcp.regs);
|
||||
avr_savestate(rtcb->xcp.regs);
|
||||
|
||||
/* Restore the exception context of the rtcb at the (new) head
|
||||
* of the ready-to-run task list.
|
||||
@@ -85,7 +85,7 @@ void up_release_pending(void)
|
||||
|
||||
/* Then switch contexts */
|
||||
|
||||
up_restorestate(rtcb->xcp.regs);
|
||||
avr_restorestate(rtcb->xcp.regs);
|
||||
}
|
||||
|
||||
/* No, then we will need to perform the user context switch */
|
||||
@@ -102,9 +102,9 @@ void up_release_pending(void)
|
||||
* ready to run list.
|
||||
*/
|
||||
|
||||
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||
avr_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||
|
||||
/* up_switchcontext forces a context switch to the task at the
|
||||
/* avr_switchcontext forces a context switch to the task at the
|
||||
* head of the ready-to-run list. It does not 'return' in the
|
||||
* normal sense. When it does return, it is because the blocked
|
||||
* task is again ready to run and has execution priority.
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_romgetc.c
|
||||
* arch/avr/src/avr/avr_romgetc.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_schedulesigaction.c
|
||||
* arch/avr/src/avr/avr_schedulesigaction.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
{
|
||||
uintptr_t reg_ptr = (uintptr_t)up_sigdeliver;
|
||||
uintptr_t reg_ptr = (uintptr_t)avr_sigdeliver;
|
||||
|
||||
sinfo("tcb=%p sigdeliver=%p\n", tcb, sigdeliver);
|
||||
|
||||
@@ -150,7 +150,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
||||
* is the same as the interrupt return context.
|
||||
*/
|
||||
|
||||
up_savestate(tcb->xcp.regs);
|
||||
avr_savestate(tcb->xcp.regs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_sigdeliver.c
|
||||
* arch/avr/src/avr/avr_sigdeliver.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -35,14 +35,14 @@
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_sigdeliver
|
||||
* Name: avr_sigdeliver
|
||||
*
|
||||
* Description:
|
||||
* This is the a signal handling trampoline. When a signal action was
|
||||
@@ -51,7 +51,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_sigdeliver(void)
|
||||
void avr_sigdeliver(void)
|
||||
{
|
||||
struct tcb_s *rtcb = this_task();
|
||||
uint8_t regs[XCPTCONTEXT_REGS];
|
||||
@@ -64,7 +64,7 @@ void up_sigdeliver(void)
|
||||
|
||||
/* Save the return state on the stack. */
|
||||
|
||||
up_copystate(regs, rtcb->xcp.regs);
|
||||
avr_copystate(regs, rtcb->xcp.regs);
|
||||
|
||||
#ifndef CONFIG_SUPPRESS_INTERRUPTS
|
||||
/* Then make sure that interrupts are enabled. Signal handlers must always
|
||||
@@ -109,13 +109,13 @@ void up_sigdeliver(void)
|
||||
* unusual in two ways:
|
||||
*
|
||||
* 1. It is not a context switch between threads. Rather,
|
||||
* up_fullcontextrestore must behave more it more like a longjmp
|
||||
* avr_fullcontextrestore must behave more it more like a longjmp
|
||||
* within the same task, using the same stack.
|
||||
* 2. In this case, up_fullcontextrestore is called with r12 pointing to
|
||||
* 2. In this case, avr_fullcontextrestore is called with r12 pointing to
|
||||
* a register save area on the stack to be destroyed. This is
|
||||
* dangerous because there is the very real possibility that the new
|
||||
* stack pointer might overlap with the register save area and that
|
||||
* stack usage in up_fullcontextrestore might corrupt the register
|
||||
* stack usage in avr_fullcontextrestore might corrupt the register
|
||||
* save data before the state is restored. At present, there does
|
||||
* not appear to be any stack overlap problems. If there were, then
|
||||
* adding 3 words to the size of register save structure size will
|
||||
@@ -123,5 +123,5 @@ void up_sigdeliver(void)
|
||||
*/
|
||||
|
||||
board_autoled_off(LED_SIGNAL);
|
||||
up_fullcontextrestore(regs);
|
||||
avr_fullcontextrestore(regs);
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_spi.c
|
||||
* arch/avr/src/avr/avr_spi.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <avr/io.h>
|
||||
#include <avr/power.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "chip.h"
|
||||
#include "avr.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_stackframe.c
|
||||
* arch/avr/src/avr/avr_stackframe.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <nuttx/arch.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -1,5 +1,5 @@
|
||||
/************************************************************************************
|
||||
* arch/avr/src/avr/up_switchcontext.S
|
||||
* arch/avr/src/avr/avr_switchcontext.S
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -36,7 +36,7 @@
|
||||
* Public Symbols
|
||||
************************************************************************************/
|
||||
|
||||
.file "up_switchcontext.S"
|
||||
.file "avr_switchcontext.S"
|
||||
|
||||
/************************************************************************************
|
||||
* Macros
|
||||
@@ -47,20 +47,20 @@
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: up_switchcontext
|
||||
* Name: avr_switchcontext
|
||||
*
|
||||
* Description:
|
||||
* Save the current thread context and restore the specified context. The full
|
||||
* C function prototype is:
|
||||
*
|
||||
* void up_switchcontext(uint8_t *saveregs, uint8_t *restoreregs);
|
||||
* void avr_switchcontext(uint8_t *saveregs, uint8_t *restoreregs);
|
||||
*
|
||||
* On Entry:
|
||||
* r24-r25: savregs
|
||||
* r22-r23: restoreregs
|
||||
*
|
||||
* Returned Value:
|
||||
* up_switchcontext forces a context switch to the task "canned" in restoreregs.
|
||||
* avr_switchcontext forces a context switch to the task "canned" in restoreregs.
|
||||
* It does not 'return' in the normal sense, rather, it will context switch back
|
||||
* to the function point. When it does 'return,' it is because the blocked
|
||||
* task hat was "pickeled" in the saveregs "can" is again ready to run and has
|
||||
@@ -72,9 +72,9 @@
|
||||
************************************************************************************/
|
||||
|
||||
.text
|
||||
.globl up_switchcontext
|
||||
.func up_switchcontext
|
||||
up_switchcontext:
|
||||
.globl avr_switchcontext
|
||||
.func avr_switchcontext
|
||||
avr_switchcontext:
|
||||
/* Use X [r26:r27] to reference the save structure. (X is Call-used) */
|
||||
|
||||
movw r26, r24
|
||||
@@ -89,7 +89,7 @@ up_switchcontext:
|
||||
.endfunc
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_fullcontextrestore
|
||||
* Name: avr_fullcontextrestore
|
||||
*
|
||||
* Description:
|
||||
* Restore the full-running context of a thread.
|
||||
@@ -98,7 +98,7 @@ up_switchcontext:
|
||||
* r24-r25 = A pointer to the register save area of the thread to be restored.
|
||||
*
|
||||
* C Prototype:
|
||||
* void up_fullcontextrestore(uint8_t *regs);
|
||||
* void avr_fullcontextrestore(uint8_t *regs);
|
||||
*
|
||||
* Assumptions:
|
||||
* Interrupts are disabled.
|
||||
@@ -106,9 +106,9 @@ up_switchcontext:
|
||||
****************************************************************************/
|
||||
|
||||
.text
|
||||
.global up_fullcontextrestore
|
||||
.func up_fullcontextrestore
|
||||
up_fullcontextrestore:
|
||||
.global avr_fullcontextrestore
|
||||
.func avr_fullcontextrestore
|
||||
avr_fullcontextrestore:
|
||||
/* Use X [r26:r27] to reference the restore structure. */
|
||||
|
||||
movw r26, r24
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_unblocktask.c
|
||||
* arch/avr/src/avr/avr_unblocktask.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "clock/clock.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -66,7 +66,7 @@ void up_unblock_task(struct tcb_s *tcb, struct tcb_s *rtcb)
|
||||
* Just copy the g_current_regs into the OLD rtcb.
|
||||
*/
|
||||
|
||||
up_savestate(rtcb->xcp.regs);
|
||||
avr_savestate(rtcb->xcp.regs);
|
||||
|
||||
/* Update scheduler parameters */
|
||||
|
||||
@@ -74,7 +74,7 @@ void up_unblock_task(struct tcb_s *tcb, struct tcb_s *rtcb)
|
||||
|
||||
/* Then switch contexts */
|
||||
|
||||
up_restorestate(tcb->xcp.regs);
|
||||
avr_restorestate(tcb->xcp.regs);
|
||||
}
|
||||
|
||||
/* No, then we will need to perform the user context switch */
|
||||
@@ -89,9 +89,9 @@ void up_unblock_task(struct tcb_s *tcb, struct tcb_s *rtcb)
|
||||
* ready to run list.
|
||||
*/
|
||||
|
||||
up_switchcontext(rtcb->xcp.regs, tcb->xcp.regs);
|
||||
avr_switchcontext(rtcb->xcp.regs, tcb->xcp.regs);
|
||||
|
||||
/* up_switchcontext forces a context switch to the task at the
|
||||
/* avr_switchcontext forces a context switch to the task at the
|
||||
* head of the ready-to-run list. It does not 'return' in the
|
||||
* normal sense. When it does return, it is because the blocked
|
||||
* task is again ready to run and has execution priority.
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr/up_usestack.c
|
||||
* arch/avr/src/avr/avr_usestack.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -35,7 +35,7 @@
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/tls.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -546,7 +546,7 @@
|
||||
* interrupt_enable - return sequence.
|
||||
*
|
||||
* NOTE: since actual returning is handled by this macro it has been
|
||||
* removed from up_fullcontextrestore function (up_switchcontext.S)
|
||||
* removed from avr_fullcontextrestore function (avr_switchcontext.S)
|
||||
*/
|
||||
|
||||
/* If interrupts shall be enabled go to 'restore remaining and reti' code
|
||||
|
||||
+10
-10
@@ -53,8 +53,8 @@
|
||||
* state from the TCB.
|
||||
*/
|
||||
|
||||
#define up_savestate(regs) up_copystate(regs, (uint32_t*)g_current_regs)
|
||||
#define up_restorestate(regs) (g_current_regs = regs)
|
||||
#define avr_savestate(regs) avr_copystate(regs, (uint32_t*)g_current_regs)
|
||||
#define avr_restorestate(regs) (g_current_regs = regs)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
@@ -85,7 +85,7 @@ extern uint32_t g_idle_topstack;
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_copystate
|
||||
* Name: avr_copystate
|
||||
*
|
||||
* Description:
|
||||
* Copy the contents of a register state save structure from one location
|
||||
@@ -93,37 +93,37 @@ extern uint32_t g_idle_topstack;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_copystate(uint32_t *dest, uint32_t *src);
|
||||
void avr_copystate(uint32_t *dest, uint32_t *src);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_fullcontextrestore
|
||||
* Name: avr_fullcontextrestore
|
||||
*
|
||||
* Description:
|
||||
* Restore the full context of a saved thread/task.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
|
||||
void avr_fullcontextrestore(uint32_t *restoreregs) noreturn_function;
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_switchcontext
|
||||
* Name: avr_switchcontext
|
||||
*
|
||||
* Description:
|
||||
* Switch from one thread/task context to another.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void up_switchcontext(uint32_t *saveregs, uint32_t *restoreregs);
|
||||
void avr_switchcontext(uint32_t *saveregs, uint32_t *restoreregs);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_doirq
|
||||
* Name: avr_doirq
|
||||
*
|
||||
* Description:
|
||||
* Dispatch an interrupt.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint32_t *up_doirq(int irq, uint32_t *regs);
|
||||
uint32_t *avr_doirq(int irq, uint32_t *regs);
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __ARCH_AVR_SRC_AVR32_AVR32_H */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr32/up_blocktask.c
|
||||
* arch/avr/src/avr32/avr_blocktask.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
#include "sched/sched.h"
|
||||
#include "group/group.h"
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@@ -68,7 +68,7 @@ void up_block_task(struct tcb_s *rtcb)
|
||||
* Just copy the g_current_regs into the OLD rtcb.
|
||||
*/
|
||||
|
||||
up_savestate(rtcb->xcp.regs);
|
||||
avr_savestate(rtcb->xcp.regs);
|
||||
|
||||
/* Restore the exception context of the rtcb at the (new) head
|
||||
* of the ready-to-run task list.
|
||||
@@ -85,7 +85,7 @@ void up_block_task(struct tcb_s *rtcb)
|
||||
* interrupt.
|
||||
*/
|
||||
|
||||
up_restorestate(rtcb->xcp.regs);
|
||||
avr_restorestate(rtcb->xcp.regs);
|
||||
}
|
||||
|
||||
/* No, then we will need to perform the user context switch */
|
||||
@@ -113,9 +113,9 @@ void up_block_task(struct tcb_s *rtcb)
|
||||
|
||||
/* Then switch contexts */
|
||||
|
||||
up_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||
avr_switchcontext(rtcb->xcp.regs, nexttcb->xcp.regs);
|
||||
|
||||
/* up_switchcontext forces a context switch to the task at the
|
||||
/* avr_switchcontext forces a context switch to the task at the
|
||||
* head of the ready-to-run list. It does not 'return' in the
|
||||
* normal sense. When it does return, it is because the blocked
|
||||
* task is again ready to run and has execution priority.
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr32/up_copystate.c
|
||||
* arch/avr/src/avr32/avr_copystate.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <arch/avr32/irq.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@@ -47,12 +47,12 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: up_copystate
|
||||
* Name: avr_copystate
|
||||
****************************************************************************/
|
||||
|
||||
/* A little faster than most memcpy's */
|
||||
|
||||
void up_copystate(uint32_t *dest, uint32_t *src)
|
||||
void avr_copystate(uint32_t *dest, uint32_t *src)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr32/up_createstack.c
|
||||
* arch/avr/src/avr32/avr_createstack.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/avr/src/avr32/up_doirq.c
|
||||
* arch/avr/src/avr32/avr_doirq.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -32,7 +32,7 @@
|
||||
#include <nuttx/board.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "up_internal.h"
|
||||
#include "avr_internal.h"
|
||||
#include "group/group.h"
|
||||
|
||||
/****************************************************************************
|
||||
@@ -55,7 +55,7 @@
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
uint32_t *up_doirq(int irq, uint32_t *regs)
|
||||
uint32_t *avr_doirq(int irq, uint32_t *regs)
|
||||
{
|
||||
board_autoled_on(LED_INIRQ);
|
||||
#ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user