1/* 2 * Copyright (c) 2011, 2017 ARM Limited 3 * All rights reserved 4 * 5 * The license below extends only to copyright in the software and shall 6 * not be construed as granting a license to any other intellectual 7 * property including but not limited to intellectual property relating 8 * to a hardware implementation of the functionality of the software --- 29 unchanged lines hidden (view full) --- 38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 * 40 * Authors: Nathan Binkert 41 */ 42 43#ifdef linux 44#define _GNU_SOURCE 45#include <sched.h> |
46 |
47#endif 48 49#include <err.h> 50#include <fcntl.h> 51#include <inttypes.h> 52#include <stdio.h> 53#include <stdlib.h> 54#include <string.h> --- 289 unchanged lines hidden (view full) --- 344 { "dumpstats", do_dump_stats, "[delay [period]]" }, 345 { "dumpresetstats", do_dump_reset_stats, "[delay [period]]" }, 346 { "readfile", do_read_file, "" }, 347 { "writefile", do_write_file, "<filename>" }, 348 { "execfile", do_exec_file, "" }, 349 { "checkpoint", do_checkpoint, "[delay [period]]" }, 350 { "addsymbol", do_addsymbol, "<address> <symbol>" }, 351 { "loadsymbol", do_loadsymbol, "" }, |
352 { "initparam", do_initparam, "[key] // key must be shorter" 353 " than 16 chars" }, |
354 { "sw99param", do_sw99param, "" }, 355#ifdef linux 356 { "pin", do_pin, "<cpu> <program> [args ...]" } 357#endif 358}; 359int numfuncs = sizeof(mainfuncs) / sizeof(mainfuncs[0]); 360 361void --- 19 unchanged lines hidden (view full) --- 381 int fd; 382 383 fd = open("/dev/mem", O_RDWR | O_SYNC); 384 if (fd == -1) { 385 perror("Can't open /dev/mem"); 386 exit(1); 387 } 388 |
389 m5_mem = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 390 M5OP_ADDR); |
391 if (!m5_mem) { 392 perror("Can't mmap /dev/mem"); 393 exit(1); 394 } 395#endif 396} 397 398int --- 24 unchanged lines hidden --- |