grub2/include/grub/ieee1275/ieee1275.h
Robert Millan 58bc8bd5b1 2010-01-03 Robert Millan <rmh.grub@aybabtu.com>
* boot/i386/pc/boot.S: Update copyright year.
	* boot/i386/pc/cdboot.S: Likewise.
	* boot/i386/pc/diskboot.S: Likewise.
	* boot/i386/pc/lnxboot.S: Likewise.
	* boot/i386/pc/pxeboot.S: Likewise.
	* bus/pci.c: Likewise.
	* commands/cmp.c: Likewise.
	* commands/help.c: Likewise.
	* commands/hexdump.c: Likewise.
	* commands/i386/pc/halt.c: Likewise.
	* commands/i386/pc/play.c: Likewise.
	* commands/i386/pc/vbeinfo.c: Likewise.
	* commands/ls.c: Likewise.
	* commands/test.c: Likewise.
	* disk/dmraid_nvidia.c: Likewise.
	* disk/i386/pc/biosdisk.c: Likewise.
	* disk/ieee1275/nand.c: Likewise.
	* disk/ieee1275/ofdisk.c: Likewise.
	* disk/lvm.c: Likewise.
	* disk/raid.c: Likewise.
	* disk/raid6_recover.c: Likewise.
	* disk/scsi.c: Likewise.
	* fs/affs.c: Likewise.
	* fs/cpio.c: Likewise.
	* fs/ext2.c: Likewise.
	* fs/hfs.c: Likewise.
	* fs/iso9660.c: Likewise.
	* fs/ntfs.c: Likewise.
	* fs/sfs.c: Likewise.
	* fs/udf.c: Likewise.
	* fs/ufs.c: Likewise.
	* fs/xfs.c: Likewise.
	* gencmdlist.sh: Likewise.
	* genmk.rb: Likewise.
	* include/grub/disk.h: Likewise.
	* include/grub/efi/api.h: Likewise.
	* include/grub/efi/efi.h: Likewise.
	* include/grub/efi/pe32.h: Likewise.
	* include/grub/elf.h: Likewise.
	* include/grub/fs.h: Likewise.
	* include/grub/i386/at_keyboard.h: Likewise.
	* include/grub/i386/pc/memory.h: Likewise.
	* include/grub/i386/pc/vbe.h: Likewise.
	* include/grub/i386/pci.h: Likewise.
	* include/grub/i386/tsc.h: Likewise.
	* include/grub/ieee1275/ieee1275.h: Likewise.
	* include/grub/ntfs.h: Likewise.
	* include/grub/sparc64/ieee1275/ieee1275.h: Likewise.
	* include/grub/sparc64/libgcc.h: Likewise.
	* include/grub/symbol.h: Likewise.
	* include/grub/types.h: Likewise.
	* include/multiboot2.h: Likewise.
	* io/gzio.c: Likewise.
	* kern/device.c: Likewise.
	* kern/disk.c: Likewise.
	* kern/efi/efi.c: Likewise.
	* kern/efi/mm.c: Likewise.
	* kern/elf.c: Likewise.
	* kern/file.c: Likewise.
	* kern/i386/dl.c: Likewise.
	* kern/i386/pc/init.c: Likewise.
	* kern/i386/pc/startup.S: Likewise.
	* kern/ieee1275/ieee1275.c: Likewise.
	* kern/ieee1275/init.c: Likewise.
	* kern/main.c: Likewise.
	* kern/mm.c: Likewise.
	* kern/powerpc/dl.c: Likewise.
	* kern/sparc64/dl.c: Likewise.
	* kern/x86_64/dl.c: Likewise.
	* lib/hexdump.c: Likewise.
	* loader/efi/appleloader.c: Likewise.
	* loader/i386/ieee1275/linux.c: Likewise.
	* loader/i386/pc/chainloader.c: Likewise.
	* loader/i386/pc/linux.c: Likewise.
	* loader/i386/pc/multiboot2.c: Likewise.
	* loader/ieee1275/multiboot2.c: Likewise.
	* loader/multiboot2.c: Likewise.
	* loader/multiboot_loader.c: Likewise.
	* loader/powerpc/ieee1275/linux.c: Likewise.
	* normal/completion.c: Likewise.
	* normal/menu_entry.c: Likewise.
	* partmap/apple.c: Likewise.
	* util/grub.d/10_hurd.in: Likewise.
	* util/hostfs.c: Likewise.
	* video/readers/png.c: Likewise.
2010-01-03 22:05:07 +00:00

180 lines
7.0 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ieee1275.h - Access the Open Firmware client interface. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc.
*
* GRUB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GRUB_IEEE1275_HEADER
#define GRUB_IEEE1275_HEADER 1
#include <grub/err.h>
#include <grub/types.h>
#include <grub/machine/ieee1275.h>
/* Maps a device alias to a pathname. */
struct grub_ieee1275_devalias
{
char *name;
char *path;
char *type;
};
struct grub_ieee1275_mem_region
{
unsigned int start;
unsigned int size;
};
#define IEEE1275_MAX_PROP_LEN 8192
#define IEEE1275_MAX_PATH_LEN 256
#ifndef IEEE1275_CALL_ENTRY_FN
#define IEEE1275_CALL_ENTRY_FN(args) (*grub_ieee1275_entry_fn) (args)
#endif
/* All backcalls to the firmware is done by calling an entry function
which was passed to us from the bootloader. When doing the backcall,
a structure is passed which specifies what the firmware should do.
NAME is the requested service. NR_INS and NR_OUTS is the number of
passed arguments and the expected number of return values, resp. */
struct grub_ieee1275_common_hdr
{
grub_ieee1275_cell_t name;
grub_ieee1275_cell_t nr_ins;
grub_ieee1275_cell_t nr_outs;
};
#define INIT_IEEE1275_COMMON(p, xname, xins, xouts) \
(p)->name = (grub_ieee1275_cell_t) xname; \
(p)->nr_ins = (grub_ieee1275_cell_t) xins; \
(p)->nr_outs = (grub_ieee1275_cell_t) xouts
typedef grub_uint32_t grub_ieee1275_ihandle_t;
typedef grub_uint32_t grub_ieee1275_phandle_t;
extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen);
extern grub_ieee1275_ihandle_t EXPORT_VAR(grub_ieee1275_mmu);
extern int (* EXPORT_VAR(grub_ieee1275_entry_fn)) (void *);
enum grub_ieee1275_flag
{
/* Old World Macintosh firmware fails seek when "dev:0" is opened. */
GRUB_IEEE1275_FLAG_NO_PARTITION_0,
/* Apple firmware runs in translated mode and requires use of the "map"
method. Other firmware runs in untranslated mode and doesn't like "map"
calls. */
GRUB_IEEE1275_FLAG_REAL_MODE,
/* CHRP specifies partitions are numbered from 1 (partition 0 refers to the
whole disk). However, CodeGen firmware numbers partitions from 0. */
GRUB_IEEE1275_FLAG_0_BASED_PARTITIONS,
/* CodeGen firmware does not correctly implement "output-device output" */
GRUB_IEEE1275_FLAG_BROKEN_OUTPUT,
/* OLPC / XO firmware hangs when accessing USB devices. */
GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY,
/* Open Hack'Ware stops when trying to set colors */
GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS,
/* Open Hack'Ware stops when grub_ieee1275_interpret is used. */
GRUB_IEEE1275_FLAG_CANNOT_INTERPRET,
/* Open Hack'Ware has no memory map, just claim what we need. */
GRUB_IEEE1275_FLAG_FORCE_CLAIM,
/* Open Hack'Ware don't support the ANSI sequence. */
GRUB_IEEE1275_FLAG_NO_ANSI,
};
extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag);
extern void EXPORT_FUNC(grub_ieee1275_set_flag) (enum grub_ieee1275_flag flag);
void EXPORT_FUNC(grub_ieee1275_init) (void);
int EXPORT_FUNC(grub_ieee1275_finddevice) (char *name,
grub_ieee1275_phandle_t *phandlep);
int EXPORT_FUNC(grub_ieee1275_get_property) (grub_ieee1275_phandle_t phandle,
const char *property, void *buf,
grub_size_t size,
grub_ssize_t *actual);
int EXPORT_FUNC(grub_ieee1275_get_integer_property) (grub_ieee1275_phandle_t phandle,
const char *property, grub_uint32_t *buf,
grub_size_t size,
grub_ssize_t *actual);
int EXPORT_FUNC(grub_ieee1275_next_property) (grub_ieee1275_phandle_t phandle,
char *prev_prop, char *prop);
int EXPORT_FUNC(grub_ieee1275_get_property_length)
(grub_ieee1275_phandle_t phandle, const char *prop, grub_ssize_t *length);
int EXPORT_FUNC(grub_ieee1275_instance_to_package)
(grub_ieee1275_ihandle_t ihandle, grub_ieee1275_phandle_t *phandlep);
int EXPORT_FUNC(grub_ieee1275_package_to_path) (grub_ieee1275_phandle_t phandle,
char *path, grub_size_t len,
grub_ssize_t *actual);
int EXPORT_FUNC(grub_ieee1275_instance_to_path)
(grub_ieee1275_ihandle_t ihandle, char *path, grub_size_t len,
grub_ssize_t *actual);
int EXPORT_FUNC(grub_ieee1275_write) (grub_ieee1275_ihandle_t ihandle,
void *buffer, grub_size_t len,
grub_ssize_t *actualp);
int EXPORT_FUNC(grub_ieee1275_read) (grub_ieee1275_ihandle_t ihandle,
void *buffer, grub_size_t len,
grub_ssize_t *actualp);
int EXPORT_FUNC(grub_ieee1275_seek) (grub_ieee1275_ihandle_t ihandle,
int pos_hi, int pos_lo,
grub_ssize_t *result);
int EXPORT_FUNC(grub_ieee1275_peer) (grub_ieee1275_phandle_t node,
grub_ieee1275_phandle_t *result);
int EXPORT_FUNC(grub_ieee1275_child) (grub_ieee1275_phandle_t node,
grub_ieee1275_phandle_t *result);
int EXPORT_FUNC(grub_ieee1275_parent) (grub_ieee1275_phandle_t node,
grub_ieee1275_phandle_t *result);
int EXPORT_FUNC(grub_ieee1275_interpret) (const char *command,
grub_ieee1275_cell_t *catch);
int EXPORT_FUNC(grub_ieee1275_enter) (void);
void EXPORT_FUNC(grub_ieee1275_exit) (void) __attribute__ ((noreturn));
int EXPORT_FUNC(grub_ieee1275_open) (const char *node,
grub_ieee1275_ihandle_t *result);
int EXPORT_FUNC(grub_ieee1275_close) (grub_ieee1275_ihandle_t ihandle);
int EXPORT_FUNC(grub_ieee1275_claim) (grub_addr_t addr, grub_size_t size,
unsigned int align, grub_addr_t *result);
int EXPORT_FUNC(grub_ieee1275_release) (grub_addr_t addr, grub_size_t size);
int EXPORT_FUNC(grub_ieee1275_set_property) (grub_ieee1275_phandle_t phandle,
const char *propname, void *buf,
grub_size_t size,
grub_ssize_t *actual);
int EXPORT_FUNC(grub_ieee1275_set_color) (grub_ieee1275_ihandle_t ihandle,
int index, int r, int g, int b);
int EXPORT_FUNC(grub_ieee1275_milliseconds) (grub_uint32_t *msecs);
int EXPORT_FUNC(grub_devalias_iterate)
(int (*hook) (struct grub_ieee1275_devalias *alias));
int EXPORT_FUNC(grub_children_iterate) (char *devpath,
int (*hook) (struct grub_ieee1275_devalias *alias));
grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate)
(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t));
int EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size);
char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path);
char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path);
#endif /* ! GRUB_IEEE1275_HEADER */