Leif's API fixes
This commit is contained in:
parent
bb9f92b9b1
commit
b385e0723b
11 changed files with 217 additions and 387 deletions
|
@ -30,8 +30,8 @@
|
|||
# define LINUX_ADDRESS (start_of_ram + 0x8000)
|
||||
# define LINUX_INITRD_ADDRESS (start_of_ram + 0x02000000)
|
||||
# define LINUX_FDT_ADDRESS (LINUX_INITRD_ADDRESS - 0x10000)
|
||||
# define firmware_get_boot_data uboot_get_boot_data
|
||||
# define firmware_get_machine_type uboot_get_machine_type
|
||||
# define firmware_get_boot_data grub_uboot_get_boot_data
|
||||
# define firmware_get_machine_type grub_uboot_get_machine_type
|
||||
#elif defined GRUB_MACHINE_EFI
|
||||
# include <grub/efi/efi.h>
|
||||
# include <grub/machine/loader.h>
|
||||
|
|
|
@ -31,14 +31,13 @@ enum disktype
|
|||
|
||||
struct ubootdisk_data
|
||||
{
|
||||
struct ubootdisk_data *next;
|
||||
void *cookie;
|
||||
int handle;
|
||||
struct device_info *dev;
|
||||
int opencount;
|
||||
enum disktype type;
|
||||
grub_uint32_t block_size;
|
||||
};
|
||||
|
||||
grub_err_t grub_ubootdisk_register (struct device_info *newdev, int handle);
|
||||
grub_err_t grub_ubootdisk_register (struct device_info *newdev);
|
||||
|
||||
#endif /* ! GRUB_UBOOT_DISK_HEADER */
|
||||
|
|
|
@ -28,16 +28,16 @@ void grub_uboot_mm_init (void);
|
|||
void grub_uboot_init (void);
|
||||
void grub_uboot_fini (void);
|
||||
|
||||
void uboot_return (int) __attribute__ ((noreturn));
|
||||
void grub_uboot_return (int) __attribute__ ((noreturn));
|
||||
|
||||
grub_addr_t uboot_get_real_bss_start (void);
|
||||
grub_addr_t grub_uboot_get_real_bss_start (void);
|
||||
|
||||
grub_err_t grub_uboot_probe_hardware (void);
|
||||
|
||||
extern grub_addr_t EXPORT_VAR (start_of_ram);
|
||||
|
||||
grub_uint32_t EXPORT_FUNC (uboot_get_machine_type) (void);
|
||||
grub_addr_t EXPORT_FUNC (uboot_get_boot_data) (void);
|
||||
grub_uint32_t EXPORT_FUNC (grub_uboot_get_machine_type) (void);
|
||||
grub_addr_t EXPORT_FUNC (grub_uboot_get_boot_data) (void);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -47,104 +47,40 @@ grub_addr_t EXPORT_FUNC (uboot_get_boot_data) (void);
|
|||
* We scan through a defined region around the hint address passed to us
|
||||
* from U-Boot.
|
||||
*/
|
||||
#include <grub/uboot/api_public.h>
|
||||
|
||||
#define UBOOT_API_SEARCH_LEN (3 * 1024 * 1024)
|
||||
int uboot_api_init (void);
|
||||
|
||||
/* All functions below are wrappers around the uboot_syscall() function */
|
||||
int grub_uboot_api_init (void);
|
||||
|
||||
/*
|
||||
* int API_getc(int *c)
|
||||
*/
|
||||
int uboot_getc (void);
|
||||
* All functions below are wrappers around the uboot_syscall() function,
|
||||
* implemented in grub-core/kern/uboot/uboot.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* int API_tstc(int *c)
|
||||
*/
|
||||
int uboot_tstc (void);
|
||||
int grub_uboot_getc (void);
|
||||
int grub_uboot_tstc (void);
|
||||
void grub_uboot_putc (int c);
|
||||
void grub_uboot_puts (const char *s);
|
||||
|
||||
/*
|
||||
* int API_putc(char *ch)
|
||||
*/
|
||||
void uboot_putc (int c);
|
||||
void EXPORT_FUNC (grub_uboot_reset) (void);
|
||||
|
||||
/*
|
||||
* int API_puts(const char *s)
|
||||
*/
|
||||
void uboot_puts (const char *s);
|
||||
struct sys_info *grub_uboot_get_sys_info (void);
|
||||
|
||||
/*
|
||||
* int API_reset(void)
|
||||
*/
|
||||
void EXPORT_FUNC (uboot_reset) (void);
|
||||
void grub_uboot_udelay (grub_uint32_t usec);
|
||||
grub_uint32_t grub_uboot_get_timer (grub_uint32_t base);
|
||||
|
||||
/*
|
||||
* int API_get_sys_info(struct sys_info *si)
|
||||
*
|
||||
* fill out the sys_info struct containing selected parameters about the
|
||||
* machine
|
||||
*/
|
||||
struct sys_info *uboot_get_sys_info (void);
|
||||
int EXPORT_FUNC (grub_uboot_dev_enum) (void);
|
||||
struct device_info * EXPORT_FUNC (grub_uboot_dev_get) (int index);
|
||||
int EXPORT_FUNC (grub_uboot_dev_open) (struct device_info *dev);
|
||||
int EXPORT_FUNC (grub_uboot_dev_close) (struct device_info *dev);
|
||||
int grub_uboot_dev_write (struct device_info *dev, void *buf, int *len);
|
||||
int grub_uboot_dev_read (struct device_info *dev, void *buf, grub_size_t blocks,
|
||||
grub_uint32_t start, grub_size_t * real_blocks);
|
||||
int EXPORT_FUNC (grub_uboot_dev_recv) (struct device_info *dev, void *buf,
|
||||
int size, int *real_size);
|
||||
int EXPORT_FUNC (grub_uboot_dev_send) (struct device_info *dev, void *buf,
|
||||
int size);
|
||||
|
||||
/*
|
||||
* int API_udelay(unsigned long *udelay)
|
||||
*/
|
||||
void uboot_udelay (grub_uint32_t usec);
|
||||
|
||||
/*
|
||||
* int API_get_timer(unsigned long *current, unsigned long *base)
|
||||
*/
|
||||
grub_uint32_t uboot_get_timer (grub_uint32_t base);
|
||||
|
||||
/*
|
||||
* int API_dev_enum(struct device_info *)
|
||||
*/
|
||||
int EXPORT_FUNC(uboot_dev_enum) (void);
|
||||
|
||||
struct device_info *EXPORT_FUNC(uboot_dev_get) (int handle);
|
||||
|
||||
/*
|
||||
* int API_dev_open(struct device_info *)
|
||||
*/
|
||||
int EXPORT_FUNC(uboot_dev_open) (int handle);
|
||||
|
||||
/*
|
||||
* int API_dev_close(struct device_info *)
|
||||
*/
|
||||
int EXPORT_FUNC(uboot_dev_close) (int handle);
|
||||
|
||||
/*
|
||||
* Notice: this is for sending network packets only, as U-Boot does not
|
||||
* support writing to storage at the moment (12.2007)
|
||||
*
|
||||
* int API_dev_write(struct device_info *di, void *buf, int *len)
|
||||
*/
|
||||
int uboot_dev_write (int handle, void *buf, int *len);
|
||||
|
||||
/*
|
||||
* int API_dev_read(
|
||||
* struct device_info *di,
|
||||
* void *buf,
|
||||
* size_t *len,
|
||||
* unsigned long *start
|
||||
* size_t *act_len
|
||||
* )
|
||||
*/
|
||||
int uboot_dev_read (int handle, void *buf, lbasize_t blocks,
|
||||
lbastart_t start, lbasize_t * real_blocks);
|
||||
|
||||
int EXPORT_FUNC(uboot_dev_recv) (int handle, void *buf, int size, int *real_size);
|
||||
int EXPORT_FUNC(uboot_dev_send) (int handle, void *buf, int size);
|
||||
|
||||
/*
|
||||
* int API_env_get(const char *name, char **value)
|
||||
*/
|
||||
char *uboot_env_get (const char *name);
|
||||
|
||||
/*
|
||||
* int API_env_set(const char *name, const char *value)
|
||||
*/
|
||||
void uboot_env_set (const char *name, const char *value);
|
||||
char *grub_uboot_env_get (const char *name);
|
||||
void grub_uboot_env_set (const char *name, const char *value);
|
||||
|
||||
#endif /* ! GRUB_UBOOT_UBOOT_HEADER */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue