summaryrefslogtreecommitdiffstats
path: root/include/blspec.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/blspec.h')
-rw-r--r--include/blspec.h60
1 files changed, 4 insertions, 56 deletions
diff --git a/include/blspec.h b/include/blspec.h
index c956f0d940..7a16ae73c6 100644
--- a/include/blspec.h
+++ b/include/blspec.h
@@ -14,6 +14,8 @@ struct bootentry {
struct menu_entry me;
char *title;
char *description;
+ int (*boot)(struct bootentry *entry, int verbose, int dryrun);
+ void (*release)(struct bootentry *entry);
};
struct blspec_entry {
@@ -23,8 +25,6 @@ struct blspec_entry {
struct cdev *cdev;
char *rootpath;
char *configpath;
-
- char *scriptpath;
};
int blspec_entry_var_set(struct blspec_entry *entry, const char *name,
@@ -39,61 +39,9 @@ int blspec_scan_device(struct bootentries *bootentries, struct device_d *dev);
int blspec_scan_devicename(struct bootentries *bootentries, const char *devname);
int blspec_scan_directory(struct bootentries *bootentries, const char *root);
+int bootentries_add_entry(struct bootentries *entries, struct bootentry *entry);
+
#define bootentries_for_each_entry(bootentries, entry) \
list_for_each_entry(entry, &bootentries->entries, list)
-static inline struct blspec_entry *blspec_entry_alloc(struct bootentries *bootentries)
-{
- struct blspec_entry *entry;
-
- entry = xzalloc(sizeof(*entry));
-
- entry->node = of_new_node(NULL, NULL);
-
- list_add_tail(&entry->entry.list, &bootentries->entries);
-
- return entry;
-}
-
-static inline void blspec_entry_free(struct blspec_entry *entry)
-{
- list_del(&entry->entry.list);
- of_delete_node(entry->node);
- free(entry->entry.me.display);
- free(entry->entry.title);
- free(entry->entry.description);
- free(entry->scriptpath);
- free(entry->configpath);
- free(entry->rootpath);
- free(entry);
-}
-
-static inline struct bootentries *blspec_alloc(void)
-{
- struct bootentries *bootentries;
-
- bootentries = xzalloc(sizeof(*bootentries));
- INIT_LIST_HEAD(&bootentries->entries);
-
- if (IS_ENABLED(CONFIG_MENU))
- bootentries->menu = menu_alloc();
-
- return bootentries;
-}
-
-static inline void blspec_free(struct bootentries *bootentries)
-{
- struct bootentry *be, *tmp;
- struct blspec_entry *entry;
-
- list_for_each_entry_safe(be, tmp, &bootentries->entries, list) {
- entry = container_of(be, struct blspec_entry, entry);
- blspec_entry_free(entry);
- }
- if (bootentries->menu)
- free(bootentries->menu->display);
- free(bootentries->menu);
- free(bootentries);
-}
-
#endif /* __LOADER_H__ */