1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 18 unchanged lines hidden (view full) --- 27 * 28 * Authors: Nathan Binkert 29 */ 30 31#include <inttypes.h> 32#include <stdio.h> 33#include <stdlib.h> 34#include <string.h> |
35#include <unistd.h> |
36 37#include "m5op.h" 38 39char *progname; 40 41void 42usage() 43{ 44 printf("usage: m5 ivlb <interval>\n" 45 " m5 ivle <interval>\n" 46 " m5 initparam\n" 47 " m5 sw99param\n" 48 " m5 exit [delay]\n" 49 " m5 resetstats [delay [period]]\n" 50 " m5 dumpstats [delay [period]]\n" 51 " m5 dumpresetstats [delay [period]]\n" 52 " m5 checkpoint [delay [period]]\n" |
53 " m5 readfile\n" |
54 "\n" 55 "All times in nanoseconds!\n"); 56 exit(1); 57} 58 59#define COMPARE(X) (strcmp(X, command) == 0) 60 61int --- 119 unchanged lines hidden (view full) --- 181 182 default: 183 usage(); 184 } 185 186 return 0; 187 } 188 |
189 if (COMPARE("readfile")) { 190 char buf[256*1024]; 191 int offset = 0; 192 int len; 193 194 if (argc != 2) 195 usage(); 196 197 while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) { 198 write(STDOUT_FILENO, buf, len); 199 offset += len; 200 } 201 202 return 0; 203 } 204 |
205 usage(); 206} |