Added back in the actual call to load().

This commit is contained in:
Michael Brown
2005-04-26 17:12:07 +00:00
parent e301acc0d4
commit fda36a0c1a
4 changed files with 59 additions and 22 deletions

View File

@@ -180,6 +180,11 @@ struct type_driver {
char *name;
struct type_dev *type_dev; /* single instance */
char * ( * describe_device ) ( struct type_dev *type_dev );
int ( * configure ) ( struct type_dev *type_dev );
int ( * load ) ( struct type_dev *type_dev,
int ( * process ) ( unsigned char *data,
unsigned int blocknum,
unsigned int len, int eof ) );
};
#define __type_driver __attribute__ (( used, __section__ ( ".drivers.type" ) ))
@@ -266,6 +271,17 @@ static inline void select_device ( struct dev *dev,
dev->bus_driver = bus_driver;
memcpy ( &dev->bus_loc, bus_loc, sizeof ( dev->bus_loc ) );
}
/* Configure a device */
static inline int configure ( struct dev *dev ) {
return dev->type_driver->configure ( dev->type_dev );
}
/* Boot from a device */
static inline int load ( struct dev *dev,
int ( * process ) ( unsigned char *data,
unsigned int blocknum,
unsigned int len, int eof ) ) {
return dev->type_driver->load ( dev->type_dev, process );
}
/* Linker symbols for the various tables */
extern struct bus_driver bus_drivers[];

View File

@@ -182,7 +182,7 @@ External prototypes
/* main.c */
struct Elf_Bhdr;
extern int main();
extern int loadkernel P((const char *fname));
extern int loadkernel P((const char *fname, int (*)(unsigned char *, unsigned int, unsigned int, int)));
extern char as_main_program;
/* nic.c */
extern void rx_qdrain P((void));