From efd6e6d56454a5874327d6e80d51e826626987e7 Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 7 Aug 2005 14:14:40 +0000 Subject: [PATCH] 2005-08-07 Yoshinori K. Okuji * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Replaced kern/ieee1275.c with kern/ieee1275/of.c. * kern/ieee1275.c: Moved to ... * kern/ieee1275/of.c: ... here. --- ChangeLog | 8 ++ conf/powerpc-ieee1275.mk | 18 ++-- conf/powerpc-ieee1275.rmk | 2 +- kern/{ieee1275.c => ieee1275/of.c} | 143 +++++++++++++++++++---------- 4 files changed, 113 insertions(+), 58 deletions(-) rename kern/{ieee1275.c => ieee1275/of.c} (92%) diff --git a/ChangeLog b/ChangeLog index 55896b65e..e9b4ac19b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-08-07 Yoshinori K. Okuji + + * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Replaced + kern/ieee1275.c with kern/ieee1275/of.c. + + * kern/ieee1275.c: Moved to ... + * kern/ieee1275/of.c: ... here. + 2005-08-06 Yoshinori K. Okuji * conf/i386-pc.rmk (kernel_img_HEADERS): Reordered for diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index e86538a17..29c83a90f 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -489,17 +489,17 @@ grub_emu-util_powerpc_ieee1275_misc.d: util/powerpc/ieee1275/misc.c grub_emu_LDFLAGS = -lncurses grubof_SOURCES = boot/powerpc/ieee1275/crt0.S boot/powerpc/ieee1275/cmain.c \ - kern/ieee1275.c kern/main.c kern/device.c \ + kern/ieee1275/of.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/partition.c kern/env.c kern/powerpc/dl.c grubof_symlist.c \ kern/powerpc/cache.S -CLEANFILES += grubof grubof-boot_powerpc_ieee1275_crt0.o grubof-boot_powerpc_ieee1275_cmain.o grubof-kern_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o -MOSTLYCLEANFILES += grubof-boot_powerpc_ieee1275_crt0.d grubof-boot_powerpc_ieee1275_cmain.d grubof-kern_ieee1275.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-kern_powerpc_ieee1275_init.d grubof-term_ieee1275_ofconsole.d grubof-kern_powerpc_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_powerpc_dl.d grubof-grubof_symlist.d grubof-kern_powerpc_cache.d +CLEANFILES += grubof grubof-boot_powerpc_ieee1275_crt0.o grubof-boot_powerpc_ieee1275_cmain.o grubof-kern_ieee1275_of.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o +MOSTLYCLEANFILES += grubof-boot_powerpc_ieee1275_crt0.d grubof-boot_powerpc_ieee1275_cmain.d grubof-kern_ieee1275_of.d grubof-kern_main.d grubof-kern_device.d grubof-kern_disk.d grubof-kern_dl.d grubof-kern_file.d grubof-kern_fs.d grubof-kern_err.d grubof-kern_misc.d grubof-kern_mm.d grubof-kern_loader.d grubof-kern_rescue.d grubof-kern_term.d grubof-kern_powerpc_ieee1275_init.d grubof-term_ieee1275_ofconsole.d grubof-kern_powerpc_ieee1275_openfw.d grubof-disk_ieee1275_ofdisk.d grubof-kern_partition.d grubof-kern_env.d grubof-kern_powerpc_dl.d grubof-grubof_symlist.d grubof-kern_powerpc_cache.d -grubof: grubof-boot_powerpc_ieee1275_crt0.o grubof-boot_powerpc_ieee1275_cmain.o grubof-kern_ieee1275.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o +grubof: grubof-boot_powerpc_ieee1275_crt0.o grubof-boot_powerpc_ieee1275_cmain.o grubof-kern_ieee1275_of.o grubof-kern_main.o grubof-kern_device.o grubof-kern_disk.o grubof-kern_dl.o grubof-kern_file.o grubof-kern_fs.o grubof-kern_err.o grubof-kern_misc.o grubof-kern_mm.o grubof-kern_loader.o grubof-kern_rescue.o grubof-kern_term.o grubof-kern_powerpc_ieee1275_init.o grubof-term_ieee1275_ofconsole.o grubof-kern_powerpc_ieee1275_openfw.o grubof-disk_ieee1275_ofdisk.o grubof-kern_partition.o grubof-kern_env.o grubof-kern_powerpc_dl.o grubof-grubof_symlist.o grubof-kern_powerpc_cache.o $(CC) -o $@ $^ $(LDFLAGS) $(grubof_LDFLAGS) grubof-boot_powerpc_ieee1275_crt0.o: boot/powerpc/ieee1275/crt0.S @@ -518,13 +518,13 @@ grubof-boot_powerpc_ieee1275_cmain.d: boot/powerpc/ieee1275/cmain.c -include grubof-boot_powerpc_ieee1275_cmain.d -grubof-kern_ieee1275.o: kern/ieee1275.c - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $< +grubof-kern_ieee1275_of.o: kern/ieee1275/of.c + $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $< -grubof-kern_ieee1275.d: kern/ieee1275.c - set -e; $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,ieee1275\.o[ :]*,grubof-kern_ieee1275.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ +grubof-kern_ieee1275_of.d: kern/ieee1275/of.c + set -e; $(CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -M $< | sed 's,of\.o[ :]*,grubof-kern_ieee1275_of.o $@ : ,g' > $@; [ -s $@ ] || rm -f $@ --include grubof-kern_ieee1275.d +-include grubof-kern_ieee1275_of.d grubof-kern_main.o: kern/main.c $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) $(grubof_CFLAGS) -c -o $@ $< diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 41fe48ed4..55dfd2d2b 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -53,7 +53,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_emu_LDFLAGS = -lncurses grubof_SOURCES = boot/powerpc/ieee1275/crt0.S boot/powerpc/ieee1275/cmain.c \ - kern/ieee1275.c kern/main.c kern/device.c \ + kern/ieee1275/of.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \ diff --git a/kern/ieee1275.c b/kern/ieee1275/of.c similarity index 92% rename from kern/ieee1275.c rename to kern/ieee1275/of.c index 56ad8764c..5d4db0734 100644 --- a/kern/ieee1275.c +++ b/kern/ieee1275/of.c @@ -1,4 +1,4 @@ -/* ieee1275.c - Access the Open Firmware client interface. */ +/* of.c - Access the Open Firmware client interface. */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. @@ -38,11 +38,13 @@ grub_ieee1275_decode_int_4 (unsigned char *p) int grub_ieee1275_finddevice (char *name, grub_ieee1275_phandle_t *phandlep) { - struct find_device_args { + struct find_device_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_cell_t device; grub_ieee1275_phandle_t phandle; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "finddevice", 1, 1); args.device = (grub_ieee1275_cell_t) name; @@ -58,14 +60,16 @@ grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle, const char *property, void *buf, grub_size_t size, grub_ssize_t *actual) { - struct get_property_args { + struct get_property_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_phandle_t phandle; grub_ieee1275_cell_t prop; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t buflen; grub_ieee1275_cell_t size; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "getprop", 4, 1); args.phandle = phandle; @@ -86,13 +90,15 @@ int grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop, char *prop, grub_ieee1275_cell_t *flags) { - struct get_property_args { + struct get_property_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_phandle_t phandle; grub_ieee1275_cell_t prev_prop; grub_ieee1275_cell_t next_prop; grub_ieee1275_cell_t flags; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "nextprop", 3, 1); args.phandle = phandle; @@ -111,12 +117,14 @@ int grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle, const char *prop, grub_ssize_t *length) { - struct get_property_args { + struct get_property_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_phandle_t phandle; grub_ieee1275_cell_t prop; grub_ieee1275_cell_t length; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "getproplen", 2, 1); args.phandle = phandle; @@ -133,11 +141,13 @@ int grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle, grub_ieee1275_phandle_t *phandlep) { - struct instance_to_package_args { + struct instance_to_package_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_ihandle_t ihandle; grub_ieee1275_phandle_t phandle; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "instance-to-package", 1, 1); args.ihandle = ihandle; @@ -150,15 +160,18 @@ grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle, int grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle, - char *path, grub_size_t len, grub_ssize_t *actual) + char *path, grub_size_t len, + grub_ssize_t *actual) { - struct instance_to_package_args { + struct instance_to_package_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_phandle_t phandle; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t buflen; grub_ieee1275_cell_t actual; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "package-to-path", 3, 1); args.phandle = phandle; @@ -177,13 +190,15 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle, char *path, grub_size_t len, grub_ssize_t *actual) { - struct instance_to_package_args { + struct instance_to_package_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_ihandle_t ihandle; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t buflen; grub_ieee1275_cell_t actual; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "instance-to-path", 3, 1); args.ihandle = ihandle; @@ -201,13 +216,15 @@ int grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer, grub_size_t len, grub_ssize_t *actualp) { - struct write_args { + struct write_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_ihandle_t ihandle; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t len; grub_ieee1275_cell_t actual; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "write", 3, 1); args.ihandle = ihandle; @@ -225,13 +242,15 @@ int grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer, grub_size_t len, grub_ssize_t *actualp) { - struct write_args { + struct write_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_ihandle_t ihandle; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t len; grub_ieee1275_cell_t actual; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "read", 3, 1); args.ihandle = ihandle; @@ -249,13 +268,15 @@ int grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi, int pos_lo, grub_ssize_t *result) { - struct write_args { + struct write_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_ihandle_t ihandle; grub_ieee1275_cell_t pos_hi; grub_ieee1275_cell_t pos_lo; grub_ieee1275_cell_t result; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "seek", 3, 1); args.ihandle = ihandle; @@ -274,11 +295,13 @@ int grub_ieee1275_peer (grub_ieee1275_phandle_t node, grub_ieee1275_phandle_t *result) { - struct peer_args { + struct peer_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_phandle_t node; grub_ieee1275_phandle_t result; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "peer", 1, 1); args.node = node; @@ -293,11 +316,13 @@ int grub_ieee1275_child (grub_ieee1275_phandle_t node, grub_ieee1275_phandle_t *result) { - struct child_args { + struct child_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_phandle_t node; grub_ieee1275_phandle_t result; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "child", 1, 1); args.node = node; @@ -313,11 +338,13 @@ int grub_ieee1275_parent (grub_ieee1275_phandle_t node, grub_ieee1275_phandle_t *result) { - struct parent_args { + struct parent_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_phandle_t node; grub_ieee1275_phandle_t result; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "parent", 1, 1); args.node = node; @@ -332,11 +359,13 @@ grub_ieee1275_parent (grub_ieee1275_phandle_t node, int grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch) { - struct enter_args { + struct enter_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_cell_t command; grub_ieee1275_cell_t catch; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "interpret", 1, 1); args.command = (grub_ieee1275_cell_t) command; @@ -351,9 +380,11 @@ grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch) int grub_ieee1275_enter (void) { - struct enter_args { + struct enter_args + { struct grub_ieee1275_common_hdr common; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "enter", 0, 0); @@ -365,9 +396,11 @@ grub_ieee1275_enter (void) int grub_ieee1275_exit (void) { - struct exit_args { + struct exit_args + { struct grub_ieee1275_common_hdr common; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "exit", 0, 0); @@ -378,11 +411,13 @@ grub_ieee1275_exit (void) int grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result) { - struct open_args { + struct open_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_cell_t path; grub_ieee1275_ihandle_t result; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "open", 1, 1); args.path = (grub_ieee1275_cell_t) path; @@ -396,10 +431,12 @@ grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result) int grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle) { - struct close_args { + struct close_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_ihandle_t ihandle; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "close", 1, 0); args.ihandle = ihandle; @@ -414,13 +451,15 @@ int grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align, grub_addr_t *result) { - struct claim_args { + struct claim_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_cell_t addr; grub_ieee1275_cell_t size; grub_ieee1275_cell_t align; grub_ieee1275_cell_t base; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "claim", 3, 1); args.addr = (grub_ieee1275_cell_t) addr; @@ -442,11 +481,13 @@ grub_ieee1275_claim (grub_addr_t addr, grub_size_t size, unsigned int align, int grub_ieee1275_release (grub_addr_t addr, grub_size_t size) { - struct release_args { + struct release_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_cell_t addr; grub_ieee1275_cell_t size; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "release", 2, 0); args.addr = addr; @@ -463,14 +504,16 @@ grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle, const char *propname, void *buf, grub_size_t size, grub_ssize_t *actual) { - struct set_property_args { + struct set_property_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_phandle_t phandle; grub_ieee1275_cell_t propname; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t size; grub_ieee1275_cell_t actual; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "setprop", 4, 1); args.size = (grub_ieee1275_cell_t) size; @@ -488,7 +531,8 @@ int grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle, int index, int r, int g, int b) { - struct set_color_args { + struct set_color_args + { struct grub_ieee1275_common_hdr common; char *method; grub_ieee1275_ihandle_t ihandle; @@ -497,7 +541,8 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle, grub_ieee1275_cell_t g; grub_ieee1275_cell_t r; grub_ieee1275_cell_t result; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1); args.method = "color!"; @@ -516,10 +561,12 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle, int grub_ieee1275_milliseconds (grub_uint32_t *msecs) { - struct milliseconds_args { + struct milliseconds_args + { struct grub_ieee1275_common_hdr common; grub_ieee1275_cell_t msecs; - } args; + } + args; INIT_IEEE1275_COMMON (&args.common, "milliseconds", 0, 1);