zephyr/arch/arm/core
Marcus Shawcroft e2d3cc4b81 arm: Restructure ARM cpu related preprocessor conditionals.
The ARM code base provides for three mutually exclusive ARM
architecture related conditional compilation choices.  M0_M0PLUS,
M3_M4 and M7.  Throughout the code base we have conditional
compilation gated around these three choices.  Adjust the form of this
conditional compilation to adopt a uniform structure.  The uniform
structure always selects code based on the definition of an
appropriate config option rather the the absence of a definition.

Removing the extensive use of #else ensures that when support for
other ARM architecture versions is added we get hard compilation
failures rather than attempting to compile inappropriate code for the
added architecture with unexpected runtime consequences.

Adopting this uniform structure makes it straight forward to replace
the adhoc CPU_CORTEX_M3_M4 and CPU_CORTEX_M0_M0PLUS configuration
variables with ones that directly represent the actual underlying ARM
architectures we provide support for.  This change also paves the way
for folding adhoc conditional compilation related to CPU_CORTEX_M7
directly in support for ARMv7-M.

This change is mechanical in nature involving two transforms:

1)

  #if !defined(CONFIG_CPU_CORTEX_M0_M0PLUS)
  ...

is transformed to:

  #if defined(CONFIG_CPU_CORTEX_M0_M0PLUS)
  #elif defined(CONFIG_CPU_CORTEX_M3_M4) || defined(CONFIG_CPU_CORTEX_M7)
  ...

2)

  #if defined(CONFIG_CPU_CORTEX_M0_M0PLUS)
  ...
  #else
  ...
  #endif

is transformed to:

  #if defined(CONFIG_CPU_CORTEX_M0_M0PLUS)
  ...
  #elif defined(CONFIG_CPU_CORTEX_M3_M4) || defined(CONFIG_CPU_CORTEX_M7)
  ...
  #else
  #error Unknown ARM architecture
  #endif

Change-Id: I7229029b174da3a8b3c6fb2eec63d776f1d11e24
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2017-01-12 09:46:25 -06:00
..
cortex_m arm: Restructure ARM cpu related preprocessor conditionals. 2017-01-12 09:46:25 -06:00
offsets kernel: remove nano/micro wording and usage 2016-12-19 19:58:03 +00:00
__aeabi_atexit.c build: Add C++ support 2016-02-05 20:25:23 -05:00
cpu_idle.S arm: Restructure ARM cpu related preprocessor conditionals. 2017-01-12 09:46:25 -06:00
exc_exit.S kernel/arch: inspect prio/sched_locked together for preemptibility 2017-01-09 20:52:25 +00:00
fatal.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
fault.c arm: Restructure ARM cpu related preprocessor conditionals. 2017-01-12 09:46:25 -06:00
fault_s.S arm: Restructure ARM cpu related preprocessor conditionals. 2017-01-12 09:46:25 -06:00
irq_init.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
irq_manage.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
irq_offload.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
isr_wrapper.S arm: Restructure ARM cpu related preprocessor conditionals. 2017-01-12 09:46:25 -06:00
Kconfig arm: systick: Some SoCs do not have systick 2016-11-27 19:39:26 +00:00
Makefile kernel: move kernel code to kernel/ directly 2016-12-19 14:59:35 -05:00
swap.S arm: Restructure ARM cpu related preprocessor conditionals. 2017-01-12 09:46:25 -06:00
sys_fatal_error_handler.c arch/all: simpler _SysFatalErrorHandler() 2016-12-15 16:17:39 -05:00
thread.c kernel: replace all remaining nanokernel occurances 2016-12-25 14:34:43 -05:00
thread_abort.c kernel/arch: consolidate tTCS and TNANO definitions 2016-11-12 07:04:52 -05:00