Commit graph

42249 commits

Author SHA1 Message Date
Rodrigo Caballero
d7c32911c4 Doc: Create the Reference Guides part.
Placeholders were created for the missing content. The automatically
generated API docs were separated from the Doxygen collaboration guide.
The Kbuild User's Guide was moved unchanged.

Change-Id: I07dfed61bfbb3cad60372c57dc3cbdf627c872f0
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:20 -05:00
Rodrigo Caballero
4e472fa2fe Doc: Add the Platform Development Primer to the structure.
The content of the files was left unchanged except for labels for
cros-referncing, the main title of the part and the tabs on the tables
which were changed to spaces. That last change ensures the integrity of
the tables independently of editor. The structure of the content files
will be revised at a later time.

Change-Id: I90477966fb3f4727d61e859d77682b529c83337d
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -05:00
Rodrigo Caballero
d838f82aaa Doc: Creates the Application Dev. Primer with the existing content.
Moves the content found in the development part to the new Application
Development Primer. Creates a master file for the new part and a
placeholder for nanokernel-only applications. Labels that have already
been changed in prior changes of the topic were updated. The project's
master file was changed to include the new part.

Change-Id: I8e9df5b3e5d382997caf62b7503274e4821137e0
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -05:00
Rodrigo Caballero
2eb7017640 Doc: Change the Network Stack information to the Kernel Primer.
Moves the Network Stack information to the Kernel Primer. Labels were
updated to reflect the new structure. 

Change-Id: Iaea3cf3506476dee3f165eeb9c4c1fd49af54c90
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -05:00
Rodrigo Caballero
c720db67d3 Doc: Change the Driver Model to its own section of the Kernel Primer.
Moves the placeholder to the proper location.

Change-Id: I952640912714073f1e0ac4a0bcb2d2b320faaee4
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -05:00
Rodrigo Caballero
f81ee6efdd Doc: Change the Nanokernel Objects to the Nanokernel Services section.
Moves the Nanokernel Object documentation to a new Nanokernel Services
section within the Kernel Primer. Labels, cross-references, figures,
headings and filenames were updated to reflect the new structure. 

Change-Id: I04f97e712d78cd211a8ed1315f86895a51affa01
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -05:00
Rodrigo Caballero
4d8b60adca Doc: Change the Microkernel Objects to the Microkernel Services section.
Moves the Microkernel Object documentation to a new Microkernel Services
section within the Kernel Primer. Labels, cross-references, figures,
headings and filenames were updated to reflect the new structure. 

Change-Id: Ia2a91410a94caa8a97bb8211db5afc84b5dc0974
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -05:00
Rodrigo Caballero
d1e57e1569 Doc: Change the Architecture part to the Overview section.
Moves the files from Architecture to the Overview section of the Kernel
Primer. Cross-references and figures were updated to reflect the new
structure. Headings and content were changed as little as possible.
These changes are needed to implement the proposed new structure of the
documentation. Content was changed as created as little as possible.

Change-Id: Id1f91ff6c8f858bfd48ad034594ba38531c7e1c4
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -05:00
Rodrigo Caballero
a952569f02 Doc: Create the Kernel Primer.
Creates the Kernel Primer, removes overview modules that are no longer
needed and updates the master file to include the new part.

Change-Id: I6d7f53f019089d502e763ecc1789fb152c90c465
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -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
Dan Kalowsky
e2258e83c8 drivers: extending device.h for common driver ops
Extending devices.h to contain values that include error code
values that a driver may need to share.  These include things like:
okay, fail, invalid configuration, etc.

Change-Id: Ib3a5e3fdd93ec8115686cf02a75436af31ef6eff
Signed-off-by: Dan Kalowsky <daniel.kalowsky@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
76db3ae424 Clean up microkernel sys_kernel configuration files
As no default platform configuration uses the PIC/PIT, the project
configuration file 'prj_console_pc8253.conf' is no longer required.

Change-Id: Ic91922e9431a2853bb5fdcdd3e31e39f3dce90c4
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
21832e3bf1 Clean up microkernel latency_measure configuration files
As no default platform configuration uses the PIC/PIT, the project
configuration file 'prj_pc8253.conf' is no longer required.

Change-Id: I89fac2685d9fca0452e5ce9d9b035e102bd62d70
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
db608ec123 Clean up microkernel app_kernel configuration files
Removes the following project configuration files:
 - prj_console_float_pc8253.conf : PIT is no longer used
 - prj_console_nofloat_*.conf    : unsupported by Makefile

Change-Id: I72689fa56413947f3a552645c7b2ed5ad599ed71
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
8760c49d80 basic_minuteia to use HPET timer
Updates the basic_minuteia platform configuration to use the HPET timer as both
the PIC and PIT will be removed in a future commit.

Change-Id: Ieefcf48175d6d2731acd6b39a5e73879902940b1
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
578d417e87 Use HPET timer Kconfig options
Removes the HPET timer macros from board.h and uses the HPET timer Kconfig
options in their stead.

Change-Id: Ia0b3cd87716277ac25f12deb31d5c5934f355050
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
366962557c HPET: Add additional Kconfig options
Adds additional Kconfig options to the HPET timer for setting its base address,
IRQ, IRQ priority and condition for triggering an interrupt.

Change-Id: I80349c60237380129da9ef41ccf6850c6b874c3c
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
bbb57b5f80 ia32: Add HPET timer initialization abstraction
Initializes the HPET timer if it is configured into the system.

Change-Id: Ia9474e868101abe88e031266b956c6a559745d75
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
097a1a17dc ia32_pci: Abstract device initialization
Abstracts the initialization of the following devices:
    LOAPIC, IOAPIC, and HPET TIMER
This allows for a more configurable ia32_pci platform.

Change-Id: I05d0d983c163be499dd967ffe0121290a4305c9e
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
9216a2cbb9 cosmetic: Fix camel case in ia32 and ia32_pci platforms
Converts camel case routine names to lower-case with underscores to comply with
coding practices.

Change-Id: I9fac0d3858389039c00882a7d2e97fcd4e4c812b
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
3ecf65e5ef x86: Rename quark_init() to ia32_pci_init()
The new name corresponds to the platform (ia32_pci), whereas the old name
referred to the old platform/bsp name.

Change-Id: I1b6f3416db146af4fdbadf70d0ab153741c781d5
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
0ea6e60035 x86: Rename pc_init() to ia32_init()
The new name corresponds to the platform (ia32), whereas the old name referred
to the old platform/bsp name.

Change-Id: Ia8fe5d2b35bceb7e04dd8ac9c41b9de7947ed1f9
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Peter Mitsis
503dd66334 x86: Remove obsolete IOAPIC initialization comment
Change-Id: I26d75e36191f348598a807f5f943de99cc3bcf67
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
2016-02-05 20:15:19 -05:00
Rodrigo Caballero
a8f3110905 Doc: Restructures the Quick Start Guide.
The Quick Start Guide is now comprised by Installing, Building and
Running the Zephyr Kernel Guides. The Installing Guide contains all the
procedures needed to install the required components and get access to
the code. The Building Guide contains the procedure to build the kernel
using a sample application. The Running Guide contains the procedures to
run an application using QEMU or the Galileo 2 board. Files and folders
were renamed. The toctree directives were updated to reflect the new
names.

Change-Id: I4398befd4a24b12a50970c21a5288afa5c533fc8
Signed-off-by: Rodrigo Caballero <rodrigo.caballero.abraham@intel.com>
2016-02-05 20:15:19 -05:00
Anas Nashif
d2fff1fb7a drivers: use subdir-ccflags-y for all drivers
All driver Makefiles are adding the same cflags and they
have been done inconsistenly, make all drivers inherit
from the top level Makefile and remove unused includes.

Change-Id: Ie66d0ba7a418ac26f7eb709f50c887dc682e935c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:19 -05:00
Anas Nashif
427cdd36ec sanity: add new line when emitting an error
Change-Id: I4075dbe3706b45e926e9ab4d0f620fe262aaa705
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:19 -05:00
Anas Nashif
abb4404689 Move PCI settings to drivers/pci
Change-Id: I92ccbcdd1292f8f4f017b45968c2204c06e6f73e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-05 20:15:19 -05:00
Dirk Brandewie
6c9a846eae gpio: Fix function signature for gpio_set_callback()
Change-Id: I66c6630b2eced4e0219b0f36b1bf7b0454770290
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
2016-02-05 20:15:19 -05:00
Benjamin Walsh
add6b9794b arc: fixes in context switch explanation comments
There were some typos and some weird phrasing.

Change-Id: I7b183755058e5ffedca97d434c43f448aafd1926
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:19 -05:00
Benjamin Walsh
ac60583b76 drivers: rename cortex_m_timer to cortex_m_systick
The name of the device is SYSTICK. The device name should be part of the
file name, like all other timer drivers we support. The name
'cortex_m_timer' said nothing about which device the driver is for, since
it's way too generic: it could be for any timer present on any Cortex-M
board.

Change-Id: I39b4f79c32516ec9aff82c55c0ca639fad1b52bb
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:19 -05:00
Benjamin Walsh
6ebb212e18 ioapic: remove comment about split kernel
The Zephyr kernel must always be built as a monolithic image, not as
separate nanokernel and microkernel images.

Change-Id: I44fdd2349b32f409c84710f58bc4b3fe96fd79b7
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-02-05 20:15:19 -05:00
Daniel Leung
971eb0ef44 samples/microkernel: add test for private memory maps
This adds unit test for microkernel private memory maps.
The code piggybacks to the public memory map test (by
including the same source file), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private memory maps test move the memory maps inside
source code. So, both mdef files will need to be updated at
the same time.

Change-Id: Ia7f65f55b61d9fb0d42ba58d63662e914d69194e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
0abe07a0cd microkernel: introduce support for private memory maps
This enable defining memory maps in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_MEM_MAP(mem_map_name, ...). The memory maps created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
memory map APIs.

Define the memory map using:

  DEFINE_MEM_MAP(mem_map1, blocks, block_size);

and "mem_map1" can be used, for example:

  task_mem_map_alloc(mem_map1, ...);

or,

  task_mem_map_free(mem_map1, ...);

etc.

To use the memory map defined in another source file, simply add:

extern const kmemory_map_t mem_map1;

to the desired C or header file.

Change-Id: I9c551b90f9d0a95f961fd8ec1c5278c2ea44312d
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
201aa8c708 microkernel: put memory map pointers into its own binary section
The _k_mem_map_list was a static array generated by sysgen,
where it containing all pre-defined memory maps from MDEF file.
To support private memory map objects (aka, defining them within
source files), the list has to accommodate memory maps that
are not only processed through sysgen, but also those defined
within source files.

This is done by creating a new section in binary, and all memory
map pointers go into this section. By doing this, the list
can still be manipulated as an array.

Change-Id: I1f3414b72f685fef4b99850749178661f14d9345
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
a77808462e Redefine microkernel memory map object identifier type
The opaque memory map object id type is now a pointer to
the associated memory map structure, rather than an index
into the microkernel's array of memory map structures.

This change is a pre-requisite to support for private
memory map objects, which are defined in source code.

Change-Id: I82ecb59eeed00efa54f781f775710c92ff9c9fc9
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
8eec65c742 samples/microkernel: add test for private pipes
This adds unit test for microkernel private pipes.
The code piggybacks to the public pipe test (by
including the same source file), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private pipes test move the pipes inside source
code. So, both mdef files will need to be updated at
the same time.

Change-Id: I6fdb5eab7c3a1d6f4b72c26a3620cee0188b07a5
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
b5517ab61c microkernel: introduce support for private pipes
This enable defining pipes in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_PIPE(pipe_name, ...). The pipes created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
pipe APIs.

Define the pipe using:

  DEFINE_PIPE(pipe1, size);

and "pipe1" can be used, for example:

  task_pipe_put(pipe1, ...);

or,

  task_pipe_get(pipe1, ...);

etc.

To use the pipe defined in another source file, simply add:

extern const kpipe_t pipe1;

to the desired C or header file.

Change-Id: Iae8e04706359bc18aae51acc75df3e3d26388882
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
815d64522f microkernel: put pipe pointer list into its own binary section
The _k_pipe_list was a static array generated by sysgen,
where it containing all pre-defined pipes from MDEF file.
To support private pipe objects (aka, defining pipes within
source files), the pipe list has to accommodate pipes that
are not only processed through sysgen, but also those defined
within source files.

This is done by creating a new section in binary, and all pipe
pointers go into this section. By doing this, the pipe list
can still be manipulated as an array. The reason behind
putting the pointers to pipe, instead of the pipe objects
themselves, is that some compiler/linker may pad the large pipe
struct. For example, compiling under gcc and march=i686 pads
the struct to 32-byte alignment (march=atom to 64-byte alignment).
This causes issue with sizeof() and pointer arithmetic because
they have no idea about the padding. So use pointers here to
prevent padding.

Change-Id: I6d3b75614c4d8760c037a5c26746410d4e4b17cb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
2285976f03 microkernel: redefine pipe object identifier type
The opaque pipe object id type is now a pointer to
the associated pipe structure, rather than an index
into the microkernel's array of pipe structures.

This change is a pre-requisite to support for private
pipes, which are defined in source code.

This also moves the required struct into more visible
headers such that private pipes can be declared.
Renaming the struct is also being done to conform to
naming convention for private kernel objects.
Since a couple structs have to be moved anyway, so
do the moving and renaming here too (contrary to what
have been done in the past, with separated patches).

Change-Id: Ibb6ec7f62745a81439ae3ea2616688b757439843
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
62077917b6 samples/microkernel: add test for private tasks
This adds unit test for microkernel private tasks.
The code piggybacks to the public task test (by
including the same source file), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private tasks test move the tasks inside source
code. So, both mdef files will need to be updated at
the same time.

Change-Id: I2890f70be460c0e45208ce03d6e7897d2662f6f0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
2bc5880d85 microkernel: introduce support for private tasks
This enable defining tasks in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_TASK(task_name). The tasks created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
task APIs.

Define the task using:

  DEFINE_TASK(task1, priority, entry_func, stack_size, groups);

and "task1" can be used, for example:

  task_start(task1);

or,

  task_abort(task1);

etc.

To use the task defined in another source file, simply add:

extern const ktask_t task1;

to the desired C or header file.

Change-Id: Ib2f3572950ca74b359b7fde1ccd6cfd04783eefb
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
75e5427e15 microkernel: put _k_task_list into its own binary section
The _k_task_list was a static array generated by sysgen,
where it containing all pre-defined tasks from MDEF file.
To support private task objects (aka, defining tasks within
source files), the task list has to accommodate tasks that
are not only processed through sysgen, but also those defined
within source files.

This is done by creating a new section in binary, and all task
objects go into this section. By doing this, the task list
can still be manipulated as an array, which is required for
task group operation.

Change-Id: I799d6967567079498bc414e0cb809e8af856b53e
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
1367a98e9e Redefine microkernel task object identifier type
The opaque task object id type is now a pointer to
the associated task structure, rather than an index
into the microkernel's array of task structures.

This change is a pre-requisite to support for private
task objects, which are defined in source code.

Change-Id: Idb53ea7f8a8a5b7e6477a74273930b08fc77dcfe
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
c290ebaebd Redefine microkernel timer objects identifier type
The opaque timer object id type is now a pointer to
the associated timer structure, rather than an index
into the microkernel's array of timer structures.

This is simply to be consistent with other microkernel
objects, such as semaphore, mutex, and mailbox.

Change-Id: If803e22ae450d4ef28e81e8a5f2451b9c26c6dce
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
f6369abf4d samples/microkernel: add test for private mailboxes
This adds unit test for microkernel private mailboxes.
The code piggybacks to the public mailbox test (by
including the same source files), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private mailboxes test move the mailboxes inside source
code. So, both mdef files will need to be updated at
the same time.

Change-Id: I52ccc5931b1abfd3ae3d654f888d4a019268bba0
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
39887c4358 microkernel: introduce support for private mailboxes
This enable defining mailboxes in source code in addition to
defining in MDEF files. This introduces the macro
DEFINE_MAILBOX(mailbox_name). The mailboxes created this
way are the same, in functionality, as those defined in MDEF
files. They can be manipulated by the standard microkernel
mailbox APIs.

Define the mailbox using:

  DEFINE_MAILBOX(mailbox1);

and "mailbox1" can be used, for example:

  task_mbox_put(mailbox1, &msg);

or,

  task_mbox_get(mailbox1, &msg);

etc.

To use the mailbox defined in another source file, simply add:

extern const kmox_t mailbox1;

to the desired C or header file.

Change-Id: I32d4194af740f96fc8df8c6cd3144a0c9accb4ec
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
105e723faa microkernel: Rename struct mbx_struct to _k_mbox_struct
This is in preparation to enable private mailbox support.
The struct needs to be moved into more visible header
so private mailboxes can be declared. This also renames
according to naming convention to be private kernel
objects.

Change-Id: Ibd75497e726efd447d27f3bfd0b4695ed1695693
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
09387cc9dd Redefine microkernel mailbox object identifier type
The opaque mailbox object id type is now a pointer to
the associated mailbox structure, rather than an index
into the microkernel's array of mailbox structures.

This change is a pre-requisite to support for private
mailboxes, which are defined in source code.

Change-Id: Ide832eee2a0762e601847ad07afba380bd79ed8b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00
Daniel Leung
5d934a3786 samples/microkernel: add test for private FIFOs
This adds unit test for microkernel private FIFOs.
The code piggybacks to the public FIFOs tests (by
including the same source file), so any updates to
the test will be applied to both.

Note that the prj.mdef are different for both tests, since
the private FIFOs test move some of the FIFOs
inside source code.

Change-Id: I4130ac540b10a31cd30f37890e9cc389af73e89b
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2016-02-05 20:15:18 -05:00