Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Ralf Baechle <ralf@linux-mips.org>
To: Andrew Clausen <clausen@gnu.org>
Cc: Trevor Woerner <mips081@vtnet.ca>, linux-mips@linux-mips.org
Subject: Re: 64-bit sysinfo
Date: Thu, 12 Jun 2003 13:44:57 +0200	[thread overview]
Message-ID: <20030612114457.GB8390@linux-mips.org> (raw)
In-Reply-To: <20030612213625.GF480@gnu.org>

On Thu, Jun 12, 2003 at 09:36:25PM +0000, Andrew Clausen wrote:

> On Thu, Jun 12, 2003 at 06:59:26AM -0400, Trevor Woerner wrote:
> > I'm crossing my fingers and hoping that my solution is to build all 
> > user-space apps with some switch that will set the sizes of data types 
> > to be the same between user space and kernel space. Does some such 
> > option exist?
> 
> No, the kernel should provide 32 bit values.  This is a bug.
> 
> I *thought* I sent a patch for this a while ago... I'm not sure now.

You sent it and I applied your patch on February 21.  Old mail appended
below again for Trevor's reference.  It doesn't explain why he sees
64-bit values though.  Trevor, what kernel exactly are you running?

  Ralf

Date:	Thu, 20 Feb 2003 11:26:55 +1100
From:	Andrew Clausen <clausen@melbourne.sgi.com>
To:	Linux-MIPS <linux-mips@linux-mips.org>
Cc:	ralf@linux-mips.org, linux-ia64@linuxia64.org
Subject: [patch] sys32_sysinfo broken on mips64 and ia64
Message-ID: <20030220002655.GE915@pureza.melbourne.sgi.com>

Hi all,

The sys32_sysinfo() calls are currently using an old version of
"struct sysinfo32", in both the mips64 and ia64 ports.

busybox's init can't cope with the bogus output on my Origin 200,
so this bug prevents the Debian installer from bootstrapping.

This is the mips64 version of the patch.  A very similar patch
could be constructed for ia64... it's very obvious what to do,
so I'll leave it to you ia64 people :)

Cheers,
Andrew


diff -u -r1.42.2.23 linux32.c
--- arch/mips64/kernel/linux32.c	23 Jan 2003 02:12:59 -0000	1.42.2.23
+++ arch/mips64/kernel/linux32.c	20 Feb 2003 00:05:41 -0000
@@ -672,8 +672,11 @@
         u32 bufferram;
         u32 totalswap;
         u32 freeswap;
-        unsigned short procs;
-        char _f[22];
+        u16 procs;
+	u32 totalhigh;
+	u32 freehigh;
+	u32 mem_unit;
+	char _f[8];
 };
 
 extern asmlinkage int sys_sysinfo(struct sysinfo *info);
@@ -698,6 +701,9 @@
 	err |= __put_user (s.totalswap, &info->totalswap);
 	err |= __put_user (s.freeswap, &info->freeswap);
 	err |= __put_user (s.procs, &info->procs);
+	err |= __put_user (s.totalhigh, &info->totalhigh);
+	err |= __put_user (s.freehigh, &info->freehigh);
+	err |= __put_user (s.mem_unit, &info->mem_unit);
 	if (err)
 		return -EFAULT;
 	return ret;

  reply	other threads:[~2003-06-12 11:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-12 10:59 64-bit sysinfo Trevor Woerner
2003-06-12 11:35 ` Ralf Baechle
2003-06-12 12:07   ` Trevor Woerner
2003-06-12 12:27     ` Ralf Baechle
2003-06-12 21:36 ` Andrew Clausen
2003-06-12 11:44   ` Ralf Baechle [this message]
2003-06-12 12:02     ` Trevor Woerner
  -- strict thread matches above, loose matches on Subject: below --
2003-06-12 11:19 Tor Arntsen
2003-06-12 12:04 ` Trevor Woerner
2003-06-12 12:04   ` Trevor Woerner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030612114457.GB8390@linux-mips.org \
    --to=ralf@linux-mips.org \
    --cc=clausen@gnu.org \
    --cc=linux-mips@linux-mips.org \
    --cc=mips081@vtnet.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox