Files
OpenCellular/include/task_id.h
Vic Yang 8a06eb1d35 Only includes necessary tasks for test binaries
This changes current TASK() syntax to TASK_BASE() and TASK_NORMAL(),
where TASK_BASE is necessary for the EC to boot on a board and
TASK_NORMAL represents the task that can be removed in a test binary.

Tasks introduced by a test should be listed as TASK_TEST().

Note that this CL breaks current tests (many of them are broken anyway),
which will be fixed in up coming CLs.

BUG=chrome-os-partner:18598
TEST=Build link/bds/spring/snow/daisy/mccroskey. (mccroskey failed for
unrelated issue)
BRANCH=none

Change-Id: Ic645cdae0906ed21dc473553f1f43c2537ec4bb9
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/47531
2013-04-10 01:08:45 -07:00

58 lines
1.5 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 __TASK_ID_H
#define __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
#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 TEST_TASK_LIST STRINGIFY(TEST_TASKFILE)
#define BOARD_TASK_LIST STRINGIFY(BOARD_TASKFILE)
#include BOARD_TASK_LIST
#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
/* Number of tasks */
TASK_ID_COUNT,
/* Special task identifiers */
TASK_ID_INVALID = 0xff /* unable to find the task */
};
#undef TASK
#endif /* __TASK_ID_H */