Example #1
0
		*(ptr + i) = ptr[i + 2 * COLUMNS];
	}
	for (i = COLUMNS * (LINES - 1) * 2; i < COLUMNS * (LINES) * 2; i++) /* clear the last line */
	{
		*(g_video_ram + i) = 0;
		*(ptr + i) = 0;
	}
	refresh_screen();
}

unsigned char g_dmesg[MAX_DMESG_LOG+2];
unsigned long g_dmesg_index = 0;

extern int dr_serialWrite( char *buf , int len);
/* Put the character C on the screen.  */
static spinlock_t putchar_lock = SPIN_LOCK_UNLOCKED("putchar");

static int init_log_file_done=0;
static struct file *log_fp;
static int dmesg_file_index=0;

int init_log_file(unsigned long unused){
	int ret=0;

	if (init_log_file_done == 0) {
		log_fp = (struct file *) fs_open((unsigned char *) "jiny.log", O_APPEND, O_RDWR);
		if (log_fp == 0)
			return 0;
		init_log_file_done = 1;
		ret=fs_write(log_fp, g_dmesg, g_dmesg_index);
		dmesg_file_index = g_dmesg_index;
Example #2
0
}
#define WARN_ON(x)
#define MM_BUG(x) stat_errors[x]++;
unsigned long err_arg1=0;
unsigned long err_arg2=0;

/************************   Start of any global variables should be declaired here */
static unsigned long dummy_start_uninitilized_var; /* some unitialized variable */
/* the list of all allocated objects */
static struct prio_tree_root object_tree_root;
static LIST_HEAD(object_list);
/* the list of gray-colored objects (see color_gray comment below) */
static LIST_HEAD(gray_list);


static spinlock_t kmemleak_lock = SPIN_LOCK_UNLOCKED("memleak");


/* set if tracing memory operations is enabled */
static atomic_t kmemleak_enabled = ATOMIC_INIT(0);
/* set in the late_initcall if there were no errors */


/* set if a fatal kmemleak error has occurred */
static atomic_t kmemleak_error = ATOMIC_INIT(0);
#define MAX_ERRORS 10
static int stat_obj_count,stat_errors[MAX_ERRORS];

#define MAX_TYPES 500
static struct {
	int count;
Example #3
0
// #define NR_MEM_LISTS 8
#define NR_MEM_LISTS 11 /* change for getting 2M pages */
#define memory_head(x) ((struct page *)(x))

/* The start of this MUST match the start of "struct page" */
struct free_mem_area_struct {
	struct page *next;
	struct page *prev;
	unsigned int *map;
	unsigned int stat_count; /* jana Added */
};
page_struct_t *g_mem_map = NULL;
unsigned long g_max_mapnr=0;
int g_nr_free_pages = 0;
static struct free_mem_area_struct free_mem_area[NR_MEM_LISTS];
static spinlock_t free_area_lock = SPIN_LOCK_UNLOCKED("memory_freearea");

extern unsigned long g_phy_mem_size;

/*********************** local function *******************************/

static inline void init_mem_queue(struct free_mem_area_struct * head)
{
	head->next = memory_head(head);
	head->prev = memory_head(head);
	head->stat_count=0;
}

static inline void add_mem_queue(struct free_mem_area_struct * head, struct page * entry)
{
	struct page * next = head->next;