summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/dev.h16
-rw-r--r--src/include/etherboot.h2
2 files changed, 17 insertions, 1 deletions
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));