Commit graph

97 commits

Author SHA1 Message Date
Peter Mitsis
6704ff462e kernel: Add __unused tag
The '__unused' tag can be used to inform the compiler that a variable
might be deliberately unused. It can be used instead of ARG_UNUSED().

Change-Id: I0ec4ee92dcec29b5f9cbda362d0d6b051055628a
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-10-03 20:22:05 +00:00
Jukka Rissanen
d8083bd6c7 toolchain: Use ALIAS_OF() in FUNC_ALIAS() macro
Use the ALIAS_OF() macro instead of using alias attribute
directly.

Change-Id: I2f904644df2212b72d8d973bc3651dcf9e7a8b0d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-09-30 15:55:40 +00:00
Jukka Rissanen
fca95109a8 toolchain: Make ALIAS_OF() macro public
Removing _ prefix from ALIAS_OF() macro in order to indicate
that it is for public use.
The macro can be used whenever the FUNC_ALIAS() cannot. The
FUNC_ALIAS() macro can give errors if the aliased function
has parameters like uint16_t etc.

Change-Id: I2f5bc51268072141bb6fb73efe034eb743db3257
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-09-30 15:55:39 +00:00
Peter Mitsis
df6c72028f unified: Conditionally define __printf_like() macro
Only define the __printf_like() toolchain macro if it is not already
defined. This permits projects to override this macro if desired.

Change-Id: Ic4a7b3eb48360f8e258493d6f447d3df793f572e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-09-20 11:43:40 -04:00
Andrew Boie
d6053db355 kernel: abolish FUNC_NO_FP
These impede debugging and we have CONFIG_OMIT_FRAME_POINTER
now which does this globally for the entire kernel.

Change-Id: I46939223e27dd298ca3ed162ff5790cb2e9ed2a2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-09 21:13:30 +00:00
Andy Ross
9f628943a8 toolchain: Remove vestigial COFF assembler symbol mangling support
The toolchain headers included an abstraction for defining symbol
names in assembly context in the situation where we're using a
DOS-style assembler that automatically prepends an underscore to
symbol names.

We aren't.  Zephyr is an ELF platform.  None of our toolchains do
this.  Nothing sets the "TOOL_PREPENDS_UNDERSCORE" macro from within
the project, and it surely isn't an industry standard.  Yank it out.
Now we can write assembler labels in natural syntax, and a few other
things fall out to simplify too.

(NOTE: these headers contain assembly code and will fail checkpatch.
That is an expected false positive.)

Change-Id: Ic89e74422b52fe50b3b7306a0347d7a560259581
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-08-30 19:01:11 +00:00
Andrew Boie
738dec483e nios2: add static interrupt handling code
Supports Internal Interrupt Controller only for now; EIC
supoort tracked in ZEP-258.

Change-Id: I2d9c5180e61c06b377fce4bda8a59042b68d58f2
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-06-22 16:42:21 +00:00
Andrew Boie
9433895954 nios2: basic build, non-functional
Basic build framework for Nios2. Everything is stubbed out,
we just want to have a build going so that we can start to
parallelize implementation tasks.

This patch is not intended to be functional, but should be
able to produce a binary for all the nanokernel-based
sanity checks.

Change-Id: I12dd8ca4a2273f7662bee46175822c9bbd99202a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-05-03 23:18:45 +00:00
Benjamin Walsh
2fa37a0bec gcc: add __weak for shorter __attribute__((__weak__))
Change-Id: Idd878c19201247492bbc42228f2a225ed625f4b8
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-04-16 05:29:20 +00:00
Andrew Boie
facd6e51c6 gcc: add __deprecated for shortened __attribute__((deprecated))
Change-Id: If4e589f8eaeb7439e5e17474ad63bbdbaabde072
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-15 22:07:57 +00:00
Johan Hedberg
62fc555c88 include: Remove UNALIGNED_READ & UNALIGNED_WRITE
These were not actually used anywhere and weren't correct (at least
not the READ variant which assumed the architecture can always deal
with unaligned access).

Change-Id: If2bee24dc729683c839bb631d411eab73498adad
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-04 20:11:57 +00:00
Johan Hedberg
1d5f1cd6c9 include: Add UNALIGNED_PUT helper
Provide a helper to perform safe unaligned writes to data.

Change-Id: I00edde580d2ef93daaf7825d333d38fc10f854ac
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2016-03-04 20:11:56 +00:00
Anas Nashif
df3bd11e3c toolchain: check if both __aligned and __packed are defined
Avoid build conflict when those are defined by someone else.

Change-Id: I1bdf4064ec2180fff311c2b7a34363c53f438602
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:31 -05:00
Peter Mitsis
babea6d2dd c++: Add EXTERN_C macro
The EXTERN_C macro is to be used to ensure compatibility between C and C++;
It prevents name mangling in C++ environments.

Change-Id: I33be727150687901f7770306c8a07c16a7e46ffa
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:25:22 -05:00
Anas Nashif
0a272bc420 fixed check for clang compiler
Use defined(__clang__) otherwise it might fail in some cases.

Change-Id: Ifb2e1cd971325e2a7f87e530e5ee921a5fcee6b9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:25:04 -05:00
Anas Nashif
275ca60b08 Fixed file description and applied doxygen style
Removed old style file description and documnetation and apply
doxygen synatx.

Change-Id: I3ac9f06d4f574bf3c79c6f6044cec3a7e2f6e4c8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:58 -05:00
Juan Manuel Cruz
a894799c94 arc: static IRQ handling
Adds support for static IRQ handler initialization.

Currently, IRQ_CONNECT and IRQ_CONFIG macros are emulating static
behavior through dynamic initialization.
This commit updates the macros to get real static initialization.
IRQ handlers must be assigned at build time.

Change-Id: Ia07fb25a5e4dae489f84ffcedb28007ee18a3b82
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@linux.intel.com>
2016-02-05 20:24:56 -05:00
Anas Nashif
77ba3c3b8b kconfig: define architecture as a kconfig variable
Do not depend on environment variables and use a kconfig variable
for defining the architecture.

In addition, remove the X86_32 variable, it just duplicates X86 for
not good reason, at least until start supporting MCUs with 64bit.

Change-Id: Ia001db81ed007e6a43f34506fed9be1345b88a4b
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:52 -05:00
Anas Nashif
db26a98c93 Fixed various clang build issues
Fix a few spots where building with with clang fails.

Change-Id: I621c7cb8daf119bf89ad512168d70e1c9b67e53f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:47 -05:00
Andrew Boie
6bf328b6ea x86: use GCC inline assembly for atomic operations
This doesn't make any assumptions on calling conventions or
the structure of the stack, and should thus be portable to
compilers that implement different C calling conventions.

In order for the rewritten functions to take up the same code
size as the pure-asm counterparts, -fomit-frame-pointer has
been specified for each of them, otherwise an extra 4 bytes
is used for every function.

The generated assembly code by these new functions has been
verified in GDB to be the same as the old ones, except a few
trivial things like particular registers used.

Change-Id: I9a896cbfc3e7f4c2497d749140729d28b32f1c9d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:42 -05:00
Andrew Boie
8a2104e16a x86: remove CONFIG_UNALIGNED_WRITE_UNSUPPORTED
This had bit-rotted to the point where it was breaking the build
and was only needed on legacy platforms that are no longer
supported.

Change-Id: I4fcfc38bacac58761fba475701e0c27d7b8b7a27
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:24:42 -05:00
Dan Kalowsky
2a63743192 cleanup: removing NOMANUAL
The \NOMANUAL tag is a remnant from days of yore and is no longer
needed or useful.  Cleaning up the code references to this.

Change-Id: I1b8cc9c9560d1dbb711f05fa63fd23386789875c
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:35 -05:00
Dan Kalowsky
da67b29569 checkpatch: warning - block_comment_style
Change-Id: I6da43e41f9c6efee577b70513ec368ae3cce0144
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:33 -05:00
Dan Kalowsky
39063598db checkpatch: error - spacing
Change-Id: Ie6e1c43581dd4b0734625b3a4e59a4ca79619e99
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
2016-02-05 20:24:31 -05:00
Anas Nashif
9104031a96 toolchain: change aligned/used macros to support external c libraries
use __aligned__ and __used__ instead of aligned/used to avoid conflicts
with macros of the same name.

Change-Id: Ic36067dfc9df7ebcea486a075f759825d0dbde70
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:24:29 -05:00
Javier B Perez Hernandez
f7fffae8aa Change BSD-3 licenses to Apache 2
Change all the Intel and Wind River code license from BSD-3 to Apache 2.

Change-Id: Id8be2c1c161a06ea8a0b9f38e17660e11dbb384b
Signed-off-by: Javier B Perez Hernandez <javier.b.perez.hernandez@linux.intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:24:29 -05:00
Benjamin Walsh
4c13d8273e toolchain: rename FUNC_ALIAS parameters
Make them less confusing:

- new_alias: alias to be created
- real_func: the real function to create an alias of
- return_type: return type of the function

Change-Id: I1007b6b4c93c5ea9c817f72d0e68c0fb40e92190
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:27 -05:00
Andrew Boie
a13fddb7da toolchain.h: add __used macro
Change-Id: I252390fb125a569a975a093903eba42c8971629d
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:19 -05:00
Andrew Boie
be324badba toolchain: add __printf_like macro
Used to direct the compiler to examine the number and correctness
of arguments based on codes in the format string.

Change-Id: I8e408b3fcd6897a14d30363425f14f81628b3d3f
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
b99194ee98 Remove obsolete SYS_PREKERNEL_INIT() macro
The SYS_PREKERNEL_INIT() macro was a temporary item until the new driver
initialization model was implemented.

Change-Id: I052db0c9f41f54bfd0b54b50aa0b18f018be640c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:37 -05:00
Anas Nashif
ea0d0b220c doxygen: change comment style to match javadoc
The change replaces multiple asterisks to ** at
the beginning of comments and adds a space before
the asterisks at the beginning of lines.

Change-Id: I7656bde3bf4d9a31e38941e43b580520432dabc1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:32 -05:00
Peter Mitsis
580dcb6d8e Remove deprecated macros ALIGN_STRUCT and PACK_STRUCT
As the macros ALIGN_STRUCT(x) and PACK_STRUCT are no longer used, it is safe
to remove them.  (Their replacement macros are __aligned(x) and __packed.)

Change-Id: If52302b6fba91ac707af828396592ecc3016934d
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:22 -05:00
Anas Nashif
f2520f87a2 Rename VXMICRO_ARCH_arc -> CONFIG_ARC
Change-Id: I4aca181523f50f43ee01e1be0c20a9ad844ef618
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
274622ea69 Rename VXMICRO_ARCH_arm -> CONFIG_ARM
Change-Id: I32b2e39781825504e7936b3df0c864988650c35c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Anas Nashif
191fc279ce Rename VXMICRO_ARCH_x86 -> CONFIG_X86_32
Change-Id: Ie1bcfebce1db838ea994cb3626396ea032225830
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:14:16 -05:00
Jukka Rissanen
781b627f8c Add __may_alias macro to GCC toolchain
This is needed when one wants to avoid gcc
"dereferencing type-punned pointer" warnings.

Change-Id: I7bfd68fabb07deb64908cb0eaa833bdc5c8a4e08
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2016-02-05 20:14:16 -05:00
Peter Mitsis
4bb47b625c Add __aligned(x) and __packed macros to GCC toolchain
The names "__aligned(x)" and "__packed" are more generic than ALIGN_STRUCT(x)
and PACK_STRUCT respectively and are to be used in their stead.

NOTE: ALIGN_STRUCT(x) and PACK_STRUCT are now considered obsolete.

Change-Id: Ic5e859092643dde53bb8fa1117c6d877c2c4296f
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:13 -05:00
Allan Stephens
e54a6c4b68 Eliminate separate include files for generating absolute symbols
The toolchain-specific macros used to generate absolute symbols
are now part of the main include file for that toolchain, since
there doesn't seem to be a good reason to have them in a separate
file.

Change-Id: Ic97800485b20d6c5b23d14f69f67ee845cf076f5
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-02-05 20:14:13 -05:00
Peter Mitsis
18fa789ca0 Rework constructor macros
Routines are no longer flagged as constructors using the FUNC_CONSTRUCT(level)
macro.  This is because some compilers do not support constructor levels.

To indicate that a routine should be a constructor, the SYS_PREKERNEL_INIT()
macro should be used AFTER the definition of the routine.  For example ...

void my_library_init(void)
{
    ...
}

SYS_PREKERNEL_INIT(my_library_init, 500);

The first parameter to SYS_PREKERNEL_INIT() is the name of the routine.  The
second is the priority level (000...999).  The lower the number, the higher
the priority.  NOTE: It is important that all three digits are specified;
otherwise the linker may put the constructors in an undesired order.

Change-Id: Ic334875c60a453b39c10a2ffdee856b4851cb16c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:00 -05:00
Peter Mitsis
1c313b6f89 Remove references to ICC
Keys off variations of "ICC" to remove references to the Intel C Compiler as
it is not supported.

Change-Id: I09f67880b39839982ed1c450e564c274440628a5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:14:00 -05:00
Yonattan Louise
d133f9661d Fix checkpatch issue - WARNING:SPACING
This commit fixes the issue marked as SPACING by the checkpatch script
deleting the whitespaces between the function name and the open parenthesis.

Change-Id: I972b1646904bf6e1131263f94ab5024a528ae07d
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:59 -05:00
Luiz Augusto von Dentz
9ef64a3112 toolchain/gcc: Add UNALIGNED_GET macro
Similar to PACK_STRUCT it provide safe access to possible unaligned data
but it is much more convenient to use with non-struct types since all
one need to do is add a cast e.g. UNALIGNED_GET((uint16_t *) data).

Change-Id: I46402bdf1dd13081fe340a7214a84750a6cf04d2
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2016-02-05 20:13:58 -05:00
Yonattan Louise
a8571c4b7f Fix checkpatch issue - WARNING:SPACING
Spaces between the function name and the open parenthesis are not allowed.
This commit fixes the case where only one open parenthesis with leading
whitespaces is present in the line.

	#!/bin/bash

	checkpatch_script="$VXMICRO_BASE/scripts/checkpatch.pl --mailback --no-tree -f --emacs --summary-file --show-types --ignore BRACES,PRINTK_WITHOUT_KERN_LEVEL,SPLIT_STRING --max-line-length=100 "

	for file in $(find ./ -name "*.[ch]" ! -path "./scripts/*" ! -path "./host/src/wrsconfig/*");
	do
		# fixing spaces between function name and open parenthesis
		for line in $(eval $checkpatch_script $file | grep "WARNING:SPACING: space prohibited between function name and open parenthesis '('" | cut -d":" -f2)
		do
			echo "$file : $line"
			sed -i ''$line' { /[ \t](.*[ \t](/ b skip_it s/[ \t]*(/(/ ; :skip_it }' $file;
		done;
	done;

Change-Id: I1e026eaee930e297374e5f2f725b78f29824dee3
Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@intel.com>
2016-02-05 20:13:54 -05:00
Dmitriy Korovkin
e82a2a36c7 Compiler specific configuration
If a source code file depends on a configuration option,
that, in turn, depends on a compiler, this file has to
include toolchain.h.

toolchain.h includes a compiler specific header file that
sets the proper configuration option.

Change-Id: I7c9002522a8c6d6fd945e27a450ebe46ba9d4892
Signed-off-by: Dmitriy Korovkin <dmitriy.korovkin@windriver.com>
2016-02-05 20:13:52 -05:00
Peter Mitsis
c2929b4f38 toolchain/arch: Remove section garbage collection ifdef guards
Section garbage collection is to be always enabled.

Note that this does not have any impact on performance measurements of any
existing sample project as they all use the default section garbage collection
value (enabled).

Change-Id: I57baa55dd52d45b633d8ca319e799ef483a5246b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:13:48 -05:00
Yonattan Louise
29bd1c70ab Fix checkpatch issue - ERROR:POINTER_LOCATION
This commit changes the pointer's location in order to comply with
the defined coding style.

Signed-off-by: Yonattan Louise <yonattan.a.louise.mendoza@linux.intel.com>
Change-Id: Ibcf1ef0e4fc53b0cb5286b36119e76d017f24cd9
2016-02-05 20:13:39 -05:00
Inaky Perez-Gonzalez
8ddf82cf70 First commit
Signed-off-by:  <inaky.perez-gonzalez@intel.com>
2015-04-10 16:44:37 -07:00