Mercurial > hg > Game > Atoc
view driver/procfs/hypervisor.c @ 0:42f240cc4bc6
From: 太田 篤志 <atoc@namikilab.tuat.ac.jp>
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 08 Sep 2009 13:44:18 +0900 |
parents | |
children |
line wrap: on
line source
/** * hypervisor.c * SPE プロセスマネージャ spe_manager * procfs エントリ "hypervisor" のハンドラ */ #include <linux/module.h> // カーネルモジュール全般 #include <linux/kernel.h> // printk #include <linux/spinlock.h> // spin_lock, spin_unlock #include "../../include/hvcalls/common.h" #include "../../include/hvcalls/ppe.h" #include "../main.h" #include "../lspe.h" #include "hypervisor.h" //============================================================================================= procfs_hypervisor_read() /** * procfs_hypervisor_read * procfs エントリ "hypervisor" の read イベントハンドラ * * @param char * page * @param char ** start * @param off_t off * @param int count * @param int * eof * @param void * data * @return int */ int procfs_hypervisor_read(char *page, char **start, off_t off, int count, int *eof, void *data) { HVC_u64 lpar_id, ppe_id, vas_id; int lspe; int i, length = 0; //----- 論理パーティション識別子, 論理 PPE 識別子, 仮想アドレス識別子 -------------------------- hvc_get_lpar_id(&lpar_id); hvc_get_ppe_id(&ppe_id); if (hvc_get_vas_id(ppe_id, &vas_id)) { printk(KERN_ERR "[%s] Error: hvc_get_vas_id() (%s:%u)\n", SPE_MANAGER_MODULE_NAME, __FILE__, __LINE__); } length += sprintf ( page + length, " Value\n" "---------------------------------\n" " Logical Partition ID %5lu\n" " Logical PPE ID %5lu\n" " Virtual Address Space ID %5lu\n" "---------------------------------\n" "\n", lpar_id, ppe_id, vas_id ); //----- 論理 SPE ------------------------------------------------------------------------------- length += sprintf ( page + length, "Logical SPEs...\n" "\n" " No. SPE ID LS Addr ProbStateReg Addr Privilege2 Addr\n" "-------------------------------------------------------------------------\n" ); lspe = get_lspe_count(); for (i = 0; i < lspe; i++) { lspe_data_t *data = get_lspe_data(i); length += sprintf ( page + length, " #%d %6lu 0x%016lx 0x%016lx 0x%016lx\n", i, data->spe_id, (unsigned long)(data->ls), (unsigned long)(data->problem), (unsigned long)(data->priv2) ); } length += sprintf ( page + length, "-------------------------------------------------------------------------\n" ); *eof = 1; return length; }