Files
OpenCellular/include/task_filter.h
Nicolas Boichat 896409ef79 Makefile: Allow different task list for RO and RW
This adds new macros for tasks (_RO and _RW), which allows to
enable a task only for RO or RW section.

We also create a new task_filter.h include file, that helps
pre-filter those tasks, and can be used either from Makefile,
or included from task_id.h.

BRANCH=none
BUG=b:35582031
TEST=make buildall -j; make savesizes
     Apply this CL
     make buildall -j; make newsizes => No size change

Change-Id: I472bc6d4ab250a0a0e1fa6aeb4b748ba6968bedf
Reviewed-on: https://chromium-review.googlesource.com/479491
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Nick Sanders <nsanders@google.com>
2017-04-25 05:52:34 -07:00

50 lines
1.2 KiB
C

/* Copyright 2017 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.
*
* Filter tasklist in *.tasklist, depending on section (RO/RW), or
* TEST/CTS build.
*/
#ifndef __CROS_EC_TASK_FILTER_H
#define __CROS_EC_TASK_FILTER_H
#ifdef SECTION_IS_RO
#define TASK_NOTEST_RO TASK_NOTEST
#define TASK_TEST_RO TASK_TEST
#define TASK_ALWAYS_RO TASK_ALWAYS
#define TASK_NOTEST_RW(n, r, d, s)
#define TASK_TEST_RW(n, r, d, s)
#define TASK_ALWAYS_RW(n, r, d, s)
#else /* SECTION_IS_RW */
#define TASK_NOTEST_RW TASK_NOTEST
#define TASK_TEST_RW TASK_TEST
#define TASK_ALWAYS_RW TASK_ALWAYS
#define TASK_NOTEST_RO(n, r, d, s)
#define TASK_TEST_RO(n, r, d, s)
#define TASK_ALWAYS_RO(n, r, d, s)
#endif
/* 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
/* If included directly from Makefile, dump task list. */
#ifdef _MAKEFILE
#define TASK(n, r, d, s) n
CONFIG_TASK_LIST CONFIG_TEST_TASK_LIST CONFIG_CTS_TASK_LIST
#endif
#endif /* __CROS_EC_TASK_FILTER_H */