Beispiel #1
0
void ccci_aed(unsigned int dump_flag, char *aed_str)
{
	#define AED_STR_LEN		(512)
	int *ex_log_addr = NULL;
	int ex_log_len = 0;
	int *md_img_addr = NULL;
	int md_img_len = 0;
	int info_str_len = 0;
	char buff[AED_STR_LEN];

	info_str_len = strlen(aed_str);
	info_str_len += strlen(image_buf);

	if(info_str_len > AED_STR_LEN){
		CCCI_MSG_INF("ctl", "Info string is too long, num:%d\n", info_str_len);
		buff[AED_STR_LEN-1] = '\0'; // Cut string length to AED_STR_LEN
	}

	snprintf(buff, AED_STR_LEN, "%s%s", aed_str, image_buf);

	if(dump_flag & CCCI_AED_DUMP_EX_MEM){
		ex_log_addr = md_ex_log;
		ex_log_len = MD_EX_LOG_SIZE;
	}
	if(dump_flag & CCCI_AED_DUMP_MD_IMG_MEM){
		md_img_addr = md_img_vir;
		md_img_len = MD_IMG_DUMP_SIZE;
	}

	#ifdef CONFIG_MTK_AEE_FEATURE
	aed_md_exception2(ex_log_addr, ex_log_len, md_img_addr, md_img_len, buff);
	#endif
}
static int proc_read_generate_ee(char *page, char **start,
				 off_t off, int count,
				 int *eof, void *data)
{
#define TEST_PHY_SIZE 0x10000

	int log[16], i;
	char *ptr;

	memset(log, 0, sizeof(log));

	ptr = kmalloc(TEST_PHY_SIZE, GFP_KERNEL);
	for (i = 0; i < TEST_PHY_SIZE; i++) {
		ptr[i] = (i % 26) + 'A';
	}
	aed_md_exception2(log, 0, (int *)ptr, TEST_PHY_SIZE, __func__);
	kfree(ptr);

	return sprintf(page, "ME Generated\n");
}