m5.c (2188:63871985840f) | m5.c (2358:4194f6d8eb87) |
---|---|
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; --- 16 unchanged lines hidden (view full) --- 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <inttypes.h> 30#include <stdio.h> 31#include <stdlib.h> 32#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; --- 16 unchanged lines hidden (view full) --- 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <inttypes.h> 30#include <stdio.h> 31#include <stdlib.h> 32#include <string.h> |
33#include <unistd.h> |
|
33 34#include "m5op.h" 35 36char *progname; 37 38void 39usage() 40{ --- 119 unchanged lines hidden (view full) --- 160 m5_dumpreset_stats(arg1, arg2); 161 return 0; 162 163 default: 164 usage(); 165 } 166 } 167 | 34 35#include "m5op.h" 36 37char *progname; 38 39void 40usage() 41{ --- 119 unchanged lines hidden (view full) --- 161 m5_dumpreset_stats(arg1, arg2); 162 return 0; 163 164 default: 165 usage(); 166 } 167 } 168 |
169 if (COMPARE("readfile")) { 170 char buf[256*1024]; 171 int offset = 0; 172 int len; 173 174 if (argc != 2) 175 usage(); 176 177 while ((len = m5_readfile(buf, sizeof(buf), offset)) > 0) { 178 write(STDOUT_FILENO, buf, len); 179 offset += len; 180 } 181 182 return 0; 183 } 184 |
|
168 if (COMPARE("checkpoint")) { 169 switch (argc) { 170 case 4: 171 arg2 = strtoul(argv[3], NULL, 0); 172 case 3: 173 arg1 = strtoul(argv[2], NULL, 0); 174 case 2: 175 m5_checkpoint(arg1, arg2); 176 return 0; 177 178 default: 179 usage(); 180 } 181 182 return 0; 183 } 184 | 185 if (COMPARE("checkpoint")) { 186 switch (argc) { 187 case 4: 188 arg2 = strtoul(argv[3], NULL, 0); 189 case 3: 190 arg1 = strtoul(argv[2], NULL, 0); 191 case 2: 192 m5_checkpoint(arg1, arg2); 193 return 0; 194 195 default: 196 usage(); 197 } 198 199 return 0; 200 } 201 |
202 if (COMPARE("loadsymbol")) { 203 m5_loadsymbol(arg1); 204 return 0; 205 } 206 |
|
185 usage(); 186} | 207 usage(); 208} |