| 1 | /* | 
|---|
| 2 |    This file is part of MutekP. | 
|---|
| 3 |    | 
|---|
| 4 |    MutekP is free software; you can redistribute it and/or modify it | 
|---|
| 5 |    under the terms of the GNU General Public License as published by | 
|---|
| 6 |    the Free Software Foundation; either version 2 of the License, or | 
|---|
| 7 |    (at your option) any later version. | 
|---|
| 8 |    | 
|---|
| 9 |    MutekP is distributed in the hope that it will be useful, but | 
|---|
| 10 |    WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 11 |    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
|---|
| 12 |    General Public License for more details. | 
|---|
| 13 |    | 
|---|
| 14 |    You should have received a copy of the GNU General Public License | 
|---|
| 15 |    along with MutekP; if not, write to the Free Software Foundation, | 
|---|
| 16 |    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 
|---|
| 17 |    | 
|---|
| 18 |    UPMC / LIP6 / SOC (c) 2008 | 
|---|
| 19 |    Copyright Ghassan Almaless <ghassan.almaless@gmail.com> | 
|---|
| 20 | */ | 
|---|
| 21 |  | 
|---|
| 22 | #include <config.h> | 
|---|
| 23 | #include <kminiShell.h> | 
|---|
| 24 | #include <list.h> | 
|---|
| 25 | #include <thread.h> | 
|---|
| 26 | #include <task.h> | 
|---|
| 27 | #include <cluster.h> | 
|---|
| 28 | #include <cpu.h> | 
|---|
| 29 | #include <spinlock.h> | 
|---|
| 30 | #include <system.h> | 
|---|
| 31 | #include <wait_queue.h> | 
|---|
| 32 |  | 
|---|
| 33 | //FIXME do it for all cluster | 
|---|
| 34 | error_t ksh_cpu_state_func(void *param) | 
|---|
| 35 | { | 
|---|
| 36 |         register uint_t cld, cpu; | 
|---|
| 37 |         uint_t cpu_nr; | 
|---|
| 38 |         ms_args_t args; | 
|---|
| 39 |  | 
|---|
| 40 | #if 0 | 
|---|
| 41 |         uint_t clstr_nr; | 
|---|
| 42 |         clstr_nr = arch_onln_cluster_nr(); | 
|---|
| 43 |   | 
|---|
| 44 |         for(cld=0; cld < clstr_nr; cld ++) | 
|---|
| 45 |         { | 
|---|
| 46 |                 ksh_print("/SYS/CLUSTER%d\n", cld); | 
|---|
| 47 |                 cpu_nr = clusters_tbl[cld].cluster->cpu_nr; | 
|---|
| 48 |  | 
|---|
| 49 |                 for(cpu=0; cpu < cpu_nr; cpu++) | 
|---|
| 50 |                 { | 
|---|
| 51 |                         args.argc = 2; | 
|---|
| 52 |                         sprintk(args.argv[1], "/SYS/CLUSTER%d/CPU%d", cld,cpu); | 
|---|
| 53 |                         cat_func(&args); | 
|---|
| 54 |                 } | 
|---|
| 55 |         } | 
|---|
| 56 | #endif | 
|---|
| 57 |         cld = current_cid; | 
|---|
| 58 |         cpu_nr = current_cluster->cpu_nr; | 
|---|
| 59 |         ksh_print("/SYS/CLUSTER%d\n", current_cid); | 
|---|
| 60 |  | 
|---|
| 61 |         for(cpu=0; cpu < cpu_nr; cpu++) | 
|---|
| 62 |         { | 
|---|
| 63 |                 args.argc = 2; | 
|---|
| 64 |                 sprintk(args.argv[1], "/SYS/CLUSTER%d/CPU%d", cld, cpu); | 
|---|
| 65 |                 cat_func(&args); | 
|---|
| 66 |         } | 
|---|
| 67 |  | 
|---|
| 68 |         return 0; | 
|---|
| 69 | } | 
|---|