25 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
26 |
* |
* |
27 |
* |
* |
28 |
* $Id: device.c,v 1.13 2005/02/26 17:37:25 debug Exp $ |
* $Id: device.c,v 1.14 2005/06/22 08:13:38 debug Exp $ |
29 |
* |
* |
30 |
* Device registry framework. |
* Device registry framework. |
31 |
*/ |
*/ |
164 |
if (step == 0) |
if (step == 0) |
165 |
do_return = 1; |
do_return = 1; |
166 |
|
|
167 |
step /= 2; |
if (step & 1) |
168 |
|
step = (step/2) + 1; |
169 |
|
else |
170 |
|
step /= 2; |
171 |
} |
} |
172 |
} |
} |
173 |
|
|
216 |
/* |
/* |
217 |
* device_add(): |
* device_add(): |
218 |
* |
* |
219 |
* Add a device to a machine. |
* Add a device to a machine. For example: "kn210 addr=0x12340000" adds a |
220 |
|
* device called "kn210" at a specific address. |
221 |
* |
* |
222 |
* "kn210 addr=0x12340000" adds a kn210 device at a specific address. |
* TODO: This function is quite ugly, and should be cleaned up. |
223 |
*/ |
*/ |
224 |
void *device_add(struct machine *machine, char *name_and_params) |
void *device_add(struct machine *machine, char *name_and_params) |
225 |
{ |
{ |
353 |
|
|
354 |
/* |
/* |
355 |
* device_set_exit_on_error(): |
* device_set_exit_on_error(): |
356 |
|
* |
357 |
|
* This function selects the behaviour of the emulator when a device is not |
358 |
|
* found. During startup, it is nicest to abort the whole emulator session, |
359 |
|
* but if a device addition is attempted from within the debugger, then it is |
360 |
|
* nicer to just print a warning and continue. |
361 |
*/ |
*/ |
362 |
void device_set_exit_on_error(int exit_on_error) |
void device_set_exit_on_error(int exit_on_error) |
363 |
{ |
{ |
369 |
* device_init(): |
* device_init(): |
370 |
* |
* |
371 |
* Initialize the device registry, and call autodev_init() to automatically |
* Initialize the device registry, and call autodev_init() to automatically |
372 |
* add all normal devices (from the devices/ directory). |
* add all normal devices (from the src/devices/ directory). |
373 |
* |
* |
374 |
* This function should be called before any other device_*() function is used. |
* This function should be called before any other device_*() function is used. |
375 |
*/ |
*/ |