From fda36a0c1a60020dd217fe5dd5f58693ed41c676 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 26 Apr 2005 17:12:07 +0000 Subject: Added back in the actual call to load(). --- src/include/dev.h | 16 ++++++++++++++++ src/include/etherboot.h | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/dev.h b/src/include/dev.h index 94833495c..e441da5ea 100644 --- a/src/include/dev.h +++ b/src/include/dev.h @@ -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[]; diff --git a/src/include/etherboot.h b/src/include/etherboot.h index b7b58681d..2e76d22ab 100644 --- a/src/include/etherboot.h +++ b/src/include/etherboot.h @@ -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)); -- cgit v1.2.3-55-g7522