m5.c (2665:a124942bacb8) | m5.c (3038:a20a6f060dd7) |
---|---|
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> | 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> |
|
35 36#include "m5op.h" 37 38char *progname; 39 40void 41usage() 42{ 43 printf("usage: m5 ivlb <interval>\n" 44 " m5 ivle <interval>\n" 45 " m5 initparam\n" 46 " m5 sw99param\n" 47 " m5 exit [delay]\n" 48 " m5 resetstats [delay [period]]\n" 49 " m5 dumpstats [delay [period]]\n" 50 " m5 dumpresetstats [delay [period]]\n" 51 " m5 checkpoint [delay [period]]\n" | 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" |
|
52 "\n" 53 "All times in nanoseconds!\n"); 54 exit(1); 55} 56 57#define COMPARE(X) (strcmp(X, command) == 0) 58 59int --- 119 unchanged lines hidden (view full) --- 179 180 default: 181 usage(); 182 } 183 184 return 0; 185 } 186 | 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 |
|
187 usage(); 188} | 205 usage(); 206} |