Display warning when a PCI device can not be initialised due to insufficient available PCI slots.
This commit is contained in:
parent
ad1889864f
commit
f7384bf085
3 changed files with 10 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ static void *device_priv[256];
|
||||||
static device_t *devices[256];
|
static device_t *devices[256];
|
||||||
|
|
||||||
static device_t *current_device;
|
static device_t *current_device;
|
||||||
|
char *current_device_name = NULL;
|
||||||
|
|
||||||
void device_init()
|
void device_init()
|
||||||
{
|
{
|
||||||
|
|
@ -27,6 +28,7 @@ void device_add(device_t *d)
|
||||||
fatal("device_add : too many devices\n");
|
fatal("device_add : too many devices\n");
|
||||||
|
|
||||||
current_device = d;
|
current_device = d;
|
||||||
|
current_device_name = d->name;
|
||||||
|
|
||||||
if (d->init != NULL)
|
if (d->init != NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -37,6 +39,7 @@ void device_add(device_t *d)
|
||||||
|
|
||||||
devices[c] = d;
|
devices[c] = d;
|
||||||
device_priv[c] = priv;
|
device_priv[c] = priv;
|
||||||
|
current_device_name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_close_all()
|
void device_close_all()
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,8 @@ void device_speed_changed();
|
||||||
void device_force_redraw();
|
void device_force_redraw();
|
||||||
void device_add_status_info(char *s, int max_len);
|
void device_add_status_info(char *s, int max_len);
|
||||||
|
|
||||||
|
extern char *current_device_name;
|
||||||
|
|
||||||
int device_get_config_int(char *name);
|
int device_get_config_int(char *name);
|
||||||
char *device_get_config_string(char *name);
|
char *device_get_config_string(char *name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
#include "ibm.h"
|
#include "ibm.h"
|
||||||
|
#include "device.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "mem.h"
|
#include "mem.h"
|
||||||
#include "pic.h"
|
#include "pic.h"
|
||||||
|
|
@ -218,5 +219,9 @@ int pci_add(uint8_t (*read)(int func, int addr, void *priv), void (*write)(int f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (current_device_name)
|
||||||
|
warning("Failed to initialise PCI device '%s' due to insufficient available slots", current_device_name);
|
||||||
|
else
|
||||||
|
warning("Failed to initialise PCI device due to insufficient available slots");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue