summaryrefslogtreecommitdiffstats
path: root/fs/proc
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
parent7406b0a326f2d70ade2671c37d1beef62249db97 (diff)
Merge with 2.3.99-pre6.
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/array.c10
-rw-r--r--fs/proc/base.c5
-rw-r--r--fs/proc/proc_misc.c38
-rw-r--r--fs/proc/proc_tty.c4
4 files changed, 44 insertions, 13 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 63a1d5828..6feabd36d 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -52,6 +52,7 @@
* : base.c too.
*/
+#include <linux/config.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/sched.h>
@@ -269,6 +270,9 @@ int proc_pid_status(struct task_struct *task, char * buffer)
{
char * orig = buffer;
struct mm_struct *mm = task->mm;
+#if defined(CONFIG_ARCH_S390)
+ int line,len;
+#endif
buffer = task_name(task, buffer);
buffer = task_state(task, buffer);
@@ -276,6 +280,10 @@ int proc_pid_status(struct task_struct *task, char * buffer)
buffer = task_mem(mm, buffer);
buffer = task_sig(task, buffer);
buffer = task_cap(task, buffer);
+#if defined(CONFIG_ARCH_S390)
+ for(line=0;(len=sprintf_regs(line,buffer,task,NULL,NULL))!=0;line++)
+ buffer+=len;
+#endif
return buffer - orig;
}
@@ -637,7 +645,7 @@ out:
return retval;
}
-#ifdef __SMP__
+#ifdef CONFIG_SMP
int proc_pid_cpu(struct task_struct *task, char * buffer)
{
int i, len;
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 63bd4459b..ae3c36122 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -15,6 +15,7 @@
#include <asm/uaccess.h>
+#include <linux/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/proc_fs.h>
@@ -474,7 +475,7 @@ static struct pid_entry base_stuff[] = {
E(PROC_PID_CMDLINE, "cmdline", S_IFREG|S_IRUGO),
E(PROC_PID_STAT, "stat", S_IFREG|S_IRUGO),
E(PROC_PID_STATM, "statm", S_IFREG|S_IRUGO),
-#ifdef __SMP__
+#ifdef CONFIG_SMP
E(PROC_PID_CPU, "cpu", S_IFREG|S_IRUGO),
#endif
E(PROC_PID_MAPS, "maps", S_IFREG|S_IRUGO),
@@ -800,7 +801,7 @@ static struct dentry *proc_base_lookup(struct inode *dir, struct dentry *dentry)
case PROC_PID_MAPS:
inode->i_fop = &proc_maps_operations;
break;
-#ifdef __SMP__
+#ifdef CONFIG_SMP
case PROC_PID_CPU:
inode->i_fop = &proc_info_file_operations;
inode->u.proc_i.op.proc_read = proc_pid_cpu;
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},
diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c
index e241c938e..1d55d4989 100644
--- a/fs/proc/proc_tty.c
+++ b/fs/proc/proc_tty.c
@@ -93,7 +93,7 @@ static int tty_drivers_read_proc(char *page, char **start, off_t off,
*eof = 1;
if (off >= len+begin)
return 0;
- *start = page + (begin-off);
+ *start = page + (off-begin);
return ((count < begin+len-off) ? count : begin+len-off);
}
@@ -123,7 +123,7 @@ static int tty_ldiscs_read_proc(char *page, char **start, off_t off,
*eof = 1;
if (off >= len+begin)
return 0;
- *start = page + (begin-off);
+ *start = page + (off-begin);
return ((count < begin+len-off) ? count : begin+len-off);
}