Commit graph

41120 commits

Author SHA1 Message Date
Mazen NEIFER
884005673c Xtensa port: Set Swap function result to -EAGAIN.
Change-Id: I70a651012d5da873c98f6b13ada5e80e67e18e0c
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
0cbf12489e Xtensa port: xt*-run requires options to be passed before file to be ran.
If passed after the file they are just ignored silently!

Change-Id: Ic9b04c3023e4d312382850fa5e1b5ae4ef555856
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
51efd6d4dc Xtensa port: Moved coprocessor stack area on bottom of stack, just after TCS.
This change should allow threads that do not access coprocessor to safely
overflow on the coprocessor save area without any issue.

Change-Id: Ic2acd20b60b6bef0b7feeb8cfb54d548eba892f0
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
ef098bf410 Xtensa port: Restore interrupted context the same way as premption resume.
This was a kind of optimization that save few cycles in the cost of code
duplication. However the path where we resume from interrupt withouch changing
the running thread is buggy and leads to many tests to fail. For now I'd prefer
to remove this optimization and have a working port. Later, once everything is
OK, I'll have time to optimize things.

Change-Id: I7af58f383848d157b9f3b3fbeceede3e83f9ce61
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
b978c70338 Xtensa port: Removed duplicate code and fixed update of current thread pointer.
Having duplicate code leads always to this kind of situation where a bug is
fixed in one place and not in the other. This bug of updating current thread
pointer was already fixed before in the Swap function, but not in the interrupt
handler.

Change-Id: I466aea2d35382446c5c82fe775ada31f0bd19492
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
8f1dd3a6e5 sanitycheck: Fixed displayed log when current directory is a symbolic link.
When current directory is a symbolic link or in a symbolic link then os.getcwd
return the real path leading to os.path.relpath returning not so nice relative
path.

Change-Id: I3e24d3e6f1fe7185992f64803d3728e9588d67e1
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
495d922406 xt-run: fix sanitycheck communication
Sanitycheck actually creates the pipes, using a naming convention imposed
by QEMU. We also need to leave a PID file.
'xt-run' Make target removed, we don't need it.

Change-Id: Ie9fd9dbb1327eb4b10424e7ee5d2f4dc09b121a4
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
b012aa1901 Xtensa port: Use directly assmebler and linker instead of via the compiler.
This allows handling options like --fatal-warnings that are passed by
sanitycheck.

Change-Id: Ia78dcef480d9d81cab6051453204c05d52917af2
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
6af2778136 Xtensa port: Fixed linker script for hifi_mini core.
Change-Id: I21f4ff0c136c1e72e6d36d179898bbde1b08b71f
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
e536b270f0 sanitycheck: don't disable tryrun
This completely breaks all the cc-option checks. It's not clear
why this was done for everyone running sanitycheck.

Change-Id: I3f944423869ccb15fab29c28130820a93cd94917
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
55acd15cc8 xt-sim: enable use of xtensa simulator with 'make run'
Change-Id: I450f24de73dc710ab3875b010ecf48e44370cfc0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
9d8d026294 xt-run: delete any stale fifos to avoid mkfifo error
Change-Id: I53d56587a0b90da273e118bd5b9e051aa2451d8f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
eab8a9f9ca xtensa_sim_console: remove deprecation warning
Change-Id: I10181f6c4d90e38927c1831c93fc459d33de6fd1
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
f11910a7fb xtensa: Makefile: cleanup
Some options which are already defined by the build system
for the C compiler or assembler have been removed: -c,
-xassembler-with-cpp, -nostdinc.
References to deleted variable flagALongCall and flagLongCall
removed.
Formatting for 80 columns, there is now one flag per line.

Change-Id: Ieecdb75e26f64c6f58dec3cc636552e7b31a678d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
19dc4c67cc Makefile: test for -fno-asynchronous-unwind-tables
Some GCC variants don't support this. Moved later in the Makefile
after the toolchain Makefile has been included so the test works
properly.

Change-Id: Ia9ec2582c486197ea3df3d878173643c14786408
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
2b2763aa95 xcc: add location of C++ compiler
Change-Id: I5b6ee6e9d424f401cca0e9d360555ff6cf94f504
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
aacfd63331 Xtensa port: Removed duplicate file and renamed to sys_io.h as other platforms.
Change-Id: I293bfa9ff8c5e641c727612c56968cec901dbfec
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
5718676aad Xtensa port: Increased idle thread stack size to avoid stack overflow.
Xtensa port uses more stack than others. This was discussed with the team and
we agreed that this can be accepted for the first beta.
We will investigate this later to see how to avoid allocating coproc registers
for the system threads in order to reduce the stack overhead. However this
will not be before the port is considered stable.

Change-Id: Icd5b2b0ab68d0906b5408f35f081b100acabc010
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
967cb2ef8a Fixed compilation error caused by bad initialization of unamed union field.
The old syntax is not accepted by some compilers including XCC.

Change-Id: Id90849a2159652ec225dd2c50d2dc2ddc22a3e08
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
03857ccb23 Xtensa port: Enable console when building for Xtensa simulator as board.
Change-Id: I48f25b7c7bb36bd7248e7d9e6718bf365eac56d9
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
bb038cc1be Xtensa port: Fixed function setting Sawp return value.
The retval field shall hold the return value itself not a pointer on its
location.

Change-Id: I3f9e225f2bdd501f88441946b5187ebbd17a71e3
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
95428c75e9 gitignore: Ignore Eclipse (Xtensa Xplorer) project files.
When debugging Xtensa port, on needs for sure to create an Xtensa Xplorer
project in order to be able to debug his project. These files will appear
in the git repository as non versioned files. It is safe to ignore them as
we won't anybody commit these files (user specific).

Change-Id: I156ec5c7393f1db98286da0b841a4e8496a9ff89
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
7f046378eb sanitycheck: support other simulators (xt-run and/or xtsc) than QEMU.
In scripts/Makefile.qemu, the target qemu is already an alias for taget run.
In scripts/Makefile.xt{,sc}-run there is no target qemu but a target run.

Change-Id: Ib9dce3561ef9367b17d30070354e709df4d7e528
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
cb745e6047 Xtensa port: Fixed RAMABLE_REGION in linker scripts.
This was introduced during a copy/paste when updating patch
https://gerrit.zephyrproject.org/r/#/c/10323/6..7

Change-Id: Id6857dd28a16974361932285b44559f702c4d910
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
b72936f305 Xtensa port: Fixed Swap function not updating _kernel.current.
Change-Id: I561967404751436717950e28a776317aea5e05c3
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
93e53da56a Xtensa port: Removed warnings related to function _NanoFatalErrorHandler.
This function needs to be decalred in a file included by _thread_entry.
It also needs to have exit function declared as not returning.

Change-Id: I2a01e7408cf70266351ae5089f45b5d9d009fabe
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
7c75da1e1a Xtensa port: Added missing initalization of thread base sturct in _new_thread.
Change-Id: Icf9e1e6d5f831c2cf6e1262c6f8e1a46356edfe7
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
2f4bec77d3 Xtensa port: Removed compiler warnings about printf formats/arguments mismatch.
Change-Id: Ie430072243911dc74263dbd7afe8703d0b3c4731
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
0efb2313ca Xtensa port: Let xcc specific make file override unsupported -Og with -O0.
Change-Id: If1a1833b5ce09c7112245b8b73c0ccd28be66c88
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
fddb1aa016 Xtensa port: _thread_entry shall use call4 to start the thread.
The function _new_thread sets the CALLINC for _thread_entry when calling the
new thread entry point. This should be CALLINC(1) (call4) instead of previous
one CALLINC(2) (call8).

This change allows resolving a crash when starting the first thread.

Change-Id: Ie97c95c87d1219342fed09f670fcae8a6230cefe
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
6fb67ed1ac Xtensa port: Replaced call to legacy sys_thread_self_get by one to k_current_get
Change-Id: I341f6bde6f6956c9ce521c4346894ee893b8e9ae
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
8f92bc255c Xtensa port: Added support for Xtensa internal timer as system timer.
Change-Id: I1a0be1a377999f18ae47687edf4fc4950dcc5ba5
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
4a51dbe934 Changed Kbuild to pass also KBUILD_CPPFLAGS to CC on addition to KBUILD_CFLAGS.
Generally CPPFLAGS are applicable to all tools that use the C preprocessor.

Change-Id: I6dea9e39a20896550241f158190e03f7baadf471
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
de2288ac38 Xtensa port: Fixed assembly comments to be accurate with code.
Change-Id: I7e0381cbefae916db515be4c10fe820dd4eddea6
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
ffd4eb9272 Xtensa port: Changed simulation support with xt-run/xtsc-run to be qemu like.
Change-Id: I1626a5cd75d17bc4f72d4a638484f87956f9e703
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
e8813d6fe5 Xtensa port: Define __builtin_unreachable() as CLI macro when using XCC.
XCC does not recognize __builtin_unreachable() and thus cause a link error.

Change-Id: I5dadf5a49d971d5e0a5ef88d582bb5ad2c36bced
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
af2593ea7e Xtensa port: Added linker script for several Xtensa cores.
Change-Id: I7a40d5f0c3fe8d25623b88f06523cb62e4ba4706
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
aa1e95bfb2 Xtensa port: Moved XCC specific libraries out of genric Xtensa make file.
These libraries are unlikely to be uesd by GCC port and thus should not be in
a generic make file. Moved to specific toolchain make file.

Change-Id: Ib585b87700e409d678f7a5cb60cff67b6022ab05
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
b8cbd05e6b Xtensa port: Enable long calls for Xtensa vector table.
Change-Id: I2e4c9ca0742988eb9ab4ec2db7c81bc988212f2c
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
daf28fa339 Xtensa port: Fixed tests/kernel/context to compile with Xtensa internal timer.
Change-Id: I4293adf23b7d46851747e3bcdd41b4a09e8fff05
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
e4e3cf604e Xtensa port: Added Xtensa specific code (C + S) files.
Change-Id: I0dff0c33d8577cc70d4d5ee8f298db38c508ee73
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
b0669a04b3 Xtensa port: Added support for Xtensa simulator console driver.
Change-Id: I58effa98fd6ff53bcfd21cb8de2fcd89651dc1d9
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
0c736f2916 Xtensa port: Added Xtensa internal timer configuration need by assembly files.
This is needed by next commit as some assembly files handling interrupts use
some options from this file.
This file is not included in next commit to separate code and build system
aptches.

Change-Id: Iff3a8019362599beb0c0058c3169480fa5183c1c
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
e2dd006ba7 Xtensa port: Removed the need to put an empy file soc.c in arch/xtensa/soc dir.
Change-Id: I439a6c36f10c6255d15a688c8f425de0fab93912
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
969f000a19 Xtensa port: Added support for Xtensa architecture to linker-defs.h.
Change-Id: Ic20d4746267bb9575960576c6b008c774fb6ef6d
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
73691609b9 xtensa: fix find_msb_set() and find_lsb_set()
find_msb_set logic was wrong. find_lsb_set() is now an inline function.

Change-Id: I2c19540907723589298b2f6af2ce1d68704bf1d7
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Andrew Boie
aa3ab35c88 xtensa: fixup license identifiers
Master branch changed requirements for license headers while this
branch has been in development.

Change-Id: I9bce16ff275057a4bb664019628fc9b6de7aef7c
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
dc391f566c Xtensa port: Added support for Xtensa architecture in zephyr include files.
Change-Id: I1ac677cd6da5222707fe31ead71dc354f7c94443
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
9baece323e Xtensa port: Added Kbuild file for Xtensa arch.
Change-Id: I174c5736c891f94309361079cfd8b47dbb43032a
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00
Mazen NEIFER
49b3c0028d Xtensa port: Added fields offset support for kernel and thread structures.
Change-Id: I9cc44f60757a2f988e2a6341da9591a5e5f54561
Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
2017-02-13 08:04:27 -08:00