grub/boot/powerpc/ieee1275/ieee1275.c

496 lines
11 KiB
C
Raw Normal View History

2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
/* ieee1275.c - Access the Open Firmware client interface. */
/*
* GRUB -- GRand Unified Bootloader
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
* Copyright (C) 2003, 2004 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.
*/
#include <grub/machine/ieee1275.h>
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
#define IEEE1275_PHANDLE_ROOT ((grub_ieee1275_phandle_t) 0)
#define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_phandle_t) -1)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
intptr_t (*grub_ieee1275_entry_fn) (void *);
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
#ifndef IEEE1275_CALL_ENTRY_FN
#define IEEE1275_CALL_ENTRY_FN(args) (*grub_ieee1275_entry_fn) (args)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
#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
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
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 is this function needed? */
grub_uint32_t
grub_ieee1275_decode_int_4 (unsigned char *p)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
grub_uint32_t val = (*p++ << 8);
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
val = (val + *p++) << 8;
val = (val + *p++) << 8;
return (val + *p);
}
int
grub_ieee1275_finddevice (char *name, grub_ieee1275_phandle_t *phandlep)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct find_device_args {
struct grub_ieee1275_common_hdr common;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
char *device;
grub_ieee1275_phandle_t phandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "finddevice", 1, 1);
args.device = name;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*phandlep = args.phandle;
return 0;
}
int
grub_ieee1275_get_property (grub_ieee1275_phandle_t handle,
const char *property, void *buf,
grub_size_t size, grub_size_t *actual)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct get_property_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_phandle_t phandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
const char *prop;
void *buf;
int buflen;
int size;
} args;
INIT_IEEE1275_COMMON (&args.common, "getprop", 4, 1);
args.phandle = handle;
args.prop = property;
args.buf = buf;
args.buflen = size;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
if (actual)
*actual = args.size;
return 0;
}
int
grub_ieee1275_next_property (int handle, char *prev_prop, char *prop,
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
int *flags)
{
struct get_property_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_phandle_t phandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
char *prev_prop;
char *next_prop;
int flags;
} args;
INIT_IEEE1275_COMMON (&args.common, "nextprop", 3, 1);
args.phandle = handle;
args.prev_prop = prev_prop;
args.next_prop = prop;
args.flags = -1;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
if (flags)
*flags = args.flags;
return 0;
}
int
grub_ieee1275_get_property_length (grub_ieee1275_phandle_t handle,
const char *prop, grub_size_t *length)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct get_property_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_phandle_t phandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
const char *prop;
grub_size_t length;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "getproplen", 2, 1);
args.phandle = handle;
args.prop = prop;
args.length = -1;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*length = args.length;
return 0;
}
int
grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle,
grub_ieee1275_phandle_t *phandlep)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct instance_to_package_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_ihandle_t ihandle;
grub_ieee1275_phandle_t phandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "instance-to-package", 1, 1);
args.ihandle = ihandle;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*phandlep = args.phandle;
return 0;
}
int
grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle,
char *path, grub_size_t len, grub_size_t *actual)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct instance_to_package_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_phandle_t phandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
char *buf;
int buflen;
int actual;
} args;
INIT_IEEE1275_COMMON (&args.common, "package-to-path", 3, 1);
args.phandle = phandle;
args.buf = path;
args.buflen = len;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
if (actual)
*actual = args.actual;
return 0;
}
int
grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle,
char *path, grub_size_t len,
grub_size_t *actual)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct instance_to_package_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_ihandle_t ihandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
char *buf;
int buflen;
int actual;
} args;
INIT_IEEE1275_COMMON (&args.common, "instance-to-path", 3, 1);
args.ihandle = ihandle;
args.buf = path;
args.buflen = len;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
if (actual)
*actual = args.actual;
return 0;
}
int
grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer,
grub_size_t len, grub_size_t *actualp)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct write_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_ihandle_t ihandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
void *buf;
grub_size_t len;
grub_size_t actual;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "write", 3, 1);
args.ihandle = ihandle;
args.buf = buffer;
args.len = len;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
if (actualp)
*actualp = args.actual;
return 0;
}
int
grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer,
grub_size_t len, grub_size_t *actualp)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct write_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_ihandle_t ihandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
void *buf;
grub_size_t len;
grub_size_t actual;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "read", 3, 1);
args.ihandle = ihandle;
args.buf = buffer;
args.len = len;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
if (actualp)
*actualp = args.actual;
return 0;
}
int
grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi,
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
int pos_lo, int *result)
{
struct write_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_ihandle_t ihandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
int pos_hi;
int pos_lo;
int result;
} args;
INIT_IEEE1275_COMMON (&args.common, "seek", 3, 1);
args.ihandle = ihandle;
args.pos_hi = pos_hi;
args.pos_lo = pos_lo;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
if (result)
*result = args.result;
return 0;
}
int
grub_ieee1275_peer (grub_ieee1275_phandle_t node,
grub_ieee1275_phandle_t *result)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct peer_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_phandle_t node;
grub_ieee1275_phandle_t result;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "peer", 1, 1);
args.node = node;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*result = args.result;
return 0;
}
int
grub_ieee1275_child (grub_ieee1275_phandle_t node,
grub_ieee1275_phandle_t *result)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct child_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_phandle_t node;
grub_ieee1275_phandle_t result;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "child", 1, 1);
args.node = node;
args.result = IEEE1275_PHANDLE_INVALID;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*result = args.result;
return 0;
}
int
grub_ieee1275_parent (grub_ieee1275_phandle_t node,
grub_ieee1275_phandle_t *result)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct parent_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_phandle_t node;
grub_ieee1275_phandle_t result;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "parent", 1, 1);
args.node = node;
args.result = IEEE1275_PHANDLE_INVALID;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*result = args.result;
return 0;
}
int
grub_ieee1275_exit (void)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct exit_args {
struct grub_ieee1275_common_hdr common;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "exit", 0, 0);
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
return 0;
}
int
grub_ieee1275_open (char *node, grub_ieee1275_ihandle_t *result)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct open_args {
struct grub_ieee1275_common_hdr common;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
char *cstr;
grub_ieee1275_ihandle_t result;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "open", 1, 1);
args.cstr = node;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*result = args.result;
return 0;
}
int
grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct close_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_ihandle_t ihandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "close", 1, 0);
args.ihandle = ihandle;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
return 0;
}
int
grub_ieee1275_claim (void *p, grub_size_t size,
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
unsigned int align, void **result)
{
struct claim_args {
struct grub_ieee1275_common_hdr common;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
void *p;
grub_size_t size;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
unsigned int align;
void *addr;
} args;
INIT_IEEE1275_COMMON (&args.common, "claim", 3, 1);
args.p = p;
args.size = size;
args.align = align;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*result = args.addr;
return 0;
}
int
grub_ieee1275_release (void *p, grub_size_t size)
{
struct release_args {
struct grub_ieee1275_common_hdr common;
void *p;
grub_size_t size;
} args;
INIT_IEEE1275_COMMON (&args.common, "release", 2, 0);
args.p = p;
args.size = size;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
return 0;
}
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
int
grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle,
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
const char *propname, void *buf,
grub_size_t size, grub_size_t *actual)
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
{
struct set_property_args {
struct grub_ieee1275_common_hdr common;
grub_ieee1275_phandle_t phandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
const char *propname;
void *buf;
grub_size_t size;
grub_size_t actual;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
} args;
INIT_IEEE1275_COMMON (&args.common, "setprop", 4, 1);
args.size = size;
args.buf = buf;
args.propname = propname;
args.phandle = phandle;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
*actual = args.actual;
return 0;
}
int
grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle,
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
int index, int r, int g, int b)
{
struct set_color_args {
struct grub_ieee1275_common_hdr common;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
char *method;
grub_ieee1275_ihandle_t ihandle;
2004-03-29 Marco Gerards <metgerards@student.han.nl> Add support for the newworld apple macintosh (PPC). This has been tested on the powerbook 2000 only. It only adds support for generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. Inverse test for crosscompile. * genmk.rb (Utility): Allow assembler files. * normal/cmdline.c (pupa_tab_complete): Reset pupa_errno. * conf/powerpc-ieee1275.rmk: New file. * disk/powerpc/ieee1275/ofdisk.c: Likewise. * disk/powerpc/ieee1275/partition.c: Likewise. * include/pupa/powerpc/ieee1275/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/console.h: Likewise. * include/pupa/powerpc/ieee1275/partition.h: Likewise. * include/pupa/powerpc/ieee1275/time.h: Likewise. * include/pupa/powerpc/ieee1275/util/biosdisk.h: Likewise. * include/pupa/powerpc/ieee1275/multiboot.h: Likewise. * include/pupa/powerpc/ieee1275/loader.h * include/pupa/powerpc/setjmp.h: Likewise. * include/pupa/powerpc/types.h: Likewise. * kern/powerpc/ieee1275/init.c: Likewise. * kern/powerpc/ieee1275/openfw.c: Likewise. * term/powerpc/ieee1275/ofconsole.c: Likewise. These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. * include/pupa/powerpc/ieee1275/ieee1275.h: Likewise.
2004-03-28 21:52:02 +00:00
int index;
int b;
int g;
int r;
int result;
} args;
INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1);
args.method = "color!";
args.ihandle = ihandle;
args.index = index;
args.r = r;
args.g = g;
args.b = b;
if (IEEE1275_CALL_ENTRY_FN (&args) == -1)
return -1;
return 0;
}