summaryrefslogtreecommitdiffstats
path: root/fs/proc/proc_misc.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-04-28 01:09:25 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-04-28 01:09:25 +0000
commitb9ba7aeb165cffecdffb60aec8c3fa8d590d9ca9 (patch)
tree42d07b0c7246ae2536a702e7c5de9e2732341116 /fs/proc/proc_misc.c
parent7406b0a326f2d70ade2671c37d1beef62249db97 (diff)
Merge with 2.3.99-pre6.
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r--fs/proc/proc_misc.c38
1 files changed, 30 insertions, 8 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index b16b9a9df..c1f126039 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -30,6 +30,7 @@
#include <linux/signal.h>
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
@@ -284,14 +285,16 @@ static int kstat_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
int i, len;
- unsigned sum = 0;
extern unsigned long total_forks;
unsigned long jif = HZ_TO_STD(jiffies);
+#if !defined(CONFIG_ARCH_S390)
+ unsigned sum = 0;
for (i = 0 ; i < NR_IRQS ; i++)
sum += kstat_irqs(i);
+#endif
-#ifdef __SMP__
+#ifdef CONFIG_SMP
len = sprintf(page,
"cpu %u %u %u %lu\n",
kstat.cpu_user,
@@ -314,9 +317,13 @@ static int kstat_read_proc(char *page, char **start, off_t off,
"disk_rblk %u %u %u %u\n"
"disk_wblk %u %u %u %u\n"
"page %u %u\n"
- "swap %u %u\n"
+#if !defined(CONFIG_ARCH_S390)
+ "swap %u %u\n"
"intr %u",
#else
+ "swap %u %u\n",
+#endif
+#else
len = sprintf(page,
"cpu %u %u %u %lu\n"
"disk %u %u %u %u\n"
@@ -325,8 +332,12 @@ static int kstat_read_proc(char *page, char **start, off_t off,
"disk_rblk %u %u %u %u\n"
"disk_wblk %u %u %u %u\n"
"page %u %u\n"
- "swap %u %u\n"
+#if !defined(CONFIG_ARCH_S390)
+ "swap %u %u\n"
"intr %u",
+#else
+ "swap %u %u\n"
+#endif
HZ_TO_STD(kstat.cpu_user),
HZ_TO_STD(kstat.cpu_nice),
HZ_TO_STD(kstat.cpu_system),
@@ -346,10 +357,14 @@ static int kstat_read_proc(char *page, char **start, off_t off,
kstat.pgpgin,
kstat.pgpgout,
kstat.pswpin,
+#if !defined(CONFIG_ARCH_S390)
kstat.pswpout,
sum);
- for (i = 0 ; i < NR_IRQS ; i++)
- len += sprintf(page + len, " %u", kstat_irqs(i));
+ for (i = 0 ; i < NR_IRQS ; i++)
+ len += sprintf(page + len, " %u", kstat_irqs(i));
+#else
+ kstat.pswpout);
+#endif
len += sprintf(page + len,
"\nctxt %u\n"
"btime %lu\n"
@@ -389,6 +404,7 @@ static int partitions_read_proc(char *page, char **start, off_t off,
return len;
}
+#if !defined(CONFIG_ARCH_S390)
static int interrupts_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
@@ -400,6 +416,7 @@ static int interrupts_read_proc(char *page, char **start, off_t off,
if (len<0) len = 0;
return len;
}
+#endif
static int filesystems_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
@@ -470,7 +487,10 @@ static int ds1286_read_proc(char *page, char **start, off_t off,
static int locks_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- int len = get_locks_status(page, start, off, count);
+ int len;
+ lock_kernel();
+ len = get_locks_status(page, start, off, count);
+ unlock_kernel();
if (len < count) *eof = 1;
return len;
}
@@ -575,7 +595,7 @@ static ssize_t read_profile(struct file *file, char *buf,
static ssize_t write_profile(struct file * file, const char * buf,
size_t count, loff_t *ppos)
{
-#ifdef __SMP__
+#ifdef CONFIG_SMP
extern int setup_profiling_timer (unsigned int multiplier);
if (count==sizeof(int)) {
@@ -628,7 +648,9 @@ void __init proc_misc_init(void)
{"stat", kstat_read_proc},
{"devices", devices_read_proc},
{"partitions", partitions_read_proc},
+#if !defined(CONFIG_ARCH_S390)
{"interrupts", interrupts_read_proc},
+#endif
{"filesystems", filesystems_read_proc},
{"dma", dma_read_proc},
{"ioports", ioports_read_proc},