~ubuntu-branches/ubuntu/trusty/grub2/trusty

« back to all changes in this revision

Viewing changes to include/grub/uboot/uboot.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-01-16 15:18:04 UTC
  • mfrom: (17.6.38 experimental)
  • Revision ID: package-import@ubuntu.com-20140116151804-3foouk7fpqcq3sxx
Tags: 2.02~beta2-2
* Convert patch handling to git-dpm.
* Add bi-endian support to ELF parser (Tomohiro B Berry).
* Adjust restore_mkdevicemap.patch to mark get_kfreebsd_version as static,
  to appease "gcc -Werror=missing-prototypes".
* Cherry-pick from upstream:
  - Change grub-macbless' manual page section to 8.
* Install grub-glue-efi, grub-macbless, grub-render-label, and
  grub-syslinux2cfg.
* grub-shell: Pass -no-pad to xorriso when building floppy images.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* uboot.h - declare variables and functions for U-Boot support */
 
2
/*
 
3
 *  GRUB  --  GRand Unified Bootloader
 
4
 *  Copyright (C) 2013 Free Software Foundation, Inc.
 
5
 *
 
6
 *  GRUB is free software: you can redistribute it and/or modify
 
7
 *  it under the terms of the GNU General Public License as published by
 
8
 *  the Free Software Foundation, either version 3 of the License, or
 
9
 *  (at your option) any later version.
 
10
 *
 
11
 *  GRUB is distributed in the hope that it will be useful,
 
12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 *  GNU General Public License for more details.
 
15
 *
 
16
 *  You should have received a copy of the GNU General Public License
 
17
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 
18
 */
 
19
 
 
20
#ifndef GRUB_UBOOT_UBOOT_HEADER
 
21
#define GRUB_UBOOT_UBOOT_HEADER 1
 
22
 
 
23
#include <grub/types.h>
 
24
#include <grub/dl.h>
 
25
 
 
26
/* Functions.  */
 
27
void grub_uboot_mm_init (void);
 
28
void grub_uboot_init (void);
 
29
void grub_uboot_fini (void);
 
30
 
 
31
void grub_uboot_return (int) __attribute__ ((noreturn));
 
32
 
 
33
grub_addr_t grub_uboot_get_real_bss_start (void);
 
34
 
 
35
grub_err_t grub_uboot_probe_hardware (void);
 
36
 
 
37
extern grub_addr_t EXPORT_VAR (start_of_ram);
 
38
 
 
39
grub_uint32_t EXPORT_FUNC (grub_uboot_get_machine_type) (void);
 
40
grub_addr_t EXPORT_FUNC (grub_uboot_get_boot_data) (void);
 
41
 
 
42
 
 
43
/*
 
44
 * The U-Boot API operates through a "syscall" interface, consisting of an
 
45
 * entry point address and a set of syscall numbers. The location of this
 
46
 * entry point is described in a structure allocated on the U-Boot heap.
 
47
 * We scan through a defined region around the hint address passed to us
 
48
 * from U-Boot.
 
49
 */
 
50
 
 
51
#define UBOOT_API_SEARCH_LEN (3 * 1024 * 1024)
 
52
int grub_uboot_api_init (void);
 
53
 
 
54
/*
 
55
 * All functions below are wrappers around the uboot_syscall() function,
 
56
 * implemented in grub-core/kern/uboot/uboot.c
 
57
*/
 
58
 
 
59
int  grub_uboot_getc (void);
 
60
int  grub_uboot_tstc (void);
 
61
void grub_uboot_putc (int c);
 
62
void grub_uboot_puts (const char *s);
 
63
 
 
64
void EXPORT_FUNC (grub_uboot_reset) (void);
 
65
 
 
66
struct sys_info *grub_uboot_get_sys_info (void);
 
67
 
 
68
void grub_uboot_udelay (grub_uint32_t usec);
 
69
grub_uint32_t grub_uboot_get_timer (grub_uint32_t base);
 
70
 
 
71
int EXPORT_FUNC (grub_uboot_dev_enum) (void);
 
72
struct device_info * EXPORT_FUNC (grub_uboot_dev_get) (int index);
 
73
int EXPORT_FUNC (grub_uboot_dev_open) (struct device_info *dev);
 
74
int EXPORT_FUNC (grub_uboot_dev_close) (struct device_info *dev);
 
75
int grub_uboot_dev_write (struct device_info *dev, void *buf, int *len);
 
76
int grub_uboot_dev_read (struct device_info *dev, void *buf, grub_size_t blocks,
 
77
                         grub_uint32_t start, grub_size_t * real_blocks);
 
78
int EXPORT_FUNC (grub_uboot_dev_recv) (struct device_info *dev, void *buf,
 
79
                                       int size, int *real_size);
 
80
int EXPORT_FUNC (grub_uboot_dev_send) (struct device_info *dev, void *buf,
 
81
                                       int size);
 
82
 
 
83
char *grub_uboot_env_get (const char *name);
 
84
void grub_uboot_env_set (const char *name, const char *value);
 
85
 
 
86
#endif /* ! GRUB_UBOOT_UBOOT_HEADER */