summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2010-12-21 11:35:28 +0100
committerTobias Klauser <tklauser@distanz.ch>2010-12-21 11:35:28 +0100
commit5da40cbf6daae35ad4948476bac7827f81ee7904 (patch)
tree0474f9a04f593f1090b6f9ffff5c61885d425618
parenta5fd477ceb5f5c130a39d0415b3ea82c697b131a (diff)
Correct size scaling functions
-rw-r--r--nios2sim-ng.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/nios2sim-ng.h b/nios2sim-ng.h
index 9be1d0d..40cb2dd 100644
--- a/nios2sim-ng.h
+++ b/nios2sim-ng.h
@@ -26,15 +26,17 @@ extern bool verbose;
do { if (verbose) fprintf(stdout, fmt, ##args); } while (0)
#ifdef DEBUG
# define dbg(fmt, args...) fprintf(stdout, fmt, ##args)
+# define trace(fmt, args...) dbg("%s: " fmt, __func__, ##args)
#else
# define dbg(fmt, args...)
+# define trace(fmt, args...)
#endif
static inline size_t size_scale(size_t size)
{
- if (size > 1024 * 1024)
+ if (size >= 1024 * 1024)
size /= 1024 * 1024;
- else if (size > 1024)
+ else if (size >= 1024)
size /= 1024;
return size;
@@ -44,9 +46,9 @@ static inline char *size_postfix(size_t size)
{
char *ret = "";
- if (size > 1024 * 1024)
+ if (size >= 1024 * 1024)
ret = "M";
- else if (size > 1024)
+ else if (size >= 1024)
ret = "K";
return ret;
Deacon1-0/+3 2011-09-20ARM: pm: no need to save/restore context ID registerRussell King1-17/+16 2011-09-20ARM: pm: only use preallocated page table during resumeRussell King1-15/+16 2011-09-20ARM: pm: preallocate a page table for suspend/resumeRussell King1-6/+0 2011-08-15ARM: 7015/1: ARM errata: Possible cache data corruption with hit-under-miss e...Catalin Marinas1-0/+16 2011-07-21ARM: Fix build errors caused by adding generic macrosRussell King1-3/+0 2011-07-07ARM: proc: add definition of cpu_reset for ARMv6 and ARMv7 coresWill Deacon1-0/+5 2011-07-07ARM: mm: proc-v6: Use the new processor struct macrosDave Martin1-29/+5 2011-05-26ARM: 6942/1: mm: make TTBR1 always point to swapper_pg_dir on ARMv6/7Catalin Marinas1-1/+3 2011-05-03ARM: PJ4: remove the ARMv6 compatible cache method entriesNicolas Pitre1-34/+0 2011-04-13Merge branch 'fix' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/px...Russell King1-2/+2 2011-04-02ARM: Make consolidated PM sleep code depend on PM_SLEEPRussell King1-1/+1 2011-03-31Fix common misspellingsLucas De Marchi1-2/+2 2011-02-22ARM: pm: add generic CPU suspend/resume supportRussell King1-0/+50 2010-10-18Merge branch 'hotplug' into develRussell King1-1/+5 2010-10-08ARM: hotplug cpu: Keep processor information, startup code & __lookup_process...Russell King1-1/+5 2010-10-04ARM: Allow SMP kernels to boot on UP systemsRussell King1-15/+28 2010-07-27ARM: Factor out common code from cpu_proc_fin()Russell King1-4/+1 2010-07-09ARM: 6207/1: Replace CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6Tony Lindgren1-2/+3