sparc64: remove header file with duplicated macros
The boot/stack.h header contains duplicated macros that are
redundant to arch/stack.h. Delete the boot/stack.h and replace
its one use by the arch/stack.h.
Closes #3341.

bsps/powerpc: Remove bsp_timer_internal_clock
The only consumer of this variable was the ppc403 clock driver used by
the
* haleakala,
* virtex, and
* virtex4
BSPs which set bsp_timer_internal_clock unconditionally to true.
Update #3285.

Mar 17, 2018:

libfdt: Add fdt_check_full() function
This new function implements a complete and thorough check of an fdt blob's
structure. Given a buffer containing an fdt, it should return 0 only if
the fdt within is structurally sound in all regards. It doesn't check
anything about the blob's contents (i.e. the actual values of the nodes and
properties), of course.
Signed-off-by: David Gibson <david@…>
Tested-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Simon Glass <sjg@…>

libfdt: Add fdt_header_size()
We have a couple of places within libfdt and its tests where we need to
find the size of the header, based on the version. Add a helper function
for it.
Signed-off-by: David Gibson <david@…>
Reviewed-by: Simon Glass <sjg@…>
Tested-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Alexey Kardashevskiy <aik@…>

i386/smp: Have ld use incremental build for appstart.o
With HAS_SMP set, we have:
libbsp_a_LIBADD += appstart.$(OBJEXT)
When trying to build appstart.o, however, we link start.o with appcpustart.o
through the linkcmds script, which leaves several symbols unresolved, and
without the "-r" (or -i) flag, this throws undefined reference errors.
This change requires us to re-run the ./bootstrap script to regenerate
Makefile.in, and therefore the Makefile for the particular BSP as well.
Complete log of errors available here:
​https://gist.github.com/AmaanC/d40bd7393dca1f82965938275845b7f9
Updates #3331

i386/smp: Define CPU_Interrupt_frame as non-void struct
This change, excluding the #error directive, lets us make progress towards
compiling i386 targets with --enable-smp.
The #error directive needs to be there since the CPU_Interrupt_frame is used by
the SMP context switching code, and this placeholder struct, if used, would only
lead to more subtle bugs and errors. With the directive, the SMP context
switching code can be improved separately.
Updates #3331

openssl: Provide deprecated functions.
Some applications (like the civetweb web server) still use functions
that are deprecated by openssl. If OPENSSL_NO_DEPRECATED is defined,
openssl will not provide these functions. This patch removes the define
so that the functions are available.

Add PowerPC paravirtualization support
Cannot read or write MSR when executing in user mode. This
is used when RTEMS_PARAVIRT is defined.
Provide alternate methods to disable/enable interrupts
Closes #3306.

mutex: Use panic() after ISR lock release
Using panic() with interrupts disabled could lead to an additional error
(INTERNAL_ERROR_BAD_THREAD_DISPATCH_ENVIRONMENT) due to a potentially
blocking output.

bootstrap: Use printf instead of echo -e for POSIX shells
On POSIX compliant shells, echo does not have the -e option.
This causes the "-e" to be echoed as well, causing potential buggy
build processes.
Example shell session:
-> % sh
$ echo -e "foo bar"
-e foo bar
$
According to POSIX, "\$" should be fine regardless due to the use of
double-quotes[1]. However, since printf is recommended over echo anyway,
we replace "echo -e" with printf where required.
[1]​http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_02_03

libfdt: Safer access to memory reservations
fdt_num_mem_rsv() and fdt_get_mem_rsv() currently don't sanity check their
parameters, or the memory reserve section offset in the header. That means
that on a corrupted blob they could access outside of the range of memory
that they should.
This improves their safety checking, meaning they shouldn't access outside
the blob's bounds, even if its contents are badly corrupted.
Signed-off-by: David Gibson <david@…>
Tested-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Alexey Kardashevskiy <aik@…>
Reviewed-by: Simon Glass <sjg@…>