/* 3) cache creation/removal */
char name[CACHE_NAMELEN];
struct doublelink next;
#ifdef CONFIG_SMP
/* 4) per-cpu data */
cpucache_t *cpudata[NR_CPUS];
#endif
#if STATS
unsigned long num_active;
unsigned long num_allocations;
unsigned long high_mark;
unsigned long grown;
unsigned long reaped;
unsigned long errors;
#ifdef CONFIG_SMP
atomic_t allochit;
atomic_t allocmiss;
atomic_t freehit;
atomic_t freemiss;
#endif
#endif
} ;
struct vma_temp {
unsigned int next;
unsigned int prev;
} vma_task;
struct mypage {
unsigned int list_next;
unsigned int list_prev;
unsigned int mapping;
unsigned int index;
unsigned int next_hash;
unsigned int count;
unsigned long flags;
unsigned int lru_next;
unsigned int lru_prev;
unsigned int pte_union;
unsigned int direct_union;
unsigned char age;
// unsigned int pprev_hash;
unsigned int buffer_head;
unsigned int virtuall;
} memmap;
union swap_header {
struct
{
char reserved[PAGE_SIZE - 10];
char magic[10]; /* SWAP-SPACE or SWAPSPACE2 */
} magic;
struct
{
char bootbits[1024]; /* Space for disklabel etc. */
unsigned int version;
unsigned int last_page;
unsigned int nr_badpages;
unsigned int padding[125];
unsigned int badpages[1];
} info;
};
//listCache.c
#include "idetect.h"
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#define KERN 0xc0000000
#define PAGES_NR 16384 //total number of page frames in node
#define MEMMAP 0xc1000030 //the address of the global mem_map array
#define MEMIMG "/dev/mem"
/*
程序作用是查找kmem_cache_t结构,输出其名字。linux2.4下适用。
*/
const char * pfenum;
void print_usage (FILE* stream, int exit_code){
fprintf(stream, "Usage: %s options \n", pfenum);
fprintf(stream,
" -h --help Display this usage information\n"
" -a --all Display files used in the past\n");
exit (exit_code);
}