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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? generic-stub.c

?? 開放源碼實時操作系統(tǒng)源碼.
?? C
?? 第 1 頁 / 共 4 頁
字號:
#include "board.h"

#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS

/* Eventually, this should default to ON */
#if USE_GDBSTUB_PROTOTYPES
#include "stub-tservice.h"
#include "generic-stub.h"
#else
// Function declarations (prevents compiler warnings)
int stubhex (unsigned char ch);
static void unlock_thread_scheduler (void);
static uint32 crc32 (target_addr_t mem, int len, uint32 crc);
#endif

#include "thread-pkts.h"
  /* Defines function macros if thread support is not selected in board.h */

#ifdef __ECOS__
char GDB_stubs_version[] CYGBLD_ATTRIB_WEAK = 
    "eCos GDB stubs - built " __DATE__ " / " __TIME__;
#endif

/****************************************************************************

                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 it's 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, Red Hat.
 *  Modified for generic CygMON stub support by Bob Manson, Red Hat.
 *
 *  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
 *
 *    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
 *
 ****************************************************************************/

#ifdef __ECOS__

// We cannot share memcpy and memset with the rest of the system since
// the user may want to step through it.
static inline void*
_memcpy(void* dest, void* src, int size)
{
    unsigned char* __d = (unsigned char*) dest;
    unsigned char* __s = (unsigned char*) src;
    
    while(size--)
        *__d++ = *__s++;

    return dest;
}

static inline void*
_memset(void* s, int c, int size)
{
    unsigned char* __s = (unsigned char*) s;
    unsigned char __c = (unsigned char) c;
    
    while(size--)
        *__s++ = __c;

    return s;
}

#else
#include <string.h>
#include <signal.h>
#define _memcpy memcpy
#define _memset memset
#endif // __ECOS__

/************************************************************************/
/* BUFMAX defines the maximum number of characters in inbound/outbound buffers*/
/* at least NUMREGBYTES*2 are needed for register packets */
#ifdef __ECOS__
#ifdef NUMREGBYTES
#define BUFMAX (32 + (NUMREGBYTES*2))
#else
#define BUFMAX 2048
#endif
#else
#define BUFMAX 2048
#endif

static int initialized = 0;     /* !0 means we've been initialized */

static int process_exception (int sigval);
static void do_nothing (void); /* and do it gracefully */
static int syscall_do_nothing (int);

#ifdef CYGSEM_ECOS_SUPPORTS_PROGRAM_ARGS
void __free_program_args (void);
static char *__add_program_arg (int argnum, uint32 arglen);
#endif

volatile __PFI __process_exception_vec = process_exception;
volatile __PFV __process_exit_vec = do_nothing;
volatile __PFI __process_syscall_vec = syscall_do_nothing;
volatile __PFI __process_signal_vec = NULL;
volatile __PFV __init_vec = NULL;
volatile __PFV __cleanup_vec = NULL;

static const char hexchars[] = "0123456789abcdef";

static void process_query (char *pkt);
static void process_set   (char *pkt);

char
__tohex (int c)
{
  return hexchars [c & 15];
}

#define __tohex(c) hexchars[(c) & 15]

#ifndef NUMREGS_GDB
#define NUMREGS_GDB NUMREGS
#endif

/* One pushback character. */
int ungot_char = -1;

static int
readDebugChar (void)
{
  if (ungot_char > 0)
    {
      int result = ungot_char;
      ungot_char = -1;
      return result;
    }
  else
    return getDebugChar ();
}

/* Convert ch from a hex digit to an int. */

int
stubhex (ch)
     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;
}

void
__getpacket (buffer)
     char *buffer;
{
    struct gdb_packet packet;
    int res;

    packet.state = 0;
    packet.contents = buffer;
    packet.err = 0;
    while ((res = __add_char_to_packet (readDebugChar () & 0xff, &packet)) != 1) {
        if (res == -2) {
            putDebugChar ('-'); // Tell host packet was not processed
            // Reset for the next packet
            packet.state = 0;
            packet.err = 0;
        }
    }
}

int
__add_char_to_packet (ch, packet)
     unsigned int ch;
     struct gdb_packet *packet;
{
  if (packet->state == 0)
    {
      if (ch == '$')
        {
          packet->state = 1;
          packet->length = 0;
          packet->checksum = 0;
          packet->xmitcsum = -1;
        }
      return 0;
    }
  
  if (packet->state == 1)
    {
      if (packet->length == BUFMAX)
        {
          packet->state = 0;
          packet->err = 1;
        }
      else if (ch == '#')
        {
          packet->contents[packet->length] = 0;
          packet->state = 2;
        }
      else 
        {
          packet->checksum += ch;
          packet->contents[packet->length++] = ch;
        }
      return 0;
    }

  if (packet->state == 2)
    {
      packet->xmitcsum = stubhex (ch) << 4;
      packet->state = 3;
      return 0;
    }

  if (packet->state == 3)
    {
      packet->xmitcsum |= stubhex (ch);
      if (packet->err) {
          // Packet was too long - just tell the consumer
          return -2;
      }
      if ((packet->checksum & 255) != packet->xmitcsum)
        {
          putDebugChar ('-');   /* failed checksum */
          packet->state = 0;
          return -1;
        }
      else
        {
          putDebugChar ('+'); /* successful transfer */
          /* if a sequence char is present, reply the sequence ID */
          if (packet->contents[2] == ':')
            {
              uint32 count = packet->length;
              uint32 i;
              putDebugChar (packet->contents[0]);
              putDebugChar (packet->contents[1]);
              /* remove sequence chars from buffer */
              for (i=3; i <= count; i++)
                packet->contents[i-3] = packet->contents[i];
            }
          return 1;
        }
    }
  /* We should never get here. */
  packet->state = 0;
  return -1;
}

/* send the packet in buffer.  */

void
__putpacket (buffer)
     char *buffer;
{
  unsigned char checksum;
  uint32 count;
  unsigned char ch;

  /*  $<packet info>#<checksum>. */
  do
    {
      putDebugChar ('$');
      checksum = 0;
      count = 0;

      while ((ch = buffer[count]))
        {
          putDebugChar (ch);
          checksum += ch;
          count += 1;
        }

      putDebugChar ('#');
      putDebugChar (hexchars[(checksum >> 4) & 0xf]);
      putDebugChar (hexchars[checksum & 0xf]);

    }
  while ((readDebugChar () & 0x7f) != '+');
}

char __remcomInBuffer[BUFMAX];
char __remcomOutBuffer[BUFMAX];

/* Indicate to caller of mem2hex or hex2mem that there has been an
   error.  */
volatile int __mem_fault = 0;


#ifndef TARGET_HAS_OWN_MEM_FUNCS
/*
 * _target_readmem_hook / _target_writemem_hook:
 * Allow target to get involved in reading/writing memory.
 *
 * If these hooks are defined by the target, they will be
 * called for each user program memory access.  Otherwise, the stub
 * will simply dereference a pointer to access user program memory.
 */

unsigned char (*_target_readmem_hook)  (unsigned char* addr);
void          (*_target_writemem_hook) (unsigned char* addr, 
                                        unsigned char value);

static unsigned char
get_target_byte (volatile unsigned char *address)
{
  if (_target_readmem_hook)     /* target needs to control memory access */
    return _target_readmem_hook ((unsigned char *) address);
  else
    return *address;
}

static void
put_target_byte (volatile unsigned char *address, unsigned char value)
{
  if (_target_writemem_hook)    /* target needs to control memory access */
    _target_writemem_hook ((unsigned char *) address, value);
  else
    *address = value;
}

/* These are the "arguments" to __do_read_mem and __do_write_mem, 
   which are passed as globals to avoid squeezing them thru
   __set_mem_fault_trap.  */

static volatile target_register_t memCount;
static volatile unsigned char    *memSrc,  *memDst;

/*
 * __do_read_mem:
 * Copy from target memory to trusted memory.
 */

static void
__do_read_mem (void)
{
  __mem_fault = 0;
  while (memCount)
    {
      unsigned char ch = get_target_byte (memSrc++);

      if (__mem_fault)
        return;
      *memDst++ = ch;
      memCount--;
    }
}

/*
 * __do_write_mem:
 * Copy from trusted memory to target memory.
 */

static void
__do_write_mem (void)
{
  __mem_fault = 0;
  while (memCount)
    {
      unsigned char ch = *memSrc++;

      put_target_byte (memDst++, ch);
      if (__mem_fault)
        return;
      memCount--;
    }
}

/*
 * __read_mem_safe:
 * Get contents of target memory, abort on error.
 */

int
__read_mem_safe (void *dst, target_register_t src, int count)
{
  memCount = count;
  memSrc   = (unsigned char *) src;
  memDst   = (unsigned char *) dst;
  __set_mem_fault_trap (__do_read_mem);
  return count - memCount;      /* return number of bytes successfully read */
}

/*
 * __write_mem_safe:
 * Set contents of target memory, abort on error.
 */

int
__write_mem_safe (unsigned char *src, target_register_t dst, int count)
{
  memCount = count;
  memSrc   = (unsigned char *) src;
  memDst   = (unsigned char *) dst;
  __set_mem_fault_trap (__do_write_mem);
  return count - memCount;      /* return number of bytes successfully read */
}

#endif /* TARGET_HAS_OWN_MEM_FUNCS */

/* These are the "arguments" to __mem2hex_helper and __hex2mem_helper, 
   which are passed as globals to avoid squeezing them thru
   __set_mem_fault_trap.  */

static int   hexMemCount;
static char *hexMemSrc, *hexMemDst;
static int   may_fault_mode;
#ifdef TARGET_HAS_HARVARD_MEMORY
static int   progMem;
#endif

/* Hamburger helper? */
static void
__mem2hex_helper (void)
{
    union {
        unsigned long  long_val;
        unsigned char  bytes[sizeof(long)];
    } val;
    int len, i;
    unsigned char ch;
    __mem_fault = 0;
    while (hexMemCount > 0) {
        if (may_fault_mode) {
            if ((hexMemCount >= sizeof(long)) &&
                (((target_register_t)hexMemSrc & (sizeof(long)-1)) == 0)) {
                // Should be safe to access via a long
                len = sizeof(long);
            } else if ((hexMemCount >= sizeof(short)) &&
                       (((target_register_t)hexMemSrc & (sizeof(short)-1)) == 0)) {
                // Should be safe to access via a short
                len = sizeof(short);
            } else {
                len = 1;
            }
#ifdef TARGET_HAS_HARVARD_MEMORY
	    if (progMem)
		__read_progmem_safe(&val.bytes[0], hexMemSrc, len);
	    else
#endif
            __read_mem_safe(&val.bytes[0], hexMemSrc, len);
        } else {
            len = 1;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产欧美在线| 免费精品99久久国产综合精品| 亚洲欧美一区二区不卡| 日产国产高清一区二区三区| 国产精品18久久久久久vr| 色婷婷综合久久久中文字幕| 日韩久久久久久| 亚洲一级电影视频| 成人精品免费视频| 精品国产三级电影在线观看| 亚洲成人第一页| aaa国产一区| 欧美激情一区二区三区不卡| 美女网站视频久久| 51午夜精品国产| 亚洲尤物在线视频观看| voyeur盗摄精品| 国产色产综合产在线视频| 久久精品国产亚洲高清剧情介绍| 91成人免费在线| 国产精品久久三| 久久精品在这里| 日韩欧美一级二级| 免费美女久久99| 91精品国产综合久久精品| 亚洲二区视频在线| 欧美日韩一区在线| 亚洲午夜免费福利视频| 日本高清不卡aⅴ免费网站| 国产精品二区一区二区aⅴ污介绍| 国产麻豆精品一区二区| 精品99999| 国产一区视频网站| 2024国产精品视频| 国产精品一二三四五| 国产午夜亚洲精品午夜鲁丝片| 蜜臀99久久精品久久久久久软件| 欧美一区二区网站| 日韩高清一区二区| 日韩精品一区二区三区视频| 久草热8精品视频在线观看| 日韩欧美国产综合| 国产乱人伦偷精品视频不卡| 日韩三级在线免费观看| 国内精品第一页| 国产精品每日更新| 欧美在线观看视频在线| 亚洲国产日韩综合久久精品| 欧美老女人第四色| 极品少妇xxxx偷拍精品少妇| 国产亚洲视频系列| 91视频www| 婷婷成人综合网| 久久先锋影音av鲁色资源网| 成人午夜在线视频| 中文字幕在线观看一区二区| 91精彩视频在线| 奇米影视在线99精品| 国产欧美日韩一区二区三区在线观看| 播五月开心婷婷综合| 亚洲宅男天堂在线观看无病毒| 制服.丝袜.亚洲.中文.综合| 国内精品久久久久影院薰衣草| 国产精品免费av| 3d动漫精品啪啪| 成人国产免费视频| 亚洲r级在线视频| 久久精品欧美一区二区三区麻豆| 99天天综合性| 日韩精品一级二级 | 国内一区二区在线| 国产精品欧美一级免费| 欧美三片在线视频观看| 国产91综合网| 午夜影院久久久| 日本一区二区三区dvd视频在线| 在线观看91视频| 成人综合婷婷国产精品久久 | 久久久青草青青国产亚洲免观| 97精品国产97久久久久久久久久久久 | 一个色在线综合| 久久久久久久久久美女| 欧美性极品少妇| 成人美女视频在线观看18| 日韩电影免费在线看| 亚洲欧美国产毛片在线| 久久久精品影视| 日韩欧美亚洲另类制服综合在线| 色综合天天综合| 懂色av一区二区在线播放| 男人的天堂久久精品| 亚洲男人都懂的| 中国av一区二区三区| 制服丝袜亚洲精品中文字幕| 色婷婷国产精品综合在线观看| 国产一区二区三区免费| 日韩av在线播放中文字幕| 亚洲男同性恋视频| ...中文天堂在线一区| 久久亚洲捆绑美女| 欧美一区二区啪啪| 欧美性大战久久久久久久| jvid福利写真一区二区三区| 国产精品亚洲一区二区三区妖精| 日本午夜一区二区| 亚洲成人午夜影院| 亚洲一区二区三区精品在线| 综合久久给合久久狠狠狠97色| 国产女主播视频一区二区| 欧美一级xxx| 日韩精品一区二区三区在线播放 | 精品视频在线看| 99精品黄色片免费大全| 不卡电影一区二区三区| 波多野结衣91| 色综合亚洲欧洲| 91美女蜜桃在线| 色狠狠色噜噜噜综合网| 一本色道久久加勒比精品| hitomi一区二区三区精品| 成人av在线资源| 99re亚洲国产精品| 91美女蜜桃在线| 欧美日韩日日骚| 欧美日韩成人综合在线一区二区| 欧美日韩一区二区电影| 欧美日韩激情在线| 日韩精品在线一区二区| 久久天天做天天爱综合色| 国产蜜臀av在线一区二区三区| 中文字幕乱码亚洲精品一区 | 午夜精品在线视频一区| 亚洲国产一区二区三区| 亚洲另类在线视频| 欧美日韩在线观看一区二区| 欧洲生活片亚洲生活在线观看| 色94色欧美sute亚洲线路一ni| 欧美伊人精品成人久久综合97| 国产校园另类小说区| 中文字幕一区二区三区av| 一区二区三区不卡视频| 国产精品素人一区二区| 日韩一区二区三区在线视频| 91视频免费播放| 欧美日韩一区二区三区四区五区 | 精品成人免费观看| 欧美精品三级在线观看| 欧美人xxxx| 久久久国产精品午夜一区ai换脸| 欧美军同video69gay| 国产欧美一区二区三区沐欲| 精品无码三级在线观看视频 | 精油按摩中文字幕久久| 国产精品亚洲成人| 91黄色免费观看| 精品国产3级a| 亚洲综合久久久久| 国产一区二区三区日韩| 日本久久精品电影| 久久精品人人做人人爽97| 亚洲国产精品综合小说图片区| 国产乱人伦偷精品视频不卡| 91亚洲精品久久久蜜桃网站 | 欧美日韩你懂得| www国产成人免费观看视频 深夜成人网| 中文av字幕一区| 欧美国产精品久久| 精品一区二区在线视频| 男男gaygay亚洲| 亚洲欧美激情插 | 捆绑调教一区二区三区| 成人久久视频在线观看| 中文字幕一区二区三区在线观看| 欧美色图在线观看| 日本乱码高清不卡字幕| 国产一区不卡视频| 亚洲午夜久久久久久久久电影院| 成人黄色免费短视频| 综合激情网...| 欧美日韩国产高清一区二区| 三级久久三级久久| 日韩欧美一级二级| 91最新地址在线播放| 伊人色综合久久天天| 在线一区二区三区四区| 自拍视频在线观看一区二区| 91麻豆高清视频| 午夜精品福利在线| 久久老女人爱爱| 99在线精品视频| 激情综合五月天| 欧美国产97人人爽人人喊| av激情综合网| 粉嫩av一区二区三区粉嫩| 欧美国产精品劲爆| 在线综合+亚洲+欧美中文字幕| 亚洲最大色网站| 久久久.com| 91九色02白丝porn| 亚欧色一区w666天堂|