Commit graph

115 commits

Author SHA1 Message Date
Anas Nashif 269d38bcda samples: philosophers: move legacy applications to legacy/
Change-Id: Id67ecd44e44be4821bad8894154cfbcbdcea0634
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-02 22:05:28 +00:00
Benjamin Walsh c2aecb26cc samples: fix kernel_event_logger to work with unified kernel
The test is modified to key on CONFIG_TASK_MONITOR instead of
CONFIG_MICROKERNEL, since that is what it was really interested in.
Also, this allows the unified kernel to work w.r.t. task monitoring,
since that is a concept that is alien to the unified kernel, since there
are no more task transitions recorded as part of a kernel server. The
unified kernel does not have a CONFIG_TASK_MONITORING option.

To make this work, since the kernel_event_logger sample makes use of the
philosophers demo, the latter had to be modified as well. The nanokernel
philosophers demo would not work with the unifed kernel since it
identifies as a microkernel, and in that case the test would be looking
for symbols defined in an MDEF file, which the nanokernel demo does not
provide of course; the same thing applies to the nanokernel
kernel_event_logger sample. Instead, the demo defines NANO_APIS_ONLY=1,
which is really what it is interested in. To allow that definition to
exist, the nanokernel philosophers demo and both the nano/micro
kernel_event_logger samples add src/ directory with its own Makefile and
add their own phil_fiber.c and phil.h files, which simply include the
original files from the microkernel philosophers demo. As a final
change, the kernel_event_logger samples need a different prj.conf file
for the unified kernel, since it needs a bigger idle stack than the
default, since the kernel event logger does work in the idle thread when
the kernel goes to sleep.

Change-Id: I4cac45a32d09d6ca1de052a368b3219f64889869
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-26 23:38:03 +00:00
Benjamin Walsh 1125c2b00e unified: correct comment about number of threads in phil demo
A bit of work has to be done by someone why wants to run the demo with a
different number of threads than the default.

Fixes ZEP-1077.

Change-Id: Ibb5cfed2bd9984bcf0f9d65f957f32daf4c5211e
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-26 23:06:25 +00:00
Benjamin Walsh fa078dea4b unified: fix philosophers demo when using stack objects
Got out of sync with the revised signature of k_stack_init().

Change-Id: Ib4c67c75f30055583a457bfb13f8dacc9929ee88
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-10-17 17:54:14 +00:00
Allan Stephens 399d0ad55a unified: Rationalize thread priority APIs
* Gets rid of k_current_priority_get(). Users can just call
  k_thread_priority_get(k_current_get()) instead.

* Declares k_thread_priority_get() in kernel.h, where it
  really belongs.

* Removes duplicate declaration of k_thread_priority_set().

Change-Id: I616ae6f2e06c95ecba3b92324186b3fa29162fd1
Signed-off-by: Allan Stephens <allan.stephens@windriver.com>
2016-10-13 13:53:59 +00:00
Benjamin Walsh aabf74cda5 Dining philosophers demo for unified kernel.
The demo can be configured to use different object types for its
synchronization: SEMAPHORES, MUTEXES, STACKS, FIFOS and LIFOS. To
configure a specific object, set the value of FORKS to one of these.

By default, the demo uses MUTEXES.

The demo can also be configured to work with static objects or dynamic
objects. The behaviour will change depending if STATIC_OBJS is set to 0
or 1.

By default, the demo uses dynamic objects.

The demo can be configured to work with threads of the same priority or
not. If using different priorities, two threads will be cooperative
threads, and the other four will be preemtible threads; if using one
priority, there will be six preemtible threads of priority 0. This is
changed via SAME_PRIO.

By default, the demo uses different priorities.

The number of threads is set via NUM_PHIL. The demo has only been tested
with six threads. In theory it should work with less than six threads,
but not with more without making changes to the forks[] array in the
phil_obj_abstract.h header file.

Change-Id: If7a0a34b216929a661245fd921a32ec413df8a4a
Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
2016-09-28 14:14:02 +00:00
Anas Nashif 5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Inaky Perez-Gonzalez eb2d8b418c testcases: add automation markup to samples/
Code in samples does not follow an standarized format for reporting
success or operation failure -- thus we use markup (in file sample.tc)
to specify what shall be found in the console to consider execution a
success.

There is a few functional code modifications that add/extend console
messages so verification is possible or easier:

 - hello_world, synchronization: extend the success message to also
   print which core is running the testcase

- pci_enum: print message on success.

Change-Id: Idb6cea03adebe97d97854603f963f4e3d4cb856a
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-07-26 08:32:24 +08:00
Inaky Perez-Gonzalez fcec9e37c0 testcases: sanity check TCs get more language for real HW
Add more specifications or qualify some to the sanity check test cases
for them to be ran in real hardware:

 - kernel types (micro vs nano)
 - platforms / arches to exclude / include
 - one that is removed (for the PCI sample) as it cannot be ran
   without extra information

Change-Id: Id14dc15eb89358c3656d2814ea41bb6fec051278
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-06-14 23:49:56 +00:00
Anas Nashif f62d86c42b samples: get rid of obsolete usage of ARCH variable
Using ARCH variable to select different configurations for the different
architectures is misleading and conflicts with the variable ARCH being used by
the build system.  The variable is not needed, it is application specific and
an application can be built without the need to specify ARCH on the command
line.

This is yet another item specific to samples and test cases that
wrongfully being used and documented for every application.  We need to use
another variable and just make it clear it is specific to samples and how they
are written.  One possible solution is to have a script that gets the
architecture based on the board being used.  Attachments

Jira: ZEP-238
Change-Id: Ieccbc087a41858fb96fb361c0aaa04705e968a4e
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-05-12 10:57:28 +00:00
Anas Nashif 4806e8c6c5 Revert "samples: philosophers: reduce stack size used"
This reverts commit 7eb9c884bc.

This change causes failures on arduino 101.

Change-Id: I6f8620b629516a6a81c2b417aa3736752ba40873
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-29 18:51:16 +00:00
Andrew Boie 6371d21846 philosophers: nanokernel: use empty config
None of the configuration directives for any of the arches were
actually needed.

Change-Id: Id0bf7393b8e2c7e0f5188c50c13d7666cdfcd114
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-04-27 21:41:14 +00:00
Anas Nashif 7eb9c884bc samples: philosophers: reduce stack size used
Change-Id: I89a21d16fc14f52226fad0bd92cab030b69c54f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-04-25 19:17:05 +00:00
Yannis Damigos 31100d1a61 samples:philosophers:Reformated 80-column width, 80-chars tabs
This patch reformats philosophers sample to fit in 80 columns
with 8-char tabs. It also fixes other coding style issues
reported by chechpatch.pl script with -f option.

Change-Id: Ie7ed59db4e67e279a26000247a1838221ac37cd3
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2016-03-08 13:54:53 +00:00
Anas Nashif 18cc4a8ea3 move sample apps to top level directory under samples/
All 'real' sample application now reside under samples/ directly.
the nano and micro variants will be under the specific sample directory
and not split across the file system.

Change-Id: I0ddf929cff7a29749aa4944b4385af058d9cc74c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-02-11 13:08:44 -05:00