diff options
author | Kevin | 2014-11-15 10:00:36 +0800 |
---|---|---|
committer | Kevin | 2014-11-15 10:00:36 +0800 |
commit | 9d40ac5867b9aefe0722bc1f110b965ff294d30d (patch) | |
tree | de942df665fac4bac0d9cb7ae86910fe937b0c1a /ANDROID_3.4.5/fs/proc | |
parent | 392e8802486cb573b916e746010e141a75f507e6 (diff) | |
download | FOSSEE-netbook-kernel-source-9d40ac5867b9aefe0722bc1f110b965ff294d30d.tar.gz FOSSEE-netbook-kernel-source-9d40ac5867b9aefe0722bc1f110b965ff294d30d.tar.bz2 FOSSEE-netbook-kernel-source-9d40ac5867b9aefe0722bc1f110b965ff294d30d.zip |
add via modify part source code for wm8880 4.4 kitkat
Diffstat (limited to 'ANDROID_3.4.5/fs/proc')
-rw-r--r-- | ANDROID_3.4.5/fs/proc/meminfo.c | 27 | ||||
-rw-r--r-- | ANDROID_3.4.5/fs/proc/version.c | 6 |
2 files changed, 30 insertions, 3 deletions
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 <asm/pgtable.h> #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 <linux/proc_fs.h> #include <linux/seq_file.h> #include <linux/utsname.h> +#include <asm/mach/version.h> 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; } |