亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? arm9tdmi.c

?? linux下的jtag仿真器程序
?? C
字號:
/* * target/arm9tdmi/arm9tdmi.c: implements arm9tdmi target * * Copyright (C) 2003 2004, Rongkai zhan <zhanrk@163.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *//* $Id: arm9tdmi.c,v 1.3 2004/10/17 13:54:32 zhanrk Exp $ */#include <unistd.h>#include <stdio.h>#include <stdlib.h>#include "jtager.h"#include "jtag.h"#include "target.h"extern core_register_t arm9tdmi_regs[];extern ice_register_t  arm9tdmi_ice_regs[];target_t arm9tdmi_target = {	.type		= TARGET_TYPE_ARM9TDMI,	.mode		= TARGET_MODE_ARM,	.status 	= TARGET_STATUS_RUNNING,	.halt_reason 	= TARGET_HALTED_NONE,		/*	 * These two pointers are initialized in the function arm9tdmi_setup()	 */	.regs = &arm9tdmi_regs[0],	.ice_regs = &arm9tdmi_ice_regs[0],	/* BYPASS register always output 0 */	.bypass 	= {ARM9TDMI_BYPASS_REG_BITNR, 0, 0},	.idcode 	= {ARM9TDMI_IDCODE_REG_BITNR, 0, 0},	/* INSTRUCTION register always output b0001 during CAPTURE-DR stage */	.instruction 	= {ARM9TDMI_INSTRUCTION_REG_BITNR, 0xffffffff, 0x01},	/* The scan path select register always output b10000 during CAPTURE-DR stage. */	.scanpath = {ARM9TDMI_SCANPATH_REG_BITNR, 0x0, 0x10}, 		/* scan chains of ARM9TDMI */	.sc_num		= 3, /* scan chain 0, 1, 2 */	.active_sc	= 0,	.sc = {		{"ARM9TDMI CPU core logic", ARM9TDMI_SCANCHAIN0_BITNR, {0, }, {0, }, NULL},		{"ARM9TDMI CPU core debug subset", ARM9TDMI_SCANCHAIN1_BITNR, {0, }, {0, }, NULL},		{"ARM9TDMI EmbeddedICE-RT logic", ARM9TDMI_SCANCHAIN2_BITNR, {0, }, {0, }, NULL}	},	.private = NULL,};/* * arm_halt - Halt the ARM target and make it into the debug mode */int arm9tdmi_halt(void){	u32 status;	int success, retval;	int temp = 0;	if (target->status != TARGET_STATUS_RUNNING) {		printf("The target cpu has been halted!\n");		return 0;	}		/*	 * We halt the target by setting the DBGRQ bit (bit[1]) of the debug	 * control register of ARM9TDMI EmbeddedICE-RT logic. We also set the	 * INTDIS bit (bit[2]) of the ICE debug control register for disabling	 * the interrupt on the target.	 *	 * NOTICE: Do not set DBGACK bit, please. The reason is:	 * When a system-speed access from debug state occurs, the core will	 * temporarily drop out of debug state, so DBGACK might go LOW.	 * But if set the DBGACK bit of the debug control register,	 * the DBGACK signal will always go HIGH.	 */	/* select scan chain 2 -- EmbeddedICE-RT */	retval = jtag_select_scanchain(2);	if (retval)		return retval;	retval = jtag_write_ireg(JTAG_INTEST); /* internal test mode */	if (retval)		return retval;		/* set DBGRQ bit and disable interrupts */	retval = arm9tdmi_ice_write(ARM9TDMI_ICE_DBGCTL, 0x3);	if (retval)		return retval;	/* After sending DBGRQ, Run-Test/Idle state must be entered: */	retval = jtag_write_ireg(JTAG_RESTART);	if (retval)		return retval;		/* Read debug status register to see whether the DBGACK signal	 * is asserted. If the DBGACK siganl goes HIGH, then the target	 * has entered the debug state.	 */	success = 0;	printf("Requesting HALT target ...");	fflush(stdout);		while (temp++ < 10) {		retval = arm9tdmi_ice_read(ARM9TDMI_ICE_DBGSTAT, &status);		if (retval)			return retval;				if (status & 0x01) {			/* success */			success = 1;			break;		}		jtag_write_ireg(JTAG_RESTART);		printf(".");		fflush(stdout);		usleep(100);	}	/* Whatever happens, the DBGRQ bit flag must be cleared */	arm9tdmi_ice_write(ARM9TDMI_ICE_DBGCTL, 0x00);		if (success) {		printf(" [OK]\n");		target->status = TARGET_STATUS_HALTED;		target->halt_reason = TARGET_HALTED_BY_DBGRQ;				/*		 * When the bit[4] of the debug status register of ARM9TDMI		 * EmbeddedICE-RT logic is HIGH, the ARM9TDMI core has		 * entered the debug state from THUMB mode. Otherwise the		 * ARM9TDMI core has entered the debug state from ARM mode.		 */		printf("The target is halted in ");		if (status & 0x10) {			printf("THUMB mode.\n");			target->mode = TARGET_MODE_THUMB;		} else {			printf("ARM mode.\n");			target->mode = TARGET_MODE_ARM;		}		retval = 0;		//retval = arm9tdmi_regs_read();	} else {		/* make the TAP controller into the Run-Test/Idle state */		jtag_write_ireg(JTAG_RESTART);				printf(" [FAILED]\n");			retval = -ERR_TARGET_HALT_FAILED;	}	return retval;} /* end of target_halt() *//* * arm9tdmi_exec_instruction - Execute an instruction on the ARM9TDMI core * 	 		       while in debug state by scan chain 1 * @writein: writein[0] contains the instruction opcode to be executed, *           writein[1] contains the data to be inputted. * @readout: used to return the data read out from scan chain 1 * @type: DEBUG_SPEED or SYSTEM_SPEED *  * Return Value: the value of BREAKPT signal. * * NOTE: We assume that the target has been halted - the target has * been in debug state. And scan chain 1 has been selected, the INTEST * instruction has been written into the instruction register. * * The bit order of Scan chain 1 for ARM9TDMI core: * *        -------------- *        |            | *        |            V *        |      +------------+ *        |      |   bit[66]  | ID[0] *        |      +------------+ *        |      |            | *        |      |   ......   | *        |      |            | *        |      +------------+ *        |      |   bit[35]  | ID[31] *        |      +------------+ *        |      |   bit[34]  | SYSSPPEED *        |      +------------+ *        |      |   bit[33]  | (ARM9TDMI: unused, ARM920T: WPTANDBKPT) *        |      +------------+ *        |      |   bit[32]  | DDEN *        |      +------------+ *        |      |   bit[31]  | DD[31] *        |      +------------+ *        |      |            | *        |      |   ......   | *        |      |            | *        |      +------------+ *        |      |   bit[0]   | DD[0] *        |      +------------+ *        |            | *        |            | *        |            V *       TDI          TDO */int arm9tdmi_exec_instruction(u32 *writein, u32 *readout, int type){	u32 indata[3] = {0, };	u32 outdata[3] = {0, };	int bitnr = arm9tdmi_target.sc[1].bitnr;	int temp, retval;	/* do a long (67 bit) access */	indata[0] = writein[1];	indata[1] = 0; 	indata[2] = 0;			if (type == SYSTEM_SPEED)		indata[1] = 1 << 2;	/* need to reverse the bit order for the command */	for (temp = 3; temp < 32; temp ++) {		if (writein[0] & (1 << temp))			indata[1] = indata[1] | (1 << (34 - temp));	}		for (temp = 0; temp < 3; temp ++) {		if (writein[0] & (1 << temp))			indata[2] = indata[2] | (1 << (2 - temp));	}		/* 	 * OK, write in and read out	 * read or write JTAG data register will always change its state	 * from Update-DR to Run-Test/Idle. Therefore, it will also pulse	 * DCLK signal.	 */	retval = jtag_rw_dreg(bitnr, indata, outdata);	if (retval)		return retval;	/*	 * DD[0] of scan chain 1 is scanned out at first, so there is no	 * need to reverse the bit order of the readout data. The readout[0]	 * is just the DD[31:0] - that is we want.	 */	readout[0] = outdata[0];		return retval;} /* end of arm9tdmi_exec_instruction() *//* * target_restart - Exit from the debug state, and return to * 		    the normal system state. */int arm9tdmi_restart(u32 pc){	if (target->status == TARGET_STATUS_RUNNING)		return -ERR_TARGET_IS_RUNNING;	if (target->mode == TARGET_MODE_THUMB) {		printf("Error: %s: THUMB mode is not yet implemented.\n",			__FUNCTION__);		return -1;	}	/* Cancel the DBGRQ and enable interrupts */	jtag_select_scanchain(2);	arm9tdmi_ice_write(0x00, 0x00);		/* Select scan chain 1 and use INTEST instruction */	jtag_select_scanchain(1);	jtag_write_ireg(JTAG_INTEST);	/* write the PC into R0 */	arm9tdmi_r0_write(pc);		/* MOV PC, R0 = 0xE1A0F000 */	target->sc[1].writein[0] = 0xE1A0F000;	target->sc[1].writein[1] = 0;	arm9tdmi_exec_instruction(target->sc[1].writein, target->sc[1].readout, DEBUG_SPEED);		/* 	 * The penultimate instruction must be scanned in with bit33 set HIGH.	 * insert NOP instruction: MOV R0, R0 = 0xE1A00000	 */	target->sc[1].writein[0] = ARM_NOP;	arm9tdmi_exec_instruction(target->sc[1].writein, target->sc[1].readout, SYSTEM_SPEED);		/* Write RESTART instruction into the TAP controller.	 * When the state machine enters the Run-Test/Idle state,	 * the ARM9TDMI core will revert back to system mode,	 * and it will resynchronize clock to MCLK.	 */	jtag_write_ireg(JTAG_RESTART); /* also make TAP controller into Run-Test/Idle state */	enter_next_state(0); /* Run-Test/Idle --> Run-Test/Idle */	target->status = TARGET_STATUS_RUNNING;	return 0;} /* end of arm9tdmi_restart() */struct target_operation arm9tdmi_tops = {	/* ARM9TDMI EmbeddedICE-RT logic register read/write operations */	.ice_read 	= arm9tdmi_ice_read,	.ice_write 	= arm9tdmi_ice_write,	/* ARM9TDMI cpu core operations */	.halt		= arm9tdmi_halt,	.restart	= arm9tdmi_restart,	/* ARM9TDMI core registers read/write operations */	.get_core_state = arm9tdmi_get_core_state,	.register_read 	= arm9tdmi_register_read,	.register_write	= arm9tdmi_register_write,	/* ARM9TDMI target memory read/write operations */	.mem_read8 	= arm9tdmi_memory_read8,	.mem_write8 	= arm9tdmi_memory_write8,	.mem_read16 	= arm9tdmi_memory_read16,	.mem_write16 	= arm9tdmi_memory_write16,	.mem_read32 	= arm9tdmi_memory_read32,	.mem_write32 	= arm9tdmi_memory_write32,};int arm9tdmi_setup(void){	target = &arm9tdmi_target;	t_op   = &arm9tdmi_tops;	return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区香蕉| 一区二区在线看| 国产麻豆午夜三级精品| 欧美一级国产精品| 美女高潮久久久| 2021中文字幕一区亚洲| 国产精品一区在线观看你懂的| 欧美成人女星排行榜| 极品少妇xxxx精品少妇偷拍| 精品噜噜噜噜久久久久久久久试看| 麻豆国产精品一区二区三区| 久久久久久9999| 成年人网站91| 亚洲第一二三四区| 日韩午夜av电影| 国产精品亚洲综合一区在线观看| 欧美国产精品专区| 色哟哟一区二区| 调教+趴+乳夹+国产+精品| 欧美一区二区视频在线观看2020| 六月婷婷色综合| 国产女主播一区| 色婷婷国产精品| 欧美aaa在线| 日本一区二区成人在线| 欧美午夜一区二区三区| 老司机精品视频线观看86| 久久欧美中文字幕| 色国产综合视频| 蜜臀久久99精品久久久画质超高清 | 欧美一级二级三级蜜桃| 精品一区二区三区久久| 亚洲视频你懂的| 欧美电视剧免费观看| 国产成a人亚洲精| 亚洲资源在线观看| 精品国产91久久久久久久妲己| 99精品视频在线观看| 蜜臀国产一区二区三区在线播放| 日韩一区在线免费观看| 在线不卡a资源高清| 国产成人久久精品77777最新版本| 亚洲精品你懂的| 久久一区二区三区国产精品| 色老综合老女人久久久| 国产一区视频导航| 亚洲福利一二三区| 国产精品亲子乱子伦xxxx裸| 日韩一区二区在线播放| 色诱视频网站一区| 国产成人精品影视| 老司机午夜精品| 亚洲成av人片在www色猫咪| 国产欧美一区二区精品忘忧草| 欧美乱妇23p| 91麻豆国产自产在线观看| 国产在线播放一区二区三区| 视频一区中文字幕国产| 亚洲精品乱码久久久久久久久| 国产日产精品一区| 精品国产乱码久久久久久夜甘婷婷 | 国产精品一区二区在线观看不卡| 亚洲国产精品一区二区久久| 亚洲欧洲三级电影| 久久午夜羞羞影院免费观看| 欧美一区国产二区| 欧美性高清videossexo| av不卡一区二区三区| 国产福利一区二区| 久久精品国产一区二区| 偷拍亚洲欧洲综合| 亚洲五月六月丁香激情| 一区二区三区精密机械公司| 亚洲婷婷在线视频| 亚洲视频一区二区在线| 国产精品高潮呻吟| 亚洲国产岛国毛片在线| 国产日韩综合av| 国产偷国产偷精品高清尤物| 久久综合色播五月| 精品国产第一区二区三区观看体验 | 婷婷激情综合网| 午夜精品久久久久久久99樱桃| 夜夜爽夜夜爽精品视频| 一区二区免费看| 亚洲一区二区三区激情| 亚洲影院久久精品| 午夜视频在线观看一区| 亚洲sss视频在线视频| 亚洲1区2区3区4区| 免费精品99久久国产综合精品| 免费观看成人av| 久久国产综合精品| 国产一区二区视频在线| 成人午夜激情影院| 色综合天天视频在线观看| 日本高清无吗v一区| 欧美三区在线观看| 欧美一区二区三区婷婷月色| 欧美成人福利视频| 久久精品夜夜夜夜久久| 一区二区中文视频| 亚洲一区二区三区四区在线免费观看 | 亚洲大片精品永久免费| 五月天丁香久久| 国产在线不卡一卡二卡三卡四卡| 国产成人在线网站| 色婷婷亚洲一区二区三区| 欧美日韩精品高清| 精品卡一卡二卡三卡四在线| 国产精品久久毛片a| 一区二区三区日韩| 久久66热偷产精品| 成人精品一区二区三区四区| 色一情一伦一子一伦一区| 777a∨成人精品桃花网| 久久丝袜美腿综合| 亚洲另类在线制服丝袜| 日一区二区三区| 国产69精品久久久久毛片| 色婷婷综合久久久中文一区二区| 91麻豆精品国产91久久久久久久久| 亚洲精品一区二区三区精华液 | 日韩一级片网址| 欧美国产国产综合| 亚洲国产一区视频| 国产成人高清在线| 欧美日韩五月天| 中文字幕不卡在线播放| 婷婷成人激情在线网| 成人午夜看片网址| 欧美一区二区三区视频在线| 国产精品欧美经典| 日韩av在线播放中文字幕| 不卡在线观看av| 日韩免费视频线观看| 亚洲免费观看高清完整版在线观看熊| 日韩电影网1区2区| 91毛片在线观看| 欧美国产日韩亚洲一区| 免费人成精品欧美精品| 一本大道久久a久久精品综合| 精品剧情在线观看| 亚洲国产一区二区三区| 成人毛片老司机大片| 精品国产制服丝袜高跟| 午夜精品久久久久影视| 99视频国产精品| 国产三级三级三级精品8ⅰ区| 亚洲成av人影院| 91久久精品午夜一区二区| 日本一区二区动态图| 久久国产免费看| 欧美一三区三区四区免费在线看| 亚洲美女精品一区| 成人精品免费看| 国产调教视频一区| 国产麻豆日韩欧美久久| 日韩写真欧美这视频| 调教+趴+乳夹+国产+精品| 欧美专区日韩专区| 亚洲欧美色图小说| 91免费看视频| 亚洲欧洲综合另类在线| av网站免费线看精品| 国产精品看片你懂得| 国产精品一区二区久激情瑜伽| 国产精品视频一二三| 国产成人av电影在线播放| 2023国产精华国产精品| 精品一区二区三区在线视频| 日韩欧美成人一区| 韩国三级电影一区二区| 日韩一区二区三| 裸体在线国模精品偷拍| 日韩一区二区在线看| 久久国产日韩欧美精品| 久久综合久久鬼色中文字| 国精品**一区二区三区在线蜜桃| 精品日产卡一卡二卡麻豆| 久久国产人妖系列| 久久久久久一二三区| 国产ts人妖一区二区| 国产精品免费丝袜| 91蜜桃婷婷狠狠久久综合9色| 亚洲女同一区二区| 欧美性高清videossexo| 日本伊人色综合网| 精品处破学生在线二十三| 国产精品一色哟哟哟| 国产精品毛片久久久久久久| 色婷婷久久99综合精品jk白丝| 亚洲综合一区二区| 欧美日本不卡视频| 激情伊人五月天久久综合| 国产日韩精品一区二区浪潮av | 日韩国产高清影视| 欧美不卡激情三级在线观看| 国产98色在线|日韩| 亚洲日穴在线视频|