17fe2f639SDominik Brodowski /* cpufreq-bench CPUFreq microbenchmark 27fe2f639SDominik Brodowski * 37fe2f639SDominik Brodowski * Copyright (C) 2008 Christian Kornacker <ckornacker@suse.de> 47fe2f639SDominik Brodowski * 57fe2f639SDominik Brodowski * This program is free software; you can redistribute it and/or modify 67fe2f639SDominik Brodowski * it under the terms of the GNU General Public License as published by 77fe2f639SDominik Brodowski * the Free Software Foundation; either version 2 of the License, or 87fe2f639SDominik Brodowski * (at your option) any later version. 97fe2f639SDominik Brodowski * 107fe2f639SDominik Brodowski * This program is distributed in the hope that it will be useful, 117fe2f639SDominik Brodowski * but WITHOUT ANY WARRANTY; without even the implied warranty of 127fe2f639SDominik Brodowski * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 137fe2f639SDominik Brodowski * GNU General Public License for more details. 147fe2f639SDominik Brodowski * 157fe2f639SDominik Brodowski * You should have received a copy of the GNU General Public License 167fe2f639SDominik Brodowski * along with this program; if not, write to the Free Software 177fe2f639SDominik Brodowski * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 187fe2f639SDominik Brodowski */ 197fe2f639SDominik Brodowski 207fe2f639SDominik Brodowski /* load loop, this schould take about 1 to 2ms to complete */ 217fe2f639SDominik Brodowski #define ROUNDS(x) {unsigned int rcnt; \ 227fe2f639SDominik Brodowski for (rcnt = 0; rcnt < x*1000; rcnt++) { \ 2302af3cb5SDominik Brodowski (void)(((int)(pow(rcnt, rcnt) * \ 2402af3cb5SDominik Brodowski sqrt(rcnt*7230970)) ^ 7230716) ^ \ 2502af3cb5SDominik Brodowski (int)atan2(rcnt, rcnt)); \ 267fe2f639SDominik Brodowski } } \ 277fe2f639SDominik Brodowski 287fe2f639SDominik Brodowski 297fe2f639SDominik Brodowski void start_benchmark(struct config *config); 30