Files
OpenCellular/include/task_id.h
Daisuke Nojiri afa53e3950 Add cts.tasklist
cts.tasklist contains tasks run only for CTS. These tasks are added to the
tasks registered in ec.tasklist with higher priority. This design allows
board directories to be free from CTS stuff.

cts.tasklist can be placed in each suite directory (cts/suite/cts.tasklist).
If a suite does not define its own cts.tasklist, the common list is used
(i.e. cts/cts.tasklist).

BUG=chromium:624520
BRANCH=none
TEST=Ran the followings:
make buildall
make CTS_MODULE=gpio BOARD=nucleo-f072rb
make CTS_MODULE=gpio BOARD=stm32l476g-eval

Change-Id: Ibb242297ee10a397a8fcb6ff73d8cbc560daa885
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/359445
Reviewed-by: Chris Chen <twothreecc@google.com>
2016-07-11 21:27:46 -07:00

74 lines
1.8 KiB
C

/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* define the task identifier of all compiled tasks */
#ifndef __CROS_EC_TASK_ID_H
#define __CROS_EC_TASK_ID_H
/* excludes non-base tasks for test build */
#ifdef TEST_BUILD
#define TASK_NOTEST(n, r, d, s)
#define TASK_TEST TASK
#else
#define TASK_NOTEST TASK
#define CONFIG_TEST_TASK_LIST
#endif
#ifndef CTS_MODULE
#define CONFIG_CTS_TASK_LIST
#endif
#define TASK_ALWAYS TASK
/* define the name of the header containing the list of tasks */
#define STRINGIFY0(name) #name
#define STRINGIFY(name) STRINGIFY0(name)
#define CTS_TASK_LIST STRINGIFY(CTS_TASKFILE)
#define TEST_TASK_LIST STRINGIFY(TEST_TASKFILE)
#define BOARD_TASK_LIST STRINGIFY(BOARD_TASKFILE)
#include BOARD_TASK_LIST
#ifdef CTS_MODULE
#include CTS_TASK_LIST
#endif
#ifdef TEST_BUILD
#include TEST_TASK_LIST
#endif
/* Task identifier (8 bits) */
typedef uint8_t task_id_t;
/**
* enumerate all tasks in the priority order
*
* the identifier of a task can be retrieved using the following constant:
* TASK_ID_<taskname> where <taskname> is the first parameter passed to the
* TASK macro in the TASK_LIST file.
*/
#define TASK(n, r, d, s) TASK_ID_##n,
enum {
TASK_ID_IDLE,
/* CONFIG_TASK_LIST is a macro coming from the BOARD_TASK_LIST file */
CONFIG_TASK_LIST
/* CONFIG_TEST_TASK_LIST is a macro from the TEST_TASK_LIST file */
CONFIG_TEST_TASK_LIST
/* For CTS tasks */
CONFIG_CTS_TASK_LIST
#ifdef EMU_BUILD
TASK_ID_TEST_RUNNER,
#endif
/* Number of tasks */
TASK_ID_COUNT,
/* Special task identifiers */
#ifdef EMU_BUILD
TASK_ID_INT_GEN = 0xfe, /* interrupt generator */
#endif
TASK_ID_INVALID = 0xff, /* unable to find the task */
};
#undef TASK
#endif /* __CROS_EC_TASK_ID_H */