2005-08-03 Hollis Blanchard <hollis@penguinppc.org>
* include/grub/powerpc/ieee1275/ieee1275.h: Move ... * include/grub/ieee1275/ieee1275.h: ... to here. All users updated. Move `abort', `grub_reboot', and `grub_halt' prototypes ... * include/grub/powerpc/ieee1275/kernel.h: ... to here. * commands/ieee1275/halt.c: Include <grub/machine/kernel.h> instead of <grub/machine/ieee1275.h>. * commands/ieee1275/reboot.c: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Move ... * kern/ieee1275.c: ... to here. All users updated. Change all parameter structs to use new type `grub_ieee1275_cell_t'. * term/powerpc/ieee1275/ofconsole.c: Move ... * term/ieee1275/ofconsole.c: ... to here. All users updated. * disk/powerpc/ieee1275/ofdisk.c: Move ... * disk/ieee1275/ofdisk.c: ... to here. All users updated. * boot/powerpc/ieee1275/cmain.c: Change `grub_ieee1275_entry_fn' type to return int. * include/grub/i386/pc/console.h: Move to include/grub/console.h. Remove unused prototypes. All users updated. * include/grub/powerpc/ieee1275/console.h: Removed. * include/grub/powerpc/ieee1275/ieee1275.h: Define `grub_ieee1275_cell_t'. * kern/powerpc/ieee1275/openfw.c: Include <grub/machine/kernel.h>. Cast comparisons with -1 to the correct type. * loader/powerpc/ieee1275/linux.c (kernel_entry_t): Change parameter type to match `grub_ieee1275_entry_fn'.
This commit is contained in:
parent
8b5f393852
commit
3be7266d92
21 changed files with 339 additions and 355 deletions
28
ChangeLog
28
ChangeLog
|
@ -1,3 +1,31 @@
|
||||||
|
2005-08-03 Hollis Blanchard <hollis@penguinppc.org>
|
||||||
|
|
||||||
|
* include/grub/powerpc/ieee1275/ieee1275.h: Move ...
|
||||||
|
* include/grub/ieee1275/ieee1275.h: ... to here. All users updated.
|
||||||
|
Move `abort', `grub_reboot', and `grub_halt' prototypes ...
|
||||||
|
* include/grub/powerpc/ieee1275/kernel.h: ... to here.
|
||||||
|
* commands/ieee1275/halt.c: Include <grub/machine/kernel.h> instead
|
||||||
|
of <grub/machine/ieee1275.h>.
|
||||||
|
* commands/ieee1275/reboot.c: Likewise.
|
||||||
|
* boot/powerpc/ieee1275/ieee1275.c: Move ...
|
||||||
|
* kern/ieee1275.c: ... to here. All users updated. Change all
|
||||||
|
parameter structs to use new type `grub_ieee1275_cell_t'.
|
||||||
|
* term/powerpc/ieee1275/ofconsole.c: Move ...
|
||||||
|
* term/ieee1275/ofconsole.c: ... to here. All users updated.
|
||||||
|
* disk/powerpc/ieee1275/ofdisk.c: Move ...
|
||||||
|
* disk/ieee1275/ofdisk.c: ... to here. All users updated.
|
||||||
|
* boot/powerpc/ieee1275/cmain.c: Change `grub_ieee1275_entry_fn' type
|
||||||
|
to return int.
|
||||||
|
* include/grub/i386/pc/console.h: Move to include/grub/console.h.
|
||||||
|
Remove unused prototypes. All users updated.
|
||||||
|
* include/grub/powerpc/ieee1275/console.h: Removed.
|
||||||
|
* include/grub/powerpc/ieee1275/ieee1275.h: Define
|
||||||
|
`grub_ieee1275_cell_t'.
|
||||||
|
* kern/powerpc/ieee1275/openfw.c: Include <grub/machine/kernel.h>.
|
||||||
|
Cast comparisons with -1 to the correct type.
|
||||||
|
* loader/powerpc/ieee1275/linux.c (kernel_entry_t): Change parameter
|
||||||
|
type to match `grub_ieee1275_entry_fn'.
|
||||||
|
|
||||||
2005-08-01 Yoshinori K. Okuji <okuji@enbug.org>
|
2005-08-01 Yoshinori K. Okuji <okuji@enbug.org>
|
||||||
|
|
||||||
* DISTLIST: Added util/i386/pc/grub-probefs.c.
|
* DISTLIST: Added util/i386/pc/grub-probefs.c.
|
||||||
|
|
|
@ -20,12 +20,12 @@
|
||||||
|
|
||||||
#include <alloca.h>
|
#include <alloca.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <grub/machine/ieee1275.h>
|
|
||||||
#include <grub/kernel.h>
|
#include <grub/kernel.h>
|
||||||
|
#include <grub/machine/kernel.h>
|
||||||
|
#include <grub/ieee1275/ieee1275.h>
|
||||||
|
|
||||||
/* OpenFirmware entry point passed to us from the real bootloader. */
|
/* OpenFirmware entry point passed to us from the real bootloader. */
|
||||||
intptr_t (*grub_ieee1275_entry_fn) (void *);
|
int (*grub_ieee1275_entry_fn) (void *);
|
||||||
|
|
||||||
grub_ieee1275_phandle_t grub_ieee1275_chosen;
|
grub_ieee1275_phandle_t grub_ieee1275_chosen;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ cmain (uint32_t r3, uint32_t r4 __attribute__((unused)), uint32_t r5)
|
||||||
extern char _start;
|
extern char _start;
|
||||||
extern char _end;
|
extern char _end;
|
||||||
|
|
||||||
grub_ieee1275_entry_fn = (intptr_t (*)(void *)) r3;
|
grub_ieee1275_entry_fn = (int (*)(void *)) r3;
|
||||||
|
|
||||||
grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0);
|
grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ cmain (uint32_t r3, uint32_t r4 __attribute__((unused)), uint32_t r5)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Assume we were entered from Open Firmware. */
|
/* Assume we were entered from Open Firmware. */
|
||||||
grub_ieee1275_entry_fn = (intptr_t (*)(void *)) r5;
|
grub_ieee1275_entry_fn = (int (*)(void *)) r5;
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen);
|
grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen);
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <grub/normal.h>
|
#include <grub/normal.h>
|
||||||
#include <grub/dl.h>
|
#include <grub/dl.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/machine/ieee1275.h>
|
#include <grub/machine/kernel.h>
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)),
|
grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)),
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <grub/normal.h>
|
#include <grub/normal.h>
|
||||||
#include <grub/dl.h>
|
#include <grub/dl.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/machine/ieee1275.h>
|
#include <grub/machine/kernel.h>
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)),
|
grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)),
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <grub/normal.h>
|
#include <grub/normal.h>
|
||||||
#include <grub/dl.h>
|
#include <grub/dl.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/machine/ieee1275.h>
|
#include <grub/ieee1275/ieee1275.h>
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_cmd_suspend (struct grub_arg_list *state __attribute__ ((unused)),
|
grub_cmd_suspend (struct grub_arg_list *state __attribute__ ((unused)),
|
||||||
|
|
|
@ -12,7 +12,8 @@ DEFSYMFILES += kernel_syms.lst
|
||||||
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
|
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
|
||||||
file.h fs.h kernel.h misc.h mm.h net.h rescue.h symbol.h \
|
file.h fs.h kernel.h misc.h mm.h net.h rescue.h symbol.h \
|
||||||
term.h types.h powerpc/libgcc.h loader.h \
|
term.h types.h powerpc/libgcc.h loader.h \
|
||||||
partition.h pc_partition.h machine/time.h machine/ieee1275.h
|
partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
|
||||||
|
machine/kernel.h
|
||||||
|
|
||||||
grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh
|
grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh
|
||||||
sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
|
sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
|
||||||
|
@ -488,17 +489,17 @@ grub_emu-util_powerpc_ieee1275_misc.d: util/powerpc/ieee1275/misc.c
|
||||||
grub_emu_LDFLAGS = -lncurses
|
grub_emu_LDFLAGS = -lncurses
|
||||||
|
|
||||||
grubof_SOURCES = boot/powerpc/ieee1275/crt0.S boot/powerpc/ieee1275/cmain.c \
|
grubof_SOURCES = boot/powerpc/ieee1275/crt0.S boot/powerpc/ieee1275/cmain.c \
|
||||||
boot/powerpc/ieee1275/ieee1275.c kern/main.c kern/device.c \
|
kern/ieee1275.c kern/main.c kern/device.c \
|
||||||
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
||||||
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
|
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
|
||||||
kern/powerpc/ieee1275/init.c term/powerpc/ieee1275/ofconsole.c \
|
kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \
|
||||||
kern/powerpc/ieee1275/openfw.c disk/powerpc/ieee1275/ofdisk.c \
|
kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
|
||||||
kern/partition.c kern/env.c kern/powerpc/dl.c grubof_symlist.c \
|
kern/partition.c kern/env.c kern/powerpc/dl.c grubof_symlist.c \
|
||||||
kern/powerpc/cache.S
|
kern/powerpc/cache.S
|
||||||
CLEANFILES += grubof grubof-boot_powerpc_ieee1275_crt0.o grubof-boot_powerpc_ieee1275_cmain.o grubof-boot_powerpc_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_powerpc_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_powerpc_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o
|
CLEANFILES += grubof grubof-boot_powerpc_ieee1275_crt0.o grubof-boot_powerpc_ieee1275_cmain.o grubof-kern_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o
|
||||||
MOSTLYCLEANFILES += grubof-boot_powerpc_ieee1275_crt0.d grubof-boot_powerpc_ieee1275_cmain.d grubof-boot_powerpc_ieee1275_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-kern_powerpc_ieee1275_init.d grubof-term_powerpc_ieee1275_ofconsole.d grubof-kern_powerpc_ieee1275_openfw.d grubof-disk_powerpc_ieee1275_ofdisk.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_powerpc_dl.d grubof-grubof_symlist.d grubof-kern_powerpc_cache.d
|
MOSTLYCLEANFILES += grubof-boot_powerpc_ieee1275_crt0.d grubof-boot_powerpc_ieee1275_cmain.d grubof-kern_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-kern_powerpc_ieee1275_init.d grubof-term_ieee1275_ofconsole.d grubof-kern_powerpc_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_powerpc_dl.d grubof-grubof_symlist.d grubof-kern_powerpc_cache.d
|
||||||
|
|
||||||
grubof: grubof-boot_powerpc_ieee1275_crt0.o grubof-boot_powerpc_ieee1275_cmain.o grubof-boot_powerpc_ieee1275_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_powerpc_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_powerpc_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o
|
grubof: grubof-boot_powerpc_ieee1275_crt0.o grubof-boot_powerpc_ieee1275_cmain.o grubof-kern_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o
|
||||||
$(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS)
|
$(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS)
|
||||||
|
|
||||||
grubof-boot_powerpc_ieee1275_crt0.o: boot/powerpc/ieee1275/crt0.S
|
grubof-boot_powerpc_ieee1275_crt0.o: boot/powerpc/ieee1275/crt0.S
|
||||||
|
@ -517,13 +518,13 @@ grubof-boot_powerpc_ieee1275_cmain.d: boot/powerpc/ieee1275/cmain.c
|
||||||
|
|
||||||
-include grubof-boot_powerpc_ieee1275_cmain.d
|
-include grubof-boot_powerpc_ieee1275_cmain.d
|
||||||
|
|
||||||
grubof-boot_powerpc_ieee1275_ieee1275.o: boot/powerpc/ieee1275/ieee1275.c
|
grubof-kern_ieee1275.o: kern/ieee1275.c
|
||||||
$(CC) -Iboot/powerpc/ieee1275 -I$(srcdir)/boot/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
grubof-boot_powerpc_ieee1275_ieee1275.d: boot/powerpc/ieee1275/ieee1275.c
|
grubof-kern_ieee1275.d: kern/ieee1275.c
|
||||||
set -e; $(CC) -Iboot/powerpc/ieee1275 -I$(srcdir)/boot/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,ieee1275\.o[ :]*,grubof-boot_powerpc_ieee1275_ieee1275.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
|
set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,ieee1275\.o[ :]*,grubof-kern_ieee1275.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
|
||||||
|
|
||||||
-include grubof-boot_powerpc_ieee1275_ieee1275.d
|
-include grubof-kern_ieee1275.d
|
||||||
|
|
||||||
grubof-kern_main.o: kern/main.c
|
grubof-kern_main.o: kern/main.c
|
||||||
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
||||||
|
@ -629,13 +630,13 @@ grubof-kern_powerpc_ieee1275_init.d: kern/powerpc/ieee1275/init.c
|
||||||
|
|
||||||
-include grubof-kern_powerpc_ieee1275_init.d
|
-include grubof-kern_powerpc_ieee1275_init.d
|
||||||
|
|
||||||
grubof-term_powerpc_ieee1275_ofconsole.o: term/powerpc/ieee1275/ofconsole.c
|
grubof-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c
|
||||||
$(CC) -Iterm/powerpc/ieee1275 -I$(srcdir)/term/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
$(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
grubof-term_powerpc_ieee1275_ofconsole.d: term/powerpc/ieee1275/ofconsole.c
|
grubof-term_ieee1275_ofconsole.d: term/ieee1275/ofconsole.c
|
||||||
set -e; $(CC) -Iterm/powerpc/ieee1275 -I$(srcdir)/term/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,ofconsole\.o[ :]*,grubof-term_powerpc_ieee1275_ofconsole.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
|
set -e; $(CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,ofconsole\.o[ :]*,grubof-term_ieee1275_ofconsole.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
|
||||||
|
|
||||||
-include grubof-term_powerpc_ieee1275_ofconsole.d
|
-include grubof-term_ieee1275_ofconsole.d
|
||||||
|
|
||||||
grubof-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c
|
grubof-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c
|
||||||
$(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
$(CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
||||||
|
@ -645,13 +646,13 @@ grubof-kern_powerpc_ieee1275_openfw.d: kern/powerpc/ieee1275/openfw.c
|
||||||
|
|
||||||
-include grubof-kern_powerpc_ieee1275_openfw.d
|
-include grubof-kern_powerpc_ieee1275_openfw.d
|
||||||
|
|
||||||
grubof-disk_powerpc_ieee1275_ofdisk.o: disk/powerpc/ieee1275/ofdisk.c
|
grubof-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c
|
||||||
$(CC) -Idisk/powerpc/ieee1275 -I$(srcdir)/disk/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
$(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
grubof-disk_powerpc_ieee1275_ofdisk.d: disk/powerpc/ieee1275/ofdisk.c
|
grubof-disk_ieee1275_ofdisk.d: disk/ieee1275/ofdisk.c
|
||||||
set -e; $(CC) -Idisk/powerpc/ieee1275 -I$(srcdir)/disk/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,ofdisk\.o[ :]*,grubof-disk_powerpc_ieee1275_ofdisk.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
|
set -e; $(CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,ofdisk\.o[ :]*,grubof-disk_ieee1275_ofdisk.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@
|
||||||
|
|
||||||
-include grubof-disk_powerpc_ieee1275_ofdisk.d
|
-include grubof-disk_ieee1275_ofdisk.d
|
||||||
|
|
||||||
grubof-kern_partition.o: kern/partition.c
|
grubof-kern_partition.o: kern/partition.c
|
||||||
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
$(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $<
|
||||||
|
|
|
@ -12,7 +12,8 @@ DEFSYMFILES += kernel_syms.lst
|
||||||
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
|
grubof_HEADERS = arg.h boot.h device.h disk.h dl.h elf.h env.h err.h \
|
||||||
file.h fs.h kernel.h misc.h mm.h net.h rescue.h symbol.h \
|
file.h fs.h kernel.h misc.h mm.h net.h rescue.h symbol.h \
|
||||||
term.h types.h powerpc/libgcc.h loader.h \
|
term.h types.h powerpc/libgcc.h loader.h \
|
||||||
partition.h pc_partition.h machine/time.h machine/ieee1275.h
|
partition.h pc_partition.h ieee1275/ieee1275.h machine/time.h \
|
||||||
|
machine/kernel.h
|
||||||
|
|
||||||
grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh
|
grubof_symlist.c: $(addprefix include/grub/,$(grubof_HEADERS)) gensymlist.sh
|
||||||
sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
|
sh $(srcdir)/gensymlist.sh $(filter %.h,$^) > $@
|
||||||
|
@ -52,11 +53,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \
|
||||||
grub_emu_LDFLAGS = -lncurses
|
grub_emu_LDFLAGS = -lncurses
|
||||||
|
|
||||||
grubof_SOURCES = boot/powerpc/ieee1275/crt0.S boot/powerpc/ieee1275/cmain.c \
|
grubof_SOURCES = boot/powerpc/ieee1275/crt0.S boot/powerpc/ieee1275/cmain.c \
|
||||||
boot/powerpc/ieee1275/ieee1275.c kern/main.c kern/device.c \
|
kern/ieee1275.c kern/main.c kern/device.c \
|
||||||
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \
|
||||||
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
|
kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \
|
||||||
kern/powerpc/ieee1275/init.c term/powerpc/ieee1275/ofconsole.c \
|
kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \
|
||||||
kern/powerpc/ieee1275/openfw.c disk/powerpc/ieee1275/ofdisk.c \
|
kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \
|
||||||
kern/partition.c kern/env.c kern/powerpc/dl.c grubof_symlist.c \
|
kern/partition.c kern/env.c kern/powerpc/dl.c grubof_symlist.c \
|
||||||
kern/powerpc/cache.S
|
kern/powerpc/cache.S
|
||||||
grubof_HEADERS = grub/powerpc/ieee1275/ieee1275.h
|
grubof_HEADERS = grub/powerpc/ieee1275/ieee1275.h
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/disk.h>
|
#include <grub/disk.h>
|
||||||
#include <grub/mm.h>
|
#include <grub/mm.h>
|
||||||
#include <grub/machine/ieee1275.h>
|
#include <grub/ieee1275/ieee1275.h>
|
||||||
#include <grub/machine/ofdisk.h>
|
#include <grub/ieee1275/ofdisk.h>
|
||||||
|
|
||||||
static int
|
static int
|
||||||
grub_ofdisk_iterate (int (*hook) (const char *name))
|
grub_ofdisk_iterate (int (*hook) (const char *name))
|
|
@ -17,8 +17,8 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GRUB_CONSOLE_MACHINE_HEADER
|
#ifndef GRUB_CONSOLE_HEADER
|
||||||
#define GRUB_CONSOLE_MACHINE_HEADER 1
|
#define GRUB_CONSOLE_HEADER 1
|
||||||
|
|
||||||
/* Define scan codes. */
|
/* Define scan codes. */
|
||||||
#define GRUB_CONSOLE_KEY_LEFT 0x4B00
|
#define GRUB_CONSOLE_KEY_LEFT 0x4B00
|
||||||
|
@ -33,27 +33,7 @@
|
||||||
#define GRUB_CONSOLE_KEY_NPAGE 0x4900
|
#define GRUB_CONSOLE_KEY_NPAGE 0x4900
|
||||||
#define GRUB_CONSOLE_KEY_PPAGE 0x5100
|
#define GRUB_CONSOLE_KEY_PPAGE 0x5100
|
||||||
|
|
||||||
#ifndef ASM_FILE
|
|
||||||
|
|
||||||
#include <grub/types.h>
|
|
||||||
#include <grub/symbol.h>
|
|
||||||
|
|
||||||
/* These are global to share code between C and asm. */
|
|
||||||
extern grub_uint8_t grub_console_cur_color;
|
|
||||||
void grub_console_real_putchar (int c);
|
|
||||||
int EXPORT_FUNC(grub_console_checkkey) (void);
|
|
||||||
int EXPORT_FUNC(grub_console_getkey) (void);
|
|
||||||
grub_uint16_t grub_console_getxy (void);
|
|
||||||
void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y);
|
|
||||||
void grub_console_cls (void);
|
|
||||||
void grub_console_setcursor (int on);
|
|
||||||
|
|
||||||
/* Initialize the console system. */
|
|
||||||
void grub_console_init (void);
|
void grub_console_init (void);
|
||||||
|
|
||||||
/* Finish the console system. */
|
|
||||||
void grub_console_fini (void);
|
void grub_console_fini (void);
|
||||||
|
|
||||||
#endif
|
#endif /* ! GRUB_CONSOLE_HEADER */
|
||||||
|
|
||||||
#endif /* ! GRUB_CONSOLE_MACHINE_HEADER */
|
|
|
@ -1,59 +0,0 @@
|
||||||
/*
|
|
||||||
* GRUB -- GRand Unified Bootloader
|
|
||||||
* Copyright (C) 2002,2005 Free Software Foundation, Inc.
|
|
||||||
*
|
|
||||||
* This program 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 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program 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 this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef GRUB_CONSOLE_MACHINE_HEADER
|
|
||||||
#define GRUB_CONSOLE_MACHINE_HEADER 1
|
|
||||||
|
|
||||||
/* Define scan codes. */
|
|
||||||
#define GRUB_CONSOLE_KEY_LEFT 0x4B00
|
|
||||||
#define GRUB_CONSOLE_KEY_RIGHT 0x4D00
|
|
||||||
#define GRUB_CONSOLE_KEY_UP 0x4800
|
|
||||||
#define GRUB_CONSOLE_KEY_DOWN 0x5000
|
|
||||||
#define GRUB_CONSOLE_KEY_IC 0x5200
|
|
||||||
#define GRUB_CONSOLE_KEY_DC 0x5300
|
|
||||||
#define GRUB_CONSOLE_KEY_BACKSPACE 0x0008
|
|
||||||
#define GRUB_CONSOLE_KEY_HOME 0x4700
|
|
||||||
#define GRUB_CONSOLE_KEY_END 0x4F00
|
|
||||||
#define GRUB_CONSOLE_KEY_NPAGE 0x4900
|
|
||||||
#define GRUB_CONSOLE_KEY_PPAGE 0x5100
|
|
||||||
|
|
||||||
#ifndef ASM_FILE
|
|
||||||
|
|
||||||
#include <grub/types.h>
|
|
||||||
#include <grub/symbol.h>
|
|
||||||
|
|
||||||
/* These are global to share code between C and asm. */
|
|
||||||
extern grub_uint8_t grub_console_cur_color;
|
|
||||||
void grub_console_real_putchar (int c);
|
|
||||||
int EXPORT_FUNC(grub_console_checkkey) (void);
|
|
||||||
int EXPORT_FUNC(grub_console_getkey) (void);
|
|
||||||
grub_uint16_t grub_console_getxy (void);
|
|
||||||
void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y);
|
|
||||||
void grub_console_cls (void);
|
|
||||||
void grub_console_setcursor (int on);
|
|
||||||
|
|
||||||
/* Initialize the console system. */
|
|
||||||
void grub_console_init (void);
|
|
||||||
|
|
||||||
/* Finish the console system. */
|
|
||||||
void grub_console_fini (void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* ! GRUB_CONSOLE_MACHINE_HEADER */
|
|
154
include/grub/ieee1275/ieee1275.h
Normal file
154
include/grub/ieee1275/ieee1275.h
Normal file
|
@ -0,0 +1,154 @@
|
||||||
|
/* ieee1275.h - Access the Open Firmware client interface. */
|
||||||
|
/*
|
||||||
|
* GRUB -- GRand Unified Bootloader
|
||||||
|
* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
|
*
|
||||||
|
* This program 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 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program 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 this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef GRUB_IEEE1275_HEADER
|
||||||
|
#define GRUB_IEEE1275_HEADER 1
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#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;
|
||||||
|
};
|
||||||
|
|
||||||
|
#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_ieee1275_cell_t grub_ieee1275_ihandle_t;
|
||||||
|
typedef grub_ieee1275_cell_t grub_ieee1275_phandle_t;
|
||||||
|
|
||||||
|
extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen);
|
||||||
|
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,
|
||||||
|
};
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
grub_uint32_t EXPORT_FUNC(grub_ieee1275_decode_int_4) (unsigned char *p);
|
||||||
|
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_next_property) (grub_ieee1275_phandle_t phandle,
|
||||||
|
char *prev_prop, char *prop,
|
||||||
|
grub_ieee1275_cell_t *flags);
|
||||||
|
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);
|
||||||
|
int 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);
|
||||||
|
|
||||||
|
|
||||||
|
grub_err_t EXPORT_FUNC(grub_devalias_iterate)
|
||||||
|
(int (*hook) (struct grub_ieee1275_devalias *alias));
|
||||||
|
grub_err_t EXPORT_FUNC(grub_children_iterate) (char *devpath,
|
||||||
|
int (*hook) (struct grub_ieee1275_devalias *alias));
|
||||||
|
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 */
|
|
@ -17,10 +17,10 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef GRUB_OFDISK_MACHINE_HEADER
|
#ifndef GRUB_OFDISK_HEADER
|
||||||
#define GRUB_OFDISK_MACHINE_HEADER 1
|
#define GRUB_OFDISK_HEADER 1
|
||||||
|
|
||||||
extern void grub_ofdisk_init (void);
|
extern void grub_ofdisk_init (void);
|
||||||
extern void grub_ofdisk_fini (void);
|
extern void grub_ofdisk_fini (void);
|
||||||
|
|
||||||
#endif /* ! GRUB_INIT_MACHINE_HEADER */
|
#endif /* ! GRUB_INIT_HEADER */
|
|
@ -21,134 +21,8 @@
|
||||||
#ifndef GRUB_IEEE1275_MACHINE_HEADER
|
#ifndef GRUB_IEEE1275_MACHINE_HEADER
|
||||||
#define GRUB_IEEE1275_MACHINE_HEADER 1
|
#define GRUB_IEEE1275_MACHINE_HEADER 1
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <grub/err.h>
|
|
||||||
#include <grub/types.h>
|
#include <grub/types.h>
|
||||||
|
|
||||||
/* Maps a device alias to a pathname. */
|
typedef grub_uint32_t grub_ieee1275_cell_t;
|
||||||
struct grub_ieee1275_devalias
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
char *path;
|
|
||||||
char *type;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct grub_ieee1275_mem_region
|
|
||||||
{
|
|
||||||
unsigned int start;
|
|
||||||
unsigned int size;
|
|
||||||
};
|
|
||||||
|
|
||||||
#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
|
|
||||||
{
|
|
||||||
char *name;
|
|
||||||
int nr_ins;
|
|
||||||
int nr_outs;
|
|
||||||
};
|
|
||||||
|
|
||||||
#define INIT_IEEE1275_COMMON(p, xname, xins, xouts) \
|
|
||||||
(p)->name = xname; (p)->nr_ins = xins; (p)->nr_outs = xouts
|
|
||||||
|
|
||||||
/* FIXME jrydberg: is this correct cell types? */
|
|
||||||
typedef intptr_t grub_ieee1275_ihandle_t;
|
|
||||||
typedef intptr_t grub_ieee1275_phandle_t;
|
|
||||||
|
|
||||||
extern grub_ieee1275_phandle_t grub_ieee1275_chosen;
|
|
||||||
extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen);
|
|
||||||
extern intptr_t (*grub_ieee1275_entry_fn) (void *);
|
|
||||||
extern intptr_t (* EXPORT_VAR(grub_ieee1275_entry_fn)) (void *);
|
|
||||||
|
|
||||||
enum grub_ieee1275_flag
|
|
||||||
{
|
|
||||||
/* Old World 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,
|
|
||||||
};
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
uint32_t EXPORT_FUNC(grub_ieee1275_decode_int_4) (unsigned char *p);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_finddevice) (char *name,
|
|
||||||
grub_ieee1275_phandle_t *phandlep);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_get_property) (grub_ieee1275_phandle_t handle,
|
|
||||||
const char *property, void *buf,
|
|
||||||
grub_size_t size,
|
|
||||||
grub_size_t *actual);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_next_property) (int handle, char *prev_prop,
|
|
||||||
char *prop, int *flags);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_get_property_length)
|
|
||||||
(grub_ieee1275_phandle_t handle, const char *prop, grub_size_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_size_t *actual);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_instance_to_path)
|
|
||||||
(grub_ieee1275_ihandle_t ihandle, char *path, grub_size_t len,
|
|
||||||
grub_size_t *actual);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_write) (grub_ieee1275_ihandle_t ihandle,
|
|
||||||
void *buffer, grub_size_t len,
|
|
||||||
grub_size_t *actualp);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_read) (grub_ieee1275_ihandle_t ihandle,
|
|
||||||
void *buffer, grub_size_t len,
|
|
||||||
grub_size_t *actualp);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_seek) (grub_ieee1275_ihandle_t ihandle,
|
|
||||||
int pos_hi, int pos_lo, int *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, int *catch);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_enter) (void);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_exit) (void);
|
|
||||||
int EXPORT_FUNC(grub_ieee1275_open) (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_size_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);
|
|
||||||
|
|
||||||
|
|
||||||
grub_err_t EXPORT_FUNC(grub_devalias_iterate)
|
|
||||||
(int (*hook) (struct grub_ieee1275_devalias *alias));
|
|
||||||
grub_err_t EXPORT_FUNC(grub_children_iterate) (char *devpath,
|
|
||||||
int (*hook) (struct grub_ieee1275_devalias *alias));
|
|
||||||
int EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size);
|
|
||||||
|
|
||||||
void EXPORT_FUNC(abort) (void);
|
|
||||||
void EXPORT_FUNC (grub_reboot) (void);
|
|
||||||
void EXPORT_FUNC (grub_halt) (void);
|
|
||||||
|
|
||||||
char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path);
|
|
||||||
char *EXPORT_FUNC(grub_ieee1275_get_filename) (const char *path);
|
|
||||||
|
|
||||||
#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */
|
#endif /* ! GRUB_IEEE1275_MACHINE_HEADER */
|
||||||
|
|
|
@ -20,6 +20,12 @@
|
||||||
#ifndef GRUB_KERNEL_MACHINE_HEADER
|
#ifndef GRUB_KERNEL_MACHINE_HEADER
|
||||||
#define GRUB_KERNEL_MACHINE_HEADER 1
|
#define GRUB_KERNEL_MACHINE_HEADER 1
|
||||||
|
|
||||||
|
#include <grub/symbol.h>
|
||||||
|
|
||||||
|
void EXPORT_FUNC (abort) (void);
|
||||||
|
void EXPORT_FUNC (grub_reboot) (void);
|
||||||
|
void EXPORT_FUNC (grub_halt) (void);
|
||||||
|
|
||||||
/* Where grub-mkimage places the core modules in memory. */
|
/* Where grub-mkimage places the core modules in memory. */
|
||||||
#define GRUB_IEEE1275_MODULE_BASE 0x00300000
|
#define GRUB_IEEE1275_MODULE_BASE 0x00300000
|
||||||
|
|
||||||
|
|
|
@ -18,13 +18,12 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <grub/machine/ieee1275.h>
|
#include <grub/ieee1275/ieee1275.h>
|
||||||
|
|
||||||
|
|
||||||
#define IEEE1275_PHANDLE_ROOT ((grub_ieee1275_phandle_t) 0)
|
#define IEEE1275_PHANDLE_ROOT ((grub_ieee1275_phandle_t) 0)
|
||||||
#define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_phandle_t) -1)
|
#define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_phandle_t) -1)
|
||||||
|
|
||||||
intptr_t (*grub_ieee1275_entry_fn) (void *);
|
|
||||||
|
|
||||||
/* FIXME is this function needed? */
|
/* FIXME is this function needed? */
|
||||||
grub_uint32_t
|
grub_uint32_t
|
||||||
|
@ -36,18 +35,17 @@ grub_ieee1275_decode_int_4 (unsigned char *p)
|
||||||
return (val + *p);
|
return (val + *p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_finddevice (char *name, grub_ieee1275_phandle_t *phandlep)
|
grub_ieee1275_finddevice (char *name, grub_ieee1275_phandle_t *phandlep)
|
||||||
{
|
{
|
||||||
struct find_device_args {
|
struct find_device_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
char *device;
|
grub_ieee1275_cell_t device;
|
||||||
grub_ieee1275_phandle_t phandle;
|
grub_ieee1275_phandle_t phandle;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "finddevice", 1, 1);
|
INIT_IEEE1275_COMMON (&args.common, "finddevice", 1, 1);
|
||||||
args.device = name;
|
args.device = (grub_ieee1275_cell_t) name;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -58,49 +56,49 @@ grub_ieee1275_finddevice (char *name, grub_ieee1275_phandle_t *phandlep)
|
||||||
int
|
int
|
||||||
grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle,
|
grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle,
|
||||||
const char *property, void *buf,
|
const char *property, void *buf,
|
||||||
grub_size_t size, grub_size_t *actual)
|
grub_size_t size, grub_ssize_t *actual)
|
||||||
{
|
{
|
||||||
struct get_property_args {
|
struct get_property_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_phandle_t phandle;
|
grub_ieee1275_phandle_t phandle;
|
||||||
const char *prop;
|
grub_ieee1275_cell_t prop;
|
||||||
void *buf;
|
grub_ieee1275_cell_t buf;
|
||||||
int buflen;
|
grub_ieee1275_cell_t buflen;
|
||||||
int size;
|
grub_ieee1275_cell_t size;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "getprop", 4, 1);
|
INIT_IEEE1275_COMMON (&args.common, "getprop", 4, 1);
|
||||||
args.phandle = phandle;
|
args.phandle = phandle;
|
||||||
args.prop = property;
|
args.prop = (grub_ieee1275_cell_t) property;
|
||||||
args.buf = buf;
|
args.buf = (grub_ieee1275_cell_t) buf;
|
||||||
args.buflen = size;
|
args.buflen = (grub_ieee1275_cell_t) size;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
if (actual)
|
if (actual)
|
||||||
*actual = args.size;
|
*actual = (grub_ssize_t) args.size;
|
||||||
if (args.size == -1)
|
if (args.size == (grub_ieee1275_cell_t) -1)
|
||||||
return -1;
|
return -1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop,
|
grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop,
|
||||||
char *prop, int *flags)
|
char *prop, grub_ieee1275_cell_t *flags)
|
||||||
{
|
{
|
||||||
struct get_property_args {
|
struct get_property_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_phandle_t phandle;
|
grub_ieee1275_phandle_t phandle;
|
||||||
char *prev_prop;
|
grub_ieee1275_cell_t prev_prop;
|
||||||
char *next_prop;
|
grub_ieee1275_cell_t next_prop;
|
||||||
int flags;
|
grub_ieee1275_cell_t flags;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "nextprop", 3, 1);
|
INIT_IEEE1275_COMMON (&args.common, "nextprop", 3, 1);
|
||||||
args.phandle = phandle;
|
args.phandle = phandle;
|
||||||
args.prev_prop = prev_prop;
|
args.prev_prop = (grub_ieee1275_cell_t) prev_prop;
|
||||||
args.next_prop = prop;
|
args.next_prop = (grub_ieee1275_cell_t) prop;
|
||||||
args.flags = -1;
|
args.flags = (grub_ieee1275_cell_t) -1;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -111,19 +109,19 @@ grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop,
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle,
|
grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle,
|
||||||
const char *prop, grub_size_t *length)
|
const char *prop, grub_ssize_t *length)
|
||||||
{
|
{
|
||||||
struct get_property_args {
|
struct get_property_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_phandle_t phandle;
|
grub_ieee1275_phandle_t phandle;
|
||||||
const char *prop;
|
grub_ieee1275_cell_t prop;
|
||||||
grub_size_t length;
|
grub_ieee1275_cell_t length;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "getproplen", 2, 1);
|
INIT_IEEE1275_COMMON (&args.common, "getproplen", 2, 1);
|
||||||
args.phandle = phandle;
|
args.phandle = phandle;
|
||||||
args.prop = prop;
|
args.prop = (grub_ieee1275_cell_t) prop;
|
||||||
args.length = -1;
|
args.length = (grub_ieee1275_cell_t) -1;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -152,20 +150,20 @@ grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle,
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle,
|
grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle,
|
||||||
char *path, grub_size_t len, grub_size_t *actual)
|
char *path, grub_size_t len, grub_ssize_t *actual)
|
||||||
{
|
{
|
||||||
struct instance_to_package_args {
|
struct instance_to_package_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_phandle_t phandle;
|
grub_ieee1275_phandle_t phandle;
|
||||||
char *buf;
|
grub_ieee1275_cell_t buf;
|
||||||
int buflen;
|
grub_ieee1275_cell_t buflen;
|
||||||
int actual;
|
grub_ieee1275_cell_t actual;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "package-to-path", 3, 1);
|
INIT_IEEE1275_COMMON (&args.common, "package-to-path", 3, 1);
|
||||||
args.phandle = phandle;
|
args.phandle = phandle;
|
||||||
args.buf = path;
|
args.buf = (grub_ieee1275_cell_t) path;
|
||||||
args.buflen = len;
|
args.buflen = (grub_ieee1275_cell_t) len;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -177,20 +175,20 @@ grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle,
|
||||||
int
|
int
|
||||||
grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
|
grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
|
||||||
char *path, grub_size_t len,
|
char *path, grub_size_t len,
|
||||||
grub_size_t *actual)
|
grub_ssize_t *actual)
|
||||||
{
|
{
|
||||||
struct instance_to_package_args {
|
struct instance_to_package_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_ihandle_t ihandle;
|
grub_ieee1275_ihandle_t ihandle;
|
||||||
char *buf;
|
grub_ieee1275_cell_t buf;
|
||||||
int buflen;
|
grub_ieee1275_cell_t buflen;
|
||||||
int actual;
|
grub_ieee1275_cell_t actual;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "instance-to-path", 3, 1);
|
INIT_IEEE1275_COMMON (&args.common, "instance-to-path", 3, 1);
|
||||||
args.ihandle = ihandle;
|
args.ihandle = ihandle;
|
||||||
args.buf = path;
|
args.buf = (grub_ieee1275_cell_t) path;
|
||||||
args.buflen = len;
|
args.buflen = (grub_ieee1275_cell_t) len;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -201,20 +199,20 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
||||||
grub_size_t len, grub_size_t *actualp)
|
grub_size_t len, grub_ssize_t *actualp)
|
||||||
{
|
{
|
||||||
struct write_args {
|
struct write_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_ihandle_t ihandle;
|
grub_ieee1275_ihandle_t ihandle;
|
||||||
void *buf;
|
grub_ieee1275_cell_t buf;
|
||||||
grub_size_t len;
|
grub_ieee1275_cell_t len;
|
||||||
grub_size_t actual;
|
grub_ieee1275_cell_t actual;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "write", 3, 1);
|
INIT_IEEE1275_COMMON (&args.common, "write", 3, 1);
|
||||||
args.ihandle = ihandle;
|
args.ihandle = ihandle;
|
||||||
args.buf = buffer;
|
args.buf = (grub_ieee1275_cell_t) buffer;
|
||||||
args.len = len;
|
args.len = (grub_ieee1275_cell_t) len;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -225,20 +223,20 @@ grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
||||||
grub_size_t len, grub_size_t *actualp)
|
grub_size_t len, grub_ssize_t *actualp)
|
||||||
{
|
{
|
||||||
struct write_args {
|
struct write_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_ihandle_t ihandle;
|
grub_ieee1275_ihandle_t ihandle;
|
||||||
void *buf;
|
grub_ieee1275_cell_t buf;
|
||||||
grub_size_t len;
|
grub_ieee1275_cell_t len;
|
||||||
grub_size_t actual;
|
grub_ieee1275_cell_t actual;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "read", 3, 1);
|
INIT_IEEE1275_COMMON (&args.common, "read", 3, 1);
|
||||||
args.ihandle = ihandle;
|
args.ihandle = ihandle;
|
||||||
args.buf = buffer;
|
args.buf = (grub_ieee1275_cell_t) buffer;
|
||||||
args.len = len;
|
args.len = (grub_ieee1275_cell_t) len;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -249,20 +247,20 @@ grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi,
|
grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi,
|
||||||
int pos_lo, int *result)
|
int pos_lo, grub_ssize_t *result)
|
||||||
{
|
{
|
||||||
struct write_args {
|
struct write_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_ihandle_t ihandle;
|
grub_ieee1275_ihandle_t ihandle;
|
||||||
int pos_hi;
|
grub_ieee1275_cell_t pos_hi;
|
||||||
int pos_lo;
|
grub_ieee1275_cell_t pos_lo;
|
||||||
int result;
|
grub_ieee1275_cell_t result;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "seek", 3, 1);
|
INIT_IEEE1275_COMMON (&args.common, "seek", 3, 1);
|
||||||
args.ihandle = ihandle;
|
args.ihandle = ihandle;
|
||||||
args.pos_hi = pos_hi;
|
args.pos_hi = (grub_ieee1275_cell_t) pos_hi;
|
||||||
args.pos_lo = pos_lo;
|
args.pos_lo = (grub_ieee1275_cell_t) pos_lo;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -332,16 +330,16 @@ grub_ieee1275_parent (grub_ieee1275_phandle_t node,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_interpret (const char *command, int *catch)
|
grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch)
|
||||||
{
|
{
|
||||||
struct enter_args {
|
struct enter_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
const char *command;
|
grub_ieee1275_cell_t command;
|
||||||
int catch;
|
grub_ieee1275_cell_t catch;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "interpret", 1, 1);
|
INIT_IEEE1275_COMMON (&args.common, "interpret", 1, 1);
|
||||||
args.command = command;
|
args.command = (grub_ieee1275_cell_t) command;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -373,22 +371,21 @@ grub_ieee1275_exit (void)
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "exit", 0, 0);
|
INIT_IEEE1275_COMMON (&args.common, "exit", 0, 0);
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
IEEE1275_CALL_ENTRY_FN (&args);
|
||||||
return -1;
|
for (;;) ;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
grub_ieee1275_open (char *node, grub_ieee1275_ihandle_t *result)
|
grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result)
|
||||||
{
|
{
|
||||||
struct open_args {
|
struct open_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
char *cstr;
|
grub_ieee1275_cell_t path;
|
||||||
grub_ieee1275_ihandle_t result;
|
grub_ieee1275_ihandle_t result;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "open", 1, 1);
|
INIT_IEEE1275_COMMON (&args.common, "open", 1, 1);
|
||||||
args.cstr = node;
|
args.path = (grub_ieee1275_cell_t) path;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -419,16 +416,16 @@ grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align,
|
||||||
{
|
{
|
||||||
struct claim_args {
|
struct claim_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_addr_t addr;
|
grub_ieee1275_cell_t addr;
|
||||||
grub_size_t size;
|
grub_ieee1275_cell_t size;
|
||||||
unsigned int align;
|
grub_ieee1275_cell_t align;
|
||||||
grub_addr_t base;
|
grub_ieee1275_cell_t base;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "claim", 3, 1);
|
INIT_IEEE1275_COMMON (&args.common, "claim", 3, 1);
|
||||||
args.addr = addr;
|
args.addr = (grub_ieee1275_cell_t) addr;
|
||||||
args.size = size;
|
args.size = (grub_ieee1275_cell_t) size;
|
||||||
args.align = align;
|
args.align = (grub_ieee1275_cell_t) align;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -436,7 +433,7 @@ grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align,
|
||||||
if (result)
|
if (result)
|
||||||
*result = args.base;
|
*result = args.base;
|
||||||
|
|
||||||
if (args.base == (grub_addr_t)-1)
|
if (args.base == (grub_ieee1275_cell_t)-1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -447,8 +444,8 @@ grub_ieee1275_release (grub_addr_t addr, grub_size_t size)
|
||||||
{
|
{
|
||||||
struct release_args {
|
struct release_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_addr_t addr;
|
grub_ieee1275_cell_t addr;
|
||||||
grub_size_t size;
|
grub_ieee1275_cell_t size;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "release", 2, 0);
|
INIT_IEEE1275_COMMON (&args.common, "release", 2, 0);
|
||||||
|
@ -464,22 +461,22 @@ grub_ieee1275_release (grub_addr_t addr, grub_size_t size)
|
||||||
int
|
int
|
||||||
grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle,
|
grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle,
|
||||||
const char *propname, void *buf,
|
const char *propname, void *buf,
|
||||||
grub_size_t size, grub_size_t *actual)
|
grub_size_t size, grub_ssize_t *actual)
|
||||||
{
|
{
|
||||||
struct set_property_args {
|
struct set_property_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_ieee1275_phandle_t phandle;
|
grub_ieee1275_phandle_t phandle;
|
||||||
const char *propname;
|
grub_ieee1275_cell_t propname;
|
||||||
void *buf;
|
grub_ieee1275_cell_t buf;
|
||||||
grub_size_t size;
|
grub_ieee1275_cell_t size;
|
||||||
grub_size_t actual;
|
grub_ieee1275_cell_t actual;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "setprop", 4, 1);
|
INIT_IEEE1275_COMMON (&args.common, "setprop", 4, 1);
|
||||||
args.size = size;
|
args.size = (grub_ieee1275_cell_t) size;
|
||||||
args.buf = buf;
|
args.buf = (grub_ieee1275_cell_t) buf;
|
||||||
args.propname = propname;
|
args.propname = (grub_ieee1275_cell_t) propname;
|
||||||
args.phandle = phandle;
|
args.phandle = (grub_ieee1275_cell_t) phandle;
|
||||||
|
|
||||||
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -495,11 +492,11 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle,
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
char *method;
|
char *method;
|
||||||
grub_ieee1275_ihandle_t ihandle;
|
grub_ieee1275_ihandle_t ihandle;
|
||||||
int index;
|
grub_ieee1275_cell_t index;
|
||||||
int b;
|
grub_ieee1275_cell_t b;
|
||||||
int g;
|
grub_ieee1275_cell_t g;
|
||||||
int r;
|
grub_ieee1275_cell_t r;
|
||||||
int result;
|
grub_ieee1275_cell_t result;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1);
|
INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1);
|
||||||
|
@ -521,7 +518,7 @@ grub_ieee1275_milliseconds (grub_uint32_t *msecs)
|
||||||
{
|
{
|
||||||
struct milliseconds_args {
|
struct milliseconds_args {
|
||||||
struct grub_ieee1275_common_hdr common;
|
struct grub_ieee1275_common_hdr common;
|
||||||
grub_uint32_t msecs;
|
grub_ieee1275_cell_t msecs;
|
||||||
} args;
|
} args;
|
||||||
|
|
||||||
INIT_IEEE1275_COMMON (&args.common, "milliseconds", 0, 1);
|
INIT_IEEE1275_COMMON (&args.common, "milliseconds", 0, 1);
|
|
@ -23,16 +23,16 @@
|
||||||
#include <grub/disk.h>
|
#include <grub/disk.h>
|
||||||
#include <grub/mm.h>
|
#include <grub/mm.h>
|
||||||
#include <grub/partition.h>
|
#include <grub/partition.h>
|
||||||
#include <grub/machine/ieee1275.h>
|
|
||||||
#include <grub/normal.h>
|
#include <grub/normal.h>
|
||||||
#include <grub/fs.h>
|
#include <grub/fs.h>
|
||||||
#include <grub/setjmp.h>
|
#include <grub/setjmp.h>
|
||||||
#include <grub/env.h>
|
#include <grub/env.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
|
#include <grub/console.h>
|
||||||
#include <grub/machine/time.h>
|
#include <grub/machine/time.h>
|
||||||
#include <grub/machine/kernel.h>
|
#include <grub/machine/kernel.h>
|
||||||
#include <grub/machine/console.h>
|
#include <grub/ieee1275/ofdisk.h>
|
||||||
#include <grub/machine/ofdisk.h>
|
#include <grub/ieee1275/ieee1275.h>
|
||||||
|
|
||||||
/* Apple OF 1.0.5 reserves 0x0 to 0x4000 for the exception handlers. */
|
/* Apple OF 1.0.5 reserves 0x0 to 0x4000 for the exception handlers. */
|
||||||
static const grub_addr_t grub_heap_start = 0x4000;
|
static const grub_addr_t grub_heap_start = 0x4000;
|
||||||
|
|
|
@ -21,7 +21,8 @@
|
||||||
#include <grub/err.h>
|
#include <grub/err.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
#include <grub/mm.h>
|
#include <grub/mm.h>
|
||||||
#include <grub/machine/ieee1275.h>
|
#include <grub/machine/kernel.h>
|
||||||
|
#include <grub/ieee1275/ieee1275.h>
|
||||||
|
|
||||||
enum grub_ieee1275_parse_type
|
enum grub_ieee1275_parse_type
|
||||||
{
|
{
|
||||||
|
@ -38,11 +39,11 @@ grub_children_iterate (char *devpath,
|
||||||
grub_ieee1275_phandle_t child;
|
grub_ieee1275_phandle_t child;
|
||||||
|
|
||||||
grub_ieee1275_finddevice (devpath, &dev);
|
grub_ieee1275_finddevice (devpath, &dev);
|
||||||
if (dev == -1)
|
if (dev == (grub_ieee1275_phandle_t) -1)
|
||||||
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown device");
|
return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown device");
|
||||||
|
|
||||||
grub_ieee1275_child (dev, &child);
|
grub_ieee1275_child (dev, &child);
|
||||||
if (child == -1)
|
if (child == (grub_ieee1275_phandle_t) -1)
|
||||||
return grub_error (GRUB_ERR_BAD_DEVICE, "Device has no children");
|
return grub_error (GRUB_ERR_BAD_DEVICE, "Device has no children");
|
||||||
|
|
||||||
do
|
do
|
||||||
|
@ -125,7 +126,8 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grub_ieee1275_finddevice (devpath, &dev) || dev == -1)
|
if (grub_ieee1275_finddevice (devpath, &dev)
|
||||||
|
|| dev == (grub_ieee1275_phandle_t) -1)
|
||||||
{
|
{
|
||||||
grub_free (devpath);
|
grub_free (devpath);
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -18,14 +18,14 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <grub/machine/loader.h>
|
|
||||||
#include <grub/machine/ieee1275.h>
|
|
||||||
#include <grub/elf.h>
|
#include <grub/elf.h>
|
||||||
#include <grub/loader.h>
|
#include <grub/loader.h>
|
||||||
#include <grub/dl.h>
|
#include <grub/dl.h>
|
||||||
#include <grub/mm.h>
|
#include <grub/mm.h>
|
||||||
#include <grub/rescue.h>
|
#include <grub/rescue.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
|
#include <grub/ieee1275/ieee1275.h>
|
||||||
|
#include <grub/machine/loader.h>
|
||||||
|
|
||||||
static grub_dl_t my_mod;
|
static grub_dl_t my_mod;
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ static grub_size_t linux_size;
|
||||||
|
|
||||||
static char *linux_args;
|
static char *linux_args;
|
||||||
|
|
||||||
typedef void (*kernel_entry_t) (void *, unsigned long, intptr_t (void *),
|
typedef void (*kernel_entry_t) (void *, unsigned long, int (void *),
|
||||||
unsigned long, unsigned long);
|
unsigned long, unsigned long);
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <grub/machine/console.h>
|
#include <grub/console.h>
|
||||||
#include <grub/machine/ieee1275.h>
|
|
||||||
#include <grub/term.h>
|
#include <grub/term.h>
|
||||||
#include <grub/types.h>
|
#include <grub/types.h>
|
||||||
#include <grub/misc.h>
|
#include <grub/misc.h>
|
||||||
|
#include <grub/ieee1275/ieee1275.h>
|
||||||
|
|
||||||
static grub_ieee1275_ihandle_t stdout_ihandle;
|
static grub_ieee1275_ihandle_t stdout_ihandle;
|
||||||
static grub_ieee1275_ihandle_t stdin_ihandle;
|
static grub_ieee1275_ihandle_t stdin_ihandle;
|
|
@ -19,7 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#include <grub/machine/console.h>
|
#include <grub/console.h>
|
||||||
#include <grub/term.h>
|
#include <grub/term.h>
|
||||||
#include <grub/types.h>
|
#include <grub/types.h>
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include <grub/fs.h>
|
#include <grub/fs.h>
|
||||||
#include <grub/i386/pc/util/biosdisk.h>
|
#include <grub/i386/pc/util/biosdisk.h>
|
||||||
#include <grub/dl.h>
|
#include <grub/dl.h>
|
||||||
#include <grub/machine/console.h>
|
#include <grub/console.h>
|
||||||
#include <grub/util/misc.h>
|
#include <grub/util/misc.h>
|
||||||
#include <grub/kernel.h>
|
#include <grub/kernel.h>
|
||||||
#include <grub/normal.h>
|
#include <grub/normal.h>
|
||||||
|
|
Loading…
Reference in a new issue