Subject: Re: format_bytes() horrior, or where has my memory gone.
To: None <lukem@cs.rmit.edu.au, port-mips@netbsd.org>
From: Toru Nishimura <nisimura@itc.aist-nara.ac.jp>
List: port-mips
Date: 06/02/1999 14:16:12
Hi, Luke.  I have a question about format_bytes().
What's the expected output when a value 41943040 is supplied?  Like this?

	total memory = 40960 K
	avail memory = 36088 K

rather than like;

	real mem  = 41943040
	avail mem = 34418688

If so, your format_bytes() is not guilty.  snprintf produces bogus
output for "%qd" when the coresponding (long long) is supplied as its
4th argument. 

I guess MIPS varargs mistakenly takes a3 register value even when
(long long) values aligned to onstack storage 16(sp) and 20(sp).

Tohru Nishimura
Nara Institute of Science and Technology