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

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

?? rtl-stub.c

?? fsmlabs的real time linux的內核
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* $Id: rtl-stub.c,v 1.1.1.1 2003/03/01 11:48:24 hofrat Exp $ * ppc-stub.c:  KGDB support for the Linux kernel. * * RTLinux Debugger modifications are written by Michael Barabanov * (baraban@fsmlabs.com) and are * Copyright (C) 2000, Finite State Machine Labs Inc. * * adapted from arch/sparc/kernel/sparc-stub.c for the PowerPC * some stuff borrowed from Paul Mackerras' xmon * Copyright (C) 1998 Michael AK Tesch (tesch@cs.wisc.edu) * * Modifications to run under Linux * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) * * This file originally came from the gdb sources, and the * copyright notices have been retained below. *//****************************************************************************		THIS SOFTWARE IS NOT COPYRIGHTED   HP offers the following for use in the public domain.  HP makes no   warranty with regard to the software or its performance and the   user accepts the software "AS IS" with all faults.   HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD   TO THIS SOFTWARE INCLUDING BUT NOT LIMITED TO THE WARRANTIES   OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.****************************************************************************//**************************************************************************** *  Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ * *  Module name: remcom.c $ *  Revision: 1.34 $ *  Date: 91/03/09 12:29:49 $ *  Contributor:     Lake Stevens Instrument Division$ * *  Description:     low level support for gdb debugger. $ * *  Considerations:  only works on target hardware $ * *  Written by:      Glenn Engel $ *  ModuleState:     Experimental $ * *  NOTES:           See Below $ * *  Modified for SPARC by Stu Grossman, Cygnus Support. * *  This code has been extensively tested on the Fujitsu SPARClite demo board. * *  To enable debugger support, two things need to happen.  One, a *  call to set_debug_traps() is necessary in order to allow any breakpoints *  or error conditions to be properly intercepted and reported to gdb. *  Two, a breakpoint needs to be generated to begin communication.  This *  is most easily accomplished by a call to breakpoint().  Breakpoint() *  simulates a breakpoint by executing a trap #1. * ************* * *    The following gdb commands are supported: * * command          function                               Return value * *    g             return the value of the CPU registers  hex data or ENN *    G             set the value of the CPU registers     OK or ENN *    qOffsets      Get section offsets.  Reply is Text=xxx;Data=yyy;Bss=zzz * *    mAA..AA,LLLL  Read LLLL bytes at address AA..AA      hex data or ENN *    MAA..AA,LLLL: Write LLLL bytes at address AA.AA      OK or ENN * *    c             Resume at current address              SNN   ( signal NN) *    cAA..AA       Continue at address AA..AA             SNN * *    s             Step one instruction                   SNN *    sAA..AA       Step one instruction from AA..AA       SNN * *    k             kill * *    ?             What was the last sigval ?             SNN   (signal NN) * *    bBB..BB	    Set baud rate to BB..BB		   OK or BNN, then sets *							   baud rate * * All commands and responses are sent with a packet which includes a * checksum.  A packet consists of * * $<packet info>#<checksum>. * * where * <packet info> :: <characters representing the command or response> * <checksum>    :: <two hex digits computed as modulo 256 sum of <packetinfo>> * * When a packet is received, it is first acknowledged with either '+' or '-'. * '+' indicates a successful transfer.  '-' indicates a failed transfer. * * Example: * * Host:                  Reply: * $m0,10#2a               +$00010203040506070809101112131415#42 * ****************************************************************************/#include <linux/kernel.h>#include <linux/string.h>#include <linux/mm.h>#include <linux/smp.h>#include <linux/smp_lock.h>#include <asm/system.h>#include <asm/signal.h>#include <asm/pgtable.h>#include <asm/ptrace.h>#include <linux/signal.h>/* RTLinux support */#define __NO_VERSION__#include <linux/module.h>#include <rtl_sync.h>#include <rtl_sched.h>#define strtoul simple_strtoul#include <psc.h>#define rtl_running_linux() (pthread_self() == &LOCAL_SCHED->rtl_linux_task)int rtl_debug_initialized = 0;/* end of RTLinux support */static void (*debugger_fault_handler)(struct pt_regs *regs) = 0;static void kgdb_fault_handler(struct pt_regs *regs);static int handle_exception (struct pt_regs *regs);extern int putDebugChar(int);   /* write a single character      */extern int getDebugChar(void);   /* read and return a single char */#define BPCODE 0x7d821008#define STR_BPCODE "7d821008"/* * BUFMAX defines the maximum number of characters in inbound/outbound buffers * at least NUMREGBYTES*2 are needed for register packets */#define BUFMAX 2048static char remcomInBuffer[BUFMAX];static char remcomOutBuffer[BUFMAX];static int kgdb_active = 0;static u_int fault_jmp_buf[100];static int kdebug;static const char hexchars[]="0123456789abcdef";/* Place where we save old trap entries for restoration - sparc*//* struct tt_entry kgdb_savettable[256]; *//* typedef void (*trapfunc_t)(void); */#if 0/* Install an exception handler for kgdb */static void exceptionHandler(int tnum, unsigned int *tfunc){	/* We are dorking with a live trap table, all irqs off */}#endifintkgdb_setjmp(long *buf){	asm ("mflr 0; stw 0,0(%0);"	     "stw 1,4(%0); stw 2,8(%0);"	     "mfcr 0; stw 0,12(%0);"	     "stmw 13,16(%0)"	     : : "r" (buf));	/* XXX should save fp regs as well */	return 0;}voidkgdb_longjmp(long *buf, int val){	if (val == 0)		val = 1;	asm ("lmw 13,16(%0);"	     "lwz 0,12(%0); mtcrf 0x38,0;"	     "lwz 0,0(%0); lwz 1,4(%0); lwz 2,8(%0);"	     "mtlr 0; mr 3,%1"	     : : "r" (buf), "r" (val));}/* Convert ch from a hex digit to an int */static inthex(unsigned char ch){	if (ch >= 'a' && ch <= 'f')		return ch-'a'+10;	if (ch >= '0' && ch <= '9')		return ch-'0';	if (ch >= 'A' && ch <= 'F')		return ch-'A'+10;	return -1;}/* Convert the memory pointed to by mem into hex, placing result in buf. * Return a pointer to the last char put in buf (null), in case of mem fault, * return 0. */static unsigned char *mem2hex(char *mem, char *buf, int count){	unsigned char ch;	if (kgdb_setjmp((long*)fault_jmp_buf) == 0) {		debugger_fault_handler = kgdb_fault_handler;		while (count-- > 0) {			ch = *mem++;			*buf++ = hexchars[ch >> 4];			*buf++ = hexchars[ch & 0xf];		}	} else {		/* error condition */	}	debugger_fault_handler = 0;	*buf = 0;	return buf;}/* convert the hex array pointed to by buf into binary to be placed in mem * return a pointer to the character AFTER the last byte written.*/static char *hex2mem(char *buf, char *mem, int count){	int i;	unsigned char ch;	if (kgdb_setjmp((long*)fault_jmp_buf) == 0) {		debugger_fault_handler = kgdb_fault_handler;		for (i=0; i<count; i++) {			ch = hex(*buf++) << 4;			ch |= hex(*buf++);			*mem++ = ch;		}		flush_icache_range((int)mem, (int)mem+count);	} else {		/* error condition */	}	debugger_fault_handler = 0;	return mem;}/* * While we find nice hex chars, build an int. * Return number of chars processed. */static inthexToInt(char **ptr, int *intValue){	int numChars = 0;	int hexValue;	*intValue = 0;	if (kgdb_setjmp((long*)fault_jmp_buf) == 0) {		debugger_fault_handler = kgdb_fault_handler;		while (**ptr) {			hexValue = hex(**ptr);			if (hexValue < 0)				break;			*intValue = (*intValue << 4) | hexValue;			numChars ++;			(*ptr)++;		}	} else {	     /* error condition */	}	debugger_fault_handler = 0;	return (numChars);}/* scan for the sequence $<data>#<checksum>     */static voidgetpacket(char *buffer){	unsigned char checksum;	unsigned char xmitcsum;	int i;	int count;	unsigned char ch;	do {		/* wait around for the start character, ignore all other		 * characters */		while ((ch = (getDebugChar() & 0x7f)) != '$') ;		checksum = 0;		xmitcsum = -1;		count = 0;		/* now, read until a # or end of buffer is found */		while (count < BUFMAX) {			ch = getDebugChar() & 0x7f;			if (ch == '#')				break;			checksum = checksum + ch;			buffer[count] = ch;			count = count + 1;		}		if (count >= BUFMAX)			continue;		buffer[count] = 0;		if (ch == '#') {			xmitcsum = hex(getDebugChar() & 0x7f) << 4;			xmitcsum |= hex(getDebugChar() & 0x7f);			if (checksum != xmitcsum)				putDebugChar('-');	/* failed checksum */			else {				putDebugChar('+'); /* successful transfer */				/* if a sequence char is present, reply the ID */				if (buffer[2] == ':') {					putDebugChar(buffer[0]);					putDebugChar(buffer[1]);					/* remove sequence chars from buffer */					count = strlen(buffer);					for (i=3; i <= count; i++)						buffer[i-3] = buffer[i];				}			}		}	} while (checksum != xmitcsum);}/* send the packet in buffer.  */static void putpacket(unsigned char *buffer){	unsigned char checksum;	int count;	unsigned char ch, recv;	/*  $<packet info>#<checksum>. */	do {		putDebugChar('$');		checksum = 0;		count = 0;		while ((ch = buffer[count])) {			putDebugChar(ch);			checksum += ch;			count += 1;		}		putDebugChar('#');		putDebugChar(hexchars[checksum >> 4]);		putDebugChar(hexchars[checksum & 0xf]);		recv = getDebugChar();	} while ((recv & 0x7f) != '+');}static void kgdb_flush_cache_all(void){	flush_instruction_cache();}static inline int get_msr(void){	int msr;	asm volatile("mfmsr %0" : "=r" (msr):);	return msr;}static inline void set_msr(int msr){	asm volatile("mtmsr %0" : : "r" (msr));}/* Set up exception handlers for tracing and breakpoints * [could be called kgdb_init()] */#include "rtl_ex.c"int rtl_debug_exception(int vector, struct pt_regs *regs, int error_code){	return handle_exception(regs);}int set_debug_traps(void){#if 0	unsigned char c;	save_and_cli(flags);	/* In case GDB is started before us, ack any packets (presumably	 * "$?#xx") sitting there.	 *	 * I've found this code causes more problems than it solves,	 * so that's why it's commented out.  GDB seems to work fine	 * now starting either before or after the kernel   -bwb	 */	while((c = getDebugChar()) != '$');	while((c = getDebugChar()) != '#');	c = getDebugChar(); /* eat first csum byte */	c = getDebugChar(); /* eat second csum byte */	putDebugChar('+'); /* ack it */#endif	rtl_request_traps(&rtl_debug_exception);	rtl_debug_initialized = 1;	return 0;}void unset_debug_traps(void){	rtl_request_traps(0);	rtl_debug_initialized = 0;}/* more RTLinux support */#define CONFIG_RTL_DEBUGGER_THREADS#define CONFIG_RTL_DEBUGGER_Z_PROTOCOL#define CONFIG_RTL_DEBUG_BP_HACKstatic spinlock_t bp_lock = SPIN_LOCK_UNLOCKED;#define RTL_MAX_BP 1024static struct bp_cache_entry {	char *mem;	unsigned long val;	struct bp_cache_entry *next;} bp_cache [RTL_MAX_BP];static struct bp_cache_entry *cache_start = 0;int insert_bp(char *mem){	int i;	struct bp_cache_entry *e;	unsigned int old;	char buf[10];	if (!mem2hex(mem, buf, 4)) {		return EINVAL; /* memory error */	}	if (!hex2mem(STR_BPCODE, mem, 4)) {		return EINVAL;	}	old = strtoul(buf, 0, 16);	for (e = cache_start; e; e = e->next) {		if (e->mem == mem) {			return EINVAL; /* already there */		}	}	for (i = 0; i < RTL_MAX_BP; i++) {		if (bp_cache[i].mem == 0) {			break;		}	}	if (i == RTL_MAX_BP) {		return EINVAL; /* no space */	}	bp_cache[i] . val = old;	bp_cache[i] . mem = mem;	bp_cache[i] . next = cache_start;	cache_start = &bp_cache[i];	debugpr("inserted %x, old contents = %x\n", mem, old);	return 0;}int search_bp (char *mem){	struct bp_cache_entry *e = cache_start;	struct bp_cache_entry *f = 0;	spin_lock (&bp_lock);	if (!e) {		spin_unlock (&bp_lock);		return EINVAL;	}	if (e->mem == mem) {		f = e;	} else {		for (; e->next; e = e->next) {			if (e->next->mem == mem) {				f = e->next;				break;			}		}	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品视频免费观看| 亚洲第一成人在线| 亚洲影视在线播放| 韩国精品久久久| 在线亚洲高清视频| 国产亚洲一区二区三区| 午夜精品免费在线| 色综合久久久久综合99| 26uuu国产电影一区二区| 亚洲午夜国产一区99re久久| 国产精品亚洲成人| 日韩一区二区精品| 亚洲女子a中天字幕| 成人激情免费视频| 亚洲aaa精品| 成人黄色777网| 久久久一区二区三区捆绑**| 欧美aa在线视频| 欧美日韩国产免费一区二区| 亚洲精品免费在线播放| 成人短视频下载| 日本一区二区三级电影在线观看| 久久国内精品自在自线400部| 欧美色国产精品| 亚洲不卡在线观看| 欧美日韩精品系列| 亚洲成人先锋电影| 91 com成人网| 全部av―极品视觉盛宴亚洲| 欧美剧情电影在线观看完整版免费励志电影 | 国产精品伊人色| 精品欧美一区二区久久| 蜜桃视频免费观看一区| 3d动漫精品啪啪1区2区免费| 丝瓜av网站精品一区二区| 欧美蜜桃一区二区三区| 日韩av电影免费观看高清完整版 | 日本一区二区综合亚洲| 成人久久久精品乱码一区二区三区| 欧美tk—视频vk| 国产激情一区二区三区| 久久久久久久久久久黄色| 国产大片一区二区| 国产精品国产三级国产普通话三级 | 国产主播一区二区三区| 久久奇米777| av一区二区久久| 亚洲精品国产第一综合99久久| 在线观看日韩国产| 亚洲大片在线观看| 日韩欧美在线网站| 国产精品资源网站| 一区二区三区毛片| 日韩午夜在线影院| 东方aⅴ免费观看久久av| 1000部国产精品成人观看| 在线免费观看不卡av| 免费成人你懂的| 欧美激情在线一区二区| 在线日韩国产精品| 久久 天天综合| 国产精品成人免费在线| 欧美日韩精品系列| 国产成人亚洲精品青草天美| 亚洲精品免费电影| 日韩片之四级片| 91麻豆免费看片| 免费在线成人网| 国产精品国产a| 欧美一级精品在线| 91丨porny丨在线| 青娱乐精品视频在线| 国产精品白丝在线| 日韩欧美一区二区三区在线| 不卡一区二区在线| 久久激情综合网| 亚洲精品国产精品乱码不99| 26uuu亚洲| 欧美日韩成人高清| 99综合电影在线视频| 精品在线你懂的| 亚洲超碰97人人做人人爱| 国产欧美日韩亚州综合| 9191久久久久久久久久久| aaa亚洲精品| 国产一区二区不卡在线| 亚洲成av人片在线观看无码| 国产免费久久精品| 日韩欧美不卡一区| 欧美亚洲丝袜传媒另类| 不卡一区二区三区四区| 久久99久久精品欧美| 日日夜夜精品免费视频| 亚洲精品福利视频网站| 国产精品免费观看视频| 精品播放一区二区| 欧美一区欧美二区| 欧美日韩在线精品一区二区三区激情| 丁香激情综合国产| 国产精品资源站在线| 国产在线精品一区二区三区不卡| 亚洲成人av一区二区| 亚洲精品日韩一| 亚洲日本免费电影| **欧美大码日韩| 国产精品久久久久久久午夜片| 久久久久久久久伊人| 精品国产伦一区二区三区观看体验| 欧美日韩精品综合在线| 欧美区在线观看| 欧美女孩性生活视频| 在线视频你懂得一区二区三区| 色婷婷狠狠综合| 在线视频国产一区| 欧美日韩一区二区三区四区五区 | 成人av综合在线| 97久久超碰精品国产| 成人激情综合网站| www.亚洲色图.com| 91视频在线观看| 在线亚洲精品福利网址导航| 欧日韩精品视频| 8v天堂国产在线一区二区| 91精品国产一区二区三区香蕉| 91精品国产一区二区人妖| 欧美xfplay| 欧美韩国一区二区| 综合久久久久久| 亚洲第一久久影院| 蜜桃在线一区二区三区| 国产一区二区在线观看视频| 国产成人aaaa| 在线看国产一区| 日韩精品中文字幕在线不卡尤物| 亚洲精品一区二区三区99| 中文字幕 久热精品 视频在线| 亚洲免费av在线| 日本午夜一区二区| 国产福利一区二区三区在线视频| 成人自拍视频在线| 色呦呦网站一区| 欧美一级久久久| 亚洲视频香蕉人妖| 日韩不卡一区二区三区| 国产在线国偷精品免费看| 国产91对白在线观看九色| 99国产精品久久| 91精品视频网| 国产精品网站在线观看| 亚洲h在线观看| 国产成+人+日韩+欧美+亚洲| 色综合天天综合网天天看片| 日韩片之四级片| 亚洲精品免费看| 国产成人午夜精品影院观看视频| 91亚洲精品久久久蜜桃网站| 91精品国产91久久久久久一区二区| 国产三级精品视频| 日韩精品91亚洲二区在线观看| 国产精品99久| 91麻豆精品国产91久久久久久| 欧美国产精品v| 轻轻草成人在线| 欧美午夜精品久久久久久孕妇| 久久尤物电影视频在线观看| 亚洲午夜精品网| 91视频你懂的| 亚洲国产成人在线| 久久国产精品一区二区| 欧美中文字幕一区二区三区| 国产性做久久久久久| 日韩电影在线一区二区三区| 99久久99久久综合| 国产亚洲欧美一区在线观看| 石原莉奈在线亚洲二区| 91玉足脚交白嫩脚丫在线播放| 欧美精品一区二区在线观看| 五月天中文字幕一区二区| 99精品视频一区| 欧美激情综合五月色丁香| 老司机精品视频在线| 欧美精品乱人伦久久久久久| 亚洲视频在线观看一区| 懂色av噜噜一区二区三区av| 精品国产3级a| 美女一区二区在线观看| 欧美日韩在线观看一区二区 | 国产精品国产自产拍高清av王其| 国内精品嫩模私拍在线| 欧美一级二级在线观看| 一区二区三国产精华液| 一本高清dvd不卡在线观看| 中文字幕精品一区| 国产成人夜色高潮福利影视| 久久青草国产手机看片福利盒子| 精品一区二区三区免费毛片爱| 欧美日韩成人在线| 免费精品视频在线| 日韩三级免费观看| 黑人巨大精品欧美一区|