/* * Copyright (C) 2020 MediaTek Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef _CACHE_CTRL_H_ #define _CACHE_CTRL_H_ #define GROUP_ROOT 1 #define GROUP_FG 2 #define GROUP_BG 3 #define GROUP_TA 4 #ifdef CONFIG_MTK_IO_BOOST #define BOOSTGROUPS_COUNT 6 #else #define BOOSTGROUPS_COUNT 5 #endif struct boost_groups { /* Maximum boost value for all RUNNABLE tasks on a CPU */ bool idle; int boost_max; u64 boost_ts; struct { /* The boost for tasks on that boost group */ int boost; /* Count of RUNNABLE tasks on that boost group */ unsigned int tasks; /* Timestamp of boost activation */ u64 ts; } group[BOOSTGROUPS_COUNT]; /* CPU's boost group locking */ raw_spinlock_t lock; }; #endif