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

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

?? loader.c

?? 自己寫的c語言版的軟件實現cpu的pipeline功能的程序。對于學習體系結構的同仁有好處。
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* loader.c - program loader routines *//* SimpleScalar(TM) Tool Suite * Copyright (C) 1994-2003 by Todd M. Austin, Ph.D. and SimpleScalar, LLC. * All Rights Reserved.  *  * THIS IS A LEGAL DOCUMENT, BY USING SIMPLESCALAR, * YOU ARE AGREEING TO THESE TERMS AND CONDITIONS. *  * No portion of this work may be used by any commercial entity, or for any * commercial purpose, without the prior, written permission of SimpleScalar, * LLC (info@simplescalar.com). Nonprofit and noncommercial use is permitted * as described below. *  * 1. SimpleScalar is provided AS IS, with no warranty of any kind, express * or implied. The user of the program accepts full responsibility for the * application of the program and the use of any results. *  * 2. Nonprofit and noncommercial use is encouraged. SimpleScalar may be * downloaded, compiled, executed, copied, and modified solely for nonprofit, * educational, noncommercial research, and noncommercial scholarship * purposes provided that this notice in its entirety accompanies all copies. * Copies of the modified software can be delivered to persons who use it * solely for nonprofit, educational, noncommercial research, and * noncommercial scholarship purposes provided that this notice in its * entirety accompanies all copies. *  * 3. ALL COMMERCIAL USE, AND ALL USE BY FOR PROFIT ENTITIES, IS EXPRESSLY * PROHIBITED WITHOUT A LICENSE FROM SIMPLESCALAR, LLC (info@simplescalar.com). *  * 4. No nonprofit user may place any restrictions on the use of this software, * including as modified by the user, by any other authorized user. *  * 5. Noncommercial and nonprofit users may distribute copies of SimpleScalar * in compiled or executable form as set forth in Section 2, provided that * either: (A) it is accompanied by the corresponding machine-readable source * code, or (B) it is accompanied by a written offer, with no time limit, to * give anyone a machine-readable copy of the corresponding source code in * return for reimbursement of the cost of distribution. This written offer * must permit verbatim duplication by anyone, or (C) it is distributed by * someone who received only the executable form, and is accompanied by a * copy of the written offer of source code. *  * 6. SimpleScalar was developed by Todd M. Austin, Ph.D. The tool suite is * currently maintained by SimpleScalar LLC (info@simplescalar.com). US Mail: * 2395 Timbercrest Court, Ann Arbor, MI 48105. *  * Copyright (C) 1994-2003 by Todd M. Austin, Ph.D. and SimpleScalar, LLC. */#include <stdio.h>#include <stdlib.h>#include "host.h"#include "misc.h"#include "machine.h"#include "endian.h"#include "regs.h"#include "memory.h"#include "sim.h"#include "eio.h"#include "loader.h"#ifdef BFD_LOADER#include <bfd.h>#else /* !BFD_LOADER */#include "target-pisa/ecoff.h"#endif /* BFD_LOADER *//* amount of tail padding added to all loaded text segments */#define TEXT_TAIL_PADDING 128/* program text (code) segment base */md_addr_t ld_text_base = 0;/* program text (code) size in bytes */unsigned int ld_text_size = 0;/* program initialized data segment base */md_addr_t ld_data_base = 0;/* program initialized ".data" and uninitialized ".bss" size in bytes */unsigned int ld_data_size = 0;/* top of the data segment */md_addr_t ld_brk_point = 0;/* program stack segment base (highest address in stack) */md_addr_t ld_stack_base = MD_STACK_BASE;/* program initial stack size */unsigned int ld_stack_size = 0;/* lowest address accessed on the stack */md_addr_t ld_stack_min = (md_addr_t)-1;/* program file name */char *ld_prog_fname = NULL;/* program entry point (initial PC) */md_addr_t ld_prog_entry = 0;/* program environment base address address */md_addr_t ld_environ_base = 0;/* target executable endian-ness, non-zero if big endian */int ld_target_big_endian;/* register simulator-specific statistics */voidld_reg_stats(struct stat_sdb_t *sdb)	/* stats data base */{  stat_reg_addr(sdb, "ld_text_base",		"program text (code) segment base",		&ld_text_base, ld_text_base, "  0x%08p");  stat_reg_uint(sdb, "ld_text_size",		"program text (code) size in bytes",		&ld_text_size, ld_text_size, NULL);  stat_reg_addr(sdb, "ld_data_base",		"program initialized data segment base",		&ld_data_base, ld_data_base, "  0x%08p");  stat_reg_uint(sdb, "ld_data_size",		"program init'ed `.data' and uninit'ed `.bss' size in bytes",		&ld_data_size, ld_data_size, NULL);  stat_reg_addr(sdb, "ld_stack_base",		"program stack segment base (highest address in stack)",		&ld_stack_base, ld_stack_base, "  0x%08p");  stat_reg_uint(sdb, "ld_stack_size",		"program initial stack size",		&ld_stack_size, ld_stack_size, NULL);#if 0 /* FIXME: broken... */  stat_reg_addr(sdb, "ld_stack_min",		"program stack segment lowest address",		&ld_stack_min, ld_stack_min, "  0x%08p");#endif  stat_reg_addr(sdb, "ld_prog_entry",		"program entry point (initial PC)",		&ld_prog_entry, ld_prog_entry, "  0x%08p");  stat_reg_addr(sdb, "ld_environ_base",		"program environment base address address",		&ld_environ_base, ld_environ_base, "  0x%08p");  stat_reg_int(sdb, "ld_target_big_endian",	       "target executable endian-ness, non-zero if big endian",	       &ld_target_big_endian, ld_target_big_endian, NULL);}/* load program text and initialized data into simulated virtual memory   space and initialize program segment range variables */voidld_load_prog(char *fname,		/* program to load */	     int argc, char **argv,	/* simulated program cmd line args */	     char **envp,		/* simulated program environment */	     struct regs_t *regs,	/* registers to initialize for load */	     struct mem_t *mem,		/* memory space to load prog into */	     int zero_bss_segs)		/* zero uninit data segment? */{  int i;  word_t temp;  md_addr_t sp, data_break = 0, null_ptr = 0, argv_addr, envp_addr;  if (eio_valid(fname))    {      if (argc != 1)	{	  fprintf(stderr, "error: EIO file has arguments\n");	  exit(1);	}      fprintf(stderr, "sim: loading EIO file: %s\n", fname);      sim_eio_fname = mystrdup(fname);      /* open the EIO file stream */      sim_eio_fd = eio_open(fname);      /* load initial state checkpoint */      if (eio_read_chkpt(regs, mem, sim_eio_fd) != -1)	fatal("bad initial checkpoint in EIO file");      /* load checkpoint? */      if (sim_chkpt_fname != NULL)	{	  counter_t restore_icnt;	  FILE *chkpt_fd;	  fprintf(stderr, "sim: loading checkpoint file: %s\n",		  sim_chkpt_fname);	  if (!eio_valid(sim_chkpt_fname))	    fatal("file `%s' does not appear to be a checkpoint file",		  sim_chkpt_fname);	  /* open the checkpoint file */	  chkpt_fd = eio_open(sim_chkpt_fname);	  /* load the state image */	  restore_icnt = eio_read_chkpt(regs, mem, chkpt_fd);	  /* fast forward the baseline EIO trace to checkpoint location */	  myfprintf(stderr, "sim: fast forwarding to instruction %n\n",		    restore_icnt);	  eio_fast_forward(sim_eio_fd, restore_icnt);	}      /* computed state... */      ld_environ_base = regs->regs_R[MD_REG_SP];      ld_prog_entry = regs->regs_PC;      /* fini... */      return;    }#ifdef MD_CROSS_ENDIAN  else    {      fatal("SimpleScalar/PISA only supports binary execution on\n"	    "       same-endian hosts, use EIO files on cross-endian hosts");    }#endif /* MD_CROSS_ENDIAN */  if (sim_chkpt_fname != NULL)    fatal("checkpoints only supported while EIO tracing");#ifdef BFD_LOADER  {    bfd *abfd;    asection *sect;    /* set up a local stack pointer, this is where the argv and envp       data is written into program memory */    ld_stack_base = MD_STACK_BASE;    sp = ROUND_DOWN(MD_STACK_BASE - MD_MAX_ENVIRON, sizeof(dfloat_t));    ld_stack_size = ld_stack_base - sp;    /* initial stack pointer value */    ld_environ_base = sp;    /* load the program into memory, try both endians */    if (!(abfd = bfd_openr(argv[0], "ss-coff-big")))      if (!(abfd = bfd_openr(argv[0], "ss-coff-little")))	fatal("cannot open executable `%s'", argv[0]);    /* this call is mainly for its side effect of reading in the sections.       we follow the traditional behavior of `strings' in that we don't       complain if we don't recognize a file to be an object file.  */    if (!bfd_check_format(abfd, bfd_object))      {	bfd_close(abfd);	fatal("cannot open executable `%s'", argv[0]);      }    /* record profile file name */    ld_prog_fname = argv[0];    /* record endian of target */    ld_target_big_endian = abfd->xvec->byteorder_big_p;    debug("processing %d sections in `%s'...",	  bfd_count_sections(abfd), argv[0]);    /* read all sections in file */    for (sect=abfd->sections; sect; sect=sect->next)      {	char *p;	debug("processing section `%s', %d bytes @ 0x%08x...",	      bfd_section_name(abfd, sect), bfd_section_size(abfd, sect),	      bfd_section_vma(abfd, sect));	/* read the section data, if allocated and loadable and non-NULL */	if ((bfd_get_section_flags(abfd, sect) & SEC_ALLOC)	    && (bfd_get_section_flags(abfd, sect) & SEC_LOAD)	    && bfd_section_vma(abfd, sect)	    && bfd_section_size(abfd, sect))	  {	    /* allocate a section buffer */	    p = calloc(bfd_section_size(abfd, sect), sizeof(char));	    if (!p)	      fatal("cannot allocate %d bytes for section `%s'",		    bfd_section_size(abfd, sect),		    bfd_section_name(abfd, sect));	    if (!bfd_get_section_contents(abfd, sect, p, (file_ptr)0,					  bfd_section_size(abfd, sect)))	      fatal("could not read entire `%s' section from executable",		    bfd_section_name(abfd, sect));	    /* copy program section it into simulator target memory */	    mem_bcopy(mem_access, mem, Write, bfd_section_vma(abfd, sect),		      p, bfd_section_size(abfd, sect));	    /* release the section buffer */	    free(p);	  }	/* zero out the section if it is loadable but not allocated in exec */	else if (zero_bss_segs		 && (bfd_get_section_flags(abfd, sect) & SEC_LOAD)		 && bfd_section_vma(abfd, sect)		 && bfd_section_size(abfd, sect))	  {	    /* zero out the section region */	    mem_bzero(mem_access, mem,		      bfd_section_vma(abfd, sect),		      bfd_section_size(abfd, sect));	  }	else	  {	    /* else do nothing with this section, it's probably debug data */	    debug("ignoring section `%s' during load...",		  bfd_section_name(abfd, sect));	  }	/* expected text section */	if (!strcmp(bfd_section_name(abfd, sect), ".text"))	  {	    /* .text section processing */	    ld_text_size =	      ((bfd_section_vma(abfd, sect) + bfd_section_size(abfd, sect))	       - MD_TEXT_BASE)		+ /* for speculative fetches/decodes */TEXT_TAIL_PADDING;	    /* create tail padding and copy into simulator target memory */	    mem_bzero(mem_access, mem,		      bfd_section_vma(abfd, sect)		      + bfd_section_size(abfd, sect),		      TEXT_TAIL_PADDING);	  }	/* expected data sections */	else if (!strcmp(bfd_section_name(abfd, sect), ".rdata")		 || !strcmp(bfd_section_name(abfd, sect), ".data")

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区三区在线看| 一区二区三区欧美久久| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美无乱码久久久免费午夜一区| 一区二区在线观看av| 欧美日韩在线精品一区二区三区激情 | 欧美色倩网站大全免费| 亚洲一区二区三区自拍| 日韩女优av电影| 国产精品资源网站| 亚洲欧美日韩国产中文在线| 欧美日韩一区二区三区在线看| 日本怡春院一区二区| 久久这里只精品最新地址| 成人av网站在线观看免费| 一区二区三区在线免费观看| 欧美一区二区二区| 欧美精品一二三| 国产美女在线观看一区| 在线不卡欧美精品一区二区三区| 蜜臀99久久精品久久久久久软件| 久久蜜桃av一区精品变态类天堂 | 亚洲视频免费看| 欧美老女人在线| 国产成人av一区| 亚洲午夜电影网| 精品国产一区二区三区不卡| 风间由美一区二区av101| 亚洲一区视频在线观看视频| 日韩精品一区二区三区视频在线观看 | 日本欧美加勒比视频| 中文字幕av一区 二区| 欧美日韩在线直播| 东方欧美亚洲色图在线| 天天色天天操综合| 亚洲欧洲日韩av| 日韩女优av电影| 色妹子一区二区| 国产乱一区二区| 午夜精品福利视频网站| 中文字幕永久在线不卡| 欧美大片免费久久精品三p | 欧美性生活影院| 国产成人精品网址| 日韩成人一级片| 一区二区三区国产豹纹内裤在线| 国产香蕉久久精品综合网| 欧美美女视频在线观看| 不卡av免费在线观看| 免费观看一级欧美片| 亚洲午夜三级在线| 国产精品久久久久久久久免费丝袜| 欧美剧情片在线观看| 91在线国产福利| 国产精品原创巨作av| 日韩电影在线观看电影| 亚洲午夜久久久久久久久电影网 | 91在线视频播放| 国产精品亚洲午夜一区二区三区| 日韩精品每日更新| 亚洲黄色小说网站| 国产精品美女久久久久aⅴ国产馆| 欧美电影免费观看高清完整版在线观看| 99riav久久精品riav| 国产精品一品视频| 国产一区二区在线观看免费| 奇米色777欧美一区二区| 亚洲综合小说图片| 亚洲午夜激情av| 亚洲成人自拍网| 亚洲综合色自拍一区| 亚洲激情校园春色| 亚洲精品国产a久久久久久 | 国产自产v一区二区三区c| 男女激情视频一区| 日韩国产欧美视频| 日韩精品每日更新| 青青青爽久久午夜综合久久午夜| 婷婷综合另类小说色区| 午夜精品福利视频网站| 日本不卡在线视频| 蜜桃精品视频在线| 激情国产一区二区| 国产一区二区美女诱惑| 东方aⅴ免费观看久久av| 成人av在线资源| 99精品桃花视频在线观看| 一本色道a无线码一区v| 欧美自拍丝袜亚洲| 欧美男生操女生| 日韩欧美久久久| 久久久久久久久久久久久女国产乱 | 狠狠色丁香久久婷婷综| 国产精品99久久久久久宅男| 国产91丝袜在线18| 不卡一区二区中文字幕| 色菇凉天天综合网| 欧美日韩高清一区| 欧美va天堂va视频va在线| 久久久久久综合| 自拍偷拍国产亚洲| 亚洲大尺度视频在线观看| 久久精品国产99久久6| 国产一区二区三区四区五区美女| 成人午夜av影视| 欧洲亚洲精品在线| 精品卡一卡二卡三卡四在线| 亚洲国产精品黑人久久久| 一区二区三区在线观看国产| 视频一区二区三区在线| 狠狠网亚洲精品| 成人av在线影院| 欧美老女人第四色| 中文字幕av资源一区| 亚洲黄色av一区| 久久99深爱久久99精品| 成人av网站在线观看| 51精品国自产在线| 国产精品毛片久久久久久| 午夜一区二区三区视频| 国产精品系列在线观看| 欧美日产在线观看| 日本一区二区三区在线观看| 亚洲一区二区五区| 国产成人a级片| 欧美精品一卡二卡| 亚洲欧美影音先锋| 美脚の诱脚舐め脚责91 | 欧美日韩成人在线| 日本一区二区动态图| 日本aⅴ精品一区二区三区| 成人av网站在线观看免费| 91精品国产综合久久婷婷香蕉| 欧美激情综合在线| 日本中文一区二区三区| 日本韩国欧美三级| 国产日韩欧美麻豆| 美美哒免费高清在线观看视频一区二区| 91亚洲国产成人精品一区二区三| 欧美成人精品3d动漫h| 亚洲午夜久久久久中文字幕久| 成人性生交大合| 26uuu精品一区二区| 亚洲18影院在线观看| 91麻豆免费观看| 中文字幕va一区二区三区| 捆绑变态av一区二区三区| 欧美丝袜自拍制服另类| 无码av免费一区二区三区试看 | 久久综合成人精品亚洲另类欧美| 亚洲午夜精品在线| 色综合中文字幕| 中文字幕国产一区| 国产精品一品二品| 精品国产乱码久久| 另类专区欧美蜜桃臀第一页| 欧美日韩一区二区三区在线看 | 午夜国产精品影院在线观看| 色综合久久综合网97色综合| 中文字幕av一区二区三区| 国产一区二区看久久| 欧美成人一级视频| 老司机精品视频导航| 日韩一区二区三区免费看| 午夜精品福利一区二区蜜股av | 91麻豆精品在线观看| 国产精品久久久久国产精品日日| 国内外成人在线视频| 26uuu欧美| 国产乱子伦视频一区二区三区 | 色综合网色综合| 亚洲欧洲99久久| 在线国产亚洲欧美| 亚洲综合久久久久| 欧美日本精品一区二区三区| 午夜精品一区二区三区电影天堂| 欧美日韩一区久久| 男女视频一区二区| 精品精品国产高清a毛片牛牛| 久久福利视频一区二区| 欧美精品一区二区三区很污很色的 | 欧美一区二区免费| 九九视频精品免费| 久久精品亚洲国产奇米99| 国产成人av福利| 自拍偷拍欧美精品| 欧美日韩在线三区| 麻豆极品一区二区三区| 久久精品一区二区三区四区| 波多野结衣亚洲| 亚洲综合在线视频| 欧美一级片在线| 精品一区二区三区av| 国产精品理论在线观看| 在线视频综合导航| 久久99国产乱子伦精品免费| 国产欧美精品一区二区色综合朱莉| 99riav一区二区三区| 日本麻豆一区二区三区视频| 青娱乐精品视频在线|