mirror of
https://github.com/apache/nuttx.git
synced 2026-09-07 17:36:38 +00:00
Merged nuttx/nuttx into master - debug and RTC updates
This commit is contained in:
commit
bc67a9e9a4
2257 changed files with 60250 additions and 27525 deletions
63
.gitignore
vendored
63
.gitignore
vendored
|
|
@ -1,30 +1,33 @@
|
|||
.depend
|
||||
Make.dep
|
||||
*.o
|
||||
*.a
|
||||
*.d
|
||||
*.i
|
||||
*~
|
||||
.swp
|
||||
.*.swp
|
||||
core
|
||||
.gdbinit
|
||||
cscope.out
|
||||
/.config
|
||||
/.config.old
|
||||
/.version
|
||||
/Make.defs
|
||||
/setenv.sh
|
||||
/setenv.bat
|
||||
/nuttx
|
||||
/nuttx.*
|
||||
/nuttx-*
|
||||
/_SAVED_APPS_config
|
||||
/*.map
|
||||
/*.elf
|
||||
/*.srec
|
||||
/*.bin
|
||||
/*.ihx
|
||||
/*.hex
|
||||
/pcode
|
||||
/tags
|
||||
.depend
|
||||
Make.dep
|
||||
*.o
|
||||
*.a
|
||||
*.d
|
||||
*.i
|
||||
*~
|
||||
.swp
|
||||
.*.swp
|
||||
core
|
||||
.gdbinit
|
||||
cscope.out
|
||||
/.config
|
||||
/.config.old
|
||||
/.version
|
||||
/Make.defs
|
||||
/setenv.sh
|
||||
/setenv.bat
|
||||
/nuttx
|
||||
/nuttx.*
|
||||
/nuttx-*
|
||||
/_SAVED_APPS_config
|
||||
/*.map
|
||||
/*.elf
|
||||
/*.srec
|
||||
/*.bin
|
||||
/*.ihx
|
||||
/*.hex
|
||||
/pcode
|
||||
/tags
|
||||
/.settings/
|
||||
/.cproject
|
||||
/.project
|
||||
|
|
|
|||
166
ChangeLog
166
ChangeLog
|
|
@ -11879,3 +11879,169 @@
|
|||
mcan_txempty(). From Frank Benkert (2016-06-01).
|
||||
|
||||
7.17 2016-xx-xx Gregory Nutt <gnutt@nuttx.org>
|
||||
|
||||
* drivers/mtd/flash_eraseall.c: Removed. This is no longer used
|
||||
in the OS and is simply a wrapper around the MDIOC_BULKERASE
|
||||
IOCTL command. It used to be called (only) from
|
||||
apps/system/flash_eraseall, but that has been removed because it
|
||||
violated the OS/application interface -- by calling flash_eraseall().
|
||||
The old code can be found in the Obsoleted' repository (and a revised
|
||||
version can be found at apps/fsutils/flash_eraseall) (2016-06-03).
|
||||
* arch/arm/src/stm32: STM32 Timer Driver: Change calculation of per-
|
||||
timer pre-scaler value. Add support for all timers (2016-6-03)
|
||||
* drivers/lcd: Correct conditional compilation in ST7565 driver. From
|
||||
Pierre-noel Bouteville (2016-6-03)
|
||||
* arch/arm/src/stm32: Correct conditional compilation in STM32 timer
|
||||
capture logic. From Pierre-noel Bouteville (2016-6-03)
|
||||
* arch/arm/src/efm32: Fix EFM32 FLASH conditional compilation. From
|
||||
Pierre-noel Bouteville (2016-6-03)
|
||||
* arch/arm/src/lpc43xx: Fix errors in GPIO interrupt logic. From v01d
|
||||
(phreakuencies) (2016-06-04)
|
||||
* arch/arm/src/kl and lpc11xx: rename xyz_lowputc to up_putc. Remove
|
||||
all references to up_lowputc, everywhere (2016-06-04).
|
||||
* configs/stm32f103-minimum: Add minnsh configuration. From Alan
|
||||
Carvalho de Assis (2016-06-04).
|
||||
* arch/arm/src/stm32: Add the up_getc() function to STM32 in order to
|
||||
support the minnsh configuration. From Alan Carvalho de Assis
|
||||
(2016-06-04).
|
||||
* include/sys/boardctl.h: Needs to be usable with C++ files (2016-06-05).
|
||||
* tools/tesbuild.sh will now build NxWM configurations (2016-06-05).
|
||||
* arch/arm/src/stm32: In PWM driver, just update duty if frequency is
|
||||
not changed and PSM started. This removeis glitch or blinking when
|
||||
only duty is frequently changed. From Pierre-noel Bouteville (2016-06-05).
|
||||
* arch/arm/src/kinetis: Add a USB device controller driver. Derived from
|
||||
the pic32mx usb driver, which uses the same usb controller. From kfazz
|
||||
(2016-06).
|
||||
* configs/teensy-3.x: Add USB support and a usbnsh configuration. From
|
||||
kfazz (2016-06).
|
||||
* arch/arm/src/stm32: Add support for the STM32F105R. From Konstantin
|
||||
Berezenko (2016-06-06).
|
||||
* include/signal.h: Change type of SIG_ERR, SIG_IGN, ... to
|
||||
_sa_handler_t. They type void does not work with the IAR toolchain.
|
||||
From Aleksandr Vyhovanec (2016-06-07).
|
||||
* arch/arm/src/stm32f7 and include/stm32f7: Added STM32FF76xxx and
|
||||
STM32FF7xx families. From David Sidrane (2016-06-08).
|
||||
* Refactoring configs/nucleo-144 sub-directories to support additional
|
||||
nucleo-144 board. Add support for the Nucleo-F767ZI board. From David
|
||||
Sidrane (2016-06-08).
|
||||
* arch/arm/src/kinetis: Add a USB device controller driver for kinetis.
|
||||
Derived from pic32mx usb driver, which uses the same usb controller.
|
||||
From kfazz (2016-06-06).
|
||||
* configs/teensy-3.x: Add USB device support and usbnsh configuration.
|
||||
From kfazz (2016-06-06.
|
||||
* arch/arm/src/stm32: Add STM32F105R support. From Konstantin Berezenko
|
||||
(2016-06-06).
|
||||
* include/signal.h: Change type of SIG_IGN and related defines to
|
||||
_sa_handler_t. From Aleksandr Vyhovanec (2016-06-07).
|
||||
* configs/nucleo-144: Refactored configs/nucleo-144 sub-directories to
|
||||
support additional nucleo-144 board. Add support for the Nucleo-F767ZI
|
||||
board. From David Sidrane (2016-06-07).
|
||||
* arch/arm/src/stm32f7: Add support for STM32FF76xxx and STM32FF7xx
|
||||
families. From David Sidrane (2016-06-08).
|
||||
* include/assert.h: Check if NDEBUG is defined. From Paul Alexander
|
||||
Patience (2016-06-08).
|
||||
* arch/arm/src/stm32: Fix STM32 DMA code and configuration for STM32F37X
|
||||
chips. From Marten Svanfeldt (2016-06-08).
|
||||
* drivers/mtd: Add a driver of IS25xP SPI flash devices. From Marten
|
||||
Svanfeldt (2016-06-09).
|
||||
* arch/arm/src/Kconfig and configs/teensy-3.x: Teensy clock fixes. The
|
||||
High Gain bit in MCG_C1 was preventing teensy from booting except
|
||||
after a programming session. The second change doesn't appear to
|
||||
change any functionality, but complies with restrictions in the k20
|
||||
family reference manual on FEI -> FBE clock transiions. From kfazz
|
||||
(2016-06-09).
|
||||
* configs/*/include/board.h: Fix timer input clock definitions. From
|
||||
David Sidrane (2016-06-09).
|
||||
* Networking: In both IPv6 and IPv4 incoming logic: (1) Should check
|
||||
if the packet size is large enough before trying to access the packet
|
||||
length in the IP header. (2) In the comparison between the IP length
|
||||
and the full packet length, need to subtract the size of the link
|
||||
layer header before making the comparison or we will get false
|
||||
positives (i.e., the packet is really too small) (2016-06-09)
|
||||
* drivers/mtd: Added driver of IS25xP SPI flash devices. Based on
|
||||
sst25xx driver. From Marten Svanfeldt (2016-06-09).
|
||||
* arch/arm/src/kinetis: Teensy clock fixes. The High Gain bit in
|
||||
MCG_C1 was preventing teensy from booting except after a programming
|
||||
session. The second change doesn't appear to change any functionality,
|
||||
but complies with restrictions in the k20 family reference manual on
|
||||
FEI -> FBE clock transiions. From kfazz (2016-06-09).
|
||||
* arch/arm/src/stm32: Fix timer input clock definitions. From David
|
||||
Sidrane (2016-06-09).
|
||||
* configs/: All configurations that have both CONFIG_NSH_LIBRARY=y and
|
||||
CONFIG_NET=y must now also have CONFIG_NSH_NETINIT=y (2016-06-09).
|
||||
* arch/arm/src/kinetis: Kinetis pwm support, based on kl_pwm driver.
|
||||
From kfazz (2016-06-09).
|
||||
* net/: In both IPv6 and IPv4 incoming logic: (1) Should check if the
|
||||
packet size is large enough before trying to access the packet length
|
||||
in the IP header. (2) In the comparison between the IP length and the
|
||||
full packet length, need to subtract the size of the link layer header
|
||||
before making the comparison or we will get false positives (i.e., the
|
||||
packet is really too small) (2016-06-09).
|
||||
* arch/srm/src/stm32: Fix compilation errors in debug mode of
|
||||
stm32_pwm.c. From Konstantin Berezenko (2016-06-09).
|
||||
* arch/arm/src/kinetis: Support up to 8 channels per timer. From kfazz
|
||||
(2016-06-09).
|
||||
* lib/: crc16: fix error. From Paul Alexander Patience (2016-06-10).
|
||||
* lib/: Add crc64 support. From Paul Alexander Patience (2016-06-10).
|
||||
* arch/arm/src/kinetis: Added kl_dumpgpio functionality as
|
||||
kinetis_pindump. From kfazz (2016-06-10).
|
||||
* arch/arm/src/sam34: Fix some errors in AFEC header file. From
|
||||
OrbitalFox (2016-06-10).
|
||||
* arch/arm/include/stm32: Correct the can2 rx irq number for stm32f10xx
|
||||
chips. From Konstantin Berezenko (2016-06-10).
|
||||
* drivers/include/input: Button upper half driver: Add definitions
|
||||
needed for compilation with the poll() interface is not disabled
|
||||
(2016-06-11).
|
||||
* Kconfig/, include/debug.h, and many other files: (1) Debug features
|
||||
are now enabled separately from debug output. CONFIG_DEBUG is gone.
|
||||
It is replaced with CONFIG_DEBUG_FEATURES. (2) The macros dbg() and
|
||||
vdbg() have renamed as err() and info(), respectively. This also
|
||||
applies to all of the variants as well, lldbg(), llvdbg(), XXdbg(),
|
||||
XXvdbg(), XXlldbg(), and XXllvdbg(). (3) Add a new debug level,
|
||||
warn() (and all variants vwarn(), llwarn(), etc.). (4) Debug
|
||||
assertions can now be enabled separately from debug output. (5) You
|
||||
can now enable subsystem/device driver debug output at different
|
||||
output levels. For example, CONFIG_DEBUG_FS no longer enables file
|
||||
system debug output. It enables general file system debug logic and
|
||||
enables selection of CONFIG_DEBUG_FS_ERROR, CONFIG_DEBUG_FS_WARN,
|
||||
and CONFIG_DEBUG_FS_INFO (2016-06-12).
|
||||
* strtoul() and strtoull(): Fix errno settings required by function
|
||||
definition. Resolved Bitbucket Issue #1. From Sebastien Lorquet
|
||||
(2016-06-13)
|
||||
* arch/arm/src/stm32f7: Add SPI driver. DMA not yet supported. From
|
||||
David Sidrane (2016-06-14).
|
||||
* configs/nucleo-144: Add test for STM32 F7 SPI. From David Sidrane
|
||||
(2016-06-14).
|
||||
* alert(): New debug macro: alert(). This is high priority,
|
||||
unconditional output and is used to simplify and stanardize crash
|
||||
error reporting(2016-06-14).
|
||||
* arch/arm/src/tiva: Bug Fix in tiva_serial.c - UART5, UART6 and UART7
|
||||
were not being configured as TTYS0 for printing over serial console.
|
||||
From Shirshak Sengupta (2016-06-14).
|
||||
* SAMV7: SPI: SPI-Freq. 40MHz; VARSELECT; hw-features
|
||||
This change adds the following improvements:
|
||||
- Increase the allowed SPI-Frequency from 20 to 40 MHz.
|
||||
- Correct and rename the "VARSELECT" option
|
||||
This option was included in the code as "CONFIG_SPI_VARSELECT" but
|
||||
nowhere defined in a Kconfig file. The change renames it to
|
||||
"CONFIG_SAMV7_SPI_VARSELECT" and corrects the implementation
|
||||
according the datasheet of Atmel. In short, this option switches
|
||||
the processor from "fixed peripheral selection" (single device) to
|
||||
"variable peripheral selection" (multiple devices on the bus).
|
||||
- Add a new Function to the interface to control the timing and delays
|
||||
of the chip according the ChipSelect lines. This function can
|
||||
control the delay between the assertion of the ChipSelect and the
|
||||
first bit, between the last bit and the de-assertion of the
|
||||
ChipSelect and between two ChipSelects. This is needed to tune the
|
||||
transfer according the specification of the connected devices.
|
||||
- Add three "hw-features" for the SAMV7, which controls the behavior
|
||||
of the ChipSelect:
|
||||
- force CS inactive after transfer: this forces a (short)
|
||||
de-assertion of the CS after a transfer, even if more data is
|
||||
available in time
|
||||
- force CS active after transfer: this forces the CS to stay active
|
||||
after a transfer, even if the chip runs out of data.
|
||||
Btw.: this is a prerequisit to make the LASTXFER bit working at all.
|
||||
- escape LASTXFER: this suppresses the LASTXFER bit at the end of the
|
||||
next transfer. The "escape"-Flag is reset automatically.
|
||||
From Frank Benkert (2016-06-14)
|
||||
|
|
|
|||
|
|
@ -162,10 +162,10 @@
|
|||
Pre-processor Definitions
|
||||
</li>
|
||||
<li>
|
||||
Private Types
|
||||
Private Types (definitions)
|
||||
</li>
|
||||
<li>
|
||||
Private Function Prototypes
|
||||
Private Function Prototypes (declarations)
|
||||
</li>
|
||||
<li>
|
||||
Private Data (definitions)
|
||||
|
|
@ -191,7 +191,7 @@
|
|||
Pre-processor Definitions
|
||||
</li>
|
||||
<li>
|
||||
Public Types
|
||||
Public Types (definitions)
|
||||
</li>
|
||||
<li>
|
||||
Public Data (declarations)
|
||||
|
|
@ -212,12 +212,12 @@
|
|||
</p>
|
||||
<p>
|
||||
<a name="idempotence"><b>Header File Idempotence</b></a>.
|
||||
C header file must protect against multipleinclusion through the use of macros that "guard" against multiple definitions if the header file is included multiple times.
|
||||
C header file must protect against multiple inclusion through the use of macros that "guard" against multiple definitions if the header file is included multiple times.
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>
|
||||
Each header file must contain the following pre-processor commands near the beginning of the header file: Between the file header and the "Included Files" block comment.
|
||||
Each header file must contain the following pre-processor conditional logic near the beginning of the header file: Between the file header and the "Included Files" block comment.
|
||||
For example,
|
||||
</p>
|
||||
<ul><pre>
|
||||
|
|
@ -248,7 +248,7 @@
|
|||
|
||||
<p>
|
||||
<b>Deoxygen Information</b>.
|
||||
NuttX does not use Deoxygen for documentation and no file should contain Doxygen tags.
|
||||
NuttX does not use Deoxygen for documentation and no file should contain Doxygen tags or Doxygen style comments.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -802,7 +802,7 @@
|
|||
<p>
|
||||
Definitions in the <code>Make.defs</code> file probably depend on some of the
|
||||
settings in the .<code>config</code> file. For example, the <code>CFLAGS</code> will most likely be
|
||||
different if <code>CONFIG_DEBUG=y</code>.
|
||||
different if <code>CONFIG_DEBUG_FEATURES=y</code>.
|
||||
</p>
|
||||
<p>
|
||||
The included <code>tools/Config.mk</code> file contains additional definitions that may
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@
|
|||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_USBDEV_TRACE</code>, or</li>
|
||||
<li><code>CONFIG_DEBUG and CONFIG_DEBUG_USB</code></li>
|
||||
<li><code>CONFIG_DEBUG_FEATURES and CONFIG_DEBUG_USB</code></li>
|
||||
</ul>
|
||||
<p><b>Log Data Sink</b>.
|
||||
The logged data itself may go to either (1) an internal circular buffer, or (2) may be provided on the console.
|
||||
|
|
@ -137,7 +137,7 @@
|
|||
Here is an example of USB trace output using <code>apps/examples/usbserial</code> for an LPC1768 platform with the following NuttX configuration settings:
|
||||
</p>
|
||||
<ul>
|
||||
<li><code>CONFIG_DEBUG</code>, <code>CONFIG_DEBUG_VERBOSE</code>, <code>CONFIG_USB</code>
|
||||
<li><code>CONFIG_DEBUG_FEATURES</code>, <code>CONFIG_DEBUG_INFO</code>, <code>CONFIG_USB</code>
|
||||
<li><code>CONFIG_EXAMPLES_USBSERIAL_TRACEINIT</code>, <code>CONFIG_EXAMPLES_USBSERIAL_TRACECLASS</code>,
|
||||
<code>CONFIG_EXAMPLES_USBSERIAL_TRACETRANSFERS</code>, <code>CONFIG_EXAMPLES_USBSERIAL_TRACECONTROLLER</code>,
|
||||
<code>CONFIG_EXAMPLES_USBSERIAL_TRACEINTERRUPTS</code>
|
||||
|
|
|
|||
18
README.txt
18
README.txt
|
|
@ -960,10 +960,13 @@ Native Windows Build
|
|||
In this build, you cannot use a Cygwin or MSYS shell. Rather the build must
|
||||
be performed in a Windows console window. Here is a better terminal than the
|
||||
standard issue, CMD.exe terminal: ConEmu which can be downloaded from:
|
||||
http://code.google.com/p/conemu-maximus5/
|
||||
https://sourceforge.net/projects/conemu/ or https://conemu.github.io/ .
|
||||
|
||||
Build Tools. The build still relies on some Unix-like commands. I use
|
||||
the GNUWin32 tools that can be downloaded from http://gnuwin32.sourceforge.net/.
|
||||
the GNUWin32 tools that can be downloaded from http://gnuwin32.sourceforge.net/
|
||||
using the 'Download all' selection. Individual packages can be download
|
||||
instead if you know what you are doing and want a faster download (No, I
|
||||
can't tell you which packages you should or should not download).
|
||||
|
||||
Host Compiler: I use the MingGW GCC compiler which can be downloaded from
|
||||
http://www.mingw.org/. If you are using GNUWin32, then it is recommended
|
||||
|
|
@ -971,12 +974,13 @@ Native Windows Build
|
|||
|
||||
This capability should still be considered a work in progress because:
|
||||
|
||||
(1) It has not been verified on all targets and tools, and
|
||||
(2) it still lacks some of the creature-comforts of the more mature environments.
|
||||
(1) It has not been verified on all targets and tools, and
|
||||
(2) it still lacks some of the creature-comforts of the more mature
|
||||
environments.
|
||||
|
||||
There is an alternative to the setenv.sh script available for the Windows
|
||||
native environment: tools/configure.bat. See tools/README.txt for additional
|
||||
information.
|
||||
There is an alternative to the setenv.sh script available for the Windows
|
||||
native environment: tools/configure.bat. See tools/README.txt for additional
|
||||
information.
|
||||
|
||||
Installing GNUWin32
|
||||
-------------------
|
||||
|
|
|
|||
|
|
@ -5303,7 +5303,8 @@ Additional new features and extended functionality:
|
|||
can be re-enabled if needed via configuration option.
|
||||
- NXFFS: Make the start up scan of the media a configuration option.
|
||||
It just takes to long and is not really necessary! Those rare cases
|
||||
where the scan was helpful can be fixed using flash_eraseall().
|
||||
where the scan was helpful can be fixed using MDIOC_BULKERASE IOCTL
|
||||
command.
|
||||
|
||||
* General Drivers:
|
||||
|
||||
|
|
|
|||
17
TODO
17
TODO
|
|
@ -1,4 +1,4 @@
|
|||
NuttX TODO List (Last updated May 28, 2016)
|
||||
NuttX TODO List (Last updated June 6, 2016)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
||||
|
|
@ -23,7 +23,7 @@ nuttx/:
|
|||
(11) Libraries (libc/, libm/)
|
||||
(11) File system/Generic drivers (fs/, drivers/)
|
||||
(8) Graphics subsystem (graphics/)
|
||||
(1) Build system / Toolchains
|
||||
(2) Build system / Toolchains
|
||||
(3) Linux/Cywgin simulation (arch/sim)
|
||||
(4) ARM (arch/arm/)
|
||||
|
||||
|
|
@ -1601,6 +1601,19 @@ o Build system
|
|||
Status: Open
|
||||
Priority: Low.
|
||||
|
||||
Title: NATIVE WINDOWS BUILD BROKEN
|
||||
Description: The way that apps/ no generates Kmenu files depends on changes added
|
||||
to apps/tools/mkkconfig.sh. Similar changes need to be made to
|
||||
apps/tools/mkkconfig.bat to restore the Windows Native build.
|
||||
UPDATE: The mkkconfig.bat script has been updated and appears to work.
|
||||
A native build has still not been attempted and there could likely be
|
||||
issues the carriage returns in Kconfig files. There are also some
|
||||
issues the interpreters/ficl and bas directories during 'make menuconfig'
|
||||
that still need to be investigated.
|
||||
Status: Open
|
||||
Priority: Low, since I am not aware of anyone using the Windows Native build.
|
||||
But, of course, very high if you want to use it.
|
||||
|
||||
o Other drivers (drivers/)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
|
|
|||
|
|
@ -588,7 +588,7 @@ config ARCH_ROMPGTABLE
|
|||
config DEBUG_HARDFAULT
|
||||
bool "Verbose Hard-Fault Debug"
|
||||
default n
|
||||
depends on DEBUG && (ARCH_CORTEXM3 || ARCH_CORTEXM4 || ARCH_CORTEXM7)
|
||||
depends on DEBUG_FEATURES && (ARCH_CORTEXM3 || ARCH_CORTEXM4 || ARCH_CORTEXM7)
|
||||
---help---
|
||||
Enables verbose debug output when a hard fault is occurs. This verbose
|
||||
output is sometimes helpful when debugging difficult hard fault problems,
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define EFM32_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define EFM32_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define EFM32_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define KINETIS_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define KINETIS_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define KINETIS_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define KL_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define KL_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define KL_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
/* Common Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define LPC11_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define LPC11_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define LPC11_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
/* Common Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define LPC17_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define LPC17_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define LPC17_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define LPC43_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define LPC43_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define LPC43_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define NUC_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define NUC_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define NUC_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
/* Common Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define SAM_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define SAM_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define SAM_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define SAM_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define SAM_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define SAM_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
/* Common Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define SAM_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define SAM_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define SAM_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -903,6 +903,43 @@
|
|||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32F105RB)
|
||||
# undef CONFIG_STM32_STM32L15XX /* STM32L151xx and STM32L152xx family */
|
||||
# undef CONFIG_STM32_ENERGYLITE /* STM32L EnergyLite family */
|
||||
# define CONFIG_STM32_STM32F10XX 1 /* STM32F10xxx family */
|
||||
# undef CONFIG_STM32_LOWDENSITY /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 16/32 Kbytes */
|
||||
# undef CONFIG_STM32_MEDIUMDENSITY /* STM32F100x, STM32F101x, STM32F102x and STM32F103x w/ 64/128 Kbytes */
|
||||
# undef CONFIG_STM32_MEDIUMPLUSDENSITY /* STM32L15xxC w/ 32/256 Kbytes */
|
||||
# undef CONFIG_STM32_HIGHDENSITY /* STM32F100x, STM32F101x, and STM32F103x w/ 256/512 Kbytes */
|
||||
# undef CONFIG_STM32_VALUELINE /* STM32F100x */
|
||||
# define CONFIG_STM32_CONNECTIVITYLINE 1 /* STM32F105x and STM32F107x */
|
||||
# undef CONFIG_STM32_STM32F20XX /* STM32F205x and STM32F207x */
|
||||
# undef CONFIG_STM32_STM32F30XX /* STM32F30xxx family */
|
||||
# undef CONFIG_STM32_STM32F37XX /* STM32F37xxx family */
|
||||
# undef CONFIG_STM32_STM32F40XX /* STM32F405xx and STM32407xx */
|
||||
# define STM32_NFSMC 1 /* FSMC */
|
||||
# define STM32_NATIM 1 /* One advanced timers TIM1 */
|
||||
# define STM32_NGTIM 4 /* 16-bit general timers TIM2-5 with DMA */
|
||||
# define STM32_NGTIMNDMA 0 /* No 16-bit general timers without DMA */
|
||||
# define STM32_NBTIM 2 /* Two basic timers, TIM6-7 */
|
||||
# define STM32_NDMA 2 /* DMA1-2 */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2 (multiplexed with SPI2-3) */
|
||||
# define STM32_NUSART 5 /* USART1-3, UART 4-5 */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 2 /* CAN1-2 */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 0 /* No LCD */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS */
|
||||
# define STM32_NGPIO 51 /* GPIOA-E */
|
||||
# define STM32_NADC 2 /* ADC1-2 */
|
||||
# define STM32_NDAC 2 /* DAC1-2 */
|
||||
# define STM32_NCAPSENSE 0 /* No capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* 100/100 Ethernet MAC */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32F107VC)
|
||||
# undef CONFIG_STM32_STM32L15XX /* STM32L151xx and STM32L152xx family */
|
||||
# undef CONFIG_STM32_ENERGYLITE /* STM32L EnergyLite family */
|
||||
|
|
@ -2430,7 +2467,7 @@
|
|||
# if defined(CONFIG_ARCH_CHIP_STM32F469A)
|
||||
# define STM32_NETHERNET 0 /* No Ethernet MAC */
|
||||
# elif defined(CONFIG_ARCH_CHIP_STM32F469I) || \
|
||||
# defined(CONFIG_ARCH_CHIP_STM32F469B) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F469B) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F469N)
|
||||
# define STM32_NETHERNET 1 /* 100/100 Ethernet MAC */
|
||||
# endif
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define STM32_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define STM32_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define STM32_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@
|
|||
# define STM32_IRQ_ETH (77) /* 61: Ethernet global interrupt */
|
||||
# define STM32_IRQ_ETHWKUP (78) /* 62: Ethernet Wakeup through EXTI line interrupt */
|
||||
# define STM32_IRQ_CAN2TX (79) /* 63: CAN2 TX interrupts */
|
||||
# define STM32_IRQ_CAN2RX0 (70) /* 64: CAN2 RX0 interrupts */
|
||||
# define STM32_IRQ_CAN2RX0 (80) /* 64: CAN2 RX0 interrupts */
|
||||
# define STM32_IRQ_CAN2RX1 (81) /* 65: CAN2 RX1 interrupt */
|
||||
# define STM32_IRQ_CAN2SCE (82) /* 66: CAN2 SCE interrupt */
|
||||
# define STM32_IRQ_OTGFS (83) /* 67: USB On The Go FS global interrupt */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/************************************************************************************
|
||||
* arch/arm/include/stm32f7/chip.h
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -45,99 +45,272 @@
|
|||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
/* STM32F745xx, STM32F746xx, and STM32F56xx. Differences between family members:
|
||||
/* STM32F745xx, STM32F746xx, STM32F756xx, STM32F765xx, STM32F767xx, STM32F768xx,
|
||||
* STM32F769xx, STM32F777xx and STM32F779xx Differences between family members:
|
||||
*
|
||||
* ----------- ---------------- ----- -------- ------------ --------
|
||||
* PART PACKAGE GPIOs SPI/I2S ADC CHANNELS LCD-TFT?
|
||||
* ----------- ---------------- ----- -------- ------------ --------
|
||||
* STM32F745Vx LQFP100 82 4/3 16 No
|
||||
* STM32F745Zx WLCSP143/LQFP144 114 6/3 24 No
|
||||
* STM32F745Ix UFBGA176/LQFP176 140 6/3 24 No
|
||||
* STM32F745Bx LQFP208 168 6/3 24 No
|
||||
* STM32F745Nx TFBGA216 68 6/3 24 No
|
||||
* ----------- ---------------- ----- ---- ----- ---- ---- ---- ---- ---- ----- ----- ---- ------------ ------
|
||||
* SPI ADC LCD
|
||||
* PART PACKAGE GPIOs I2S CHAN TFT MIPI JPEG CAN ETH DFSDM CRYPTO FPU RAM L1
|
||||
* ----------- ---------------- ----- ---- ----- ---- ---- ---- ---- ---- ----- ----- ---- ------------ ------
|
||||
* STM32F745Vx LQFP100 82 4/3 16 No No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
* STM32F745Zx WLCSP143/LQFP144 114 6/3 24 No No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
* STM32F745Ix UFBGA176/LQFP176 140 6/3 24 No No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
* STM32F745Bx LQFP208 168 6/3 24 No No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
* STM32F745Nx TFBGA216 68 6/3 24 No No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
*
|
||||
* STM32F746Vx LQFP100 82 4/3 16 Yes
|
||||
* STM32F746Zx WLCSP143/LQFP144 114 6/3 24 Yes
|
||||
* STM32F746Ix UFBGA176/LQFP176 140 6/3 24 Yes
|
||||
* STM32F746Bx LQFP208 168 6/3 24 Yes
|
||||
* STM32F746Nx TFBGA216 168 6/3 24 Yes
|
||||
* STM32F746Vx LQFP100 82 4/3 16 Yes No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
* STM32F746Zx WLCSP143/LQFP144 114 6/3 24 Yes No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
* STM32F746Ix UFBGA176/LQFP176 140 6/3 24 Yes No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
* STM32F746Bx LQFP208 168 6/3 24 Yes No No 2 Yes No No SFPU (240+16+64) 4+4
|
||||
* STM32F746Nx TFBGA216 168 6/3 24 Yes No No 2 Yes No No SFPU
|
||||
*
|
||||
* STM32F756Vx LQFP100 82 4/3 16 Yes
|
||||
* STM32F756Zx WLCSP143/LQFP144 114 6/3 24 Yes
|
||||
* STM32F756Ix UFBGA176/LQFP176 140 6/3 24 Yes
|
||||
* STM32F756Bx LQFP208 168 6/3 24 Yes
|
||||
* STM32F756Nx TFBGA216 168 6/3 24 Yes
|
||||
* ----------- ---------------- ----- -------- ------------ --------
|
||||
* STM32F756Vx LQFP100 82 4/3 16 Yes No No 2 Yes No Yes SFPU (240+16+64) 4+4
|
||||
* STM32F756Zx WLCSP143/LQFP144 114 6/3 24 Yes No No 2 Yes No Yes SFPU (240+16+64) 4+4
|
||||
* STM32F756Ix UFBGA176/LQFP176 140 6/3 24 Yes No No 2 Yes No Yes SFPU (240+16+64) 4+4
|
||||
* STM32F756Bx LQFP208 168 6/3 24 Yes No No 2 Yes No Yes SFPU (240+16+64) 4+4
|
||||
* STM32F756Nx TFBGA216 168 6/3 24 Yes No No 2 Yes No Yes SFPU (240+16+64) 4+4
|
||||
*
|
||||
* STM32F765Vx LQFP100 82 4/3 16 No No No 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F765Zx WLCSP143/LQFP144 114 6/3 24 No No No 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F765Ix UFBGA176/LQFP176 140 6/3 24 No No No 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F765Bx LQFP208 168 6/3 24 No No No 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F765Nx TFBGA216 168 6/3 24 No No No 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
*
|
||||
* STM32F767Vx LQFP100 82 4/3 16 Yes No Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F767Zx WLCSP143/LQFP144 114 6/3 24 Yes No Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F767Ix UFBGA176/LQFP176 132 6/3 24 Yes Yes Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F767Bx LQFP208 168 6/3 24 Yes Yes Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F767Nx TFBGA216 159 6/3 24 Yes Yes Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
*
|
||||
* STM32F768Ax WLCSP180 129 6/3 24 Yes Yes Yes 3 No Yes No DFPU (368+16+128) 16+16
|
||||
*
|
||||
* STM32F769Vx LQFP100 82 4/3 16 Yes No Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F769Zx LQFP144 114 6/3 24 Yes No Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F769Ix UFBGA176/LQFP176 132 6/3 24 Yes Yes Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F769Bx LQFP208 168 6/3 24 Yes Yes Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
* STM32F769Nx TFBGA216 159 6/3 24 Yes Yes Yes 3 Yes Yes No DFPU (368+16+128) 16+16
|
||||
*
|
||||
* STM32F769Ax WLCSP180 129 6/3 24 Yes Yes Yes 3 No Yes No DFPU (368+16+128) 16+16
|
||||
*
|
||||
* STM32F777Vx LQFP100 82 4/3 16 Yes No Yes 3 Yes Yes Yes DFPU (368+16+128) 16+16
|
||||
* STM32F777Zx LQFP144 114 6/3 24 Yes No Yes 3 Yes Yes Yes DFPU (368+16+128) 16+16
|
||||
* STM32F777Ix UFBGA176/LQFP176 132 6/3 24 Yes Yes Yes 3 Yes Yes Yes DFPU (368+16+128) 16+16
|
||||
* STM32F777Bx LQFP208 159 6/3 24 Yes Yes Yes 3 Yes Yes Yes DFPU (368+16+128) 16+16
|
||||
* STM32F777Nx TFBGA216 159 6/3 24 Yes Yes Yes 3 Yes Yes Yes DFPU (368+16+128) 16+16
|
||||
*
|
||||
* STM32F778Ax WLCSP180 129 6/3 24 Yes Yes Yes 3 No Yes Yes DFPU (368+16+128) 16+16
|
||||
*
|
||||
* STM32F779Ix UFBGA176/LQFP176 132 6/3 24 Yes Yes Yes 3 Yes Yes Yes DFPU (368+16+128) 16+16
|
||||
* STM32F779Bx LQFP208 159 6/3 24 Yes Yes Yes 3 Yes Yes Yes DFPU (368+16+128) 16+16
|
||||
* STM32F779Nx TFBGA216 159 6/3 24 Yes Yes Yes 3 Yes Yes Yes DFPU (368+16+128) 16+16
|
||||
|
||||
* STM32F779Ax WLCSP180 129 6/3 24 Yes Yes Yes 3 No Yes Yes DFPU (368+16+128) 16+16
|
||||
* ----------- ---------------- ----- ---- ----- ---- ---- ---- ---- ---- ----- ----- ---- ------------ ------
|
||||
*
|
||||
* Parts STM32F74xxE have 512Kb of FLASH
|
||||
* Parts STM32F74xxG have 1024Kb of FLASH
|
||||
* Parts STM32F74xxI have 2048Kb of FLASH
|
||||
*
|
||||
* The correct FLASH size will be set CONFIG_STM32F7_FLASH_CONFIG_x or overridden
|
||||
* with CONFIG_STM32F7_FLASH_OVERRIDE_x
|
||||
*
|
||||
* The correct FLASH size must be set with a CONFIG_STM32F7_FLASH_*KB
|
||||
* selection.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARCH_CHIP_STM32F745) || defined(CONFIG_ARCH_CHIP_STM32F746) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F756)
|
||||
|
||||
#if defined(CONFIG_ARCH_CHIP_STM32F745)
|
||||
# define STM32F7_STM32F745XX 1 /* STM32F745xx family */
|
||||
# undef STM32F7_STM32F746XX /* Not STM32F746xx family */
|
||||
# undef STM32F7_STM32F756XX /* Not STM32F756xx family */
|
||||
|
||||
# define STM32F7_NLCDTFT 0 /* No LCD-TFT */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32F746)
|
||||
|
||||
# undef STM32F7_STM32F745XX /* Not STM32F745xx family */
|
||||
# define STM32F7_STM32F746XX 1 /* STM32F746xx family */
|
||||
# undef STM32F7_STM32F756XX /* Not STM32F756xx family */
|
||||
|
||||
# define STM32F7_NLCDTFT 1 /* One LCD-TFT */
|
||||
|
||||
#else /* if defined(CONFIG_ARCH_CHIP_STM32F746) */
|
||||
|
||||
# undef STM32F7_STM32F745XX /* Not STM32F745xx family */
|
||||
# undef STM32F7_STM32F746XX /* Not STM32F746xx family */
|
||||
# define STM32F7_STM32F756XX 1 /* STM32F756xx family */
|
||||
|
||||
# define STM32F7_NLCDTFT 1 /* One LCD-TFT */
|
||||
#if defined(CONFIG_ARCH_CHIP_STM32F745VG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F745VE) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F745IG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F745IE) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F745ZE) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F745ZG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746BG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746VG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746VE) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746BE) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746ZG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746IE) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746NG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746NE) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746ZE) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F746IG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F756NG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F756BG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F756IG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F756VG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F756ZG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765NI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765VI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765VG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765BI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765NG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765ZG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765ZI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765IG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765BG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F765II) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767NG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767IG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767VG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767ZG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767NI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767VI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767BG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767ZI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F767II) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F769BI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F769II) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F769BG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F769NI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F769AI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F769NG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F769IG) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F777ZI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F777VI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F777NI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F777BI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F777II) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F778AI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F779II) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F779NI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F779BI) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32F779AI)
|
||||
#else
|
||||
# error STM32 F7 chip not identified
|
||||
#endif
|
||||
|
||||
# define STM32F7_SRAM1_SIZE (240*1024) /* 240Kb SRAM1 on AHB bus Matrix */
|
||||
# define STM32F7_SRAM2_SIZE (16*1024) /* 16Kb SRAM2 on AHB bus Matrix */
|
||||
# define STM32F7_DTCM_SRAM_SIZE (64*1024) /* 64Kb DTCM SRAM on TCM inerface */
|
||||
# define STM32F7_ITCM_SRAM_SIZE (16*1024) /* 16Kb ITCM SRAM on TCM inerface */
|
||||
/* Size SRAM */
|
||||
|
||||
#if defined(CONFIG_STM32F7_STM32F74XX) || defined(CONFIG_STM32F7_STM32F75XX)
|
||||
# define STM32F7_SRAM1_SIZE (240*1024) /* 240Kb SRAM1 on AHB bus Matrix */
|
||||
# define STM32F7_SRAM2_SIZE (16*1024) /* 16Kb SRAM2 on AHB bus Matrix */
|
||||
# if defined(CONFIG_ARMV7M_HAVE_DTCM)
|
||||
# define STM32F7_DTCM_SRAM_SIZE (64*1024) /* 64Kb DTCM SRAM on TCM interface */
|
||||
# else
|
||||
# define STM32F7_DTCM_SRAM_SIZE (0) /* No DTCM SRAM on TCM interface */
|
||||
# endif
|
||||
# if defined(CONFIG_ARMV7M_HAVE_ITCM)
|
||||
# define STM32F7_ITCM_SRAM_SIZE (16*1024) /* 16Kb ITCM SRAM on TCM interface */
|
||||
# else
|
||||
# define STM32F7_ITCM_SRAM_SIZE (0) /* No ITCM SRAM on TCM interface */
|
||||
# endif
|
||||
#elif defined(CONFIG_STM32F7_STM32F76XX) || defined(CONFIG_STM32F7_STM32F77X)
|
||||
# define STM32F7_SRAM1_SIZE (368*1024) /* 368Kb SRAM1 on AHB bus Matrix */
|
||||
# define STM32F7_SRAM2_SIZE (16*1024) /* 16Kb SRAM2 on AHB bus Matrix */
|
||||
# if defined(CONFIG_ARMV7M_HAVE_DTCM)
|
||||
# define STM32F7_DTCM_SRAM_SIZE (128*1024) /* 128Kb DTCM SRAM on TCM interface */
|
||||
# else
|
||||
# define STM32F7_DTCM_SRAM_SIZE (0) /* No DTCM SRAM on TCM interface */
|
||||
# endif
|
||||
# if defined(CONFIG_ARMV7M_HAVE_ITCM)
|
||||
# define STM32F7_ITCM_SRAM_SIZE (16*1024) /* 16Kb ITCM SRAM on TCM interface */
|
||||
# else
|
||||
# define STM32F7_ITCM_SRAM_SIZE (0) /* No ITCM SRAM on TCM interface */
|
||||
# endif
|
||||
#else
|
||||
# error STM32 F7 chip Family not identified
|
||||
#endif
|
||||
|
||||
/* Common to all Family members */
|
||||
|
||||
# define STM32F7_NFSMC 1 /* Have FSMC memory controller */
|
||||
# define STM32F7_NETHERNET 1 /* 100/100 Ethernet MAC */
|
||||
# define STM32F7_NATIM 2 /* Two advanced timers TIM1 and 8 */
|
||||
# define STM32F7_NGTIM32 2 /* 32-bit general timers TIM2 and 5 with DMA */
|
||||
# define STM32F7_NGTIM16 2 /* 16-bit general timers TIM3 and 4 with DMA */
|
||||
# define STM32F7_NGTIMNDMA 6 /* 16-bit general timers TIM9-14 without DMA */
|
||||
# define STM32F7_NBTIM 2 /* Two basic timers, TIM6-7 */
|
||||
# define STM32F7_NRNG 1 /* Random number generator (RNG) */
|
||||
# define STM32F7_NUART 4 /* UART 4-5 and 7-8 */
|
||||
# define STM32F7_NUSART 4 /* USART1-3 and 6 */
|
||||
# define STM32F7_NSPI 6 /* SPI1-6 (Except V series) */
|
||||
# define STM32F7_NI2S 3 /* I2S1-2 (multiplexed with SPI1-3) */
|
||||
# define STM32F7_NI2C 4 /* I2C1-4 */
|
||||
# define STM32F7_NUSBOTGFS 1 /* USB OTG FS */
|
||||
# define STM32F7_NUSBOTGHS 1 /* USB OTG HS */
|
||||
# define STM32F7_NCAN 2 /* CAN1-2 */
|
||||
# define STM32F7_NSAI 2 /* SAI1-2 */
|
||||
# define STM32F7_NSPDIFRX 4 /* 4 SPDIFRX inputs */
|
||||
# define STM32F7_NSDMMC 1 /* SDMMC interface */
|
||||
# define STM32F7_NDCMI 1 /* Digital camera interface (DCMI) */
|
||||
# define STM32F7_NDMA 2 /* DMA1-2 */
|
||||
# define STM32F7_NDMA2D 1 /* DChrom-ART Accelerator™ (DMA2D) */
|
||||
# define STM32F7_NGPIO 11 /* 11 GPIO ports, GPIOA-K */
|
||||
# define STM32F7_NADC 3 /* 12-bit ADC1-3, 24 channels *except V series) */
|
||||
# define STM32F7_NDAC 2 /* 12-bit DAC1-2 */
|
||||
# define STM32F7_NCAPSENSE 0 /* No capacitive sensing channels */
|
||||
# define STM32F7_NCRC 1 /* CRC */
|
||||
|
||||
/* TBD FPU Configuration */
|
||||
|
||||
#if defined(CONFIG_ARCH_HAVE_FPU)
|
||||
#else
|
||||
# error STM32 F7 chip not identified
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARCH_HAVE_DPFPU)
|
||||
#else
|
||||
#endif
|
||||
|
||||
/* Diversification based on Family and package */
|
||||
|
||||
#if defined(CONFIG_STM32F7_HAVE_FSMC)
|
||||
# define STM32F7_NFSMC 1 /* Have FSMC memory controller */
|
||||
#else
|
||||
# define STM32F7_NFSMC 0 /* No FSMC memory controller */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_ETHRNET)
|
||||
# define STM32F7_NETHERNET 1 /* 100/100 Ethernet MAC */
|
||||
#else
|
||||
# define STM32F7_NETHERNET 0 /* No 100/100 Ethernet MAC */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_RNG)
|
||||
# define STM32F7_NRNG 1 /* Random number generator (RNG) */
|
||||
#else
|
||||
# define STM32F7_NRNG 0 /* No Random number generator (RNG) */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_SPI5) && defined(CONFIG_STM32F7_HAVE_SPI6)
|
||||
# define STM32F7_NSPI 6 /* SPI1-6 (Except V series) */
|
||||
#else
|
||||
# define STM32F7_NSPI 4 /* SPI1-4 V series */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_SDMMC2)
|
||||
# define STM32F7_NSDMMC 2 /* 2 SDMMC interfaces */
|
||||
#else
|
||||
# define STM32F7_NSDMMC 1 /* 1 SDMMC interface */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_CAN3)
|
||||
# define STM32F7_NCAN 3 /* CAN1-3 */
|
||||
#else
|
||||
# define STM32F7_NCAN 2 /* CAN1-2 */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_DCMI)
|
||||
# define STM32F7_NDCMI 1 /* Digital camera interface (DCMI) */
|
||||
#else
|
||||
# define STM32F7_NDCMI 0 /* No Digital camera interface (DCMI) */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_DSIHOST)
|
||||
# define STM32F7_NDSIHOST 1 /* Have MIPI DSI Host */
|
||||
#else
|
||||
# define STM32F7_NDSIHOST 0 /* No MIPI DSI Host */
|
||||
#endif
|
||||
#if defined (CONFIG_STM32F7_HAVE_LTDC)
|
||||
# define STM32F7_NLCDTFT 1 /* One LCD-TFT */
|
||||
#else
|
||||
# define STM32F7_NLCDTFT 0 /* No LCD-TFT */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_DMA2D)
|
||||
# define STM32F7_NDMA2D 0 /* No DChrom-ART Accelerator™ (DMA2D) */
|
||||
#else
|
||||
# define STM32F7_NDMA2D 1 /* DChrom-ART Accelerator™ (DMA2D) */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_JPEG)
|
||||
#define STM32F7_NJPEG 1 /* One JPEG Converter */
|
||||
#else
|
||||
#define STM32F7_NJPEG 0 /* No JPEG Converter */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_CRYP)
|
||||
#define STM32F7_NCRYP 1 /* One CRYP engine */
|
||||
#else
|
||||
#define STM32F7_NCRYP 0 /* No CRYP engine */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_HASH)
|
||||
#define STM32F7_NHASH 1 /* One HASH engine */
|
||||
#else
|
||||
#define STM32F7_NHASH 0 /* No HASH engine */
|
||||
#endif
|
||||
#if defined(CONFIG_STM32F7_HAVE_DFSDM)
|
||||
#define STM32F7_NDFSDM 4 /* One set of 4 Digital filters */
|
||||
#else
|
||||
#define STM32F7_NDFSDM 0 /* No Digital filters */
|
||||
#endif
|
||||
|
||||
/* NVIC priority levels *************************************************************/
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define STM32_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define STM32_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define STM32_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
@ -78,6 +78,8 @@
|
|||
|
||||
#if defined(CONFIG_STM32F7_STM32F74XX) || defined(CONFIG_STM32F7_STM32F75XX)
|
||||
# include <arch/stm32f7/stm32f74xx75xx_irq.h>
|
||||
#elif defined(CONFIG_STM32F7_STM32F76XX) || defined(CONFIG_STM32F7_STM32F77XX)
|
||||
# include <arch/stm32f7/stm32f76xx77xx_irq.h>
|
||||
#else
|
||||
# error "Unsupported STM32 F7 chip"
|
||||
#endif
|
||||
|
|
|
|||
215
arch/arm/include/stm32f7/stm32f76xx77xx_irq.h
Normal file
215
arch/arm/include/stm32f7/stm32f76xx77xx_irq.h
Normal file
|
|
@ -0,0 +1,215 @@
|
|||
/****************************************************************************************************
|
||||
* arch/arm/include/stm32f7/stm32f76xx77xx_irq.h.h
|
||||
*
|
||||
* Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
* Authors: Gregory Nutt <gnutt@nuttx.org>
|
||||
* David Sidrane <david_s5@nscdg.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name NuttX nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
/* This file should never be included directed but, rather, only indirectly through arch/irq.h */
|
||||
|
||||
#ifndef __ARCH_ARM_INCLUDE_STM32F7_STM32F76XX77XX_IRQ_H
|
||||
#define __ARCH_ARM_INCLUDE_STM32F7_STM32F76XX77XX_IRQ_H
|
||||
|
||||
/****************************************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************************************/
|
||||
|
||||
/* IRQ numbers. The IRQ number corresponds vector number and hence map directly to bits in the
|
||||
* NVIC. This does, however, waste several words of memory in the IRQ to handle mapping tables.
|
||||
*
|
||||
* Processor Exceptions (vectors 0-15). These common definitions can be found in the file
|
||||
* nuttx/arch/arm/include/stm32f7/irq.h which includes this file
|
||||
*
|
||||
* External interrupts (vectors >= 16)
|
||||
*/
|
||||
|
||||
#define STM32_IRQ_WWDG (STM32_IRQ_FIRST+0) /* 0: Window Watchdog interrupt */
|
||||
#define STM32_IRQ_PVD (STM32_IRQ_FIRST+1) /* 1: PVD through EXTI Line detection interrupt */
|
||||
#define STM32_IRQ_TAMPER (STM32_IRQ_FIRST+2) /* 2: Tamper and time stamp interrupts */
|
||||
#define STM32_IRQ_TIMESTAMP (STM32_IRQ_FIRST+2) /* 2: Tamper and time stamp interrupts */
|
||||
#define STM32_IRQ_RTC_WKUP (STM32_IRQ_FIRST+3) /* 3: RTC global interrupt */
|
||||
#define STM32_IRQ_FLASH (STM32_IRQ_FIRST+4) /* 4: Flash global interrupt */
|
||||
#define STM32_IRQ_RCC (STM32_IRQ_FIRST+5) /* 5: RCC global interrupt */
|
||||
#define STM32_IRQ_EXTI0 (STM32_IRQ_FIRST+6) /* 6: EXTI Line 0 interrupt */
|
||||
#define STM32_IRQ_EXTI1 (STM32_IRQ_FIRST+7) /* 7: EXTI Line 1 interrupt */
|
||||
#define STM32_IRQ_EXTI2 (STM32_IRQ_FIRST+8) /* 8: EXTI Line 2 interrupt */
|
||||
#define STM32_IRQ_EXTI3 (STM32_IRQ_FIRST+9) /* 9: EXTI Line 3 interrupt */
|
||||
#define STM32_IRQ_EXTI4 (STM32_IRQ_FIRST+10) /* 10: EXTI Line 4 interrupt */
|
||||
#define STM32_IRQ_DMA1S0 (STM32_IRQ_FIRST+11) /* 11: DMA1 Stream 0 global interrupt */
|
||||
#define STM32_IRQ_DMA1S1 (STM32_IRQ_FIRST+12) /* 12: DMA1 Stream 1 global interrupt */
|
||||
#define STM32_IRQ_DMA1S2 (STM32_IRQ_FIRST+13) /* 13: DMA1 Stream 2 global interrupt */
|
||||
#define STM32_IRQ_DMA1S3 (STM32_IRQ_FIRST+14) /* 14: DMA1 Stream 3 global interrupt */
|
||||
#define STM32_IRQ_DMA1S4 (STM32_IRQ_FIRST+15) /* 15: DMA1 Stream 4 global interrupt */
|
||||
#define STM32_IRQ_DMA1S5 (STM32_IRQ_FIRST+16) /* 16: DMA1 Stream 5 global interrupt */
|
||||
#define STM32_IRQ_DMA1S6 (STM32_IRQ_FIRST+17) /* 17: DMA1 Stream 6 global interrupt */
|
||||
#define STM32_IRQ_ADC (STM32_IRQ_FIRST+18) /* 18: ADC1, ADC2, and ADC3 global interrupt */
|
||||
#define STM32_IRQ_CAN1TX (STM32_IRQ_FIRST+19) /* 19: CAN1 TX interrupts */
|
||||
#define STM32_IRQ_CAN1RX0 (STM32_IRQ_FIRST+20) /* 20: CAN1 RX0 interrupts */
|
||||
#define STM32_IRQ_CAN1RX1 (STM32_IRQ_FIRST+21) /* 21: CAN1 RX1 interrupt */
|
||||
#define STM32_IRQ_CAN1SCE (STM32_IRQ_FIRST+22) /* 22: CAN1 SCE interrupt */
|
||||
#define STM32_IRQ_EXTI95 (STM32_IRQ_FIRST+23) /* 23: EXTI Line[9:5] interrupts */
|
||||
#define STM32_IRQ_TIM1BRK (STM32_IRQ_FIRST+24) /* 24: TIM1 Break interrupt */
|
||||
#define STM32_IRQ_TIM9 (STM32_IRQ_FIRST+24) /* 24: TIM9 global interrupt */
|
||||
#define STM32_IRQ_TIM1UP (STM32_IRQ_FIRST+25) /* 25: TIM1 Update interrupt */
|
||||
#define STM32_IRQ_TIM10 (STM32_IRQ_FIRST+25) /* 25: TIM10 global interrupt */
|
||||
#define STM32_IRQ_TIM1TRGCOM (STM32_IRQ_FIRST+26) /* 26: TIM1 Trigger and Commutation interrupts */
|
||||
#define STM32_IRQ_TIM11 (STM32_IRQ_FIRST+26) /* 26: TIM11 global interrupt */
|
||||
#define STM32_IRQ_TIM1CC (STM32_IRQ_FIRST+27) /* 27: TIM1 Capture Compare interrupt */
|
||||
#define STM32_IRQ_TIM2 (STM32_IRQ_FIRST+28) /* 28: TIM2 global interrupt */
|
||||
#define STM32_IRQ_TIM3 (STM32_IRQ_FIRST+29) /* 29: TIM3 global interrupt */
|
||||
#define STM32_IRQ_TIM4 (STM32_IRQ_FIRST+30) /* 30: TIM4 global interrupt */
|
||||
#define STM32_IRQ_I2C1EV (STM32_IRQ_FIRST+31) /* 31: I2C1 event interrupt */
|
||||
#define STM32_IRQ_I2C1ER (STM32_IRQ_FIRST+32) /* 32: I2C1 error interrupt */
|
||||
#define STM32_IRQ_I2C2EV (STM32_IRQ_FIRST+33) /* 33: I2C2 event interrupt */
|
||||
#define STM32_IRQ_I2C2ER (STM32_IRQ_FIRST+34) /* 34: I2C2 error interrupt */
|
||||
#define STM32_IRQ_SPI1 (STM32_IRQ_FIRST+35) /* 35: SPI1 global interrupt */
|
||||
#define STM32_IRQ_SPI2 (STM32_IRQ_FIRST+36) /* 36: SPI2 global interrupt */
|
||||
#define STM32_IRQ_USART1 (STM32_IRQ_FIRST+37) /* 37: USART1 global interrupt */
|
||||
#define STM32_IRQ_USART2 (STM32_IRQ_FIRST+38) /* 38: USART2 global interrupt */
|
||||
#define STM32_IRQ_USART3 (STM32_IRQ_FIRST+39) /* 39: USART3 global interrupt */
|
||||
#define STM32_IRQ_EXTI1510 (STM32_IRQ_FIRST+40) /* 40: EXTI Line[15:10] interrupts */
|
||||
#define STM32_IRQ_RTCALRM (STM32_IRQ_FIRST+41) /* 41: RTC alarm through EXTI line interrupt */
|
||||
#define STM32_IRQ_OTGFSWKUP (STM32_IRQ_FIRST+42) /* 42: USB On-The-Go FS Wakeup through EXTI line interrupt */
|
||||
#define STM32_IRQ_TIM8BRK (STM32_IRQ_FIRST+43) /* 43: TIM8 Break interrupt */
|
||||
#define STM32_IRQ_TIM12 (STM32_IRQ_FIRST+43) /* 43: TIM12 global interrupt */
|
||||
#define STM32_IRQ_TIM8UP (STM32_IRQ_FIRST+44) /* 44: TIM8 Update interrupt */
|
||||
#define STM32_IRQ_TIM13 (STM32_IRQ_FIRST+44) /* 44: TIM13 global interrupt */
|
||||
#define STM32_IRQ_TIM8TRGCOM (STM32_IRQ_FIRST+45) /* 45: TIM8 Trigger and Commutation interrupts */
|
||||
#define STM32_IRQ_TIM14 (STM32_IRQ_FIRST+45) /* 45: TIM14 global interrupt */
|
||||
#define STM32_IRQ_TIM8CC (STM32_IRQ_FIRST+46) /* 46: TIM8 Capture Compare interrupt */
|
||||
#define STM32_IRQ_DMA1S7 (STM32_IRQ_FIRST+47) /* 47: DMA1 Stream 7 global interrupt */
|
||||
#define STM32_IRQ_FSMC (STM32_IRQ_FIRST+48) /* 48: FSMC global interrupt */
|
||||
#define STM32_IRQ_SDMMC1 (STM32_IRQ_FIRST+49) /* 49: SDMMC1 global interrupt */
|
||||
#define STM32_IRQ_TIM5 (STM32_IRQ_FIRST+50) /* 50: TIM5 global interrupt */
|
||||
#define STM32_IRQ_SPI3 (STM32_IRQ_FIRST+51) /* 51: SPI3 global interrupt */
|
||||
#define STM32_IRQ_UART4 (STM32_IRQ_FIRST+52) /* 52: UART4 global interrupt */
|
||||
#define STM32_IRQ_UART5 (STM32_IRQ_FIRST+53) /* 53: UART5 global interrupt */
|
||||
#define STM32_IRQ_TIM6 (STM32_IRQ_FIRST+54) /* 54: TIM6 global interrupt */
|
||||
#define STM32_IRQ_DAC (STM32_IRQ_FIRST+54) /* 54: DAC1 and DAC2 underrun error interrupts */
|
||||
#define STM32_IRQ_TIM7 (STM32_IRQ_FIRST+55) /* 55: TIM7 global interrupt */
|
||||
#define STM32_IRQ_DMA2S0 (STM32_IRQ_FIRST+56) /* 56: DMA2 Stream 0 global interrupt */
|
||||
#define STM32_IRQ_DMA2S1 (STM32_IRQ_FIRST+57) /* 57: DMA2 Stream 1 global interrupt */
|
||||
#define STM32_IRQ_DMA2S2 (STM32_IRQ_FIRST+58) /* 58: DMA2 Stream 2 global interrupt */
|
||||
#define STM32_IRQ_DMA2S3 (STM32_IRQ_FIRST+59) /* 59: DMA2 Stream 3 global interrupt */
|
||||
#define STM32_IRQ_DMA2S4 (STM32_IRQ_FIRST+60) /* 60: DMA2 Stream 4 global interrupt */
|
||||
#define STM32_IRQ_ETH (STM32_IRQ_FIRST+61) /* 61: Ethernet global interrupt */
|
||||
#define STM32_IRQ_ETHWKUP (STM32_IRQ_FIRST+62) /* 62: Ethernet Wakeup through EXTI line interrupt */
|
||||
#define STM32_IRQ_CAN2TX (STM32_IRQ_FIRST+63) /* 63: CAN2 TX interrupts */
|
||||
#define STM32_IRQ_CAN2RX0 (STM32_IRQ_FIRST+64) /* 64: CAN2 RX0 interrupts */
|
||||
#define STM32_IRQ_CAN2RX1 (STM32_IRQ_FIRST+65) /* 65: CAN2 RX1 interrupt */
|
||||
#define STM32_IRQ_CAN2SCE (STM32_IRQ_FIRST+66) /* 66: CAN2 SCE interrupt */
|
||||
#define STM32_IRQ_OTGFS (STM32_IRQ_FIRST+67) /* 67: USB On The Go FS global interrupt */
|
||||
#define STM32_IRQ_DMA2S5 (STM32_IRQ_FIRST+68) /* 68: DMA2 Stream 5 global interrupt */
|
||||
#define STM32_IRQ_DMA2S6 (STM32_IRQ_FIRST+69) /* 69: DMA2 Stream 6 global interrupt */
|
||||
#define STM32_IRQ_DMA2S7 (STM32_IRQ_FIRST+70) /* 70: DMA2 Stream 7 global interrupt */
|
||||
#define STM32_IRQ_USART6 (STM32_IRQ_FIRST+71) /* 71: USART6 global interrupt */
|
||||
#define STM32_IRQ_I2C3EV (STM32_IRQ_FIRST+72) /* 72: I2C3 event interrupt */
|
||||
#define STM32_IRQ_I2C3ER (STM32_IRQ_FIRST+73) /* 73: I2C3 error interrupt */
|
||||
#define STM32_IRQ_OTGHSEP1OUT (STM32_IRQ_FIRST+74) /* 74: USB On The Go HS End Point 1 Out global interrupt */
|
||||
#define STM32_IRQ_OTGHSEP1IN (STM32_IRQ_FIRST+75) /* 75: USB On The Go HS End Point 1 In global interrupt */
|
||||
#define STM32_IRQ_OTGHSWKUP (STM32_IRQ_FIRST+76) /* 76: USB On The Go HS Wakeup through EXTI interrupt */
|
||||
#define STM32_IRQ_OTGHS (STM32_IRQ_FIRST+77) /* 77: USB On The Go HS global interrupt */
|
||||
#define STM32_IRQ_DCMI (STM32_IRQ_FIRST+78) /* 78: DCMI global interrupt */
|
||||
#define STM32_IRQ_CRYP (STM32_IRQ_FIRST+79) /* 79: CRYP crypto global interrupt */
|
||||
#define STM32_IRQ_HASH (STM32_IRQ_FIRST+80) /* 80: Hash and Rng global interrupt */
|
||||
#define STM32_IRQ_RNG (STM32_IRQ_FIRST+80) /* 80: Hash and Rng global interrupt */
|
||||
#define STM32_IRQ_FPU (STM32_IRQ_FIRST+81) /* 81: FPU global interrupt */
|
||||
#define STM32_IRQ_UART7 (STM32_IRQ_FIRST+82) /* 82: UART7 global interrupt */
|
||||
#define STM32_IRQ_UART8 (STM32_IRQ_FIRST+83) /* 83: UART8 global interrupt */
|
||||
#define STM32_IRQ_SPI4 (STM32_IRQ_FIRST+84) /* 84: SPI4 global interrupt */
|
||||
#define STM32_IRQ_SPI5 (STM32_IRQ_FIRST+85) /* 85: SPI5 global interrupt */
|
||||
#define STM32_IRQ_SPI6 (STM32_IRQ_FIRST+86) /* 86: SPI6 global interrupt */
|
||||
#define STM32_IRQ_SAI1 (STM32_IRQ_FIRST+87) /* 87: SAI1 global interrupt */
|
||||
#define STM32_IRQ_LTDCINT (STM32_IRQ_FIRST+88) /* 88: LCD-TFT global interrupt */
|
||||
#define STM32_IRQ_LTDCERRINT (STM32_IRQ_FIRST+89) /* 89: LCD-TFT global Error interrupt */
|
||||
#define STM32_IRQ_DMA2D (STM32_IRQ_FIRST+90) /* 90: DMA2D global interrupt */
|
||||
#define STM32_IRQ_SAI2 (STM32_IRQ_FIRST+91) /* 91: SAI2 global interrupt */
|
||||
#define STM32_IRQ_QUADSPI (STM32_IRQ_FIRST+92) /* 92: QuadSPI global interrupt */
|
||||
#define STM32_IRQ_LPTIMER1 (STM32_IRQ_FIRST+93) /* 93: LP Timer1 global interrupt */
|
||||
#define STM32_IRQ_HDMICEC (STM32_IRQ_FIRST+94) /* 94: HDMI-CEC global interrupt */
|
||||
#define STM32_IRQ_I2C4EV (STM32_IRQ_FIRST+95) /* 95: I2C4 event interrupt */
|
||||
#define STM32_IRQ_I2C4ER (STM32_IRQ_FIRST+96) /* 96: I2C4 Error interrupt */
|
||||
#define STM32_IRQ_SPDIFRX (STM32_IRQ_FIRST+97) /* 97: SPDIFRX global interrupt */
|
||||
#define STM32_IRQ_DSIHOST (STM32_IRQ_FIRST+98) /* 98: DSI host global interrupt */
|
||||
#define STM32_IRQ_DFSDM1FLT0 (STM32_IRQ_FIRST+99) /* 99: DFSDM1 Filter 0 global interrupt */
|
||||
#define STM32_IRQ_DFSDM1FLT1 (STM32_IRQ_FIRST+100) /* 100: DFSDM1 Filter 1 global interrupt */
|
||||
#define STM32_IRQ_DFSDM1FLT2 (STM32_IRQ_FIRST+101) /* 101: DFSDM1 Filter 2 global interrupt */
|
||||
#define STM32_IRQ_DFSDM1FLT3 (STM32_IRQ_FIRST+102) /* 102: DFSDM1 Filter 3 global interrupt */
|
||||
#define STM32_IRQ_SDMMC2 (STM32_IRQ_FIRST+103) /* 103: SDMMC2 global interrupt */
|
||||
#define STM32_IRQ_CAN3TX (STM32_IRQ_FIRST+104) /* 104: CAN3 TX interrupt */
|
||||
#define STM32_IRQ_CAN3RX0 (STM32_IRQ_FIRST+105) /* 105: CAN3 RX0 interrupt */
|
||||
#define STM32_IRQ_CAN3RX1 (STM32_IRQ_FIRST+106) /* 106: CAN3 RX1 interrupt */
|
||||
#define STM32_IRQ_CAN3SCE (STM32_IRQ_FIRST+107) /* 107: CAN3 SCE interrupt */
|
||||
#define STM32_IRQ_JPEG (STM32_IRQ_FIRST+108) /* 108: JPEG global interrupt */
|
||||
#define STM32_IRQ_MDIOS (STM32_IRQ_FIRST+109) /* 109: MDIO slave global interrupt */
|
||||
|
||||
#define NR_INTERRUPTS 110
|
||||
#define NR_VECTORS (STM32_IRQ_FIRST+NR_INTERRUPTS)
|
||||
|
||||
/* EXTI interrupts (Do not use IRQ numbers) */
|
||||
|
||||
#define NR_IRQS NR_VECTORS
|
||||
|
||||
/****************************************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************************************/
|
||||
|
||||
/****************************************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __ARCH_ARM_INCLUDE_STM32F7_STM32F76XX77XX_IRQ_H */
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define STM32L4_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define STM32L4_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define STM32L4_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@
|
|||
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define TIVA_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG) */
|
||||
#define TIVA_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define TIVA_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ volatile uint32_t *g_current_regs[1];
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_IRQ)
|
||||
#if defined(CONFIG_DEBUG_IRQ_INFO)
|
||||
static void a1x_dumpintc(const char *msg, int irq)
|
||||
{
|
||||
irqstate_t flags;
|
||||
|
|
@ -85,40 +85,42 @@ static void a1x_dumpintc(const char *msg, int irq)
|
|||
/* Dump some relevant ARMv7 register contents */
|
||||
|
||||
flags = enter_critical_section();
|
||||
lldbg("ARMv7 (%s, irq=%d):\n", msg, irq);
|
||||
lldbg(" CPSR: %08x SCTLR: %08x\n", flags, cp15_rdsctlr());
|
||||
|
||||
irqinfo("ARMv7 (%s, irq=%d):\n", msg, irq);
|
||||
irqinfo(" CPSR: %08x SCTLR: %08x\n", flags, cp15_rdsctlr());
|
||||
|
||||
/* Dump all of the (readable) INTC register contents */
|
||||
|
||||
lldbg("INTC (%s, irq=%d):\n", msg, irq);
|
||||
lldbg(" VECTOR: %08x BASE: %08x PROTECT: %08x NMICTRL: %08x\n",
|
||||
getreg32(A1X_INTC_VECTOR), getreg32(A1X_INTC_BASEADDR),
|
||||
getreg32(A1X_INTC_PROTECT), getreg32(A1X_INTC_NMICTRL));
|
||||
lldbg(" IRQ PEND: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_IRQ_PEND0), getreg32(A1X_INTC_IRQ_PEND1),
|
||||
getreg32(A1X_INTC_IRQ_PEND2));
|
||||
lldbg(" FIQ PEND: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_FIQ_PEND0), getreg32(A1X_INTC_FIQ_PEND1),
|
||||
getreg32(A1X_INTC_FIQ_PEND2));
|
||||
lldbg(" SEL: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_IRQ_SEL0), getreg32(A1X_INTC_IRQ_SEL1),
|
||||
getreg32(A1X_INTC_IRQ_SEL2));
|
||||
lldbg(" EN: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_EN0), getreg32(A1X_INTC_EN1),
|
||||
getreg32(A1X_INTC_EN2));
|
||||
lldbg(" MASK: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_MASK0), getreg32(A1X_INTC_MASK1),
|
||||
getreg32(A1X_INTC_MASK2));
|
||||
lldbg(" RESP: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_RESP0), getreg32(A1X_INTC_RESP1),
|
||||
getreg32(A1X_INTC_RESP2));
|
||||
lldbg(" FF: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_FF0), getreg32(A1X_INTC_FF1),
|
||||
getreg32(A1X_INTC_FF2));
|
||||
lldbg(" PRIO: %08x %08x %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_PRIO0), getreg32(A1X_INTC_PRIO1),
|
||||
getreg32(A1X_INTC_PRIO2), getreg32(A1X_INTC_PRIO3),
|
||||
getreg32(A1X_INTC_PRIO4));
|
||||
irqinfo("INTC (%s, irq=%d):\n", msg, irq);
|
||||
irqinfo(" VECTOR: %08x BASE: %08x PROTECT: %08x NMICTRL: %08x\n",
|
||||
getreg32(A1X_INTC_VECTOR), getreg32(A1X_INTC_BASEADDR),
|
||||
getreg32(A1X_INTC_PROTECT), getreg32(A1X_INTC_NMICTRL));
|
||||
irqinfo(" IRQ PEND: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_IRQ_PEND0), getreg32(A1X_INTC_IRQ_PEND1),
|
||||
getreg32(A1X_INTC_IRQ_PEND2));
|
||||
irqinfo(" FIQ PEND: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_FIQ_PEND0), getreg32(A1X_INTC_FIQ_PEND1),
|
||||
getreg32(A1X_INTC_FIQ_PEND2));
|
||||
irqinfo(" SEL: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_IRQ_SEL0), getreg32(A1X_INTC_IRQ_SEL1),
|
||||
getreg32(A1X_INTC_IRQ_SEL2));
|
||||
irqinfo(" EN: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_EN0), getreg32(A1X_INTC_EN1),
|
||||
getreg32(A1X_INTC_EN2));
|
||||
irqinfo(" MASK: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_MASK0), getreg32(A1X_INTC_MASK1),
|
||||
getreg32(A1X_INTC_MASK2));
|
||||
irqinfo(" RESP: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_RESP0), getreg32(A1X_INTC_RESP1),
|
||||
getreg32(A1X_INTC_RESP2));
|
||||
irqinfo(" FF: %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_FF0), getreg32(A1X_INTC_FF1),
|
||||
getreg32(A1X_INTC_FF2));
|
||||
irqinfo(" PRIO: %08x %08x %08x %08x %08x\n",
|
||||
getreg32(A1X_INTC_PRIO0), getreg32(A1X_INTC_PRIO1),
|
||||
getreg32(A1X_INTC_PRIO2), getreg32(A1X_INTC_PRIO3),
|
||||
getreg32(A1X_INTC_PRIO4));
|
||||
|
||||
leave_critical_section(flags);
|
||||
}
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -1156,7 +1156,7 @@ static int uart_interrupt(struct uart_dev_s *dev)
|
|||
/* Read the modem status register (MSR) to clear */
|
||||
|
||||
status = up_serialin(priv, A1X_UART_MSR_OFFSET);
|
||||
vdbg("MSR: %02x\n", status);
|
||||
_info("MSR: %02x\n", status);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1167,7 +1167,7 @@ static int uart_interrupt(struct uart_dev_s *dev)
|
|||
/* Read the line status register (LSR) to clear */
|
||||
|
||||
status = up_serialin(priv, A1X_UART_LSR_OFFSET);
|
||||
vdbg("LSR: %02x\n", status);
|
||||
_info("LSR: %02x\n", status);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -1192,7 +1192,7 @@ static int uart_interrupt(struct uart_dev_s *dev)
|
|||
|
||||
default:
|
||||
{
|
||||
lldbg("Unexpected IIR: %02x\n", status);
|
||||
_llerr("Unexpected IIR: %02x\n", status);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/arm/up_assert.c
|
||||
*
|
||||
* Copyright (C) 2007-2010, 2012-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2010, 2012-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
|
|
@ -77,23 +66,6 @@
|
|||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||
*/
|
||||
|
||||
#undef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP))
|
||||
# define CONFIG_PRINT_TASKNAME 1
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -127,7 +99,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)stack;
|
||||
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
stack, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
|
@ -154,12 +126,12 @@ static inline void up_registerdump(void)
|
|||
for (regs = REG_R0; regs <= REG_R15; regs += 8)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)&CURRENT_REGS[regs];
|
||||
lldbg("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
||||
lldbg("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
|
||||
_alert("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
@ -228,12 +200,12 @@ static void up_dumpstate(void)
|
|||
|
||||
/* Show interrupt stack info */
|
||||
|
||||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("IRQ stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
_alert("sp: %08x\n", sp);
|
||||
_alert("IRQ stack:\n");
|
||||
_alert(" base: %08x\n", istackbase);
|
||||
_alert(" size: %08x\n", istacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
_alert(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
|
||||
/* Does the current stack pointer lie within the interrupt
|
||||
|
|
@ -251,24 +223,24 @@ static void up_dumpstate(void)
|
|||
*/
|
||||
|
||||
sp = g_intstackbase;
|
||||
lldbg("sp: %08x\n", sp);
|
||||
_alert("sp: %08x\n", sp);
|
||||
}
|
||||
|
||||
/* Show user stack info */
|
||||
|
||||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
_alert("User stack:\n");
|
||||
_alert(" base: %08x\n", ustackbase);
|
||||
_alert(" size: %08x\n", ustacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
_alert(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
#else
|
||||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("stack base: %08x\n", ustackbase);
|
||||
lldbg("stack size: %08x\n", ustacksize);
|
||||
_alert("sp: %08x\n", sp);
|
||||
_alert("stack base: %08x\n", ustackbase);
|
||||
_alert("stack size: %08x\n", ustacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
_alert("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
@ -279,7 +251,7 @@ static void up_dumpstate(void)
|
|||
if (sp > ustackbase || sp <= ustackbase - ustacksize)
|
||||
{
|
||||
#if !defined(CONFIG_ARCH_INTERRUPTSTACK) || CONFIG_ARCH_INTERRUPTSTACK < 4
|
||||
lldbg("ERROR: Stack pointer is not within allocated stack\n");
|
||||
_alert("ERROR: Stack pointer is not within allocated stack\n");
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
|
@ -339,17 +311,17 @@ static void _up_assert(int errorcode)
|
|||
|
||||
void up_assert(const uint8_t *filename, int lineno)
|
||||
{
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
struct tcb_s *rtcb = this_task();
|
||||
#endif
|
||||
|
||||
board_autoled_on(LED_ASSERTION);
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Assertion failed at file:%s line: %d task: %s\n",
|
||||
filename, lineno, rtcb->name);
|
||||
#else
|
||||
lldbg("Assertion failed at file:%s line: %d\n",
|
||||
_alert("Assertion failed at file:%s line: %d\n",
|
||||
filename, lineno);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/arm/up_dataabort.c
|
||||
*
|
||||
* Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2011, 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
@ -63,18 +52,6 @@
|
|||
# include "arm.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -112,7 +89,6 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
|
|||
* for register dumps and possibly context switching.
|
||||
*/
|
||||
|
||||
|
||||
savestate = (uint32_t *)CURRENT_REGS;
|
||||
#endif
|
||||
CURRENT_REGS = regs;
|
||||
|
|
@ -131,7 +107,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
|
|||
* fatal error.
|
||||
*/
|
||||
|
||||
pglldbg("FSR: %08x FAR: %08x\n", fsr, far);
|
||||
pgllerr("FSR: %08x FAR: %08x\n", fsr, far);
|
||||
if ((fsr & FSR_MASK) != FSR_PAGE)
|
||||
{
|
||||
goto segfault;
|
||||
|
|
@ -142,7 +118,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
|
|||
* (It has not yet been saved in the register context save area).
|
||||
*/
|
||||
|
||||
pgllvdbg("VBASE: %08x VEND: %08x\n", PG_PAGED_VBASE, PG_PAGED_VEND);
|
||||
pgllinfo("VBASE: %08x VEND: %08x\n", PG_PAGED_VBASE, PG_PAGED_VEND);
|
||||
if (far < PG_PAGED_VBASE || far >= PG_PAGED_VEND)
|
||||
{
|
||||
goto segfault;
|
||||
|
|
@ -180,7 +156,7 @@ void up_dataabort(uint32_t *regs, uint32_t far, uint32_t fsr)
|
|||
|
||||
segfault:
|
||||
#endif
|
||||
lldbg("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr);
|
||||
_alert("Data abort. PC: %08x FAR: %08x FSR: %08x\n", regs[REG_PC], far, fsr);
|
||||
PANIC();
|
||||
}
|
||||
|
||||
|
|
@ -196,7 +172,7 @@ void up_dataabort(uint32_t *regs)
|
|||
|
||||
/* Crash -- possibly showing diagnost debug information. */
|
||||
|
||||
lldbg("Data abort. PC: %08x\n", regs[REG_PC]);
|
||||
_alert("Data abort. PC: %08x\n", regs[REG_PC]);
|
||||
PANIC();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_machine != EM_ARM)
|
||||
{
|
||||
bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_ident[EI_CLASS] != ELFCLASS32)
|
||||
{
|
||||
bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
|
||||
#endif
|
||||
{
|
||||
bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if ((ehdr->e_entry & 3) != 0)
|
||||
{
|
||||
bdbg("Entry point is not properly aligned: %08x\n", ehdr->e_entry);
|
||||
berr("Entry point is not properly aligned: %08x\n", ehdr->e_entry);
|
||||
return -ENOEXEC
|
||||
}
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_CALL:
|
||||
case R_ARM_JUMP24:
|
||||
{
|
||||
bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
binfo("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
offset += sym->st_value - addr;
|
||||
if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000)
|
||||
{
|
||||
bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -201,7 +201,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_ABS32:
|
||||
case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */
|
||||
{
|
||||
bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
*(uint32_t *)addr += sym->st_value;
|
||||
|
|
@ -210,7 +210,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
case R_ARM_V4BX:
|
||||
{
|
||||
bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
binfo("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr));
|
||||
|
||||
/* Preserve only Rm and the condition code */
|
||||
|
|
@ -225,7 +225,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
case R_ARM_PREL31:
|
||||
{
|
||||
bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
offset = *(uint32_t *)addr + sym->st_value - addr;
|
||||
|
|
@ -236,7 +236,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_MOVW_ABS_NC:
|
||||
case R_ARM_MOVT_ABS:
|
||||
{
|
||||
bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
break;
|
||||
|
||||
default:
|
||||
bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -266,6 +266,6 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
|
||||
uintptr_t addr)
|
||||
{
|
||||
bdbg("RELA relocation not supported\n");
|
||||
berr("RELA relocation not supported\n");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@
|
|||
|
||||
/* This macro will modify r0, r1, r2 and r14 */
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
.macro showprogress, code
|
||||
mov r0, #\code
|
||||
bl up_lowputc
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
/* This macro will modify r0, r1, r2 and r14 */
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
.macro showprogress, code
|
||||
mov r0, #\code
|
||||
bl up_lowputc
|
||||
|
|
@ -115,7 +115,7 @@ __start:
|
|||
bl up_earlyserialinit
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
mov r0, #'C'
|
||||
bl up_putc
|
||||
mov r0, #'\n'
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/arm/up_prefetchabort.c
|
||||
*
|
||||
* Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2011, 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
@ -110,7 +99,7 @@ void up_prefetchabort(uint32_t *regs)
|
|||
* virtual addresses.
|
||||
*/
|
||||
|
||||
pglldbg("VADDR: %08x VBASE: %08x VEND: %08x\n",
|
||||
pgllerr("VADDR: %08x VBASE: %08x VEND: %08x\n",
|
||||
regs[REG_PC], PG_PAGED_VBASE, PG_PAGED_VEND);
|
||||
|
||||
if (regs[REG_R15] >= PG_PAGED_VBASE && regs[REG_R15] < PG_PAGED_VEND)
|
||||
|
|
@ -148,7 +137,7 @@ void up_prefetchabort(uint32_t *regs)
|
|||
else
|
||||
#endif
|
||||
{
|
||||
lldbg("Prefetch abort. PC: %08x\n", regs[REG_PC]);
|
||||
_alert("Prefetch abort. PC: %08x\n", regs[REG_PC]);
|
||||
PANIC();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ void up_release_pending(void)
|
|||
{
|
||||
struct tcb_s *rtcb = this_task();
|
||||
|
||||
slldbg("From TCB=%p\n", rtcb);
|
||||
sllerr("From TCB=%p\n", rtcb);
|
||||
|
||||
/* Merge the g_pendingtasks list into the ready-to-run task list */
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||
struct tcb_s *rtcb = this_task();
|
||||
bool switch_needed;
|
||||
|
||||
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||
sllerr("TCB=%p PRI=%d\n", tcb, priority);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list.
|
||||
* sched_removereadytorun will return true if we just
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
{
|
||||
irqstate_t flags;
|
||||
|
||||
sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
* being delivered to the currently executing task.
|
||||
*/
|
||||
|
||||
sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
|
||||
if (tcb == this_task())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void up_sigdeliver(void)
|
|||
|
||||
board_autoled_on(LED_SIGNAL);
|
||||
|
||||
sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
||||
ASSERT(rtcb->xcp.sigdeliver != NULL);
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ void up_sigdeliver(void)
|
|||
* errno that is needed by the user logic (it is probably EINTR).
|
||||
*/
|
||||
|
||||
sdbg("Resuming\n");
|
||||
serr("Resuming\n");
|
||||
(void)up_irq_save();
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/arm/up_syscall.c
|
||||
*
|
||||
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
@ -58,22 +47,6 @@
|
|||
#include "up_arch.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* vectors
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -82,8 +55,8 @@
|
|||
* Name: up_syscall
|
||||
*
|
||||
* Description:
|
||||
* SWI interrupts will vection here with insn=the SWI
|
||||
* instruction and xcp=the interrupt context
|
||||
* SWI interrupts will vector here with insn=the SWI instruction and
|
||||
* xcp=the interrupt context
|
||||
*
|
||||
* The handler may get the SWI number be de-referencing
|
||||
* the return address saved in the xcp and decoding
|
||||
|
|
@ -93,7 +66,7 @@
|
|||
|
||||
void up_syscall(uint32_t *regs)
|
||||
{
|
||||
lldbg("Syscall from 0x%x\n", regs[REG_PC]);
|
||||
_alert("Syscall from 0x%x\n", regs[REG_PC]);
|
||||
CURRENT_REGS = regs;
|
||||
PANIC();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/arm/up_undefinedinsn.c
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
|
@ -58,18 +47,6 @@
|
|||
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -80,7 +57,7 @@
|
|||
|
||||
void up_undefinedinsn(uint32_t *regs)
|
||||
{
|
||||
lldbg("Undefined instruction at 0x%x\n", regs[REG_PC]);
|
||||
_alert("Undefined instruction at 0x%x\n", regs[REG_PC]);
|
||||
CURRENT_REGS = regs;
|
||||
PANIC();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
****************************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
/****************************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
@ -386,7 +387,7 @@ extern "C"
|
|||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
void up_dumpnvic(FAR const char *msg);
|
||||
#else
|
||||
# define up_dumpnvic(m)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv6-m/up_assert.c
|
||||
*
|
||||
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2015, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
|
@ -76,23 +65,6 @@
|
|||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||
*/
|
||||
|
||||
#undef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP))
|
||||
# define CONFIG_PRINT_TASKNAME 1
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -126,7 +98,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)stack;
|
||||
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
stack, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
|
@ -144,12 +116,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
|
|||
{
|
||||
/* Dump interesting properties of this task */
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("%s: PID=%d Stack Used=%lu of %lu\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("%s: PID=%d Stack Used=%lu of %lu\n",
|
||||
tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
|
||||
(unsigned long)tcb->adj_stack_size);
|
||||
#else
|
||||
lldbg("PID: %d Stack Used=%lu of %lu\n",
|
||||
_alert("PID: %d Stack Used=%lu of %lu\n",
|
||||
tcb->pid, (unsigned long)up_check_tcbstack(tcb),
|
||||
(unsigned long)tcb->adj_stack_size);
|
||||
#endif
|
||||
|
|
@ -184,22 +156,22 @@ static inline void up_registerdump(void)
|
|||
{
|
||||
/* Yes.. dump the interrupt registers */
|
||||
|
||||
lldbg("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1],
|
||||
CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3],
|
||||
CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5],
|
||||
CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]);
|
||||
lldbg("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9],
|
||||
CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11],
|
||||
CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13],
|
||||
CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]);
|
||||
#ifdef CONFIG_BUILD_PROTECTED
|
||||
lldbg("xPSR: %08x PRIMASK: %08x EXEC_RETURN: %08x\n",
|
||||
_alert("xPSR: %08x PRIMASK: %08x EXEC_RETURN: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK],
|
||||
CURRENT_REGS[REG_EXC_RETURN]);
|
||||
#else
|
||||
lldbg("xPSR: %08x PRIMASK: %08x\n",
|
||||
_alert("xPSR: %08x PRIMASK: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -270,12 +242,12 @@ static void up_dumpstate(void)
|
|||
|
||||
/* Show interrupt stack info */
|
||||
|
||||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("IRQ stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
_alert("sp: %08x\n", sp);
|
||||
_alert("IRQ stack:\n");
|
||||
_alert(" base: %08x\n", istackbase);
|
||||
_alert(" size: %08x\n", istacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
_alert(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
|
||||
/* Does the current stack pointer lie within the interrupt
|
||||
|
|
@ -297,14 +269,14 @@ static void up_dumpstate(void)
|
|||
if (CURRENT_REGS)
|
||||
{
|
||||
sp = CURRENT_REGS[REG_R13];
|
||||
lldbg("sp: %08x\n", sp);
|
||||
_alert("sp: %08x\n", sp);
|
||||
}
|
||||
|
||||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
_alert("User stack:\n");
|
||||
_alert(" base: %08x\n", ustackbase);
|
||||
_alert(" size: %08x\n", ustacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
_alert(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
/* Dump the user stack if the stack pointer lies within the allocated user
|
||||
|
|
@ -317,11 +289,11 @@ static void up_dumpstate(void)
|
|||
}
|
||||
|
||||
#else
|
||||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("stack base: %08x\n", ustackbase);
|
||||
lldbg("stack size: %08x\n", ustacksize);
|
||||
_alert("sp: %08x\n", sp);
|
||||
_alert("stack base: %08x\n", ustackbase);
|
||||
_alert("stack size: %08x\n", ustacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
_alert("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
/* Dump the user stack if the stack pointer lies within the allocated user
|
||||
|
|
@ -330,7 +302,7 @@ static void up_dumpstate(void)
|
|||
|
||||
if (sp > ustackbase || sp <= ustackbase - ustacksize)
|
||||
{
|
||||
lldbg("ERROR: Stack pointer is not within allocated stack\n");
|
||||
_alert("ERROR: Stack pointer is not within allocated stack\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -394,17 +366,17 @@ static void _up_assert(int errorcode)
|
|||
|
||||
void up_assert(const uint8_t *filename, int lineno)
|
||||
{
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
struct tcb_s *rtcb = this_task();
|
||||
#endif
|
||||
|
||||
board_autoled_on(LED_ASSERTION);
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Assertion failed at file:%s line: %d task: %s\n",
|
||||
filename, lineno, rtcb->name);
|
||||
#else
|
||||
lldbg("Assertion failed at file:%s line: %d\n",
|
||||
_alert("Assertion failed at file:%s line: %d\n",
|
||||
filename, lineno);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv6-m/up_dumpnvic.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -48,19 +48,7 @@
|
|||
|
||||
#include "nvic.h"
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
|
@ -76,6 +64,7 @@
|
|||
|
||||
void up_dumpnvic(FAR const char *msg)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG_INFO
|
||||
irqstate_t flags;
|
||||
int i;
|
||||
|
||||
|
|
@ -83,29 +72,30 @@ void up_dumpnvic(FAR const char *msg)
|
|||
|
||||
flags = enter_critical_section();
|
||||
|
||||
lldbg("NVIC: %s\n", msg);
|
||||
lldbg(" ISER: %08x ICER: %08x ISPR: %08x ICPR: %08x\n",
|
||||
getreg32(ARMV6M_NVIC_ISER), getreg32(ARMV6M_NVIC_ICER),
|
||||
getreg32(ARMV6M_NVIC_ISPR), getreg32(ARMV6M_NVIC_ICPR));
|
||||
_llinfo("NVIC: %s\n", msg);
|
||||
_llinfo(" ISER: %08x ICER: %08x ISPR: %08x ICPR: %08x\n",
|
||||
getreg32(ARMV6M_NVIC_ISER), getreg32(ARMV6M_NVIC_ICER),
|
||||
getreg32(ARMV6M_NVIC_ISPR), getreg32(ARMV6M_NVIC_ICPR));
|
||||
|
||||
for (i = 0 ; i < 8; i += 4)
|
||||
{
|
||||
lldbg(" IPR%d: %08x IPR%d: %08x IPR%d: %08x IPR%d: %08x\n",
|
||||
i, getreg32(ARMV6M_NVIC_IPR(i)),
|
||||
i+1, getreg32(ARMV6M_NVIC_IPR(i+1)),
|
||||
i+2, getreg32(ARMV6M_NVIC_IPR(i+2)),
|
||||
i+3, getreg32(ARMV6M_NVIC_IPR(i+3)));
|
||||
_llinfo(" IPR%d: %08x IPR%d: %08x IPR%d: %08x IPR%d: %08x\n",
|
||||
i, getreg32(ARMV6M_NVIC_IPR(i)),
|
||||
i+1, getreg32(ARMV6M_NVIC_IPR(i+1)),
|
||||
i+2, getreg32(ARMV6M_NVIC_IPR(i+2)),
|
||||
i+3, getreg32(ARMV6M_NVIC_IPR(i+3)));
|
||||
}
|
||||
|
||||
lldbg("SYSCON:\n");
|
||||
lldbg(" CPUID: %08x ICSR: %08x AIRCR: %08x SCR: %08x\n",
|
||||
getreg32(ARMV6M_SYSCON_CPUID), getreg32(ARMV6M_SYSCON_ICSR),
|
||||
getreg32(ARMV6M_SYSCON_AIRCR), getreg32(ARMV6M_SYSCON_SCR));
|
||||
lldbg(" CCR: %08x SHPR2: %08x SHPR3: %08x\n",
|
||||
getreg32(ARMV6M_SYSCON_CCR), getreg32(ARMV6M_SYSCON_SHPR2),
|
||||
getreg32(ARMV6M_SYSCON_SHPR3));
|
||||
_llinfo("SYSCON:\n");
|
||||
_llinfo(" CPUID: %08x ICSR: %08x AIRCR: %08x SCR: %08x\n",
|
||||
getreg32(ARMV6M_SYSCON_CPUID), getreg32(ARMV6M_SYSCON_ICSR),
|
||||
getreg32(ARMV6M_SYSCON_AIRCR), getreg32(ARMV6M_SYSCON_SCR));
|
||||
_llinfo(" CCR: %08x SHPR2: %08x SHPR3: %08x\n",
|
||||
getreg32(ARMV6M_SYSCON_CCR), getreg32(ARMV6M_SYSCON_SHPR2),
|
||||
getreg32(ARMV6M_SYSCON_SHPR3));
|
||||
|
||||
leave_critical_section(flags);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_DEBUG */
|
||||
#endif /* CONFIG_DEBUG_FEATURES */
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_machine != EM_ARM)
|
||||
{
|
||||
bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_ident[EI_CLASS] != ELFCLASS32)
|
||||
{
|
||||
bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
|
||||
#endif
|
||||
{
|
||||
bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -168,7 +168,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_CALL:
|
||||
case R_ARM_JUMP24:
|
||||
{
|
||||
bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
binfo("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
offset += sym->st_value - addr;
|
||||
if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000)
|
||||
{
|
||||
bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -197,7 +197,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_ABS32:
|
||||
case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */
|
||||
{
|
||||
bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
*(uint32_t *)addr += sym->st_value;
|
||||
|
|
@ -245,7 +245,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
upper_insn = (uint32_t)(*(uint16_t *)addr);
|
||||
lower_insn = (uint32_t)(*(uint16_t *)(addr + 2));
|
||||
|
||||
bvdbg("Performing THM_JUMP24 [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing THM_JUMP24 [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn,
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -279,7 +279,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
/* And perform the relocation */
|
||||
|
||||
bvdbg(" S=%d J1=%d J2=%d offset=%08lx branch target=%08lx\n",
|
||||
binfo(" S=%d J1=%d J2=%d offset=%08lx branch target=%08lx\n",
|
||||
S, J1, J2, (long)offset, offset + sym->st_value - addr);
|
||||
|
||||
offset += sym->st_value - addr;
|
||||
|
|
@ -290,7 +290,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
|
||||
{
|
||||
bdbg(" ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n",
|
||||
berr(" ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -300,7 +300,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
if (offset <= (int32_t)0xff000000 || offset >= (int32_t)0x01000000)
|
||||
{
|
||||
bdbg(" ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n",
|
||||
berr(" ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -320,14 +320,14 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
lower_insn = ((lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | ((offset >> 1) & 0x07ff));
|
||||
*(uint16_t *)(addr + 2) = (uint16_t)lower_insn;
|
||||
|
||||
bvdbg(" S=%d J1=%d J2=%d insn [%04x %04x]\n",
|
||||
binfo(" S=%d J1=%d J2=%d insn [%04x %04x]\n",
|
||||
S, J1, J2, (int)upper_insn, (int)lower_insn);
|
||||
}
|
||||
break;
|
||||
|
||||
case R_ARM_V4BX:
|
||||
{
|
||||
bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
binfo("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr));
|
||||
|
||||
/* Preserve only Rm and the condition code */
|
||||
|
|
@ -342,7 +342,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
case R_ARM_PREL31:
|
||||
{
|
||||
bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
offset = *(uint32_t *)addr + sym->st_value - addr;
|
||||
|
|
@ -353,7 +353,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_MOVW_ABS_NC:
|
||||
case R_ARM_MOVT_ABS:
|
||||
{
|
||||
bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -408,7 +408,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
upper_insn = (uint32_t)(*(uint16_t *)addr);
|
||||
lower_insn = (uint32_t)(*(uint16_t *)(addr + 2));
|
||||
|
||||
bvdbg("Performing THM_MOVx [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing THM_MOVx [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn,
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -425,7 +425,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
/* And perform the relocation */
|
||||
|
||||
bvdbg(" offset=%08lx branch target=%08lx\n",
|
||||
binfo(" offset=%08lx branch target=%08lx\n",
|
||||
(long)offset, offset + sym->st_value);
|
||||
|
||||
offset += sym->st_value;
|
||||
|
|
@ -445,13 +445,13 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
lower_insn = ((lower_insn & 0x8f00) | ((offset & 0x0700) << 4) | (offset & 0x00ff));
|
||||
*(uint16_t *)(addr + 2) = (uint16_t)lower_insn;
|
||||
|
||||
bvdbg(" insn [%04x %04x]\n",
|
||||
binfo(" insn [%04x %04x]\n",
|
||||
(int)upper_insn, (int)lower_insn);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -461,6 +461,6 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
|
||||
uintptr_t addr)
|
||||
{
|
||||
bdbg("RELA relocation not supported\n");
|
||||
berr("RELA relocation not supported\n");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,25 +55,13 @@
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_HARDFAULT
|
||||
# define hfdbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||
# define hferr(format, ...) _llerr(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define hfdbg(x...)
|
||||
# define hferr(x...)
|
||||
#endif
|
||||
|
||||
#define INSN_SVC0 0xdf00 /* insn: svc 0 */
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -118,7 +106,7 @@ int up_hardfault(int irq, FAR void *context)
|
|||
/* Fetch the instruction that caused the Hard fault */
|
||||
|
||||
uint16_t insn = *pc;
|
||||
hfdbg(" PC: %p INSN: %04x\n", pc, insn);
|
||||
hferr(" PC: %p INSN: %04x\n", pc, insn);
|
||||
|
||||
/* If this was the instruction 'svc 0', then forward processing
|
||||
* to the SVCall handler
|
||||
|
|
@ -126,7 +114,7 @@ int up_hardfault(int irq, FAR void *context)
|
|||
|
||||
if (insn == INSN_SVC0)
|
||||
{
|
||||
hfdbg("Forward SVCall\n");
|
||||
hferr("Forward SVCall\n");
|
||||
return up_svcall(irq, context);
|
||||
}
|
||||
}
|
||||
|
|
@ -134,22 +122,22 @@ int up_hardfault(int irq, FAR void *context)
|
|||
#if defined(CONFIG_DEBUG_HARDFAULT)
|
||||
/* Dump some hard fault info */
|
||||
|
||||
hfdbg("\nHard Fault:\n");
|
||||
hfdbg(" IRQ: %d regs: %p\n", irq, regs);
|
||||
hfdbg(" PRIMASK: %08x IPSR: %08x\n",
|
||||
hferr("\nHard Fault:\n");
|
||||
hferr(" IRQ: %d regs: %p\n", irq, regs);
|
||||
hferr(" PRIMASK: %08x IPSR: %08x\n",
|
||||
getprimask(), getipsr());
|
||||
hfdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
hferr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
hfdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
hferr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
hfdbg(" xPSR: %08x PRIMASK: %08x (saved)\n",
|
||||
hferr(" xPSR: %08x PRIMASK: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
|
||||
#endif
|
||||
|
||||
(void)up_irq_save();
|
||||
lldbg("PANIC!!! Hard fault\n");
|
||||
_llerr("PANIC!!! Hard fault\n");
|
||||
PANIC();
|
||||
return OK; /* Won't get here */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void up_release_pending(void)
|
|||
{
|
||||
struct tcb_s *rtcb = this_task();
|
||||
|
||||
slldbg("From TCB=%p\n", rtcb);
|
||||
sllerr("From TCB=%p\n", rtcb);
|
||||
|
||||
/* Merge the g_pendingtasks list into the ready-to-run task list */
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||
struct tcb_s *rtcb = this_task();
|
||||
bool switch_needed;
|
||||
|
||||
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||
sllerr("TCB=%p PRI=%d\n", tcb, priority);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list.
|
||||
* sched_removereadytorun will return true if we just removed the head
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
{
|
||||
irqstate_t flags;
|
||||
|
||||
sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
* to the currently executing task.
|
||||
*/
|
||||
|
||||
sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
|
||||
if (tcb == this_task())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ void up_sigdeliver(void)
|
|||
|
||||
board_autoled_on(LED_SIGNAL);
|
||||
|
||||
sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
||||
ASSERT(rtcb->xcp.sigdeliver != NULL);
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ void up_sigdeliver(void)
|
|||
* errno that is needed by the user logic (it is probably EINTR).
|
||||
*/
|
||||
|
||||
sdbg("Resuming\n");
|
||||
serr("Resuming\n");
|
||||
(void)up_irq_save();
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
|
|
|
|||
|
|
@ -55,33 +55,6 @@
|
|||
#include "exc_return.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Debug output from this file may interfere with context switching! To get
|
||||
* debug output you must enabled the following in your NuttX configuration:
|
||||
*
|
||||
* - CONFIG_DEBUG and CONFIG_DEBUG_SYSCALL (shows only syscalls)
|
||||
* - CONFIG_DEBUG and CONFIG_DEBUG_SVCALL (shows everything)
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL) || defined(CONFIG_DEBUG_SVCALL)
|
||||
# define svcdbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define svcdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -169,24 +142,24 @@ int up_svcall(int irq, FAR void *context)
|
|||
* and R1..R7 = variable number of arguments depending on the system call.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL) || defined(CONFIG_DEBUG_SVCALL)
|
||||
#ifdef CONFIG_DEBUG_SYSCALL_INFO
|
||||
# ifndef CONFIG_DEBUG_SVCALL
|
||||
if (cmd > SYS_switch_context)
|
||||
# endif
|
||||
{
|
||||
svcdbg("SVCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
||||
svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcllinfo("SVCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
||||
svcllinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcllinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
# ifdef CONFIG_BUILD_PROTECTED
|
||||
svcdbg(" PSR: %08x PRIMASK: %08x EXC_RETURN: %08x\n",
|
||||
regs[REG_XPSR], regs[REG_PRIMASK], regs[REG_EXC_RETURN]);
|
||||
svcllinfo(" PSR: %08x PRIMASK: %08x EXC_RETURN: %08x\n",
|
||||
regs[REG_XPSR], regs[REG_PRIMASK], regs[REG_EXC_RETURN]);
|
||||
# else
|
||||
svcdbg(" PSR: %08x PRIMASK: %08x\n",
|
||||
regs[REG_XPSR], regs[REG_PRIMASK]);
|
||||
svcllinfo(" PSR: %08x PRIMASK: %08x\n",
|
||||
regs[REG_XPSR], regs[REG_PRIMASK]);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
|
@ -471,7 +444,7 @@ int up_svcall(int irq, FAR void *context)
|
|||
|
||||
regs[REG_R0] -= CONFIG_SYS_RESERVED;
|
||||
#else
|
||||
slldbg("ERROR: Bad SYS call: %d\n", regs[REG_R0]);
|
||||
svcllerr("ERROR: Bad SYS call: %d\n", regs[REG_R0]);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
|
@ -479,37 +452,37 @@ int up_svcall(int irq, FAR void *context)
|
|||
|
||||
/* Report what happened. That might difficult in the case of a context switch */
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL) || defined(CONFIG_DEBUG_SVCALL)
|
||||
#ifdef CONFIG_DEBUG_SYSCALL_INFO
|
||||
# ifndef CONFIG_DEBUG_SVCALL
|
||||
if (cmd > SYS_switch_context)
|
||||
# else
|
||||
if (regs != CURRENT_REGS)
|
||||
# endif
|
||||
{
|
||||
svcdbg("SVCall Return:\n");
|
||||
svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1],
|
||||
CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3],
|
||||
CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5],
|
||||
CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]);
|
||||
svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9],
|
||||
CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11],
|
||||
CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13],
|
||||
CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]);
|
||||
svcllinfo("SVCall Return:\n");
|
||||
svcllinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1],
|
||||
CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3],
|
||||
CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5],
|
||||
CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]);
|
||||
svcllinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9],
|
||||
CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11],
|
||||
CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13],
|
||||
CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]);
|
||||
#ifdef CONFIG_BUILD_PROTECTED
|
||||
svcdbg(" PSR: %08x PRIMASK: %08x EXC_RETURN: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK],
|
||||
CURRENT_REGS[REG_EXC_RETURN]);
|
||||
svcllinfo(" PSR: %08x PRIMASK: %08x EXC_RETURN: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK],
|
||||
CURRENT_REGS[REG_EXC_RETURN]);
|
||||
#else
|
||||
svcdbg(" PSR: %08x PRIMASK: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
|
||||
svcllinfo(" PSR: %08x PRIMASK: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
|
||||
#endif
|
||||
}
|
||||
# ifdef CONFIG_DEBUG_SVCALL
|
||||
else
|
||||
{
|
||||
svcdbg("SVCall Return: %d\n", regs[REG_R0]);
|
||||
svcllinfo("SVCall Return: %d\n", regs[REG_R0]);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
|
|||
{
|
||||
int ret;
|
||||
|
||||
bvdbg("addrenv=%p textsize=%lu datasize=%lu\n",
|
||||
binfo("addrenv=%p textsize=%lu datasize=%lu\n",
|
||||
addrenv, (unsigned long)textsize, (unsigned long)datasize);
|
||||
|
||||
DEBUGASSERT(addrenv);
|
||||
|
|
@ -278,7 +278,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
|
|||
MMU_L2_UTEXTFLAGS);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("ERROR: Failed to create .text region: %d\n", ret);
|
||||
berr("ERROR: Failed to create .text region: %d\n", ret);
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
|
@ -293,7 +293,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
|
|||
MMU_L2_UDATAFLAGS);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("ERROR: Failed to create .bss/.data region: %d\n", ret);
|
||||
berr("ERROR: Failed to create .bss/.data region: %d\n", ret);
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
|
@ -305,7 +305,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
|
|||
ret = up_addrenv_initdata((uintptr_t)addrenv->data[0] & PMD_PTE_PADDR_MASK);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("ERROR: Failed to initialize .bss/.data region: %d\n", ret);
|
||||
berr("ERROR: Failed to initialize .bss/.data region: %d\n", ret);
|
||||
goto errout;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -318,7 +318,7 @@ int up_addrenv_create(size_t textsize, size_t datasize, size_t heapsize,
|
|||
MMU_L2_UDATAFLAGS);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("ERROR: Failed to create heap region: %d\n", ret);
|
||||
berr("ERROR: Failed to create heap region: %d\n", ret);
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
|
@ -353,7 +353,7 @@ errout:
|
|||
|
||||
int up_addrenv_destroy(FAR group_addrenv_t *addrenv)
|
||||
{
|
||||
bvdbg("addrenv=%p\n", addrenv);
|
||||
binfo("addrenv=%p\n", addrenv);
|
||||
DEBUGASSERT(addrenv);
|
||||
|
||||
/* Destroy the .text region */
|
||||
|
|
@ -405,7 +405,7 @@ int up_addrenv_destroy(FAR group_addrenv_t *addrenv)
|
|||
|
||||
int up_addrenv_vtext(FAR group_addrenv_t *addrenv, FAR void **vtext)
|
||||
{
|
||||
bvdbg("return=%p\n", (FAR void *)CONFIG_ARCH_TEXT_VBASE);
|
||||
binfo("return=%p\n", (FAR void *)CONFIG_ARCH_TEXT_VBASE);
|
||||
|
||||
/* Not much to do in this case */
|
||||
|
||||
|
|
@ -439,7 +439,7 @@ int up_addrenv_vtext(FAR group_addrenv_t *addrenv, FAR void **vtext)
|
|||
int up_addrenv_vdata(FAR group_addrenv_t *addrenv, uintptr_t textsize,
|
||||
FAR void **vdata)
|
||||
{
|
||||
bvdbg("return=%p\n",
|
||||
binfo("return=%p\n",
|
||||
(FAR void *)(CONFIG_ARCH_DATA_VBASE + ARCH_DATA_RESERVE_SIZE));
|
||||
|
||||
/* Not much to do in this case */
|
||||
|
|
@ -636,7 +636,7 @@ int up_addrenv_restore(FAR const save_addrenv_t *oldenv)
|
|||
uintptr_t vaddr;
|
||||
int i;
|
||||
|
||||
bvdbg("oldenv=%p\n", oldenv);
|
||||
binfo("oldenv=%p\n", oldenv);
|
||||
DEBUGASSERT(oldenv);
|
||||
|
||||
for (vaddr = CONFIG_ARCH_TEXT_VBASE, i = 0;
|
||||
|
|
@ -752,7 +752,7 @@ int up_addrenv_coherent(FAR const group_addrenv_t *addrenv)
|
|||
int up_addrenv_clone(FAR const group_addrenv_t *src,
|
||||
FAR group_addrenv_t *dest)
|
||||
{
|
||||
bvdbg("src=%p dest=%p\n", src, dest);
|
||||
binfo("src=%p dest=%p\n", src, dest);
|
||||
DEBUGASSERT(src && dest);
|
||||
|
||||
/* Just copy the address environment from the source to the destination */
|
||||
|
|
@ -784,7 +784,7 @@ int up_addrenv_clone(FAR const group_addrenv_t *src,
|
|||
|
||||
int up_addrenv_attach(FAR struct task_group_s *group, FAR struct tcb_s *tcb)
|
||||
{
|
||||
bvdbg("group=%p tcb=%p\n", group, tcb);
|
||||
binfo("group=%p tcb=%p\n", group, tcb);
|
||||
|
||||
/* Nothing needs to be done in this implementation */
|
||||
|
||||
|
|
@ -817,7 +817,7 @@ int up_addrenv_attach(FAR struct task_group_s *group, FAR struct tcb_s *tcb)
|
|||
|
||||
int up_addrenv_detach(FAR struct task_group_s *group, FAR struct tcb_s *tcb)
|
||||
{
|
||||
bvdbg("group=%p tcb=%p\n", group, tcb);
|
||||
binfo("group=%p tcb=%p\n", group, tcb);
|
||||
|
||||
/* Nothing needs to be done in this implementation */
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@
|
|||
|
||||
int up_addrenv_kstackalloc(FAR struct tcb_s *tcb)
|
||||
{
|
||||
bvdbg("tcb=%p stacksize=%u\n", tcb, ARCH_KERNEL_STACKSIZE);
|
||||
binfo("tcb=%p stacksize=%u\n", tcb, ARCH_KERNEL_STACKSIZE);
|
||||
|
||||
DEBUGASSERT(tcb && tcb->xcp.kstack == 0);
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ int up_addrenv_kstackalloc(FAR struct tcb_s *tcb)
|
|||
tcb->xcp.kstack = (FAR uint32_t *)kmm_memalign(8, ARCH_KERNEL_STACKSIZE);
|
||||
if (!tcb->xcp.kstack)
|
||||
{
|
||||
bdbg("ERROR: Failed to allocate the kernel stack\n");
|
||||
berr("ERROR: Failed to allocate the kernel stack\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ int up_addrenv_kstackalloc(FAR struct tcb_s *tcb)
|
|||
|
||||
int up_addrenv_kstackfree(FAR struct tcb_s *tcb)
|
||||
{
|
||||
bvdbg("tcb=%p\n", tcb);
|
||||
binfo("tcb=%p\n", tcb);
|
||||
DEBUGASSERT(tcb);
|
||||
|
||||
/* Does the exiting thread have a kernel stack? */
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ int up_shmat(FAR uintptr_t *pages, unsigned int npages, uintptr_t vaddr)
|
|||
unsigned int nmapped;
|
||||
unsigned int shmndx;
|
||||
|
||||
shmvdbg("pages=%p npages=%d vaddr=%08lx\n",
|
||||
shminfo("pages=%p npages=%d vaddr=%08lx\n",
|
||||
pages, npages, (unsigned long)vaddr);
|
||||
|
||||
/* Sanity checks */
|
||||
|
|
@ -241,7 +241,7 @@ int up_shmdt(uintptr_t vaddr, unsigned int npages)
|
|||
unsigned int nunmapped;
|
||||
unsigned int shmndx;
|
||||
|
||||
shmvdbg("npages=%d vaddr=%08lx\n", npages, (unsigned long)vaddr);
|
||||
shminfo("npages=%d vaddr=%08lx\n", npages, (unsigned long)vaddr);
|
||||
|
||||
/* Sanity checks */
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ int up_addrenv_ustackalloc(FAR struct tcb_s *tcb, size_t stacksize)
|
|||
{
|
||||
int ret;
|
||||
|
||||
bvdbg("tcb=%p stacksize=%lu\n", tcb, (unsigned long)stacksize);
|
||||
binfo("tcb=%p stacksize=%lu\n", tcb, (unsigned long)stacksize);
|
||||
|
||||
DEBUGASSERT(tcb);
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ int up_addrenv_ustackalloc(FAR struct tcb_s *tcb, size_t stacksize)
|
|||
MMU_L2_UDATAFLAGS);
|
||||
if (ret < 0)
|
||||
{
|
||||
bdbg("ERROR: Failed to create stack region: %d\n", ret);
|
||||
berr("ERROR: Failed to create stack region: %d\n", ret);
|
||||
up_addrenv_ustackfree(tcb);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@ int up_addrenv_ustackalloc(FAR struct tcb_s *tcb, size_t stacksize)
|
|||
|
||||
int up_addrenv_ustackfree(FAR struct tcb_s *tcb)
|
||||
{
|
||||
bvdbg("tcb=%p\n", tcb);
|
||||
binfo("tcb=%p\n", tcb);
|
||||
DEBUGASSERT(tcb);
|
||||
|
||||
/* Destroy the stack region */
|
||||
|
|
@ -221,7 +221,7 @@ int up_addrenv_ustackfree(FAR struct tcb_s *tcb)
|
|||
|
||||
int up_addrenv_vustack(FAR const struct tcb_s *tcb, FAR void **vstack)
|
||||
{
|
||||
bvdbg("Return=%p\n", (FAR void *)CONFIG_ARCH_STACK_VBASE);
|
||||
binfo("Return=%p\n", (FAR void *)CONFIG_ARCH_STACK_VBASE);
|
||||
|
||||
/* Not much to do in this case */
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen,
|
|||
unsigned int i;
|
||||
unsigned int j;
|
||||
|
||||
bvdbg("listlen=%d vaddr=%08lx regionsize=%ld, mmuflags=%08x\n",
|
||||
binfo("listlen=%d vaddr=%08lx regionsize=%ld, mmuflags=%08x\n",
|
||||
listlen, (unsigned long)vaddr, (unsigned long)regionsize,
|
||||
(unsigned int)mmuflags);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ int arm_addrenv_create_region(FAR uintptr_t **list, unsigned int listlen,
|
|||
npages = MM_NPAGES(regionsize);
|
||||
if (npages > (listlen << (20 - MM_PGSHIFT)))
|
||||
{
|
||||
bdbg("ERROR: npages=%u listlen=%u\n", npages, listlen);
|
||||
berr("ERROR: npages=%u listlen=%u\n", npages, listlen);
|
||||
return -E2BIG;
|
||||
}
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ void arm_addrenv_destroy_region(FAR uintptr_t **list, unsigned int listlen,
|
|||
int i;
|
||||
int j;
|
||||
|
||||
bvdbg("listlen=%d vaddr=%08lx\n", listlen, (unsigned long)vaddr);
|
||||
binfo("listlen=%d vaddr=%08lx\n", listlen, (unsigned long)vaddr);
|
||||
|
||||
for (i = 0; i < listlen; vaddr += SECTION_SIZE, list++, i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-a/arm_assert.c
|
||||
*
|
||||
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
|
@ -75,19 +64,6 @@
|
|||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||
*/
|
||||
|
||||
#undef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP))
|
||||
# define CONFIG_PRINT_TASKNAME 1
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -121,7 +97,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)stack;
|
||||
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
stack, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
|
@ -139,12 +115,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
|
|||
{
|
||||
/* Dump interesting properties of this task */
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("%s: PID=%d Stack Used=%lu of %lu\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("%s: PID=%d Stack Used=%lu of %lu\n",
|
||||
tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
|
||||
(unsigned long)tcb->adj_stack_size);
|
||||
#else
|
||||
lldbg("PID: %d Stack Used=%lu of %lu\n",
|
||||
_alert("PID: %d Stack Used=%lu of %lu\n",
|
||||
tcb->pid, (unsigned long)up_check_tcbstack(tcb),
|
||||
(unsigned long)tcb->adj_stack_size);
|
||||
#endif
|
||||
|
|
@ -184,12 +160,12 @@ static inline void up_registerdump(void)
|
|||
for (regs = REG_R0; regs <= REG_R15; regs += 8)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)&CURRENT_REGS[regs];
|
||||
lldbg("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
||||
lldbg("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
|
||||
_alert("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
@ -253,7 +229,7 @@ static void up_dumpstate(void)
|
|||
ustacksize = (uint32_t)rtcb->adj_stack_size;
|
||||
}
|
||||
|
||||
lldbg("Current sp: %08x\n", sp);
|
||||
_alert("Current sp: %08x\n", sp);
|
||||
|
||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
/* Get the limits on the interrupt stack memory */
|
||||
|
|
@ -263,21 +239,21 @@ static void up_dumpstate(void)
|
|||
|
||||
/* Show interrupt stack info */
|
||||
|
||||
lldbg("Interrupt stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
_alert("Interrupt stack:\n");
|
||||
_alert(" base: %08x\n", istackbase);
|
||||
_alert(" size: %08x\n", istacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
_alert(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Show user stack info */
|
||||
|
||||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
_alert("User stack:\n");
|
||||
_alert(" base: %08x\n", ustackbase);
|
||||
_alert(" size: %08x\n", ustacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
_alert(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
|
|
@ -287,9 +263,9 @@ static void up_dumpstate(void)
|
|||
{
|
||||
kstackbase = (uint32_t)rtcb->xcp.kstack + CONFIG_ARCH_KERNEL_STACKSIZE - 4;
|
||||
|
||||
lldbg("Kernel stack:\n");
|
||||
lldbg(" base: %08x\n", kstackbase);
|
||||
lldbg(" size: %08x\n", CONFIG_ARCH_KERNEL_STACKSIZE);
|
||||
_alert("Kernel stack:\n");
|
||||
_alert(" base: %08x\n", kstackbase);
|
||||
_alert(" size: %08x\n", CONFIG_ARCH_KERNEL_STACKSIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -300,7 +276,7 @@ static void up_dumpstate(void)
|
|||
{
|
||||
/* Yes.. dump the interrupt stack */
|
||||
|
||||
lldbg("Interrupt Stack\n", sp);
|
||||
_alert("Interrupt Stack\n", sp);
|
||||
up_stackdump(sp, istackbase);
|
||||
|
||||
/* Extract the user stack pointer which should lie
|
||||
|
|
@ -308,7 +284,7 @@ static void up_dumpstate(void)
|
|||
*/
|
||||
|
||||
sp = g_intstackbase;
|
||||
lldbg("User sp: %08x\n", sp);
|
||||
_alert("User sp: %08x\n", sp);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -318,7 +294,7 @@ static void up_dumpstate(void)
|
|||
|
||||
if (sp > ustackbase - ustacksize && sp < ustackbase)
|
||||
{
|
||||
lldbg("User Stack\n", sp);
|
||||
_alert("User Stack\n", sp);
|
||||
up_stackdump(sp, ustackbase);
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +305,7 @@ static void up_dumpstate(void)
|
|||
|
||||
if (sp >= (uint32_t)rtcb->xcp.kstack && sp < kstackbase)
|
||||
{
|
||||
lldbg("Kernel Stack\n", sp);
|
||||
_alert("Kernel Stack\n", sp);
|
||||
up_stackdump(sp, kstackbase);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -337,7 +313,7 @@ static void up_dumpstate(void)
|
|||
#ifdef CONFIG_SMP
|
||||
/* Show the CPU number */
|
||||
|
||||
lldbg("CPU%d:\n", up_cpu_index());
|
||||
_alert("CPU%d:\n", up_cpu_index());
|
||||
#endif
|
||||
|
||||
/* Then dump the CPU registers (if available) */
|
||||
|
|
@ -396,16 +372,16 @@ static void _up_assert(int errorcode)
|
|||
|
||||
void up_assert(const uint8_t *filename, int lineno)
|
||||
{
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
struct tcb_s *rtcb = this_task();
|
||||
#endif
|
||||
board_autoled_on(LED_ASSERTION);
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Assertion failed at file:%s line: %d task: %s\n",
|
||||
filename, lineno, rtcb->name);
|
||||
#else
|
||||
lldbg("Assertion failed at file:%s line: %d\n",
|
||||
_alert("Assertion failed at file:%s line: %d\n",
|
||||
filename, lineno);
|
||||
#endif
|
||||
up_dumpstate();
|
||||
|
|
|
|||
|
|
@ -64,19 +64,19 @@ static inline void arm_registerdump(FAR struct tcb_s *tcb)
|
|||
{
|
||||
int regndx;
|
||||
|
||||
lldbg("CPU%d:\n", up_cpu_index());
|
||||
_llerr("CPU%d:\n", up_cpu_index());
|
||||
|
||||
/* Dump the startup registers */
|
||||
|
||||
for (regndx = REG_R0; regndx <= REG_R15; regndx += 8)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)&tcb->xcp.regs[regndx];
|
||||
lldbg("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regndx, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
||||
lldbg("CPSR: %08x\n", tcb->xcp.regs[REG_CPSR]);
|
||||
_llerr("CPSR: %08x\n", tcb->xcp.regs[REG_CPSR]);
|
||||
}
|
||||
#else
|
||||
# define arm_registerdump(tcb)
|
||||
|
|
@ -106,7 +106,7 @@ int arm_start_handler(int irq, FAR void *context)
|
|||
{
|
||||
FAR struct tcb_s *tcb;
|
||||
|
||||
sllvdbg("CPU%d Started\n", up_cpu_index());
|
||||
sllinfo("CPU%d Started\n", up_cpu_index());
|
||||
|
||||
/* Reset scheduler parameters */
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ int arm_start_handler(int irq, FAR void *context)
|
|||
|
||||
int up_cpu_start(int cpu)
|
||||
{
|
||||
sllvdbg("Starting CPU%d\n", cpu);
|
||||
sllinfo("Starting CPU%d\n", cpu);
|
||||
|
||||
DEBUGASSERT(cpu >= 0 && cpu < CONFIG_SMP_NCPUS && cpu != this_cpu());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-a/arm_dataabort.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
@ -115,7 +104,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr)
|
|||
* fatal error.
|
||||
*/
|
||||
|
||||
pglldbg("DFSR: %08x DFAR: %08x\n", dfsr, dfar);
|
||||
pgllerr("DFSR: %08x DFAR: %08x\n", dfsr, dfar);
|
||||
if ((dfsr & FSR_MASK) != FSR_PAGE)
|
||||
{
|
||||
goto segfault;
|
||||
|
|
@ -126,7 +115,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr)
|
|||
* (It has not yet been saved in the register context save area).
|
||||
*/
|
||||
|
||||
pgllvdbg("VBASE: %08x VEND: %08x\n", PG_PAGED_VBASE, PG_PAGED_VEND);
|
||||
pgllinfo("VBASE: %08x VEND: %08x\n", PG_PAGED_VBASE, PG_PAGED_VEND);
|
||||
if (dfar < PG_PAGED_VBASE || dfar >= PG_PAGED_VEND)
|
||||
{
|
||||
goto segfault;
|
||||
|
|
@ -163,7 +152,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr)
|
|||
return regs;
|
||||
|
||||
segfault:
|
||||
lldbg("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
|
||||
_alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
|
||||
regs[REG_PC], dfar, dfsr);
|
||||
PANIC();
|
||||
return regs; /* To keep the compiler happy */
|
||||
|
|
@ -181,7 +170,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr)
|
|||
|
||||
/* Crash -- possibly showing diagnostic debug information. */
|
||||
|
||||
lldbg("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
|
||||
_alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
|
||||
regs[REG_PC], dfar, dfsr);
|
||||
PANIC();
|
||||
return regs; /* To keep the compiler happy */
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_machine != EM_ARM)
|
||||
{
|
||||
bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -82,7 +82,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_ident[EI_CLASS] != ELFCLASS32)
|
||||
{
|
||||
bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
|
||||
#endif
|
||||
{
|
||||
bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if ((ehdr->e_entry & 3) != 0)
|
||||
{
|
||||
bdbg("Entry point is not properly aligned: %08x\n", ehdr->e_entry);
|
||||
berr("Entry point is not properly aligned: %08x\n", ehdr->e_entry);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_CALL:
|
||||
case R_ARM_JUMP24:
|
||||
{
|
||||
bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
binfo("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
offset += sym->st_value - addr;
|
||||
if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000)
|
||||
{
|
||||
bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -191,7 +191,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_ABS32:
|
||||
case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */
|
||||
{
|
||||
bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
*(uint32_t *)addr += sym->st_value;
|
||||
|
|
@ -200,7 +200,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
case R_ARM_V4BX:
|
||||
{
|
||||
bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
binfo("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr));
|
||||
|
||||
/* Preserve only Rm and the condition code */
|
||||
|
|
@ -215,7 +215,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
case R_ARM_PREL31:
|
||||
{
|
||||
bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
offset = *(uint32_t *)addr + sym->st_value - addr;
|
||||
|
|
@ -226,7 +226,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_MOVW_ABS_NC:
|
||||
case R_ARM_MOVT_ABS:
|
||||
{
|
||||
bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -246,7 +246,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
break;
|
||||
|
||||
default:
|
||||
bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -256,6 +256,6 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
|
||||
uintptr_t addr)
|
||||
{
|
||||
bdbg("RELA relocation not supported\n");
|
||||
berr("RELA relocation not supported\n");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ uint32_t *arm_decodeirq(uint32_t *regs)
|
|||
regval = getreg32(GIC_ICCIAR);
|
||||
irq = (regval & GIC_ICCIAR_INTID_MASK) >> GIC_ICCIAR_INTID_SHIFT;
|
||||
|
||||
gicllvdbg("irq=%d\n", irq);
|
||||
irqllinfo("irq=%d\n", irq);
|
||||
|
||||
/* Ignore spurions IRQs. ICCIAR will report 1023 if there is no pending
|
||||
* interrupt.
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@
|
|||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <syslog.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "gic.h"
|
||||
|
||||
#if defined(CONFIG_ARMV7A_HAVE_GICv2) && defined(CONFIG_DEBUG_IRQ)
|
||||
#if defined(CONFIG_ARMV7A_HAVE_GICv2) && defined(CONFIG_DEBUG_IRQ_INFO)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
|
|
@ -69,20 +69,20 @@
|
|||
|
||||
static inline void arm_gic_dump_cpu(bool all, int irq, int nlines)
|
||||
{
|
||||
lowsyslog(LOG_INFO, " CPU Interface Registers:\n");
|
||||
lowsyslog(LOG_INFO, " ICR: %08x PMR: %08x BPR: %08x IAR: %08x\n",
|
||||
irqllinfo(" CPU Interface Registers:\n");
|
||||
irqllinfo(" ICR: %08x PMR: %08x BPR: %08x IAR: %08x\n",
|
||||
getreg32(GIC_ICCICR), getreg32(GIC_ICCPMR),
|
||||
getreg32(GIC_ICCBPR), getreg32(GIC_ICCIAR));
|
||||
lowsyslog(LOG_INFO, " RPR: %08x HPIR: %08x ABPR: %08x\n",
|
||||
irqllinfo(" RPR: %08x HPIR: %08x ABPR: %08x\n",
|
||||
getreg32(GIC_ICCRPR), getreg32(GIC_ICCHPIR),
|
||||
getreg32(GIC_ICCABPR));
|
||||
lowsyslog(LOG_INFO, " AIAR: %08x AHPIR: %08x IDR: %08x\n",
|
||||
irqllinfo(" AIAR: %08x AHPIR: %08x IDR: %08x\n",
|
||||
getreg32(GIC_ICCAIAR), getreg32(GIC_ICCAHPIR),
|
||||
getreg32(GIC_ICCIDR));
|
||||
lowsyslog(LOG_INFO, " APR1: %08x APR2: %08x APR3: %08x APR4: %08x\n",
|
||||
irqllinfo(" APR1: %08x APR2: %08x APR3: %08x APR4: %08x\n",
|
||||
getreg32(GIC_ICCAPR1), getreg32(GIC_ICCAPR2),
|
||||
getreg32(GIC_ICCAPR3), getreg32(GIC_ICCAPR4));
|
||||
lowsyslog(LOG_INFO, " NSAPR1: %08x NSAPR2: %08x NSAPR3: %08x NSAPR4: %08x\n",
|
||||
irqllinfo(" NSAPR1: %08x NSAPR2: %08x NSAPR3: %08x NSAPR4: %08x\n",
|
||||
getreg32(GIC_ICCNSAPR1), getreg32(GIC_ICCNSAPR2),
|
||||
getreg32(GIC_ICCNSAPR3), getreg32(GIC_ICCNSAPR4));
|
||||
}
|
||||
|
|
@ -110,7 +110,7 @@ static void arm_gic_dumpregs(uintptr_t regaddr, int nlines, int incr)
|
|||
incr <<= 2;
|
||||
for (i = 0; i < nlines; i += incr, regaddr += 16)
|
||||
{
|
||||
lowsyslog(LOG_INFO, " %08x %08x %08x %08x\n",
|
||||
irqllinfo(" %08x %08x %08x %08x\n",
|
||||
getreg32(regaddr), getreg32(regaddr + 4),
|
||||
getreg32(regaddr + 8), getreg32(regaddr + 12));
|
||||
}
|
||||
|
|
@ -135,7 +135,7 @@ static void arm_gic_dumpregs(uintptr_t regaddr, int nlines, int incr)
|
|||
static inline void arm_gic_dump4(const char *name, uintptr_t regaddr,
|
||||
int nlines)
|
||||
{
|
||||
lowsyslog(LOG_INFO, " %s[%08lx]\n", name, (unsigned long)regaddr);
|
||||
irqllinfo(" %s[%08lx]\n", name, (unsigned long)regaddr);
|
||||
arm_gic_dumpregs(regaddr, nlines, 4);
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ static inline void arm_gic_dump4(const char *name, uintptr_t regaddr,
|
|||
static inline void arm_gic_dump8(const char *name, uintptr_t regaddr,
|
||||
int nlines)
|
||||
{
|
||||
lowsyslog(LOG_INFO, " %s[%08lx]\n", name, (unsigned long)regaddr);
|
||||
irqllinfo(" %s[%08lx]\n", name, (unsigned long)regaddr);
|
||||
arm_gic_dumpregs(regaddr, nlines, 8);
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +181,7 @@ static inline void arm_gic_dump8(const char *name, uintptr_t regaddr,
|
|||
static inline void arm_gic_dump16(const char *name, uintptr_t regaddr,
|
||||
int nlines)
|
||||
{
|
||||
lowsyslog(LOG_INFO, " %s[%08lx]\n", name, (unsigned long)regaddr);
|
||||
irqllinfo(" %s[%08lx]\n", name, (unsigned long)regaddr);
|
||||
arm_gic_dumpregs(regaddr, nlines, 16);
|
||||
}
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ static inline void arm_gic_dump16(const char *name, uintptr_t regaddr,
|
|||
static inline void arm_gic_dump32(const char *name, uintptr_t regaddr,
|
||||
int nlines)
|
||||
{
|
||||
lowsyslog(LOG_INFO, " %s[%08lx]\n", name, (unsigned long)regaddr);
|
||||
irqllinfo(" %s[%08lx]\n", name, (unsigned long)regaddr);
|
||||
arm_gic_dumpregs(regaddr, nlines, 32);
|
||||
}
|
||||
|
||||
|
|
@ -226,8 +226,8 @@ static inline void arm_gic_dump32(const char *name, uintptr_t regaddr,
|
|||
|
||||
static inline void arm_gic_dump_distributor(bool all, int irq, int nlines)
|
||||
{
|
||||
lowsyslog(LOG_INFO, " Distributor Registers:\n");
|
||||
lowsyslog(LOG_INFO, " DCR: %08x ICTR: %08x IIDR: %08x\n",
|
||||
irqllinfo(" Distributor Registers:\n");
|
||||
irqllinfo(" DCR: %08x ICTR: %08x IIDR: %08x\n",
|
||||
getreg32(GIC_ICDDCR), getreg32(GIC_ICDICTR),
|
||||
getreg32(GIC_ICDIIDR));
|
||||
|
||||
|
|
@ -246,25 +246,25 @@ static inline void arm_gic_dump_distributor(bool all, int irq, int nlines)
|
|||
}
|
||||
else
|
||||
{
|
||||
lowsyslog(LOG_INFO, " ISR: %08x ISER: %08x ISPR: %08x SAR: %08x\n",
|
||||
irqllinfo(" ISR: %08x ISER: %08x ISPR: %08x SAR: %08x\n",
|
||||
getreg32(GIC_ICDISR(irq)), getreg32(GIC_ICDISER(irq)),
|
||||
getreg32(GIC_ICDISPR(irq)), getreg32(GIC_ICDSAR(irq)));
|
||||
lowsyslog(LOG_INFO, " IPR: %08x IPTR: %08x ICFR: %08x SPISR: %08x\n",
|
||||
irqllinfo(" IPR: %08x IPTR: %08x ICFR: %08x SPISR: %08x\n",
|
||||
getreg32(GIC_ICDIPR(irq)), getreg32(GIC_ICDIPTR(irq)),
|
||||
getreg32(GIC_ICDICFR(irq)), getreg32(GIC_ICDSPISR(irq)));
|
||||
lowsyslog(LOG_INFO, " NSACR: %08x SCPR: %08x\n",
|
||||
irqllinfo(" NSACR: %08x SCPR: %08x\n",
|
||||
getreg32(GIC_ICDNSACR(irq)), getreg32(GIC_ICDSCPR(irq)));
|
||||
}
|
||||
|
||||
lowsyslog(LOG_INFO, " PIDR[%08lx]:\n", (unsigned long)GIC_ICDPIDR(0));
|
||||
lowsyslog(LOG_INFO, " %08x %08x %08x %08x\n",
|
||||
irqllinfo(" PIDR[%08lx]:\n", (unsigned long)GIC_ICDPIDR(0));
|
||||
irqllinfo(" %08x %08x %08x %08x\n",
|
||||
getreg32(GIC_ICDPIDR(0)), getreg32(GIC_ICDPIDR(1)),
|
||||
getreg32(GIC_ICDPIDR(2)), getreg32(GIC_ICDPIDR(3)));
|
||||
lowsyslog(LOG_INFO, " %08x %08x %08x %08x\n",
|
||||
irqllinfo(" %08x %08x %08x %08x\n",
|
||||
getreg32(GIC_ICDPIDR(4)), getreg32(GIC_ICDPIDR(5)),
|
||||
getreg32(GIC_ICDPIDR(6)));
|
||||
lowsyslog(LOG_INFO, " CIDR[%08lx]:\n", (unsigned long)GIC_ICDCIDR(0));
|
||||
lowsyslog(LOG_INFO, " %08x %08x %08x %08x\n",
|
||||
irqllinfo(" CIDR[%08lx]:\n", (unsigned long)GIC_ICDCIDR(0));
|
||||
irqllinfo(" %08x %08x %08x %08x\n",
|
||||
getreg32(GIC_ICDCIDR(0)), getreg32(GIC_ICDCIDR(1)),
|
||||
getreg32(GIC_ICDCIDR(2)), getreg32(GIC_ICDCIDR(3)));
|
||||
}
|
||||
|
|
@ -295,15 +295,15 @@ void arm_gic_dump(const char *msg, bool all, int irq)
|
|||
|
||||
if (all)
|
||||
{
|
||||
lowsyslog(LOG_INFO, "GIC: %s NLINES=%u\n", msg, nlines);
|
||||
irqllinfo("GIC: %s NLINES=%u\n", msg, nlines);
|
||||
}
|
||||
else
|
||||
{
|
||||
lowsyslog(LOG_INFO, "GIC: %s IRQ=%d\n", msg, irq);
|
||||
irqllinfo("GIC: %s IRQ=%d\n", msg, irq);
|
||||
}
|
||||
|
||||
arm_gic_dump_cpu(all, irq, nlines);
|
||||
arm_gic_dump_distributor(all, irq, nlines);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARMV7A_HAVE_GICv2 && CONFIG_DEBUG_IRQ */
|
||||
#endif /* CONFIG_ARMV7A_HAVE_GICv2 && CONFIG_DEBUG_IRQ_INFO */
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@
|
|||
|
||||
/* This macro will modify r0, r1, r2 and r14 */
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
.macro showprogress, code
|
||||
mov r0, #\code
|
||||
bl up_lowputc
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ void up_l2ccinitialize(void)
|
|||
putreg32(L2CC_CR_L2CEN, L2CC_CR);
|
||||
}
|
||||
|
||||
lldbg("(%d ways) * (%d bytes/way) = %d bytes\n",
|
||||
_llerr("(%d ways) * (%d bytes/way) = %d bytes\n",
|
||||
PL310_NWAYS, PL310_WAYSIZE, PL310_CACHE_SIZE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@
|
|||
|
||||
/* This macro will modify r0, r1, r2 and r14 */
|
||||
|
||||
#ifdef CONFIG_DEBUG
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
.macro showprogress, code
|
||||
mov r0, #\code
|
||||
bl up_lowputc
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-a/arm_prefetchabort.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
@ -97,7 +86,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr)
|
|||
* virtual addresses.
|
||||
*/
|
||||
|
||||
pglldbg("VADDR: %08x VBASE: %08x VEND: %08x\n",
|
||||
pgllerr("VADDR: %08x VBASE: %08x VEND: %08x\n",
|
||||
regs[REG_PC], PG_PAGED_VBASE, PG_PAGED_VEND);
|
||||
|
||||
if (regs[REG_R15] >= PG_PAGED_VBASE && regs[REG_R15] < PG_PAGED_VEND)
|
||||
|
|
@ -134,7 +123,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr)
|
|||
}
|
||||
else
|
||||
{
|
||||
lldbg("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
|
||||
_alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
|
||||
regs[REG_PC], ifar, ifsr);
|
||||
PANIC();
|
||||
}
|
||||
|
|
@ -154,7 +143,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr)
|
|||
|
||||
/* Crash -- possibly showing diagnostic debug information. */
|
||||
|
||||
lldbg("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
|
||||
_alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
|
||||
regs[REG_PC], ifar, ifsr);
|
||||
PANIC();
|
||||
return regs; /* To keep the compiler happy */
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ void up_release_pending(void)
|
|||
{
|
||||
struct tcb_s *rtcb = this_task();
|
||||
|
||||
slldbg("From TCB=%p\n", rtcb);
|
||||
sllerr("From TCB=%p\n", rtcb);
|
||||
|
||||
/* Merge the g_pendingtasks list into the ready-to-run task list */
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||
struct tcb_s *rtcb = this_task();
|
||||
bool switch_needed;
|
||||
|
||||
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||
sllerr("TCB=%p PRI=%d\n", tcb, priority);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list.
|
||||
* sched_removereadytorun will return true if we just
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
{
|
||||
irqstate_t flags;
|
||||
|
||||
sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
* to the currently executing task.
|
||||
*/
|
||||
|
||||
sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
|
||||
if (tcb == this_task())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ void up_sigdeliver(void)
|
|||
|
||||
board_autoled_on(LED_SIGNAL);
|
||||
|
||||
sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
||||
ASSERT(rtcb->xcp.sigdeliver != NULL);
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ void up_sigdeliver(void)
|
|||
* errno that is needed by the user logic (it is probably EINTR).
|
||||
*/
|
||||
|
||||
sdbg("Resuming\n");
|
||||
serr("Resuming\n");
|
||||
(void)up_irq_save();
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-a/arm_syscall.c
|
||||
*
|
||||
* Copyright (C) 2013-2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <syscall.h>
|
||||
|
|
@ -65,17 +54,6 @@
|
|||
#include "addrenv.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL)
|
||||
# define svcdbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define svcdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -178,16 +156,14 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||
* and R1..R7 = variable number of arguments depending on the system call.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL)
|
||||
svcdbg("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
||||
svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcdbg("CPSR: %08x\n", regs[REG_CPSR]);
|
||||
#endif
|
||||
svcllinfo("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
||||
svcllinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcllinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcllinfo("CPSR: %08x\n", regs[REG_CPSR]);
|
||||
|
||||
/* Handle the SVCall according to the command in R0 */
|
||||
|
||||
|
|
@ -480,7 +456,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||
|
||||
regs[REG_R0] -= CONFIG_SYS_RESERVED;
|
||||
#else
|
||||
svcdbg("ERROR: Bad SYS call: %d\n", regs[REG_R0]);
|
||||
svcllerr("ERROR: Bad SYS call: %d\n", regs[REG_R0]);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
|
|
@ -501,18 +477,16 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||
break;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL)
|
||||
/* Report what happened */
|
||||
|
||||
svcdbg("SYSCALL Exit: regs: %p\n", regs);
|
||||
svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcdbg("CPSR: %08x\n", regs[REG_CPSR]);
|
||||
#endif
|
||||
svcllinfo("SYSCALL Exit: regs: %p\n", regs);
|
||||
svcllinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcllinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcllinfo("CPSR: %08x\n", regs[REG_CPSR]);
|
||||
|
||||
/* Return the last value of curent_regs. This supports context switches
|
||||
* on return from the exception. That capability is only used with the
|
||||
|
|
@ -526,7 +500,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||
|
||||
uint32_t *arm_syscall(uint32_t *regs)
|
||||
{
|
||||
lldbg("SYSCALL from 0x%x\n", regs[REG_PC]);
|
||||
_alert("SYSCALL from 0x%x\n", regs[REG_PC]);
|
||||
CURRENT_REGS = regs;
|
||||
PANIC();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-a/arm_undefinedinsn.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
|
@ -68,7 +57,7 @@
|
|||
|
||||
uint32_t *arm_undefinedinsn(uint32_t *regs)
|
||||
{
|
||||
lldbg("Undefined instruction at 0x%x\n", regs[REG_PC]);
|
||||
_alert("Undefined instruction at 0x%x\n", regs[REG_PC]);
|
||||
CURRENT_REGS = regs;
|
||||
PANIC();
|
||||
return regs; /* To keep the compiler happy */
|
||||
|
|
|
|||
|
|
@ -590,21 +590,6 @@
|
|||
|
||||
#define GIC_IRQ_SPI 32 /* First SPI interrupt ID */
|
||||
|
||||
/* General Macro Definitions ************************************************/
|
||||
/* Debug */
|
||||
|
||||
#ifdef CONFIG_DEBUG_IRQ
|
||||
# define gicdbg(format, ...) dbg(format, ##__VA_ARGS__)
|
||||
# define giclldbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||
# define gicvdbg(format, ...) vdbg(format, ##__VA_ARGS__)
|
||||
# define gicllvdbg(format, ...) llvdbg(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define gicdbg(x...)
|
||||
# define giclldbg(x...)
|
||||
# define gicvdbg(x...)
|
||||
# define gicllvdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -817,7 +802,7 @@ int arm_pause_handler(int irq, FAR void *context);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_IRQ
|
||||
#ifdef CONFIG_DEBUG_IRQ_INFO
|
||||
void arm_gic_dump(const char *msg, bool all, int irq);
|
||||
#else
|
||||
# define arm_gic_dump(m,a,i)
|
||||
|
|
|
|||
|
|
@ -219,9 +219,10 @@ uint32_t mpu_subregion(uintptr_t base, size_t size, uint8_t l2size);
|
|||
|
||||
static inline void mpu_showtype(void)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG
|
||||
#ifdef CONFIG_DEBUG_ERROR
|
||||
uint32_t regval = getreg32(MPU_TYPE);
|
||||
dbg("%s MPU Regions: data=%d instr=%d\n",
|
||||
|
||||
_err("%s MPU Regions: data=%d instr=%d\n",
|
||||
(regval & MPU_TYPE_SEPARATE) != 0 ? "Separate" : "Unified",
|
||||
(regval & MPU_TYPE_DREGION_MASK) >> MPU_TYPE_DREGION_SHIFT,
|
||||
(regval & MPU_TYPE_IREGION_MASK) >> MPU_TYPE_IREGION_SHIFT);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-m/up_assert.c
|
||||
*
|
||||
* Copyright (C) 2009-2010, 2012-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009-2010, 2012-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
|
@ -75,23 +64,6 @@
|
|||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||
*/
|
||||
|
||||
#undef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP))
|
||||
# define CONFIG_PRINT_TASKNAME 1
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -125,7 +97,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)stack;
|
||||
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
stack, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
|
@ -143,12 +115,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
|
|||
{
|
||||
/* Dump interesting properties of this task */
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("%s: PID=%d Stack Used=%lu of %lu\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("%s: PID=%d Stack Used=%lu of %lu\n",
|
||||
tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
|
||||
(unsigned long)tcb->adj_stack_size);
|
||||
#else
|
||||
lldbg("PID: %d Stack Used=%lu of %lu\n",
|
||||
_alert("PID: %d Stack Used=%lu of %lu\n",
|
||||
tcb->pid, (unsigned long)up_check_tcbstack(tcb),
|
||||
(unsigned long)tcb->adj_stack_size);
|
||||
#endif
|
||||
|
|
@ -183,29 +155,29 @@ static inline void up_registerdump(void)
|
|||
{
|
||||
/* Yes.. dump the interrupt registers */
|
||||
|
||||
lldbg("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1],
|
||||
CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3],
|
||||
CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5],
|
||||
CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]);
|
||||
lldbg("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_alert("R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9],
|
||||
CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11],
|
||||
CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13],
|
||||
CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]);
|
||||
|
||||
#ifdef CONFIG_ARMV7M_USEBASEPRI
|
||||
lldbg("xPSR: %08x BASEPRI: %08x CONTROL: %08x\n",
|
||||
_alert("xPSR: %08x BASEPRI: %08x CONTROL: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI],
|
||||
getcontrol());
|
||||
#else
|
||||
lldbg("xPSR: %08x PRIMASK: %08x CONTROL: %08x\n",
|
||||
_alert("xPSR: %08x PRIMASK: %08x CONTROL: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK],
|
||||
getcontrol());
|
||||
#endif
|
||||
|
||||
#ifdef REG_EXC_RETURN
|
||||
lldbg("EXC_RETURN: %08x\n", CURRENT_REGS[REG_EXC_RETURN]);
|
||||
_alert("EXC_RETURN: %08x\n", CURRENT_REGS[REG_EXC_RETURN]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -275,12 +247,12 @@ static void up_dumpstate(void)
|
|||
|
||||
/* Show interrupt stack info */
|
||||
|
||||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("IRQ stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
_alert("sp: %08x\n", sp);
|
||||
_alert("IRQ stack:\n");
|
||||
_alert(" base: %08x\n", istackbase);
|
||||
_alert(" size: %08x\n", istacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
_alert(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
|
||||
/* Does the current stack pointer lie within the interrupt
|
||||
|
|
@ -302,14 +274,14 @@ static void up_dumpstate(void)
|
|||
if (CURRENT_REGS)
|
||||
{
|
||||
sp = CURRENT_REGS[REG_R13];
|
||||
lldbg("sp: %08x\n", sp);
|
||||
_alert("sp: %08x\n", sp);
|
||||
}
|
||||
|
||||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
_alert("User stack:\n");
|
||||
_alert(" base: %08x\n", ustackbase);
|
||||
_alert(" size: %08x\n", ustacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
_alert(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
/* Dump the user stack if the stack pointer lies within the allocated user
|
||||
|
|
@ -325,11 +297,11 @@ static void up_dumpstate(void)
|
|||
|
||||
/* Show user stack info */
|
||||
|
||||
lldbg("sp: %08x\n", sp);
|
||||
lldbg("stack base: %08x\n", ustackbase);
|
||||
lldbg("stack size: %08x\n", ustacksize);
|
||||
_alert("sp: %08x\n", sp);
|
||||
_alert("stack base: %08x\n", ustackbase);
|
||||
_alert("stack size: %08x\n", ustacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
_alert("stack used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
/* Dump the user stack if the stack pointer lies within the allocated user
|
||||
|
|
@ -338,7 +310,7 @@ static void up_dumpstate(void)
|
|||
|
||||
if (sp > ustackbase || sp <= ustackbase - ustacksize)
|
||||
{
|
||||
lldbg("ERROR: Stack pointer is not within the allocated stack\n");
|
||||
_alert("ERROR: Stack pointer is not within the allocated stack\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -403,17 +375,17 @@ static void _up_assert(int errorcode)
|
|||
|
||||
void up_assert(const uint8_t *filename, int lineno)
|
||||
{
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
struct tcb_s *rtcb = this_task();
|
||||
#endif
|
||||
|
||||
board_autoled_on(LED_ASSERTION);
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Assertion failed at file:%s line: %d task: %s\n",
|
||||
filename, lineno, rtcb->name);
|
||||
#else
|
||||
lldbg("Assertion failed at file:%s line: %d\n",
|
||||
_alert("Assertion failed at file:%s line: %d\n",
|
||||
filename, lineno);
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_machine != EM_ARM)
|
||||
{
|
||||
bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_ident[EI_CLASS] != ELFCLASS32)
|
||||
{
|
||||
bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
|
||||
#endif
|
||||
{
|
||||
bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_CALL:
|
||||
case R_ARM_JUMP24:
|
||||
{
|
||||
bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
binfo("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
offset += sym->st_value - addr;
|
||||
if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000)
|
||||
{
|
||||
bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -193,7 +193,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_ABS32:
|
||||
case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */
|
||||
{
|
||||
bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
*(uint32_t *)addr += sym->st_value;
|
||||
|
|
@ -204,7 +204,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_TARGET2: /* TARGET2 is a platform-specific relocation: gcc-arm-none-eabi
|
||||
* performs a self relocation */
|
||||
{
|
||||
bvdbg("Performing TARGET2 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing TARGET2 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
*(uint32_t *)addr += sym->st_value - addr;
|
||||
|
|
@ -253,7 +253,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
upper_insn = (uint32_t)(*(uint16_t *)addr);
|
||||
lower_insn = (uint32_t)(*(uint16_t *)(addr + 2));
|
||||
|
||||
bvdbg("Performing THM_JUMP24 [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing THM_JUMP24 [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn,
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -287,7 +287,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
/* And perform the relocation */
|
||||
|
||||
bvdbg(" S=%d J1=%d J2=%d offset=%08lx branch target=%08lx\n",
|
||||
binfo(" S=%d J1=%d J2=%d offset=%08lx branch target=%08lx\n",
|
||||
S, J1, J2, (long)offset, offset + sym->st_value - addr);
|
||||
|
||||
offset += sym->st_value - addr;
|
||||
|
|
@ -298,7 +298,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
|
||||
{
|
||||
bdbg(" ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n",
|
||||
berr(" ERROR: JUMP24 [%d] requires odd offset, offset=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -308,7 +308,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
if (offset <= (int32_t)0xff000000 || offset >= (int32_t)0x01000000)
|
||||
{
|
||||
bdbg(" ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n",
|
||||
berr(" ERROR: JUMP24 [%d] relocation out of range, branch taget=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -328,14 +328,14 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
lower_insn = ((lower_insn & 0xd000) | (J1 << 13) | (J2 << 11) | ((offset >> 1) & 0x07ff));
|
||||
*(uint16_t *)(addr + 2) = (uint16_t)lower_insn;
|
||||
|
||||
bvdbg(" S=%d J1=%d J2=%d insn [%04x %04x]\n",
|
||||
binfo(" S=%d J1=%d J2=%d insn [%04x %04x]\n",
|
||||
S, J1, J2, (int)upper_insn, (int)lower_insn);
|
||||
}
|
||||
break;
|
||||
|
||||
case R_ARM_V4BX:
|
||||
{
|
||||
bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
binfo("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr));
|
||||
|
||||
/* Preserve only Rm and the condition code */
|
||||
|
|
@ -350,7 +350,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
case R_ARM_PREL31:
|
||||
{
|
||||
bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
offset = *(uint32_t *)addr + sym->st_value - addr;
|
||||
|
|
@ -361,7 +361,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_MOVW_ABS_NC:
|
||||
case R_ARM_MOVT_ABS:
|
||||
{
|
||||
bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -416,7 +416,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
upper_insn = (uint32_t)(*(uint16_t *)addr);
|
||||
lower_insn = (uint32_t)(*(uint16_t *)(addr + 2));
|
||||
|
||||
bvdbg("Performing THM_MOVx [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing THM_MOVx [%d] link at addr=%08lx [%04x %04x] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (int)upper_insn, (int)lower_insn,
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -433,7 +433,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
/* And perform the relocation */
|
||||
|
||||
bvdbg(" offset=%08lx branch target=%08lx\n",
|
||||
binfo(" offset=%08lx branch target=%08lx\n",
|
||||
(long)offset, offset + sym->st_value);
|
||||
|
||||
offset += sym->st_value;
|
||||
|
|
@ -455,13 +455,13 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
(offset & 0x00ff));
|
||||
*(uint16_t *)(addr + 2) = (uint16_t)lower_insn;
|
||||
|
||||
bvdbg(" insn [%04x %04x]\n",
|
||||
binfo(" insn [%04x %04x]\n",
|
||||
(int)upper_insn, (int)lower_insn);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -471,7 +471,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
|
||||
uintptr_t addr)
|
||||
{
|
||||
bdbg("RELA relocation not supported\n");
|
||||
berr("RELA relocation not supported\n");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@
|
|||
*/
|
||||
|
||||
#ifdef CONFIG_DEBUG_HARDFAULT
|
||||
# define hfdbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||
# define hferr(format, ...) _llerr(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define hfdbg(x...)
|
||||
# define hferr(x...)
|
||||
#endif
|
||||
|
||||
#define INSN_SVC0 0xdf00 /* insn: svc 0 */
|
||||
|
|
@ -127,7 +127,7 @@ int up_hardfault(int irq, FAR void *context)
|
|||
/* Fetch the instruction that caused the Hard fault */
|
||||
|
||||
uint16_t insn = *pc;
|
||||
hfdbg(" PC: %p INSN: %04x\n", pc, insn);
|
||||
hferr(" PC: %p INSN: %04x\n", pc, insn);
|
||||
|
||||
/* If this was the instruction 'svc 0', then forward processing
|
||||
* to the SVCall handler
|
||||
|
|
@ -135,7 +135,7 @@ int up_hardfault(int irq, FAR void *context)
|
|||
|
||||
if (insn == INSN_SVC0)
|
||||
{
|
||||
hfdbg("Forward SVCall\n");
|
||||
hferr("Forward SVCall\n");
|
||||
return up_svcall(irq, context);
|
||||
}
|
||||
}
|
||||
|
|
@ -143,43 +143,43 @@ int up_hardfault(int irq, FAR void *context)
|
|||
|
||||
/* Dump some hard fault info */
|
||||
|
||||
hfdbg("Hard Fault:\n");
|
||||
hfdbg(" IRQ: %d regs: %p\n", irq, regs);
|
||||
hfdbg(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x CONTROL: %08x\n",
|
||||
hferr("Hard Fault:\n");
|
||||
hferr(" IRQ: %d regs: %p\n", irq, regs);
|
||||
hferr(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x CONTROL: %08x\n",
|
||||
getbasepri(), getprimask(), getipsr(), getcontrol());
|
||||
hfdbg(" CFAULTS: %08x HFAULTS: %08x DFAULTS: %08x BFAULTADDR: %08x AFAULTS: %08x\n",
|
||||
hferr(" CFAULTS: %08x HFAULTS: %08x DFAULTS: %08x BFAULTADDR: %08x AFAULTS: %08x\n",
|
||||
getreg32(NVIC_CFAULTS), getreg32(NVIC_HFAULTS),
|
||||
getreg32(NVIC_DFAULTS), getreg32(NVIC_BFAULT_ADDR),
|
||||
getreg32(NVIC_AFAULTS));
|
||||
hfdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
hferr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
hfdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
hferr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
|
||||
#ifdef CONFIG_ARMV7M_USEBASEPRI
|
||||
# ifdef REG_EXC_RETURN
|
||||
hfdbg(" xPSR: %08x BASEPRI: %08x EXC_RETURN: %08x (saved)\n",
|
||||
hferr(" xPSR: %08x BASEPRI: %08x EXC_RETURN: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI],
|
||||
CURRENT_REGS[REG_EXC_RETURN]);
|
||||
# else
|
||||
hfdbg(" xPSR: %08x BASEPRI: %08x (saved)\n",
|
||||
hferr(" xPSR: %08x BASEPRI: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI]);
|
||||
# endif
|
||||
#else
|
||||
# ifdef REG_EXC_RETURN
|
||||
hfdbg(" xPSR: %08x PRIMASK: %08x EXC_RETURN: %08x (saved)\n",
|
||||
hferr(" xPSR: %08x PRIMASK: %08x EXC_RETURN: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK],
|
||||
CURRENT_REGS[REG_EXC_RETURN]);
|
||||
# else
|
||||
hfdbg(" xPSR: %08x PRIMASK: %08x (saved)\n",
|
||||
hferr(" xPSR: %08x PRIMASK: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
(void)up_irq_save();
|
||||
lldbg("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS));
|
||||
_llerr("PANIC!!! Hard fault: %08x\n", getreg32(NVIC_HFAULTS));
|
||||
PANIC();
|
||||
return OK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@
|
|||
#undef DEBUG_MEMFAULTS /* Define to debug memory management faults */
|
||||
|
||||
#ifdef DEBUG_MEMFAULTS
|
||||
# define mfdbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||
# define mferr(format, ...) _llerr(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define mfdbg(x...)
|
||||
# define mferr(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -92,35 +92,35 @@ int up_memfault(int irq, FAR void *context)
|
|||
/* Dump some memory management fault info */
|
||||
|
||||
(void)up_irq_save();
|
||||
lldbg("PANIC!!! Memory Management Fault:\n");
|
||||
mfdbg(" IRQ: %d context: %p\n", irq, regs);
|
||||
lldbg(" CFAULTS: %08x MMFAR: %08x\n",
|
||||
_llerr("PANIC!!! Memory Management Fault:\n");
|
||||
mferr(" IRQ: %d context: %p\n", irq, regs);
|
||||
_llerr(" CFAULTS: %08x MMFAR: %08x\n",
|
||||
getreg32(NVIC_CFAULTS), getreg32(NVIC_MEMMANAGE_ADDR));
|
||||
mfdbg(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x CONTROL: %08x\n",
|
||||
mferr(" BASEPRI: %08x PRIMASK: %08x IPSR: %08x CONTROL: %08x\n",
|
||||
getbasepri(), getprimask(), getipsr(), getcontrol());
|
||||
mfdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
mferr(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
mfdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
mferr(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
|
||||
#ifdef CONFIG_ARMV7M_USEBASEPRI
|
||||
# ifdef REG_EXC_RETURN
|
||||
mfdbg(" xPSR: %08x BASEPRI: %08x EXC_RETURN: %08x (saved)\n",
|
||||
mferr(" xPSR: %08x BASEPRI: %08x EXC_RETURN: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI],
|
||||
CURRENT_REGS[REG_EXC_RETURN]);
|
||||
# else
|
||||
mfdbg(" xPSR: %08x BASEPRI: %08x (saved)\n",
|
||||
mferr(" xPSR: %08x BASEPRI: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_BASEPRI]);
|
||||
# endif
|
||||
#else
|
||||
# ifdef REG_EXC_RETURN
|
||||
mfdbg(" xPSR: %08x PRIMASK: %08x EXC_RETURN: %08x (saved)\n",
|
||||
mferr(" xPSR: %08x PRIMASK: %08x EXC_RETURN: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK],
|
||||
CURRENT_REGS[REG_EXC_RETURN]);
|
||||
# else
|
||||
mfdbg(" xPSR: %08x PRIMASK: %08x (saved)\n",
|
||||
mferr(" xPSR: %08x PRIMASK: %08x (saved)\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_PRIMASK]);
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -49,39 +49,6 @@
|
|||
|
||||
#ifdef CONFIG_ARCH_RAMVECTORS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing the interrupt
|
||||
* config. NOTE: that only lldbg types are used so that the output is
|
||||
* immediately available.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DEBUG_IRQ
|
||||
# define intdbg lldbg
|
||||
# define intvdbg llvdbg
|
||||
#else
|
||||
# define intdbg(x...)
|
||||
# define intvdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Declarations
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -103,7 +70,7 @@ int up_ramvec_attach(int irq, up_vector_t vector)
|
|||
{
|
||||
int ret = -EINVAL;
|
||||
|
||||
intvdbg("%s IRQ%d\n", vector ? "Attaching" : "Detaching", irq);
|
||||
irqinfo("%s IRQ%d\n", vector ? "Attaching" : "Detaching", irq);
|
||||
|
||||
if ((unsigned)irq < NR_VECTORS)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -71,24 +71,6 @@
|
|||
|
||||
#define RAMVEC_ALIGN ((~NVIC_VECTAB_TBLOFF_MASK & 0xffff) + 1)
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Non-standard debug that may be enabled just for testing the interrupt
|
||||
* config. NOTE: that only lldbg types are used so that the output is
|
||||
* immediately available.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_DEBUG_IRQ
|
||||
# define intdbg lldbg
|
||||
# define intvdbg llvdbg
|
||||
#else
|
||||
# define intdbg(x...)
|
||||
# define intvdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Declarations
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
|
@ -147,7 +129,7 @@ void up_ramvec_initialize(void)
|
|||
src = (const CODE up_vector_t *)getreg32(NVIC_VECTAB);
|
||||
dest = g_ram_vectors;
|
||||
|
||||
intvdbg("src=%p dest=%p\n", src, dest);
|
||||
irqinfo("src=%p dest=%p\n", src, dest);
|
||||
|
||||
for (i = 0; i < ARMV7M_VECTAB_SIZE; i++)
|
||||
{
|
||||
|
|
@ -163,7 +145,7 @@ void up_ramvec_initialize(void)
|
|||
* the table alignment is insufficient.
|
||||
*/
|
||||
|
||||
intvdbg("NVIC_VECTAB=%08x\n", getreg32(NVIC_VECTAB));
|
||||
irqinfo("NVIC_VECTAB=%08x\n", getreg32(NVIC_VECTAB));
|
||||
DEBUGASSERT(getreg32(NVIC_VECTAB) == (uint32_t)g_ram_vectors);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ void up_release_pending(void)
|
|||
{
|
||||
struct tcb_s *rtcb = this_task();
|
||||
|
||||
slldbg("From TCB=%p\n", rtcb);
|
||||
sllerr("From TCB=%p\n", rtcb);
|
||||
|
||||
/* Merge the g_pendingtasks list into the ready-to-run task list */
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||
struct tcb_s *rtcb = this_task();
|
||||
bool switch_needed;
|
||||
|
||||
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||
sllerr("TCB=%p PRI=%d\n", tcb, priority);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list.
|
||||
* sched_removereadytorun will return true if we just removed the head
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
{
|
||||
irqstate_t flags;
|
||||
|
||||
sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
DEBUGASSERT(tcb != NULL && sigdeliver != NULL);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
|
@ -110,7 +110,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
* to the currently executing task.
|
||||
*/
|
||||
|
||||
sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
|
||||
if (tcb == this_task())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void up_sigdeliver(void)
|
|||
|
||||
board_autoled_on(LED_SIGNAL);
|
||||
|
||||
sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
||||
ASSERT(rtcb->xcp.sigdeliver != NULL);
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ void up_sigdeliver(void)
|
|||
* errno that is needed by the user logic (it is probably EINTR).
|
||||
*/
|
||||
|
||||
sdbg("Resuming\n");
|
||||
serr("Resuming\n");
|
||||
(void)up_irq_save();
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,33 +56,6 @@
|
|||
#include "exc_return.h"
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Debug ********************************************************************/
|
||||
/* Debug output from this file may interfere with context switching! To get
|
||||
* debug output you must enabled the following in your NuttX configuration:
|
||||
*
|
||||
* - CONFIG_DEBUG and CONFIG_DEBUG_SYSCALL (shows only syscalls)
|
||||
* - CONFIG_DEBUG and CONFIG_DEBUG_SVCALL (shows everything)
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL) || defined(CONFIG_DEBUG_SVCALL)
|
||||
# define svcdbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define svcdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -164,23 +137,23 @@ int up_svcall(int irq, FAR void *context)
|
|||
* and R1..R7 = variable number of arguments depending on the system call.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL) || defined(CONFIG_DEBUG_SVCALL)
|
||||
#ifdef CONFIG_DEBUG_SYSCALL_INFO
|
||||
# ifndef CONFIG_DEBUG_SVCALL
|
||||
if (cmd > SYS_switch_context)
|
||||
# endif
|
||||
{
|
||||
svcdbg("SVCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
||||
svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcllinfo("SVCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
||||
svcllinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcllinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
# ifdef REG_EXC_RETURN
|
||||
svcdbg(" PSR: %08x EXC_RETURN: %08x\n",
|
||||
regs[REG_XPSR], regs[REG_EXC_RETURN]);
|
||||
svcllinfo(" PSR: %08x EXC_RETURN: %08x\n",
|
||||
regs[REG_XPSR], regs[REG_EXC_RETURN]);
|
||||
# else
|
||||
svcdbg(" PSR: %08x\n", regs[REG_XPSR]);
|
||||
svcllinfo(" PSR: %08x\n", regs[REG_XPSR]);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
|
@ -473,7 +446,7 @@ int up_svcall(int irq, FAR void *context)
|
|||
|
||||
regs[REG_R0] -= CONFIG_SYS_RESERVED;
|
||||
#else
|
||||
slldbg("ERROR: Bad SYS call: %d\n", regs[REG_R0]);
|
||||
svcllerr("ERROR: Bad SYS call: %d\n", regs[REG_R0]);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
|
|
@ -481,35 +454,35 @@ int up_svcall(int irq, FAR void *context)
|
|||
|
||||
/* Report what happened. That might difficult in the case of a context switch */
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL) || defined(CONFIG_DEBUG_SVCALL)
|
||||
#ifdef CONFIG_DEBUG_SYSCALL_INFO
|
||||
# ifndef CONFIG_DEBUG_SVCALL
|
||||
if (cmd > SYS_switch_context)
|
||||
# else
|
||||
if (regs != CURRENT_REGS)
|
||||
# endif
|
||||
{
|
||||
svcdbg("SVCall Return:\n");
|
||||
svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1],
|
||||
CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3],
|
||||
CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5],
|
||||
CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]);
|
||||
svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9],
|
||||
CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11],
|
||||
CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13],
|
||||
CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]);
|
||||
svcllinfo("SVCall Return:\n");
|
||||
svcllinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R0], CURRENT_REGS[REG_R1],
|
||||
CURRENT_REGS[REG_R2], CURRENT_REGS[REG_R3],
|
||||
CURRENT_REGS[REG_R4], CURRENT_REGS[REG_R5],
|
||||
CURRENT_REGS[REG_R6], CURRENT_REGS[REG_R7]);
|
||||
svcllinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
CURRENT_REGS[REG_R8], CURRENT_REGS[REG_R9],
|
||||
CURRENT_REGS[REG_R10], CURRENT_REGS[REG_R11],
|
||||
CURRENT_REGS[REG_R12], CURRENT_REGS[REG_R13],
|
||||
CURRENT_REGS[REG_R14], CURRENT_REGS[REG_R15]);
|
||||
# ifdef REG_EXC_RETURN
|
||||
svcdbg(" PSR: %08x EXC_RETURN: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_EXC_RETURN]);
|
||||
svcllinfo(" PSR: %08x EXC_RETURN: %08x\n",
|
||||
CURRENT_REGS[REG_XPSR], CURRENT_REGS[REG_EXC_RETURN]);
|
||||
# else
|
||||
svcdbg(" PSR: %08x\n", CURRENT_REGS[REG_XPSR]);
|
||||
svcllinfo(" PSR: %08x\n", CURRENT_REGS[REG_XPSR]);
|
||||
# endif
|
||||
}
|
||||
# ifdef CONFIG_DEBUG_SVCALL
|
||||
else
|
||||
{
|
||||
svcdbg("SVCall Return: %d\n", regs[REG_R0]);
|
||||
svcllinfo("SVCall Return: %d\n", regs[REG_R0]);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-r/arm_assert.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
|
@ -69,25 +58,13 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* USB trace dumping */
|
||||
|
||||
#ifndef CONFIG_USBDEV_TRACE
|
||||
# undef CONFIG_ARCH_USBDUMP
|
||||
#endif
|
||||
|
||||
/* The following is just intended to keep some ugliness out of the mainline
|
||||
* code. We are going to print the task name if:
|
||||
*
|
||||
* CONFIG_TASK_NAME_SIZE > 0 && <-- The task has a name
|
||||
* (defined(CONFIG_DEBUG) || <-- And the debug is enabled (lldbg used)
|
||||
* defined(CONFIG_ARCH_STACKDUMP) <-- Or lowsyslog() is used
|
||||
*/
|
||||
|
||||
#undef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0 && (defined(CONFIG_DEBUG) || defined(CONFIG_ARCH_STACKDUMP))
|
||||
# define CONFIG_PRINT_TASKNAME 1
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -121,7 +98,7 @@ static void up_stackdump(uint32_t sp, uint32_t stack_base)
|
|||
for (stack = sp & ~0x1f; stack < stack_base; stack += 32)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)stack;
|
||||
lldbg("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_llerr("%08x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
stack, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
|
@ -139,12 +116,12 @@ static void up_taskdump(FAR struct tcb_s *tcb, FAR void *arg)
|
|||
{
|
||||
/* Dump interesting properties of this task */
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("%s: PID=%d Stack Used=%lu of %lu\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_llerr("%s: PID=%d Stack Used=%lu of %lu\n",
|
||||
tcb->name, tcb->pid, (unsigned long)up_check_tcbstack(tcb),
|
||||
(unsigned long)tcb->adj_stack_size);
|
||||
#else
|
||||
lldbg("PID: %d Stack Used=%lu of %lu\n",
|
||||
_llerr("PID: %d Stack Used=%lu of %lu\n",
|
||||
tcb->pid, (unsigned long)up_check_tcbstack(tcb),
|
||||
(unsigned long)tcb->adj_stack_size);
|
||||
#endif
|
||||
|
|
@ -184,12 +161,12 @@ static inline void up_registerdump(void)
|
|||
for (regs = REG_R0; regs <= REG_R15; regs += 8)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)&CURRENT_REGS[regs];
|
||||
lldbg("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
_llerr("R%d: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs, ptr[0], ptr[1], ptr[2], ptr[3],
|
||||
ptr[4], ptr[5], ptr[6], ptr[7]);
|
||||
}
|
||||
|
||||
lldbg("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
|
||||
_llerr("CPSR: %08x\n", CURRENT_REGS[REG_CPSR]);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
@ -253,7 +230,7 @@ static void up_dumpstate(void)
|
|||
ustacksize = (uint32_t)rtcb->adj_stack_size;
|
||||
}
|
||||
|
||||
lldbg("Current sp: %08x\n", sp);
|
||||
_llerr("Current sp: %08x\n", sp);
|
||||
|
||||
#if CONFIG_ARCH_INTERRUPTSTACK > 3
|
||||
/* Get the limits on the interrupt stack memory */
|
||||
|
|
@ -263,21 +240,21 @@ static void up_dumpstate(void)
|
|||
|
||||
/* Show interrupt stack info */
|
||||
|
||||
lldbg("Interrupt stack:\n");
|
||||
lldbg(" base: %08x\n", istackbase);
|
||||
lldbg(" size: %08x\n", istacksize);
|
||||
_llerr("Interrupt stack:\n");
|
||||
_llerr(" base: %08x\n", istackbase);
|
||||
_llerr(" size: %08x\n", istacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_intstack());
|
||||
_llerr(" used: %08x\n", up_check_intstack());
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Show user stack info */
|
||||
|
||||
lldbg("User stack:\n");
|
||||
lldbg(" base: %08x\n", ustackbase);
|
||||
lldbg(" size: %08x\n", ustacksize);
|
||||
_llerr("User stack:\n");
|
||||
_llerr(" base: %08x\n", ustackbase);
|
||||
_llerr(" size: %08x\n", ustacksize);
|
||||
#ifdef CONFIG_STACK_COLORATION
|
||||
lldbg(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
_llerr(" used: %08x\n", up_check_tcbstack(rtcb));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
|
|
@ -287,9 +264,9 @@ static void up_dumpstate(void)
|
|||
{
|
||||
kstackbase = (uint32_t)rtcb->xcp.kstack + CONFIG_ARCH_KERNEL_STACKSIZE - 4;
|
||||
|
||||
lldbg("Kernel stack:\n");
|
||||
lldbg(" base: %08x\n", kstackbase);
|
||||
lldbg(" size: %08x\n", CONFIG_ARCH_KERNEL_STACKSIZE);
|
||||
_llerr("Kernel stack:\n");
|
||||
_llerr(" base: %08x\n", kstackbase);
|
||||
_llerr(" size: %08x\n", CONFIG_ARCH_KERNEL_STACKSIZE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -300,7 +277,7 @@ static void up_dumpstate(void)
|
|||
{
|
||||
/* Yes.. dump the interrupt stack */
|
||||
|
||||
lldbg("Interrupt Stack\n", sp);
|
||||
_llerr("Interrupt Stack\n", sp);
|
||||
up_stackdump(sp, istackbase);
|
||||
|
||||
/* Extract the user stack pointer which should lie
|
||||
|
|
@ -308,7 +285,7 @@ static void up_dumpstate(void)
|
|||
*/
|
||||
|
||||
sp = g_intstackbase;
|
||||
lldbg("User sp: %08x\n", sp);
|
||||
_llerr("User sp: %08x\n", sp);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -318,7 +295,7 @@ static void up_dumpstate(void)
|
|||
|
||||
if (sp > ustackbase - ustacksize && sp < ustackbase)
|
||||
{
|
||||
lldbg("User Stack\n", sp);
|
||||
_llerr("User Stack\n", sp);
|
||||
up_stackdump(sp, ustackbase);
|
||||
}
|
||||
|
||||
|
|
@ -329,7 +306,7 @@ static void up_dumpstate(void)
|
|||
|
||||
if (sp >= (uint32_t)rtcb->xcp.kstack && sp < kstackbase)
|
||||
{
|
||||
lldbg("Kernel Stack\n", sp);
|
||||
_llerr("Kernel Stack\n", sp);
|
||||
up_stackdump(sp, kstackbase);
|
||||
}
|
||||
#endif
|
||||
|
|
@ -390,16 +367,16 @@ static void _up_assert(int errorcode)
|
|||
|
||||
void up_assert(const uint8_t *filename, int lineno)
|
||||
{
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
struct tcb_s *rtcb = this_task();
|
||||
#endif
|
||||
board_autoled_on(LED_ASSERTION);
|
||||
|
||||
#ifdef CONFIG_PRINT_TASKNAME
|
||||
lldbg("Assertion failed at file:%s line: %d task: %s\n",
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_llerr("Assertion failed at file:%s line: %d task: %s\n",
|
||||
filename, lineno, rtcb->name);
|
||||
#else
|
||||
lldbg("Assertion failed at file:%s line: %d\n",
|
||||
_llerr("Assertion failed at file:%s line: %d\n",
|
||||
filename, lineno);
|
||||
#endif
|
||||
up_dumpstate();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-r/arm_dataabort.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
@ -86,7 +75,7 @@ uint32_t *arm_dataabort(uint32_t *regs, uint32_t dfar, uint32_t dfsr)
|
|||
|
||||
/* Crash -- possibly showing diagnostic debug information. */
|
||||
|
||||
lldbg("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
|
||||
_alert("Data abort. PC: %08x DFAR: %08x DFSR: %08x\n",
|
||||
regs[REG_PC], dfar, dfsr);
|
||||
PANIC();
|
||||
return regs; /* To keep the compiler happy */
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_machine != EM_ARM)
|
||||
{
|
||||
bdbg("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
berr("Not for ARM: e_machine=%04x\n", ehdr->e_machine);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if (ehdr->e_ident[EI_CLASS] != ELFCLASS32)
|
||||
{
|
||||
bdbg("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
berr("Need 32-bit objects: e_ident[EI_CLASS]=%02x\n", ehdr->e_ident[EI_CLASS]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB)
|
||||
#endif
|
||||
{
|
||||
bdbg("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
berr("Wrong endian-ness: e_ident[EI_DATA]=%02x\n", ehdr->e_ident[EI_DATA]);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ bool up_checkarch(FAR const Elf32_Ehdr *ehdr)
|
|||
|
||||
if ((ehdr->e_entry & 3) != 0)
|
||||
{
|
||||
bdbg("Entry point is not properly aligned: %08x\n", ehdr->e_entry);
|
||||
berr("Entry point is not properly aligned: %08x\n", ehdr->e_entry);
|
||||
return -ENOEXEC;
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_CALL:
|
||||
case R_ARM_JUMP24:
|
||||
{
|
||||
bvdbg("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
binfo("Performing PC24 [%d] link at addr %08lx [%08lx] to sym '%s' st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -187,7 +187,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
offset += sym->st_value - addr;
|
||||
if (offset & 3 || offset <= (int32_t) 0xfe000000 || offset >= (int32_t) 0x02000000)
|
||||
{
|
||||
bdbg(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
berr(" ERROR: PC24 [%d] relocation out of range, offset=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), offset);
|
||||
|
||||
return -EINVAL;
|
||||
|
|
@ -203,7 +203,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_ABS32:
|
||||
case R_ARM_TARGET1: /* New ABI: TARGET1 always treated as ABS32 */
|
||||
{
|
||||
bvdbg("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing ABS32 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
*(uint32_t *)addr += sym->st_value;
|
||||
|
|
@ -212,7 +212,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
case R_ARM_V4BX:
|
||||
{
|
||||
bvdbg("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
binfo("Performing V4BX link at addr=%08lx [%08lx]\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr));
|
||||
|
||||
/* Preserve only Rm and the condition code */
|
||||
|
|
@ -227,7 +227,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
|
||||
case R_ARM_PREL31:
|
||||
{
|
||||
bvdbg("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing PREL31 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
(long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);
|
||||
|
||||
offset = *(uint32_t *)addr + sym->st_value - addr;
|
||||
|
|
@ -238,7 +238,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
case R_ARM_MOVW_ABS_NC:
|
||||
case R_ARM_MOVT_ABS:
|
||||
{
|
||||
bvdbg("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
binfo("Performing MOVx_ABS [%d] link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n",
|
||||
ELF32_R_TYPE(rel->r_info), (long)addr, (long)(*(uint32_t *)addr),
|
||||
sym, (long)sym->st_value);
|
||||
|
||||
|
|
@ -258,7 +258,7 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
break;
|
||||
|
||||
default:
|
||||
bdbg("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
berr("Unsupported relocation: %d\n", ELF32_R_TYPE(rel->r_info));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -268,6 +268,6 @@ int up_relocate(FAR const Elf32_Rel *rel, FAR const Elf32_Sym *sym,
|
|||
int up_relocateadd(FAR const Elf32_Rela *rel, FAR const Elf32_Sym *sym,
|
||||
uintptr_t addr)
|
||||
{
|
||||
bdbg("RELA relocation not supported\n");
|
||||
berr("RELA relocation not supported\n");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ void up_l2ccinitialize(void)
|
|||
putreg32(L2CC_CR_L2CEN, L2CC_CR);
|
||||
}
|
||||
|
||||
lldbg("(%d ways) * (%d bytes/way) = %d bytes\n",
|
||||
_llerr("(%d ways) * (%d bytes/way) = %d bytes\n",
|
||||
PL310_NWAYS, PL310_WAYSIZE, PL310_CACHE_SIZE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-r/arm_prefetchabort.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <debug.h>
|
||||
|
||||
|
|
@ -82,7 +71,7 @@ uint32_t *arm_prefetchabort(uint32_t *regs, uint32_t ifar, uint32_t ifsr)
|
|||
|
||||
/* Crash -- possibly showing diagnostic debug information. */
|
||||
|
||||
lldbg("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
|
||||
_alert("Prefetch abort. PC: %08x IFAR: %08x IFSR: %08x\n",
|
||||
regs[REG_PC], ifar, ifsr);
|
||||
PANIC();
|
||||
return regs; /* To keep the compiler happy */
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ void up_release_pending(void)
|
|||
{
|
||||
struct tcb_s *rtcb = this_task();
|
||||
|
||||
slldbg("From TCB=%p\n", rtcb);
|
||||
sllerr("From TCB=%p\n", rtcb);
|
||||
|
||||
/* Merge the g_pendingtasks list into the ready-to-run task list */
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ void up_reprioritize_rtr(struct tcb_s *tcb, uint8_t priority)
|
|||
struct tcb_s *rtcb = this_task();
|
||||
bool switch_needed;
|
||||
|
||||
slldbg("TCB=%p PRI=%d\n", tcb, priority);
|
||||
sllerr("TCB=%p PRI=%d\n", tcb, priority);
|
||||
|
||||
/* Remove the tcb task from the ready-to-run list.
|
||||
* sched_removereadytorun will return true if we just
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
{
|
||||
irqstate_t flags;
|
||||
|
||||
sdbg("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
serr("tcb=0x%p sigdeliver=0x%p\n", tcb, sigdeliver);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
* to the currently executing task.
|
||||
*/
|
||||
|
||||
sdbg("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
serr("rtcb=0x%p CURRENT_REGS=0x%p\n", this_task(), CURRENT_REGS);
|
||||
|
||||
if (tcb == this_task())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ void up_sigdeliver(void)
|
|||
|
||||
board_autoled_on(LED_SIGNAL);
|
||||
|
||||
sdbg("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
serr("rtcb=%p sigdeliver=%p sigpendactionq.head=%p\n",
|
||||
rtcb, rtcb->xcp.sigdeliver, rtcb->sigpendactionq.head);
|
||||
ASSERT(rtcb->xcp.sigdeliver != NULL);
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ void up_sigdeliver(void)
|
|||
* errno that is needed by the user logic (it is probably EINTR).
|
||||
*/
|
||||
|
||||
sdbg("Resuming\n");
|
||||
serr("Resuming\n");
|
||||
(void)up_irq_save();
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <syscall.h>
|
||||
|
|
@ -64,18 +53,7 @@
|
|||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Debug ********************************************************************/
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL)
|
||||
# define svcdbg(format, ...) lldbg(format, ##__VA_ARGS__)
|
||||
#else
|
||||
# define svcdbg(x...)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -176,16 +154,14 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||
* and R1..R7 = variable number of arguments depending on the system call.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL)
|
||||
svcdbg("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
||||
svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcdbg("CPSR: %08x\n", regs[REG_CPSR]);
|
||||
#endif
|
||||
svcllinfo("SYSCALL Entry: regs: %p cmd: %d\n", regs, cmd);
|
||||
svcllinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcllinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcllinfo("CPSR: %08x\n", regs[REG_CPSR]);
|
||||
|
||||
/* Handle the SVCall according to the command in R0 */
|
||||
|
||||
|
|
@ -478,7 +454,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||
|
||||
regs[REG_R0] -= CONFIG_SYS_RESERVED;
|
||||
#else
|
||||
svcdbg("ERROR: Bad SYS call: %d\n", regs[REG_R0]);
|
||||
svcllerr("ERROR: Bad SYS call: %d\n", regs[REG_R0]);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
|
|
@ -499,18 +475,16 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||
break;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_DEBUG_SYSCALL)
|
||||
/* Report what happened */
|
||||
|
||||
svcdbg("SYSCALL Exit: regs: %p\n", regs);
|
||||
svcdbg(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcdbg(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcdbg("CPSR: %08x\n", regs[REG_CPSR]);
|
||||
#endif
|
||||
svcllinfo("SYSCALL Exit: regs: %p\n", regs);
|
||||
svcllinfo(" R0: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R0], regs[REG_R1], regs[REG_R2], regs[REG_R3],
|
||||
regs[REG_R4], regs[REG_R5], regs[REG_R6], regs[REG_R7]);
|
||||
svcllinfo(" R8: %08x %08x %08x %08x %08x %08x %08x %08x\n",
|
||||
regs[REG_R8], regs[REG_R9], regs[REG_R10], regs[REG_R11],
|
||||
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15]);
|
||||
svcllinfo("CPSR: %08x\n", regs[REG_CPSR]);
|
||||
|
||||
/* Return the last value of curent_regs. This supports context switches
|
||||
* on return from the exception. That capability is only used with the
|
||||
|
|
@ -524,7 +498,7 @@ uint32_t *arm_syscall(uint32_t *regs)
|
|||
|
||||
uint32_t *arm_syscall(uint32_t *regs)
|
||||
{
|
||||
lldbg("SYSCALL from 0x%x\n", regs[REG_PC]);
|
||||
_alert("SYSCALL from 0x%x\n", regs[REG_PC]);
|
||||
CURRENT_REGS = regs;
|
||||
PANIC();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/****************************************************************************
|
||||
* arch/arm/src/armv7-r/arm_undefinedinsn.c
|
||||
*
|
||||
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2015-2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -39,17 +39,6 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/* Output debug info if stack dump is selected -- even if debug is not
|
||||
* selected.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_ARCH_STACKDUMP
|
||||
# undef CONFIG_DEBUG
|
||||
# undef CONFIG_DEBUG_VERBOSE
|
||||
# define CONFIG_DEBUG 1
|
||||
# define CONFIG_DEBUG_VERBOSE 1
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
|
|
@ -58,18 +47,6 @@
|
|||
|
||||
#include "up_internal.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
@ -80,7 +57,7 @@
|
|||
|
||||
uint32_t *arm_undefinedinsn(uint32_t *regs)
|
||||
{
|
||||
lldbg("Undefined instruction at 0x%x\n", regs[REG_PC]);
|
||||
_alert("Undefined instruction at 0x%x\n", regs[REG_PC]);
|
||||
CURRENT_REGS = regs;
|
||||
PANIC();
|
||||
return regs; /* To keep the compiler happy */
|
||||
|
|
|
|||
|
|
@ -359,9 +359,9 @@ static inline void mpu_set_rgnr(unsigned int rgnr)
|
|||
|
||||
static inline void mpu_showtype(void)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
uint32_t regval = mpu_get_mpuir();
|
||||
dbg("%s MPU Regions: data=%d instr=%d\n",
|
||||
_err("%s MPU Regions: data=%d instr=%d\n",
|
||||
(regval & MPUIR_SEPARATE) != 0 ? "Separate" : "Unified",
|
||||
(regval & MPUIR_DREGION_MASK) >> MPUIR_DREGION_SHIFT,
|
||||
(regval & MPUIR_IREGION_MASK) >> MPUIR_IREGION_SHIFT);
|
||||
|
|
|
|||
|
|
@ -413,11 +413,11 @@ static void c5471_macassign(struct c5471_driver_s *c5471);
|
|||
#ifdef CONFIG_C5471_NET_DUMPBUFFER
|
||||
static inline void c5471_dumpbuffer(const char *msg, const uint8_t *buffer, unsigned int nbytes)
|
||||
{
|
||||
/* CONFIG_DEBUG, CONFIG_DEBUG_VERBOSE, and CONFIG_DEBUG_NET have to be
|
||||
/* CONFIG_DEBUG_FEATURES, CONFIG_DEBUG_INFO, and CONFIG_DEBUG_NET have to be
|
||||
* defined or the following does nothing.
|
||||
*/
|
||||
|
||||
nvdbgdumpbuffer(msg, buffer, nbytes);
|
||||
ninfodumpbuffer(msg, buffer, nbytes);
|
||||
}
|
||||
#else
|
||||
# define c5471_dumpbuffer(msg, buffer,nbytes)
|
||||
|
|
@ -737,22 +737,22 @@ static int c5471_phyinit (void)
|
|||
phyid = (c5471_mdread(0, MD_PHY_MSB_REG) << 16) | c5471_mdread(0, MD_PHY_LSB_REG);
|
||||
if (phyid != LU3X31_T64_PHYID)
|
||||
{
|
||||
ndbg("Unrecognized PHY ID: %08x\n", phyid);
|
||||
nerr("Unrecognized PHY ID: %08x\n", phyid);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
/* Next, Set desired network rate, 10BaseT, 100BaseT, or auto. */
|
||||
|
||||
#ifdef CONFIG_C5471_AUTONEGOTIATION
|
||||
ndbg("Setting PHY Transceiver for Autonegotiation\n");
|
||||
nerr("Setting PHY Transceiver for Autonegotiation\n");
|
||||
c5471_mdwrite(0, MD_PHY_CONTROL_REG, MODE_AUTONEG);
|
||||
#endif
|
||||
#ifdef CONFIG_C5471_BASET100
|
||||
ndbg("Setting PHY Transceiver for 100BaseT FullDuplex\n");
|
||||
nerr("Setting PHY Transceiver for 100BaseT FullDuplex\n");
|
||||
c5471_mdwrite(0, MD_PHY_CONTROL_REG, MODE_100MBIT_FULLDUP);
|
||||
#endif
|
||||
#ifdef CONFIG_C5471_BASET10
|
||||
ndbg("Setting PHY Transceiver for 10BaseT FullDuplex\n");
|
||||
nerr("Setting PHY Transceiver for 10BaseT FullDuplex\n");
|
||||
c5471_mdwrite(0, MD_PHY_CONTROL_REG, MODE_10MBIT_FULLDUP);
|
||||
#endif
|
||||
|
||||
|
|
@ -802,7 +802,7 @@ static inline void c5471_inctxcpu(struct c5471_driver_s *c5471)
|
|||
c5471->c_txcpudesc += 2*sizeof(uint32_t);
|
||||
}
|
||||
|
||||
nvdbg("TX CPU desc: %08x\n", c5471->c_txcpudesc);
|
||||
ninfo("TX CPU desc: %08x\n", c5471->c_txcpudesc);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -825,7 +825,7 @@ static inline void c5471_incrxcpu(struct c5471_driver_s *c5471)
|
|||
c5471->c_rxcpudesc += 2*sizeof(uint32_t);
|
||||
}
|
||||
|
||||
nvdbg("RX CPU desc: %08x\n", c5471->c_rxcpudesc);
|
||||
ninfo("RX CPU desc: %08x\n", c5471->c_rxcpudesc);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -861,7 +861,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471)
|
|||
bfirstframe = true;
|
||||
c5471->c_lastdescstart = c5471->c_rxcpudesc;
|
||||
|
||||
nvdbg("Packet size: %d RX CPU desc: %08x\n", nbytes, c5471->c_rxcpudesc);
|
||||
ninfo("Packet size: %d RX CPU desc: %08x\n", nbytes, c5471->c_rxcpudesc);
|
||||
c5471_dumpbuffer("Transmit packet", dev->d_buf, dev->d_len);
|
||||
|
||||
while (nbytes)
|
||||
|
|
@ -918,7 +918,7 @@ static int c5471_transmit(struct c5471_driver_s *c5471)
|
|||
|
||||
putreg32(((getreg32(c5471->c_rxcpudesc) & ~EIM_RXDESC_BYTEMASK) | framelen), c5471->c_rxcpudesc);
|
||||
nbytes -= framelen;
|
||||
nvdbg("Wrote framelen: %d nbytes: %d nshorts: %d\n", framelen, nbytes, nshorts);
|
||||
ninfo("Wrote framelen: %d nbytes: %d nshorts: %d\n", framelen, nbytes, nshorts);
|
||||
|
||||
if (0 == nbytes)
|
||||
{
|
||||
|
|
@ -1092,43 +1092,43 @@ static void c5471_rxstatus(struct c5471_driver_s *c5471)
|
|||
if ((rxstatus & EIM_TXDESC_RETRYERROR) != 0)
|
||||
{
|
||||
c5471->c_rxretries++;
|
||||
nvdbg("c_rxretries: %d\n", c5471->c_rxretries);
|
||||
ninfo("c_rxretries: %d\n", c5471->c_rxretries);
|
||||
}
|
||||
|
||||
if ((rxstatus & EIM_TXDESC_HEARTBEAT) != 0)
|
||||
{
|
||||
c5471->c_rxheartbeat++;
|
||||
nvdbg("c_rxheartbeat: %d\n", c5471->c_rxheartbeat);
|
||||
ninfo("c_rxheartbeat: %d\n", c5471->c_rxheartbeat);
|
||||
}
|
||||
|
||||
if ((rxstatus & EIM_TXDESC_LCOLLISON) != 0)
|
||||
{
|
||||
c5471->c_rxlcollision++;
|
||||
nvdbg("c_rxlcollision: %d\n", c5471->c_rxlcollision);
|
||||
ninfo("c_rxlcollision: %d\n", c5471->c_rxlcollision);
|
||||
}
|
||||
|
||||
if ((rxstatus & EIM_TXDESC_COLLISION) != 0)
|
||||
{
|
||||
c5471->c_rxcollision++;
|
||||
nvdbg("c_rxcollision: %d\n", c5471->c_rxcollision);
|
||||
ninfo("c_rxcollision: %d\n", c5471->c_rxcollision);
|
||||
}
|
||||
|
||||
if ((rxstatus & EIM_TXDESC_CRCERROR) != 0)
|
||||
{
|
||||
c5471->c_rxcrc++;
|
||||
nvdbg("c_rxcrc: %d\n", c5471->c_rxcrc);
|
||||
ninfo("c_rxcrc: %d\n", c5471->c_rxcrc);
|
||||
}
|
||||
|
||||
if ((rxstatus & EIM_TXDESC_UNDERRUN) != 0)
|
||||
{
|
||||
c5471->c_rxunderrun++;
|
||||
nvdbg("c_rxunderrun: %d\n", c5471->c_rxunderrun);
|
||||
ninfo("c_rxunderrun: %d\n", c5471->c_rxunderrun);
|
||||
}
|
||||
|
||||
if ((rxstatus & EIM_TXDESC_LOC) != 0)
|
||||
{
|
||||
c5471->c_rxloc++;
|
||||
nvdbg("c_rxloc: %d\n", c5471->c_rxloc);
|
||||
ninfo("c_rxloc: %d\n", c5471->c_rxloc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1166,7 +1166,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
|||
* the EIM for additional packets that might be received later from the network.
|
||||
*/
|
||||
|
||||
nvdbg("Reading TX CPU desc: %08x\n", c5471->c_txcpudesc);
|
||||
ninfo("Reading TX CPU desc: %08x\n", c5471->c_txcpudesc);
|
||||
while (bmore)
|
||||
{
|
||||
/* Words #0 and #1 of descriptor */
|
||||
|
|
@ -1196,7 +1196,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
|||
/* Divide by 2 with round up to get the number of 16-bit words. */
|
||||
|
||||
nshorts = (framelen + 1) >> 1;
|
||||
nvdbg("Reading framelen: %d packetlen: %d nshorts: %d packetmen: %p\n",
|
||||
ninfo("Reading framelen: %d packetlen: %d nshorts: %d packetmen: %p\n",
|
||||
framelen, packetlen, nshorts, packetmem);
|
||||
|
||||
for (i = 0 ; i < nshorts; i++, j++)
|
||||
|
|
@ -1210,7 +1210,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
|||
}
|
||||
else
|
||||
{
|
||||
nvdbg("Discarding framelen: %d packetlen\n", framelen, packetlen);
|
||||
ninfo("Discarding framelen: %d packetlen\n", framelen, packetlen);
|
||||
}
|
||||
|
||||
if (getreg32(c5471->c_txcpudesc) & EIM_TXDESC_LIF)
|
||||
|
|
@ -1253,7 +1253,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
|||
/* Set amount of data in c5471->c_dev.d_len. */
|
||||
|
||||
dev->d_len = packetlen;
|
||||
nvdbg("Received packet, packetlen: %d type: %02x\n", packetlen, ntohs(BUF->type));
|
||||
ninfo("Received packet, packetlen: %d type: %02x\n", packetlen, ntohs(BUF->type));
|
||||
c5471_dumpbuffer("Received packet", dev->d_buf, dev->d_len);
|
||||
|
||||
#ifdef CONFIG_NET_PKT
|
||||
|
|
@ -1267,7 +1267,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
|||
#ifdef CONFIG_NET_IPv4
|
||||
if (BUF->type == HTONS(ETHTYPE_IP))
|
||||
{
|
||||
nllvdbg("IPv4 frame\n");
|
||||
nllinfo("IPv4 frame\n");
|
||||
|
||||
/* Handle ARP on input then give the IPv4 packet to the network
|
||||
* layer
|
||||
|
|
@ -1310,7 +1310,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
|||
#ifdef CONFIG_NET_IPv6
|
||||
if (BUF->type == HTONS(ETHTYPE_IP6))
|
||||
{
|
||||
nllvdbg("Iv6 frame\n");
|
||||
nllinfo("Iv6 frame\n");
|
||||
|
||||
/* Give the IPv6 packet to the network layer */
|
||||
|
||||
|
|
@ -1371,7 +1371,7 @@ static void c5471_receive(struct c5471_driver_s *c5471)
|
|||
{
|
||||
/* Increment the count of dropped packets */
|
||||
|
||||
ndbg("Too big! packetlen: %d\n", packetlen);
|
||||
nerr("Too big! packetlen: %d\n", packetlen);
|
||||
c5471->c_rxdropped++;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1432,43 +1432,43 @@ static void c5471_txstatus(struct c5471_driver_s *c5471)
|
|||
if ((txstatus & EIM_RXDESC_MISS) != 0)
|
||||
{
|
||||
c5471->c_txmiss++;
|
||||
nvdbg("c_txmiss: %d\n", c5471->c_txmiss);
|
||||
ninfo("c_txmiss: %d\n", c5471->c_txmiss);
|
||||
}
|
||||
|
||||
if ((txstatus & EIM_RXDESC_VLAN) != 0)
|
||||
{
|
||||
c5471->c_txvlan++;
|
||||
nvdbg("c_txvlan: %d\n", c5471->c_txvlan);
|
||||
ninfo("c_txvlan: %d\n", c5471->c_txvlan);
|
||||
}
|
||||
|
||||
if ((txstatus & EIM_RXDESC_LFRAME) != 0)
|
||||
{
|
||||
c5471->c_txlframe++;
|
||||
nvdbg("c_txlframe: %d\n", c5471->c_txlframe);
|
||||
ninfo("c_txlframe: %d\n", c5471->c_txlframe);
|
||||
}
|
||||
|
||||
if ((txstatus & EIM_RXDESC_SFRAME) != 0)
|
||||
{
|
||||
c5471->c_txsframe++;
|
||||
nvdbg("c_txsframe: %d\n", c5471->c_txsframe);
|
||||
ninfo("c_txsframe: %d\n", c5471->c_txsframe);
|
||||
}
|
||||
|
||||
if ((txstatus & EIM_RXDESC_CRCERROR) != 0)
|
||||
{
|
||||
c5471->c_txcrc++;
|
||||
nvdbg("c_txcrc: %d\n", c5471->c_txcrc);
|
||||
ninfo("c_txcrc: %d\n", c5471->c_txcrc);
|
||||
}
|
||||
|
||||
if ((txstatus & EIM_RXDESC_OVERRUN) != 0)
|
||||
{
|
||||
c5471->c_txoverrun++;
|
||||
nvdbg("c_txoverrun: %d\n", c5471->c_txoverrun);
|
||||
ninfo("c_txoverrun: %d\n", c5471->c_txoverrun);
|
||||
}
|
||||
|
||||
if ((txstatus & EIM_RXDESC_OVERRUN) != 0)
|
||||
{
|
||||
c5471->c_txalign++;
|
||||
nvdbg("c_txalign: %d\n", c5471->c_txalign);
|
||||
ninfo("c_txalign: %d\n", c5471->c_txalign);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1607,7 +1607,7 @@ static void c5471_txtimeout(int argc, uint32_t arg, ...)
|
|||
|
||||
#ifdef CONFIG_C5471_NET_STATS
|
||||
c5471->c_txtimeouts++;
|
||||
nvdbg("c_txtimeouts: %d\n", c5471->c_txtimeouts);
|
||||
ninfo("c_txtimeouts: %d\n", c5471->c_txtimeouts);
|
||||
#endif
|
||||
|
||||
/* Then try to restart the hardware */
|
||||
|
|
@ -1680,7 +1680,7 @@ static int c5471_ifup(struct net_driver_s *dev)
|
|||
struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private;
|
||||
volatile uint32_t clearbits;
|
||||
|
||||
ndbg("Bringing up: %d.%d.%d.%d\n",
|
||||
nerr("Bringing up: %d.%d.%d.%d\n",
|
||||
dev->d_ipaddr & 0xff, (dev->d_ipaddr >> 8) & 0xff,
|
||||
(dev->d_ipaddr >> 16) & 0xff, dev->d_ipaddr >> 24);
|
||||
|
||||
|
|
@ -1742,7 +1742,7 @@ static int c5471_ifdown(struct net_driver_s *dev)
|
|||
struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private;
|
||||
irqstate_t flags;
|
||||
|
||||
ndbg("Stopping\n");
|
||||
nerr("Stopping\n");
|
||||
|
||||
/* Disable the Ethernet interrupt */
|
||||
|
||||
|
|
@ -1798,7 +1798,7 @@ static int c5471_txavail(struct net_driver_s *dev)
|
|||
struct c5471_driver_s *c5471 = (struct c5471_driver_s *)dev->d_private;
|
||||
irqstate_t flags;
|
||||
|
||||
ndbg("Polling\n");
|
||||
nerr("Polling\n");
|
||||
flags = enter_critical_section();
|
||||
|
||||
/* Ignore the notification if the interface is not yet up */
|
||||
|
|
@ -1951,7 +1951,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
|
|||
|
||||
/* TX ENET 0 */
|
||||
|
||||
ndbg("TX ENET0 desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
nerr("TX ENET0 desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
putreg32((desc & 0x0000ffff), ENET0_TDBA); /* 16-bit offset address */
|
||||
for (i = NUM_DESC_TX-1; i >= 0; i--)
|
||||
{
|
||||
|
|
@ -1978,7 +1978,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
|
|||
|
||||
/* RX ENET 0 */
|
||||
|
||||
ndbg("RX ENET0 desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
nerr("RX ENET0 desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
putreg32((desc & 0x0000ffff), ENET0_RDBA); /* 16-bit offset address */
|
||||
for (i = NUM_DESC_RX-1; i >= 0; i--)
|
||||
{
|
||||
|
|
@ -2005,7 +2005,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
|
|||
|
||||
/* TX CPU */
|
||||
|
||||
ndbg("TX CPU desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
nerr("TX CPU desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
c5471->c_txcpudesc = desc;
|
||||
putreg32((desc & 0x0000ffff), EIM_CPU_TXBA); /* 16-bit offset address */
|
||||
for (i = NUM_DESC_TX-1; i >= 0; i--)
|
||||
|
|
@ -2035,7 +2035,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
|
|||
|
||||
/* RX CPU */
|
||||
|
||||
ndbg("RX CPU desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
nerr("RX CPU desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
c5471->c_rxcpudesc = desc;
|
||||
putreg32((desc & 0x0000ffff), EIM_CPU_RXBA); /* 16-bit offset address */
|
||||
for (i = NUM_DESC_RX-1; i >= 0; i--)
|
||||
|
|
@ -2063,7 +2063,7 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
|
|||
pbuf += sizeof(uint32_t); /* Ether Module's "Buffer Usage Word" */
|
||||
}
|
||||
|
||||
ndbg("END desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
nerr("END desc: %08x pbuf: %08x\n", desc, pbuf);
|
||||
|
||||
/* Save the descriptor packet size */
|
||||
|
||||
|
|
@ -2150,13 +2150,13 @@ static void c5471_eimconfig(struct c5471_driver_s *c5471)
|
|||
static void c5471_reset(struct c5471_driver_s *c5471)
|
||||
{
|
||||
#if defined(CONFIG_C5471_PHY_LU3X31T_T64)
|
||||
ndbg("EIM reset\n");
|
||||
nerr("EIM reset\n");
|
||||
c5471_eimreset(c5471);
|
||||
#endif
|
||||
ndbg("PHY init\n");
|
||||
nerr("PHY init\n");
|
||||
c5471_phyinit();
|
||||
|
||||
ndbg("EIM config\n");
|
||||
nerr("EIM config\n");
|
||||
c5471_eimconfig(c5471);
|
||||
}
|
||||
|
||||
|
|
@ -2178,7 +2178,7 @@ static void c5471_macassign(struct c5471_driver_s *c5471)
|
|||
uint8_t *mptr = dev->d_mac.ether_addr_octet;
|
||||
register uint32_t tmp;
|
||||
|
||||
ndbg("MAC: %0x:%0x:%0x:%0x:%0x:%0x\n",
|
||||
nerr("MAC: %0x:%0x:%0x:%0x:%0x:%0x\n",
|
||||
mptr[0], mptr[1], mptr[2], mptr[3], mptr[4], mptr[5]);
|
||||
|
||||
/* Set CPU port MAC address. S/W will only see incoming packets that match
|
||||
|
|
@ -2241,7 +2241,7 @@ void up_netinitialize(void)
|
|||
{
|
||||
/* We could not attach the ISR to the ISR */
|
||||
|
||||
nlldbg("irq_attach() failed\n");
|
||||
nllerr("irq_attach() failed\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ static inline unsigned int wdt_prescaletoptv(unsigned int prescale)
|
|||
}
|
||||
}
|
||||
|
||||
dbg("prescale=%d -> ptv=%d\n", prescale, ptv);
|
||||
_err("prescale=%d -> ptv=%d\n", prescale, ptv);
|
||||
return ptv;
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +173,7 @@ static int wdt_setusec(uint32_t usec)
|
|||
uint32_t divisor = 1;
|
||||
uint32_t mode;
|
||||
|
||||
dbg("usec=%d\n", usec);
|
||||
_err("usec=%d\n", usec);
|
||||
|
||||
/* Calculate a value of prescaler and divisor that will be able
|
||||
* to count to the usec. It may not be exact or the best
|
||||
|
|
@ -186,7 +186,7 @@ static int wdt_setusec(uint32_t usec)
|
|||
do
|
||||
{
|
||||
divisor = (CLOCK_MHZx2 * usec) / (prescaler * 2);
|
||||
dbg("divisor=0x%x prescaler=0x%x\n", divisor, prescaler);
|
||||
_err("divisor=0x%x prescaler=0x%x\n", divisor, prescaler);
|
||||
|
||||
if (divisor >= 0x10000)
|
||||
{
|
||||
|
|
@ -194,7 +194,7 @@ static int wdt_setusec(uint32_t usec)
|
|||
{
|
||||
/* This is the max possible ~2.5 seconds. */
|
||||
|
||||
dbg("prescaler=0x%x too big!\n", prescaler);
|
||||
_err("prescaler=0x%x too big!\n", prescaler);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -207,19 +207,19 @@ static int wdt_setusec(uint32_t usec)
|
|||
}
|
||||
while (divisor >= 0x10000);
|
||||
|
||||
dbg("prescaler=0x%x divisor=0x%x\n", prescaler, divisor);
|
||||
_err("prescaler=0x%x divisor=0x%x\n", prescaler, divisor);
|
||||
|
||||
mode = wdt_prescaletoptv(prescaler);
|
||||
mode &= ~C5471_TIMER_AUTORELOAD; /* One shot mode. */
|
||||
mode |= divisor << 5;
|
||||
dbg("mode=0x%x\n", mode);
|
||||
_err("mode=0x%x\n", mode);
|
||||
|
||||
c5471_wdt_cntl = mode;
|
||||
|
||||
/* Now start the watchdog */
|
||||
|
||||
c5471_wdt_cntl |= C5471_TIMER_STARTBIT;
|
||||
dbg("cntl_timer=0x%x\n", c5471_wdt_cntl);
|
||||
_err("cntl_timer=0x%x\n", c5471_wdt_cntl);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -234,17 +234,17 @@ static int wdt_setusec(uint32_t usec)
|
|||
|
||||
static int wdt_interrupt(int irq, void *context)
|
||||
{
|
||||
dbg("expired\n");
|
||||
_err("expired\n");
|
||||
|
||||
#if defined(CONFIG_SOFTWARE_REBOOT)
|
||||
# if defined(CONFIG_SOFTWARE_TEST)
|
||||
dbg(" Test only\n");
|
||||
_err(" Test only\n");
|
||||
# else
|
||||
dbg(" Re-booting\n");
|
||||
_err(" Re-booting\n");
|
||||
# warning "Add logic to reset CPU here"
|
||||
# endif
|
||||
#else
|
||||
dbg(" No reboot\n");
|
||||
_err(" No reboot\n");
|
||||
#endif
|
||||
return OK;
|
||||
}
|
||||
|
|
@ -259,7 +259,7 @@ static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen)
|
|||
* not work if the user provides a buffer smaller than 18 bytes.
|
||||
*/
|
||||
|
||||
dbg("buflen=%d\n", buflen);
|
||||
_err("buflen=%d\n", buflen);
|
||||
if (buflen >= 18)
|
||||
{
|
||||
sprintf(buffer, "%08x %08x\n", c5471_wdt_cntl, c5471_wdt_count);
|
||||
|
|
@ -274,7 +274,7 @@ static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen)
|
|||
|
||||
static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen)
|
||||
{
|
||||
dbg("buflen=%d\n", buflen);
|
||||
_err("buflen=%d\n", buflen);
|
||||
if (buflen)
|
||||
{
|
||||
/* Reset the timer to the maximum delay */
|
||||
|
|
@ -292,7 +292,7 @@ static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen)
|
|||
|
||||
static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
dbg("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg);
|
||||
_err("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg);
|
||||
|
||||
/* Process the IOCTL command (see arch/watchdog.h) */
|
||||
|
||||
|
|
@ -315,7 +315,7 @@ static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
static int wdt_open(struct file *filep)
|
||||
{
|
||||
dbg("");
|
||||
_err("");
|
||||
|
||||
if (g_wdtopen)
|
||||
{
|
||||
|
|
@ -339,7 +339,7 @@ static int wdt_open(struct file *filep)
|
|||
|
||||
static int wdt_close(struct file *filep)
|
||||
{
|
||||
dbg("");
|
||||
_err("");
|
||||
|
||||
/* The task controlling the watchdog has terminated. Take the timer
|
||||
* the
|
||||
|
|
@ -367,7 +367,7 @@ int up_wdtinit(void)
|
|||
{
|
||||
int ret;
|
||||
|
||||
dbg("C547x Watchdog Driver\n");
|
||||
_err("C547x Watchdog Driver\n");
|
||||
|
||||
/* Register as /dev/wdt */
|
||||
|
||||
|
|
@ -379,7 +379,7 @@ int up_wdtinit(void)
|
|||
|
||||
/* Register for an interrupt level callback through wdt_interrupt */
|
||||
|
||||
dbg("Attach to IRQ=%d\n", C5471_IRQ_WATCHDOG);
|
||||
_err("Attach to IRQ=%d\n", C5471_IRQ_WATCHDOG);
|
||||
|
||||
/* Make sure that the timer is stopped */
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue