From 9d40ac5867b9aefe0722bc1f110b965ff294d30d Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 15 Nov 2014 10:00:36 +0800 Subject: add via modify part source code for wm8880 4.4 kitkat --- ANDROID_3.4.5/fs/proc/meminfo.c | 27 ++++++++++++++++++++++++--- ANDROID_3.4.5/fs/proc/version.c | 6 ++++++ 2 files changed, 30 insertions(+), 3 deletions(-) (limited to 'ANDROID_3.4.5/fs/proc') diff --git a/ANDROID_3.4.5/fs/proc/meminfo.c b/ANDROID_3.4.5/fs/proc/meminfo.c index 80e4645f..3fdbefd4 100644 --- a/ANDROID_3.4.5/fs/proc/meminfo.c +++ b/ANDROID_3.4.5/fs/proc/meminfo.c @@ -15,6 +15,8 @@ #include #include "internal.h" +extern int wmt_getsyspara(char *varname, unsigned char *varval, int *varlen); + void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) { } @@ -28,13 +30,32 @@ static int meminfo_proc_show(struct seq_file *m, void *v) long cached; unsigned long pages[NR_LRU_LISTS]; int lru; - + unsigned long misc_mem_total,misc_mem_free,m_mem_total,m_mem_free; + char param_name[] = "wmt.ram.fake_size"; + int ret = -1; + unsigned char buf[80]; + unsigned int paramlen= 80; + unsigned char colon; /* * display in kilobytes. */ #define K(x) ((x) << (PAGE_SHIFT - 10)) si_meminfo(&i); si_swapinfo(&i); + + ret = wmt_getsyspara(param_name, buf, ¶mlen); + if(ret == 0) + { + sscanf(buf,"%8lu%c%8lu", &misc_mem_total,&colon,&misc_mem_free); + m_mem_total = K(i.totalram)+misc_mem_total*1024; + m_mem_free = K(i.freeram)+misc_mem_free*1024; + } + else + { + m_mem_total = K(i.totalram); + m_mem_free = K(i.freeram); + } + committed = percpu_counter_read_positive(&vm_committed_as); allowed = ((totalram_pages - hugetlb_total_pages()) * sysctl_overcommit_ratio / 100) + total_swap_pages; @@ -105,8 +126,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v) "AnonHugePages: %8lu kB\n" #endif , - K(i.totalram), - K(i.freeram), + m_mem_total, + m_mem_free, K(i.bufferram), K(cached), K(total_swapcache_pages), diff --git a/ANDROID_3.4.5/fs/proc/version.c b/ANDROID_3.4.5/fs/proc/version.c index 76817a60..8d181cdc 100644 --- a/ANDROID_3.4.5/fs/proc/version.c +++ b/ANDROID_3.4.5/fs/proc/version.c @@ -4,13 +4,19 @@ #include #include #include +#include static int version_proc_show(struct seq_file *m, void *v) { +#if 1 /* add to show kernel version */ + seq_printf(m, "%s\n",linux_banner); + seq_printf(m, "Kernel %s (%s - %s)\n",CONFIG_KERNEL_VERSION,__DATE__,__TIME__); +#else seq_printf(m, linux_proc_banner, utsname()->sysname, utsname()->release, utsname()->version); +#endif return 0; } -- cgit