Amit Arora | ed3e565 | 2010-10-27 12:02:53 +0530 | [diff] [blame] | 1 | /******************************************************************************* |
Amit Kucheria | c0e17fc | 2011-01-17 09:35:52 +0200 | [diff] [blame] | 2 | * Copyright (C) 2010, Linaro Limited. |
Amit Arora | ed3e565 | 2010-10-27 12:02:53 +0530 | [diff] [blame] | 3 | * |
| 4 | * This file is part of PowerDebug. |
| 5 | * |
| 6 | * All rights reserved. This program and the accompanying materials |
| 7 | * are made available under the terms of the Eclipse Public License v1.0 |
| 8 | * which accompanies this distribution, and is available at |
| 9 | * http://www.eclipse.org/legal/epl-v10.html |
| 10 | * |
| 11 | * Contributors: |
| 12 | * Amit Arora <amit.arora@linaro.org> (IBM Corporation) |
| 13 | * - initial API and implementation |
| 14 | *******************************************************************************/ |
| 15 | |
| 16 | #include <sys/stat.h> |
| 17 | #include <sys/vfs.h> |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 18 | #include <errno.h> |
| 19 | #include <sys/stat.h> |
Amit Arora | ed3e565 | 2010-10-27 12:02:53 +0530 | [diff] [blame] | 20 | #include <linux/magic.h> |
| 21 | |
Amit Arora | 3bc8c92 | 2010-11-16 11:27:38 +0530 | [diff] [blame] | 22 | extern int maxy; |
| 23 | |
Amit Arora | 04f9774 | 2010-11-16 11:28:57 +0530 | [diff] [blame] | 24 | #define MAX_LINES 120 |
Amit Arora | 031263a | 2010-11-09 11:12:41 +0530 | [diff] [blame] | 25 | |
Amit Arora | ed3e565 | 2010-10-27 12:02:53 +0530 | [diff] [blame] | 26 | struct clock_info { |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 27 | char name[NAME_MAX]; |
| 28 | int flags; |
| 29 | int rate; |
| 30 | int usecount; |
| 31 | int num_children; |
| 32 | int last_child; |
Amit Arora | 031263a | 2010-11-09 11:12:41 +0530 | [diff] [blame] | 33 | int expanded; |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 34 | int level; |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 35 | struct clock_info *parent; |
| 36 | struct clock_info **children; |
Amit Arora | ed3e565 | 2010-10-27 12:02:53 +0530 | [diff] [blame] | 37 | } *clocks_info; |
| 38 | |
Amit Arora | 031263a | 2010-11-09 11:12:41 +0530 | [diff] [blame] | 39 | char clock_lines[MAX_LINES][128]; |
| 40 | int clock_line_no; |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 41 | int old_clock_line_no; |
Amit Arora | ed3e565 | 2010-10-27 12:02:53 +0530 | [diff] [blame] | 42 | |
Daniel Lezcano | f0e0665 | 2011-03-26 22:06:19 +0100 | [diff] [blame^] | 43 | extern int clock_init(void); |
| 44 | |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 45 | void add_clock_details_recur(struct clock_info *clk, int hrow, int selected); |
Amit Arora | 031263a | 2010-11-09 11:12:41 +0530 | [diff] [blame] | 46 | void destroy_clocks_info(void); |
| 47 | void destroy_clocks_info_recur(struct clock_info *clock); |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 48 | void collapse_all_subclocks(struct clock_info *clock); |
Amit Arora | f4fb810 | 2010-11-30 13:55:50 +0530 | [diff] [blame] | 49 | struct clock_info *find_clock(struct clock_info *clk, char *clkarg); |