Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / s390 / appldata / appldata_base.c
blobd0f82c995af680a3c678d68c60094ae91b056348
1 /*
2 * arch/s390/appldata/appldata_base.c
4 * Base infrastructure for Linux-z/VM Monitor Stream, Stage 1.
5 * Exports appldata_register_ops() and appldata_unregister_ops() for the
6 * data gathering modules.
8 * Copyright (C) 2003,2006 IBM Corporation, IBM Deutschland Entwicklung GmbH.
10 * Author: Gerald Schaefer <gerald.schaefer@de.ibm.com>
13 #include <linux/module.h>
14 #include <linux/init.h>
15 #include <linux/slab.h>
16 #include <linux/errno.h>
17 #include <asm/uaccess.h>
18 #include <asm/io.h>
19 #include <asm/smp.h>
20 #include <linux/interrupt.h>
21 #include <linux/proc_fs.h>
22 #include <linux/page-flags.h>
23 #include <linux/swap.h>
24 #include <linux/pagemap.h>
25 #include <linux/sysctl.h>
26 #include <asm/timer.h>
27 //#include <linux/kernel_stat.h>
28 #include <linux/notifier.h>
29 #include <linux/cpu.h>
30 #include <linux/workqueue.h>
32 #include "appldata.h"
35 #define MY_PRINT_NAME "appldata" /* for debug messages, etc. */
36 #define APPLDATA_CPU_INTERVAL 10000 /* default (CPU) time for
37 sampling interval in
38 milliseconds */
40 #define TOD_MICRO 0x01000 /* nr. of TOD clock units
41 for 1 microsecond */
44 * Parameter list for DIAGNOSE X'DC'
46 #ifndef CONFIG_64BIT
47 struct appldata_parameter_list {
48 u16 diag; /* The DIAGNOSE code X'00DC' */
49 u8 function; /* The function code for the DIAGNOSE */
50 u8 parlist_length; /* Length of the parameter list */
51 u32 product_id_addr; /* Address of the 16-byte product ID */
52 u16 reserved;
53 u16 buffer_length; /* Length of the application data buffer */
54 u32 buffer_addr; /* Address of the application data buffer */
56 #else
57 struct appldata_parameter_list {
58 u16 diag;
59 u8 function;
60 u8 parlist_length;
61 u32 unused01;
62 u16 reserved;
63 u16 buffer_length;
64 u32 unused02;
65 u64 product_id_addr;
66 u64 buffer_addr;
68 #endif /* CONFIG_64BIT */
71 * /proc entries (sysctl)
73 static const char appldata_proc_name[APPLDATA_PROC_NAME_LENGTH] = "appldata";
74 static int appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
75 void __user *buffer, size_t *lenp, loff_t *ppos);
76 static int appldata_interval_handler(ctl_table *ctl, int write,
77 struct file *filp,
78 void __user *buffer,
79 size_t *lenp, loff_t *ppos);
81 static struct ctl_table_header *appldata_sysctl_header;
82 static struct ctl_table appldata_table[] = {
84 .ctl_name = CTL_APPLDATA_TIMER,
85 .procname = "timer",
86 .mode = S_IRUGO | S_IWUSR,
87 .proc_handler = &appldata_timer_handler,
90 .ctl_name = CTL_APPLDATA_INTERVAL,
91 .procname = "interval",
92 .mode = S_IRUGO | S_IWUSR,
93 .proc_handler = &appldata_interval_handler,
95 { .ctl_name = 0 }
98 static struct ctl_table appldata_dir_table[] = {
100 .ctl_name = CTL_APPLDATA,
101 .procname = appldata_proc_name,
102 .maxlen = 0,
103 .mode = S_IRUGO | S_IXUGO,
104 .child = appldata_table,
106 { .ctl_name = 0 }
110 * Timer
112 DEFINE_PER_CPU(struct vtimer_list, appldata_timer);
113 static atomic_t appldata_expire_count = ATOMIC_INIT(0);
115 static DEFINE_SPINLOCK(appldata_timer_lock);
116 static int appldata_interval = APPLDATA_CPU_INTERVAL;
117 static int appldata_timer_active;
120 * Work queue
122 static struct workqueue_struct *appldata_wq;
123 static void appldata_work_fn(void *data);
124 static DECLARE_WORK(appldata_work, appldata_work_fn, NULL);
128 * Ops list
130 static DEFINE_SPINLOCK(appldata_ops_lock);
131 static LIST_HEAD(appldata_ops_list);
134 /*************************** timer, work, DIAG *******************************/
136 * appldata_timer_function()
138 * schedule work and reschedule timer
140 static void appldata_timer_function(unsigned long data, struct pt_regs *regs)
142 P_DEBUG(" -= Timer =-\n");
143 P_DEBUG("CPU: %i, expire_count: %i\n", smp_processor_id(),
144 atomic_read(&appldata_expire_count));
145 if (atomic_dec_and_test(&appldata_expire_count)) {
146 atomic_set(&appldata_expire_count, num_online_cpus());
147 queue_work(appldata_wq, (struct work_struct *) data);
152 * appldata_work_fn()
154 * call data gathering function for each (active) module
156 static void appldata_work_fn(void *data)
158 struct list_head *lh;
159 struct appldata_ops *ops;
160 int i;
162 P_DEBUG(" -= Work Queue =-\n");
163 i = 0;
164 spin_lock(&appldata_ops_lock);
165 list_for_each(lh, &appldata_ops_list) {
166 ops = list_entry(lh, struct appldata_ops, list);
167 P_DEBUG("list_for_each loop: %i) active = %u, name = %s\n",
168 ++i, ops->active, ops->name);
169 if (ops->active == 1) {
170 ops->callback(ops->data);
173 spin_unlock(&appldata_ops_lock);
177 * appldata_diag()
179 * prepare parameter list, issue DIAG 0xDC
181 int appldata_diag(char record_nr, u16 function, unsigned long buffer,
182 u16 length, char *mod_lvl)
184 unsigned long ry;
185 struct appldata_product_id {
186 char prod_nr[7]; /* product nr. */
187 char prod_fn[2]; /* product function */
188 char record_nr; /* record nr. */
189 char version_nr[2]; /* version */
190 char release_nr[2]; /* release */
191 char mod_lvl[2]; /* modification lvl. */
192 } appldata_product_id = {
193 /* all strings are EBCDIC, record_nr is byte */
194 .prod_nr = {0xD3, 0xC9, 0xD5, 0xE4,
195 0xE7, 0xD2, 0xD9}, /* "LINUXKR" */
196 .prod_fn = {0xD5, 0xD3}, /* "NL" */
197 .record_nr = record_nr,
198 .version_nr = {0xF2, 0xF6}, /* "26" */
199 .release_nr = {0xF0, 0xF1}, /* "01" */
200 .mod_lvl = {mod_lvl[0], mod_lvl[1]},
202 struct appldata_parameter_list appldata_parameter_list = {
203 .diag = 0xDC,
204 .function = function,
205 .parlist_length =
206 sizeof(appldata_parameter_list),
207 .buffer_length = length,
208 .product_id_addr =
209 (unsigned long) &appldata_product_id,
210 .buffer_addr = virt_to_phys((void *) buffer)
213 if (!MACHINE_IS_VM)
214 return -ENOSYS;
215 ry = -1;
216 asm volatile(
217 "diag %1,%0,0xDC\n\t"
218 : "=d" (ry)
219 : "d" (&appldata_parameter_list),
220 "m" (appldata_parameter_list),
221 "m" (appldata_product_id)
222 : "cc");
223 return (int) ry;
225 /************************ timer, work, DIAG <END> ****************************/
228 /****************************** /proc stuff **********************************/
231 * appldata_mod_vtimer_wrap()
233 * wrapper function for mod_virt_timer(), because smp_call_function_on()
234 * accepts only one parameter.
236 static void __appldata_mod_vtimer_wrap(void *p) {
237 struct {
238 struct vtimer_list *timer;
239 u64 expires;
240 } *args = p;
241 mod_virt_timer(args->timer, args->expires);
244 #define APPLDATA_ADD_TIMER 0
245 #define APPLDATA_DEL_TIMER 1
246 #define APPLDATA_MOD_TIMER 2
249 * __appldata_vtimer_setup()
251 * Add, delete or modify virtual timers on all online cpus.
252 * The caller needs to get the appldata_timer_lock spinlock.
254 static void
255 __appldata_vtimer_setup(int cmd)
257 u64 per_cpu_interval;
258 int i;
260 switch (cmd) {
261 case APPLDATA_ADD_TIMER:
262 if (appldata_timer_active)
263 break;
264 per_cpu_interval = (u64) (appldata_interval*1000 /
265 num_online_cpus()) * TOD_MICRO;
266 for_each_online_cpu(i) {
267 per_cpu(appldata_timer, i).expires = per_cpu_interval;
268 smp_call_function_on(add_virt_timer_periodic,
269 &per_cpu(appldata_timer, i),
270 0, 1, i);
272 appldata_timer_active = 1;
273 P_INFO("Monitoring timer started.\n");
274 break;
275 case APPLDATA_DEL_TIMER:
276 for_each_online_cpu(i)
277 del_virt_timer(&per_cpu(appldata_timer, i));
278 if (!appldata_timer_active)
279 break;
280 appldata_timer_active = 0;
281 atomic_set(&appldata_expire_count, num_online_cpus());
282 P_INFO("Monitoring timer stopped.\n");
283 break;
284 case APPLDATA_MOD_TIMER:
285 per_cpu_interval = (u64) (appldata_interval*1000 /
286 num_online_cpus()) * TOD_MICRO;
287 if (!appldata_timer_active)
288 break;
289 for_each_online_cpu(i) {
290 struct {
291 struct vtimer_list *timer;
292 u64 expires;
293 } args;
294 args.timer = &per_cpu(appldata_timer, i);
295 args.expires = per_cpu_interval;
296 smp_call_function_on(__appldata_mod_vtimer_wrap,
297 &args, 0, 1, i);
303 * appldata_timer_handler()
305 * Start/Stop timer, show status of timer (0 = not active, 1 = active)
307 static int
308 appldata_timer_handler(ctl_table *ctl, int write, struct file *filp,
309 void __user *buffer, size_t *lenp, loff_t *ppos)
311 int len;
312 char buf[2];
314 if (!*lenp || *ppos) {
315 *lenp = 0;
316 return 0;
318 if (!write) {
319 len = sprintf(buf, appldata_timer_active ? "1\n" : "0\n");
320 if (len > *lenp)
321 len = *lenp;
322 if (copy_to_user(buffer, buf, len))
323 return -EFAULT;
324 goto out;
326 len = *lenp;
327 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len))
328 return -EFAULT;
329 spin_lock(&appldata_timer_lock);
330 if (buf[0] == '1')
331 __appldata_vtimer_setup(APPLDATA_ADD_TIMER);
332 else if (buf[0] == '0')
333 __appldata_vtimer_setup(APPLDATA_DEL_TIMER);
334 spin_unlock(&appldata_timer_lock);
335 out:
336 *lenp = len;
337 *ppos += len;
338 return 0;
342 * appldata_interval_handler()
344 * Set (CPU) timer interval for collection of data (in milliseconds), show
345 * current timer interval.
347 static int
348 appldata_interval_handler(ctl_table *ctl, int write, struct file *filp,
349 void __user *buffer, size_t *lenp, loff_t *ppos)
351 int len, interval;
352 char buf[16];
354 if (!*lenp || *ppos) {
355 *lenp = 0;
356 return 0;
358 if (!write) {
359 len = sprintf(buf, "%i\n", appldata_interval);
360 if (len > *lenp)
361 len = *lenp;
362 if (copy_to_user(buffer, buf, len))
363 return -EFAULT;
364 goto out;
366 len = *lenp;
367 if (copy_from_user(buf, buffer, len > sizeof(buf) ? sizeof(buf) : len)) {
368 return -EFAULT;
370 sscanf(buf, "%i", &interval);
371 if (interval <= 0) {
372 P_ERROR("Timer CPU interval has to be > 0!\n");
373 return -EINVAL;
376 spin_lock(&appldata_timer_lock);
377 appldata_interval = interval;
378 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
379 spin_unlock(&appldata_timer_lock);
381 P_INFO("Monitoring CPU interval set to %u milliseconds.\n",
382 interval);
383 out:
384 *lenp = len;
385 *ppos += len;
386 return 0;
390 * appldata_generic_handler()
392 * Generic start/stop monitoring and DIAG, show status of
393 * monitoring (0 = not in process, 1 = in process)
395 static int
396 appldata_generic_handler(ctl_table *ctl, int write, struct file *filp,
397 void __user *buffer, size_t *lenp, loff_t *ppos)
399 struct appldata_ops *ops = NULL, *tmp_ops;
400 int rc, len, found;
401 char buf[2];
402 struct list_head *lh;
404 found = 0;
405 spin_lock(&appldata_ops_lock);
406 list_for_each(lh, &appldata_ops_list) {
407 tmp_ops = list_entry(lh, struct appldata_ops, list);
408 if (&tmp_ops->ctl_table[2] == ctl) {
409 found = 1;
412 if (!found) {
413 spin_unlock(&appldata_ops_lock);
414 return -ENODEV;
416 ops = ctl->data;
417 if (!try_module_get(ops->owner)) { // protect this function
418 spin_unlock(&appldata_ops_lock);
419 return -ENODEV;
421 spin_unlock(&appldata_ops_lock);
423 if (!*lenp || *ppos) {
424 *lenp = 0;
425 module_put(ops->owner);
426 return 0;
428 if (!write) {
429 len = sprintf(buf, ops->active ? "1\n" : "0\n");
430 if (len > *lenp)
431 len = *lenp;
432 if (copy_to_user(buffer, buf, len)) {
433 module_put(ops->owner);
434 return -EFAULT;
436 goto out;
438 len = *lenp;
439 if (copy_from_user(buf, buffer,
440 len > sizeof(buf) ? sizeof(buf) : len)) {
441 module_put(ops->owner);
442 return -EFAULT;
445 spin_lock(&appldata_ops_lock);
446 if ((buf[0] == '1') && (ops->active == 0)) {
447 // protect work queue callback
448 if (!try_module_get(ops->owner)) {
449 spin_unlock(&appldata_ops_lock);
450 module_put(ops->owner);
451 return -ENODEV;
453 ops->callback(ops->data); // init record
454 rc = appldata_diag(ops->record_nr,
455 APPLDATA_START_INTERVAL_REC,
456 (unsigned long) ops->data, ops->size,
457 ops->mod_lvl);
458 if (rc != 0) {
459 P_ERROR("START DIAG 0xDC for %s failed, "
460 "return code: %d\n", ops->name, rc);
461 module_put(ops->owner);
462 } else {
463 P_INFO("Monitoring %s data enabled, "
464 "DIAG 0xDC started.\n", ops->name);
465 ops->active = 1;
467 } else if ((buf[0] == '0') && (ops->active == 1)) {
468 ops->active = 0;
469 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
470 (unsigned long) ops->data, ops->size,
471 ops->mod_lvl);
472 if (rc != 0) {
473 P_ERROR("STOP DIAG 0xDC for %s failed, "
474 "return code: %d\n", ops->name, rc);
475 } else {
476 P_INFO("Monitoring %s data disabled, "
477 "DIAG 0xDC stopped.\n", ops->name);
479 module_put(ops->owner);
481 spin_unlock(&appldata_ops_lock);
482 out:
483 *lenp = len;
484 *ppos += len;
485 module_put(ops->owner);
486 return 0;
489 /*************************** /proc stuff <END> *******************************/
492 /************************* module-ops management *****************************/
494 * appldata_register_ops()
496 * update ops list, register /proc/sys entries
498 int appldata_register_ops(struct appldata_ops *ops)
500 struct list_head *lh;
501 struct appldata_ops *tmp_ops;
502 int i;
504 i = 0;
506 if ((ops->size > APPLDATA_MAX_REC_SIZE) ||
507 (ops->size < 0)){
508 P_ERROR("Invalid size of %s record = %i, maximum = %i!\n",
509 ops->name, ops->size, APPLDATA_MAX_REC_SIZE);
510 return -ENOMEM;
512 if ((ops->ctl_nr == CTL_APPLDATA) ||
513 (ops->ctl_nr == CTL_APPLDATA_TIMER) ||
514 (ops->ctl_nr == CTL_APPLDATA_INTERVAL)) {
515 P_ERROR("ctl_nr %i already in use!\n", ops->ctl_nr);
516 return -EBUSY;
518 ops->ctl_table = kzalloc(4*sizeof(struct ctl_table), GFP_KERNEL);
519 if (ops->ctl_table == NULL) {
520 P_ERROR("Not enough memory for %s ctl_table!\n", ops->name);
521 return -ENOMEM;
524 spin_lock(&appldata_ops_lock);
525 list_for_each(lh, &appldata_ops_list) {
526 tmp_ops = list_entry(lh, struct appldata_ops, list);
527 P_DEBUG("register_ops loop: %i) name = %s, ctl = %i\n",
528 ++i, tmp_ops->name, tmp_ops->ctl_nr);
529 P_DEBUG("Comparing %s (ctl %i) with %s (ctl %i)\n",
530 tmp_ops->name, tmp_ops->ctl_nr, ops->name,
531 ops->ctl_nr);
532 if (strncmp(tmp_ops->name, ops->name,
533 APPLDATA_PROC_NAME_LENGTH) == 0) {
534 P_ERROR("Name \"%s\" already registered!\n", ops->name);
535 kfree(ops->ctl_table);
536 spin_unlock(&appldata_ops_lock);
537 return -EBUSY;
539 if (tmp_ops->ctl_nr == ops->ctl_nr) {
540 P_ERROR("ctl_nr %i already registered!\n", ops->ctl_nr);
541 kfree(ops->ctl_table);
542 spin_unlock(&appldata_ops_lock);
543 return -EBUSY;
546 list_add(&ops->list, &appldata_ops_list);
547 spin_unlock(&appldata_ops_lock);
549 ops->ctl_table[0].ctl_name = CTL_APPLDATA;
550 ops->ctl_table[0].procname = appldata_proc_name;
551 ops->ctl_table[0].maxlen = 0;
552 ops->ctl_table[0].mode = S_IRUGO | S_IXUGO;
553 ops->ctl_table[0].child = &ops->ctl_table[2];
555 ops->ctl_table[1].ctl_name = 0;
557 ops->ctl_table[2].ctl_name = ops->ctl_nr;
558 ops->ctl_table[2].procname = ops->name;
559 ops->ctl_table[2].mode = S_IRUGO | S_IWUSR;
560 ops->ctl_table[2].proc_handler = appldata_generic_handler;
561 ops->ctl_table[2].data = ops;
563 ops->ctl_table[3].ctl_name = 0;
565 ops->sysctl_header = register_sysctl_table(ops->ctl_table,1);
567 P_INFO("%s-ops registered!\n", ops->name);
568 return 0;
572 * appldata_unregister_ops()
574 * update ops list, unregister /proc entries, stop DIAG if necessary
576 void appldata_unregister_ops(struct appldata_ops *ops)
578 void *table;
579 spin_lock(&appldata_ops_lock);
580 list_del(&ops->list);
581 /* at that point any incoming access will fail */
582 table = ops->ctl_table;
583 ops->ctl_table = NULL;
584 spin_unlock(&appldata_ops_lock);
585 unregister_sysctl_table(ops->sysctl_header);
586 kfree(table);
587 P_INFO("%s-ops unregistered!\n", ops->name);
589 /********************** module-ops management <END> **************************/
592 /******************************* init / exit *********************************/
594 static void
595 appldata_online_cpu(int cpu)
597 init_virt_timer(&per_cpu(appldata_timer, cpu));
598 per_cpu(appldata_timer, cpu).function = appldata_timer_function;
599 per_cpu(appldata_timer, cpu).data = (unsigned long)
600 &appldata_work;
601 atomic_inc(&appldata_expire_count);
602 spin_lock(&appldata_timer_lock);
603 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
604 spin_unlock(&appldata_timer_lock);
607 static void
608 appldata_offline_cpu(int cpu)
610 del_virt_timer(&per_cpu(appldata_timer, cpu));
611 if (atomic_dec_and_test(&appldata_expire_count)) {
612 atomic_set(&appldata_expire_count, num_online_cpus());
613 queue_work(appldata_wq, &appldata_work);
615 spin_lock(&appldata_timer_lock);
616 __appldata_vtimer_setup(APPLDATA_MOD_TIMER);
617 spin_unlock(&appldata_timer_lock);
620 static int __cpuinit
621 appldata_cpu_notify(struct notifier_block *self,
622 unsigned long action, void *hcpu)
624 switch (action) {
625 case CPU_ONLINE:
626 appldata_online_cpu((long) hcpu);
627 break;
628 #ifdef CONFIG_HOTPLUG_CPU
629 case CPU_DEAD:
630 appldata_offline_cpu((long) hcpu);
631 break;
632 #endif
633 default:
634 break;
636 return NOTIFY_OK;
639 static struct notifier_block __devinitdata appldata_nb = {
640 .notifier_call = appldata_cpu_notify,
644 * appldata_init()
646 * init timer, register /proc entries
648 static int __init appldata_init(void)
650 int i;
652 P_DEBUG("sizeof(parameter_list) = %lu\n",
653 sizeof(struct appldata_parameter_list));
655 appldata_wq = create_singlethread_workqueue("appldata");
656 if (!appldata_wq) {
657 P_ERROR("Could not create work queue\n");
658 return -ENOMEM;
661 for_each_online_cpu(i)
662 appldata_online_cpu(i);
664 /* Register cpu hotplug notifier */
665 register_cpu_notifier(&appldata_nb);
667 appldata_sysctl_header = register_sysctl_table(appldata_dir_table, 1);
668 #ifdef MODULE
669 appldata_dir_table[0].de->owner = THIS_MODULE;
670 appldata_table[0].de->owner = THIS_MODULE;
671 appldata_table[1].de->owner = THIS_MODULE;
672 #endif
674 P_DEBUG("Base interface initialized.\n");
675 return 0;
679 * appldata_exit()
681 * stop timer, unregister /proc entries
683 static void __exit appldata_exit(void)
685 struct list_head *lh;
686 struct appldata_ops *ops;
687 int rc, i;
689 P_DEBUG("Unloading module ...\n");
691 * ops list should be empty, but just in case something went wrong...
693 spin_lock(&appldata_ops_lock);
694 list_for_each(lh, &appldata_ops_list) {
695 ops = list_entry(lh, struct appldata_ops, list);
696 rc = appldata_diag(ops->record_nr, APPLDATA_STOP_REC,
697 (unsigned long) ops->data, ops->size,
698 ops->mod_lvl);
699 if (rc != 0) {
700 P_ERROR("STOP DIAG 0xDC for %s failed, "
701 "return code: %d\n", ops->name, rc);
704 spin_unlock(&appldata_ops_lock);
706 for_each_online_cpu(i)
707 appldata_offline_cpu(i);
709 appldata_timer_active = 0;
711 unregister_sysctl_table(appldata_sysctl_header);
713 destroy_workqueue(appldata_wq);
714 P_DEBUG("... module unloaded!\n");
716 /**************************** init / exit <END> ******************************/
719 module_init(appldata_init);
720 module_exit(appldata_exit);
721 MODULE_LICENSE("GPL");
722 MODULE_AUTHOR("Gerald Schaefer");
723 MODULE_DESCRIPTION("Linux-VM Monitor Stream, base infrastructure");
725 EXPORT_SYMBOL_GPL(appldata_register_ops);
726 EXPORT_SYMBOL_GPL(appldata_unregister_ops);
727 EXPORT_SYMBOL_GPL(appldata_diag);
729 #ifdef MODULE
731 * Kernel symbols needed by appldata_mem and appldata_os modules.
732 * However, if this file is compiled as a module (for testing only), these
733 * symbols are not exported. In this case, we define them locally and export
734 * those.
736 void si_swapinfo(struct sysinfo *val)
738 val->freeswap = -1ul;
739 val->totalswap = -1ul;
742 unsigned long avenrun[3] = {-1 - FIXED_1/200, -1 - FIXED_1/200,
743 -1 - FIXED_1/200};
744 int nr_threads = -1;
746 void get_full_page_state(struct page_state *ps)
748 memset(ps, -1, sizeof(struct page_state));
751 unsigned long nr_running(void)
753 return -1;
756 unsigned long nr_iowait(void)
758 return -1;
761 /*unsigned long nr_context_switches(void)
763 return -1;
765 #endif /* MODULE */
766 EXPORT_SYMBOL_GPL(si_swapinfo);
767 EXPORT_SYMBOL_GPL(nr_threads);
768 EXPORT_SYMBOL_GPL(nr_running);
769 EXPORT_SYMBOL_GPL(nr_iowait);
770 //EXPORT_SYMBOL_GPL(nr_context_switches);