m5.c (11289:ab19693da8c9) m5.c (11320:42ecb523c64a)
1/*
2 * Copyright (c) 2011 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

--- 271 unchanged lines hidden (view full) ---

280
281#ifdef linux
282void
283do_pin(int argc, char *argv[])
284{
285 if (argc < 2)
286 usage();
287
1/*
2 * Copyright (c) 2011 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

--- 271 unchanged lines hidden (view full) ---

280
281#ifdef linux
282void
283do_pin(int argc, char *argv[])
284{
285 if (argc < 2)
286 usage();
287
288 cpu_set_t mask;
288 cpu_set_t mask;
289 CPU_ZERO(&mask);
290
291 const char *sep = ",";
292 char *target = strtok(argv[0], sep);
293 while (target) {
294 CPU_SET(atoi(target), &mask);
295 target = strtok(NULL, sep);
289 CPU_ZERO(&mask);
290
291 const char *sep = ",";
292 char *target = strtok(argv[0], sep);
293 while (target) {
294 CPU_SET(atoi(target), &mask);
295 target = strtok(NULL, sep);
296 }
296 }
297
298 if (sched_setaffinity(0, sizeof(cpu_set_t), &mask) < 0)
299 err(1, "setaffinity");
300
301 execvp(argv[1], &argv[1]);
302 err(1, "execvp failed!");
303}
304#endif

--- 88 unchanged lines hidden ---
297
298 if (sched_setaffinity(0, sizeof(cpu_set_t), &mask) < 0)
299 err(1, "setaffinity");
300
301 execvp(argv[1], &argv[1]);
302 err(1, "execvp failed!");
303}
304#endif

--- 88 unchanged lines hidden ---