25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: dev_mp.c,v 1.34 2006/02/09 20:02:59 debug Exp $ |
* $Id: dev_mp.c,v 1.37 2006/07/01 21:15:46 debug Exp $ |
29 |
* |
* |
30 |
* This is a fake multiprocessor (MP) device. It can be useful for |
* This is a fake multiprocessor (MP) device. It can be useful for |
31 |
* theoretical experiments, but probably bares no resemblance to any |
* theoretical experiments, but probably bares no resemblance to any |
42 |
#include "machine.h" |
#include "machine.h" |
43 |
#include "memory.h" |
#include "memory.h" |
44 |
#include "misc.h" |
#include "misc.h" |
45 |
#include "mp.h" |
|
46 |
|
#include "testmachine/dev_mp.h" |
47 |
|
|
48 |
|
|
49 |
struct mp_data { |
struct mp_data { |
121 |
break; |
break; |
122 |
|
|
123 |
case DEV_MP_PAUSE_CPU: |
case DEV_MP_PAUSE_CPU: |
124 |
/* Pause all cpus except our selves: */ |
/* Pause all cpus except a specific CPU: */ |
125 |
which_cpu = idata; |
which_cpu = idata; |
126 |
|
|
127 |
for (i=0; i<cpu->machine->ncpus; i++) |
for (i=0; i<cpu->machine->ncpus; i++) |
229 |
|
|
230 |
case DEV_MP_NCYCLES: |
case DEV_MP_NCYCLES: |
231 |
/* |
/* |
232 |
* Return approximately the number of cycles executed |
* Return _approximately_ the number of cycles executed |
233 |
* in this machine. (This value is not updated for each |
* in this machine. |
234 |
* instruction.) |
* |
235 |
|
* Note: At the moment, this is actually the number of |
236 |
|
* instructions executed on CPU 0. |
237 |
|
* |
238 |
|
* (This value is not updated for each instruction.) |
239 |
*/ |
*/ |
240 |
odata = cpu->machine->ncycles; |
odata = cpu->machine->ninstrs; |
241 |
break; |
break; |
242 |
|
|
243 |
default: |
default: |