build: fixup parallel build

This fixes several known, and a few previously unknown issues with
building in parallel (-jN).

'make again' can now be run with parallel jobs.  To prevent the clean
rule from running in the middle of the build, explicit submake calls for
clean and all are made.

'make defconfig all' run in parallel would run into a similar issue of
the configuration changing in the middle of the build.  Work around this
by not allowing an 'all' build at the same time as a defconfig build.
Only the defconfig rule will run.

'make' run in parallel without a configuration would result in an error
attempting to preprocess the linker script.  The linker script rule is
now dependent upon the configuration.

The Kconfig generated files have been given explicit variables which can
be depended upon.  Additionally, the generated .conf file is included
instead of the .config file, which is not intended to be included in a
Makefile.  As a result, KCONFIG_MAKE_DEFS had to be given a dummy rule
to prevent Make from attempting to rebuild it during the include.  As
such, it cannot be depended on.  KCONFIG_HEADER must be depended upon
instead.  Both are generated by the same rule.

Generate the config headers when processing a defconfig, since .config
is not included.

Change-Id: Ic22ff469e190c346daf065ea0dc4a0866f3846d9
kernel: Abstract arch-specific portions of sched and semaphores

Move all arch-specific components of the sched and semaphores to the
arch/ folder.  This meant providing exported definitions for many of the
sched functions, which are available in kernel/sched_internals.h.  The
symbols in that header should only be used by kernel/sched/, but must be
implemented by the architecture.

The semaphore try_lock has been replaced with the GCC builtin
__sync_bool_compare_and_swap().  In the future, this should be a
standard F4OS atomic operation.

Change-Id: I24df70dcc4141c74c5e59da6f20cb0f5b8c7c7de
sched: avoid switching to PSP until restore_context

Previously, start_task_switching() required a NOP after
restore_full_context() to prevent the compiler from inserting an
instruction between enable_psp() and restore_full_context() which
modified the stack.

This is obviously incredibly fragile.  It is fixed by only setting the
"user stack" (PSP) before restore_full_context(), and actually enabling
it in the restore context function.

Change-Id: I6a15b88f5f000ee6ba66ff4aa94bf976d2c23bfc
kernel: generic disable_interrupts()

Create disable_interrupts() for arch-generic interrupt disabling.
Shouldn't be needed outside of the fault handlers, so the prototype is
in the fault header.

Change-Id: I5f7bd80bc6af016fb17252e88ee377f9ee485101
kernel: Move SVC macro implementations to arch/

The header <arch/svc.h> provides a defined set of macros or static
inline functions.

Change-Id: Ib4334e438dfdc7c53f866782e7377f9521121e82
kernel: move fault handlers to arch/

General fault logic remains in kernel/fault.c.  The specific arch fault
handlers are in the arch/ folder.

Change-Id: Iabce799c2d4375ab9a692e063bacac26953d8cee
kernel: Eliminate arch register dependencies

Eliminate calls to arch-specific registers, and replace them with
generic calls.

task_switch is a bit unsafe, in that it will directly switch if SVC is
not currently allowed.  This is fine on current architectures.

Change-Id: I9fd31ed5969a861a351d35985426c7a7c598907a
math: switch to C implementation of lowpass

Make low-pass filter implementation generic by implementing it in C.

On ARMv7-M, this generates nearly identical output, except it uses VMLA
instead of VFMA for multiply and accumulate.  The only difference
between these instructions is the way rounding is applied.

Change-Id: I212771013aa67ca8477fb4e33bbee758ab04fe69
math: Abstract arch-specific math

Move the inline ASM implementations of fabsf and sqrtf to
arch/arm/math.c.  Generally, provide weak versions, in the event there is
no arch-specific version.

The sqrtf implementation has been imported from Newlib.

Change-Id: Ie8dd47d44579b585f8c4b17a24668d78671486db
build: get arch build settings from arch/

Include a config makefile for the target arch that will add the
appropriate settings, such as CROSS_COMPILE, and any additional CFLAGS.

Change-Id: I430b0fb0f0bb4da0471d2cf4e1e7f08def1c343f
lib: remove unnecessary arch/ header

Change-Id: Ibaec594c330145d4e6b5f9d3366c2c430f7db587
build: properly depend on .config

Add an actual dependency for .config, so that when it changes, such as
when applying a defconfig, the Kconfig headers are forced to be
regenerated.

Change-Id: I4aea8daf325fcceb104c43e31070cd18e930eccf
build: use gcc for final linking

Use GCC for the final linking stage, passing LFLAGS using -Xlinker.  GCC
will invoke ld with the appropriate options to find libraries like
libgcc.

Change-Id: I9f3e91f1e24da8ce9d6d9d756c39d618805bd03c
config: encapsulate arch and chip selection in arch and chip menus

Instead of placing the "Architecture" and "Chip to target" options
outside of their menu, place them inside.  Ensure that the chip menu
is inside the arch menu.

Change-Id: I9dbe8d4db9d0c84349b6d7ec31c30840a9ec1f59
dev: add raw memory helper macros

Provide raw_mem_* macros to aid in safely reading and writing raw memory
locations.  These macros include memory barriers to ensure that accesses
are not reordered.

The this time, only a compiler memory barrier is used, not a CPU memory
barrier.

The memory barrier macros are also provided by this header.

Change-Id: I9e49dfa15c4467f2316119c0618e02c460f1dfd5