diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/binfmt.h | 39 | ||||
-rw-r--r-- | include/driver.h | 7 | ||||
-rw-r--r-- | include/filetype.h | 1 | ||||
-rw-r--r-- | include/menu.h | 1 | ||||
-rw-r--r-- | include/net.h | 8 |
5 files changed, 49 insertions, 7 deletions
diff --git a/include/binfmt.h b/include/binfmt.h new file mode 100644 index 0000000000..46b627e36d --- /dev/null +++ b/include/binfmt.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2012 Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> + * + * GPL v2 + */ + +#ifndef __BFMT_H__ +#define __BFMT_H__ + +#include <filetype.h> +#include <linux/list.h> + +struct binfmt_hook { + enum filetype type; + int (*hook)(struct binfmt_hook *b, char *file, int argc, char **argv); + char *exec; + + struct list_head list; +}; + +#ifdef CONFIG_BINFMT +int binfmt_register(struct binfmt_hook *b); +void binfmt_unregister(struct binfmt_hook *b); + +int execute_binfmt(int argc, char **argv); +#else +static inline int binfmt_register(struct binfmt_hook *b) +{ + return -EINVAL; +} +static inline void binfmt_unregister(struct binfmt_hook *b) {} + +static inline int execute_binfmt(int argc, char **argv) +{ + return 1; +} +#endif + +#endif /* __BFMT_H__ */ diff --git a/include/driver.h b/include/driver.h index 37620273af..09dd1e45c0 100644 --- a/include/driver.h +++ b/include/driver.h @@ -126,6 +126,11 @@ struct driver_d { #define RW_SIZE(x) (x) #define RW_SIZE_MASK 0x7 +/* dynamically assign the next free id */ +#define DEVICE_ID_DYNAMIC -1 +/* do not use an id (only one device available */ +#define DEVICE_ID_SINGLE -2 + /* Register devices and drivers. */ int register_driver(struct driver_d *); @@ -206,7 +211,7 @@ struct device_d *add_generic_device_res(const char* devname, int id, static inline struct device_d *add_mem_device(const char *name, resource_size_t start, resource_size_t size, unsigned int flags) { - return add_generic_device("mem", -1, name, start, size, + return add_generic_device("mem", DEVICE_ID_DYNAMIC, name, start, size, IORESOURCE_MEM | flags, NULL); } diff --git a/include/filetype.h b/include/filetype.h index d0b62265b0..93387938be 100644 --- a/include/filetype.h +++ b/include/filetype.h @@ -16,6 +16,7 @@ enum filetype { filetype_bzip2, filetype_oftree, filetype_aimage, + filetype_sh, }; const char *file_type_to_string(enum filetype f); diff --git a/include/menu.h b/include/menu.h index 136fe61acd..74abcfb077 100644 --- a/include/menu.h +++ b/include/menu.h @@ -79,6 +79,7 @@ static inline struct menu* menu_alloc(void) if (m) { INIT_LIST_HEAD(&m->entries); m->nb_entries = 0; + m->auto_select = -1; } return m; } diff --git a/include/net.h b/include/net.h index 3f2187eca0..25d7b6e024 100644 --- a/include/net.h +++ b/include/net.h @@ -274,16 +274,12 @@ static inline void net_copy_uint32(uint32_t *to, uint32_t *from) } /* Convert an IP address to a string */ -char *ip_to_string (IPaddr_t x, char *s); +char *ip_to_string (IPaddr_t x); /* Convert a string to ip address */ int string_to_ip(const char *s, IPaddr_t *ip); -IPaddr_t getenv_ip_dns(const char *name, int dns); -static inline IPaddr_t getenv_ip(const char *name) -{ - return getenv_ip_dns(name, 0); -} +IPaddr_t getenv_ip(const char *name); int setenv_ip(const char *name, IPaddr_t ip); int string_to_ethaddr(const char *str, char *enetaddr); |