aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/appldata/appldata_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/appldata/appldata_base.c')
-rw-r--r--arch/s390/appldata/appldata_base.c44
1 files changed, 15 insertions, 29 deletions
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c
index 9a22434a580c..61bc44626c04 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -5,9 +5,9 @@
5 * Exports appldata_register_ops() and appldata_unregister_ops() for the 5 * Exports appldata_register_ops() and appldata_unregister_ops() for the
6 * data gathering modules. 6 * data gathering modules.
7 * 7 *
8 * Copyright (C) 2003 IBM Corporation, IBM Deutschland Entwicklung GmbH. 8 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH.
9 * 9 *
10 * Author: Gerald Schaefer <geraldsc@de.ibm.com> 10 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
11 */ 11 */
12 12
13#include <linux/config.h> 13#include <linux/config.h>
@@ -40,22 +40,6 @@
40 40
41#define TOD_MICRO 0x01000 /* nr. of TOD clock units 41#define TOD_MICRO 0x01000 /* nr. of TOD clock units
42 for 1 microsecond */ 42 for 1 microsecond */
43#ifndef CONFIG_64BIT
44
45#define APPLDATA_START_INTERVAL_REC 0x00 /* Function codes for */
46#define APPLDATA_STOP_REC 0x01 /* DIAG 0xDC */
47#define APPLDATA_GEN_EVENT_RECORD 0x02
48#define APPLDATA_START_CONFIG_REC 0x03
49
50#else
51
52#define APPLDATA_START_INTERVAL_REC 0x80
53#define APPLDATA_STOP_REC 0x81
54#define APPLDATA_GEN_EVENT_RECORD 0x82
55#define APPLDATA_START_CONFIG_REC 0x83
56
57#endif /* CONFIG_64BIT */
58
59 43
60/* 44/*
61 * Parameter list for DIAGNOSE X'DC' 45 * Parameter list for DIAGNOSE X'DC'
@@ -195,8 +179,8 @@ static void appldata_work_fn(void *data)
195 * 179 *
196 * prepare parameter list, issue DIAG 0xDC 180 * prepare parameter list, issue DIAG 0xDC
197 */ 181 */
198static int appldata_diag(char record_nr, u16 function, unsigned long buffer, 182int appldata_diag(char record_nr, u16 function, unsigned long buffer,
199 u16 length) 183 u16 length, char *mod_lvl)
200{ 184{
201 unsigned long ry; 185 unsigned long ry;
202 struct appldata_product_id { 186 struct appldata_product_id {
@@ -214,7 +198,7 @@ static int appldata_diag(char record_nr, u16 function, unsigned long buffer,
214 .record_nr = record_nr, 198 .record_nr = record_nr,
215 .version_nr = {0xF2, 0xF6}, /* "26" */ 199 .version_nr = {0xF2, 0xF6}, /* "26" */
216 .release_nr = {0xF0, 0xF1}, /* "01" */ 200 .release_nr = {0xF0, 0xF1}, /* "01" */
217 .mod_lvl = {0xF0, 0xF0}, /* "00" */ 201 .mod_lvl = {mod_lvl[0], mod_lvl[1]},
218 }; 202 };
219 struct appldata_parameter_list appldata_parameter_list = { 203 struct appldata_parameter_list appldata_parameter_list = {
220 .diag = 0xDC, 204 .diag = 0xDC,
@@ -467,24 +451,25 @@ appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
467 module_put(ops->owner); 451 module_put(ops->owner);
468 return -ENODEV; 452 return -ENODEV;
469 } 453 }
470 ops->active = 1;
471 ops->callback(ops->data); // init record 454 ops->callback(ops->data); // init record
472 rc = appldata_diag(ops->record_nr, 455 rc = appldata_diag(ops->record_nr,
473 APPLDATA_START_INTERVAL_REC, 456 APPLDATA_START_INTERVAL_REC,
474 (unsigned long) ops->data, ops->size); 457 (unsigned long) ops->data, ops->size,
458 ops->mod_lvl);
475 if (rc != 0) { 459 if (rc != 0) {
476 P_ERROR("START DIAG 0xDC for %s failed, " 460 P_ERROR("START DIAG 0xDC for %s failed, "
477 "return code: %d\n", ops->name, rc); 461 "return code: %d\n", ops->name, rc);
478 module_put(ops->owner); 462 module_put(ops->owner);
479 ops->active = 0;
480 } else { 463 } else {
481 P_INFO("Monitoring %s data enabled, " 464 P_INFO("Monitoring %s data enabled, "
482 "DIAG 0xDC started.\n", ops->name); 465 "DIAG 0xDC started.\n", ops->name);
466 ops->active = 1;
483 } 467 }
484 } else if ((buf[0] == '0') && (ops->active == 1)) { 468 } else if ((buf[0] == '0') && (ops->active == 1)) {
485 ops->active = 0; 469 ops->active = 0;
486 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, 470 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
487 (unsigned long) ops->data, ops->size); 471 (unsigned long) ops->data, ops->size,
472 ops->mod_lvl);
488 if (rc != 0) { 473 if (rc != 0) {
489 P_ERROR("STOP DIAG 0xDC for %s failed, " 474 P_ERROR("STOP DIAG 0xDC for %s failed, "
490 "return code: %d\n", ops->name, rc); 475 "return code: %d\n", ops->name, rc);
@@ -633,7 +618,7 @@ appldata_offline_cpu(int cpu)
633 spin_unlock(&appldata_timer_lock); 618 spin_unlock(&appldata_timer_lock);
634} 619}
635 620
636static int 621static int __cpuinit
637appldata_cpu_notify(struct notifier_block *self, 622appldata_cpu_notify(struct notifier_block *self,
638 unsigned long action, void *hcpu) 623 unsigned long action, void *hcpu)
639{ 624{
@@ -652,7 +637,7 @@ appldata_cpu_notify(struct notifier_block *self,
652 return NOTIFY_OK; 637 return NOTIFY_OK;
653} 638}
654 639
655static struct notifier_block appldata_nb = { 640static struct notifier_block __devinitdata appldata_nb = {
656 .notifier_call = appldata_cpu_notify, 641 .notifier_call = appldata_cpu_notify,
657}; 642};
658 643
@@ -710,7 +695,8 @@ static void __exit appldata_exit(void)
710 list_for_each(lh, &appldata_ops_list) { 695 list_for_each(lh, &appldata_ops_list) {
711 ops = list_entry(lh, struct appldata_ops, list); 696 ops = list_entry(lh, struct appldata_ops, list);
712 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC, 697 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
713 (unsigned long) ops->data, ops->size); 698 (unsigned long) ops->data, ops->size,
699 ops->mod_lvl);
714 if (rc != 0) { 700 if (rc != 0) {
715 P_ERROR("STOP DIAG 0xDC for %s failed, " 701 P_ERROR("STOP DIAG 0xDC for %s failed, "
716 "return code: %d\n", ops->name, rc); 702 "return code: %d\n", ops->name, rc);
@@ -739,6 +725,7 @@ MODULE_DESCRIPTION("Linux-VM Monitor Stream, base infrastructure");
739 725
740EXPORT_SYMBOL_GPL(appldata_register_ops); 726EXPORT_SYMBOL_GPL(appldata_register_ops);
741EXPORT_SYMBOL_GPL(appldata_unregister_ops); 727EXPORT_SYMBOL_GPL(appldata_unregister_ops);
728EXPORT_SYMBOL_GPL(appldata_diag);
742 729
743#ifdef MODULE 730#ifdef MODULE
744/* 731/*
@@ -779,7 +766,6 @@ unsigned long nr_iowait(void)
779#endif /* MODULE */ 766#endif /* MODULE */
780EXPORT_SYMBOL_GPL(si_swapinfo); 767EXPORT_SYMBOL_GPL(si_swapinfo);
781EXPORT_SYMBOL_GPL(nr_threads); 768EXPORT_SYMBOL_GPL(nr_threads);
782EXPORT_SYMBOL_GPL(avenrun);
783EXPORT_SYMBOL_GPL(get_full_page_state); 769EXPORT_SYMBOL_GPL(get_full_page_state);
784EXPORT_SYMBOL_GPL(nr_running); 770EXPORT_SYMBOL_GPL(nr_running);
785EXPORT_SYMBOL_GPL(nr_iowait); 771EXPORT_SYMBOL_GPL(nr_iowait);