get rid of util/$(target_cpu)/$(platform)/misc.c
PATCH 1/1 get rid of util/$(target_cpu)/$(platform)/misc.c
This patch gets rid of util/$(target_cpu)/$(platform)/misc.c by integrating them into util/misc.c.
It paves the way for unification of grub-emu.
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
2009-06-29 Robert Millan <[email protected]>
* util/misc.c: Include <setjmp.h>' and <grub/machine/machine.h>'. (grub_reboot, grub_halt): New functions.
* util/i386/pc/misc.c: Delete. Update all users.
* util/sparc64/ieee1275/misc.c: Likewise.
* util/powerpc/ieee1275/misc.c: Likewise.
i386-pc.rmk +0 -1
@@ -158,7 +158,6 @@ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
i386-efi.rmk +0 -1
@@ -65,7 +65,6 @@ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
i386-ieee1275.rmk +0 -1
@@ -92,7 +92,6 @@ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
x86_64-efi.rmk +0 -1
@@ -62,7 +62,6 @@ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
powerpc-ieee1275.rmk +0 -1
@@ -73,7 +73,6 @@ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/powerpc/ieee1275/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
i386-coreboot.rmk +0 -1
@@ -138,7 +138,6 @@ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
sparc64-ieee1275.rmk +0 -1
@@ -129,7 +129,6 @@ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/sparc64/ieee1275/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \
powerpc/ieee1275/misc.c +0 -33
@@ -1,33 +0,0 @@ -/* -* GRUB -- GRand Unified Bootloader -* Copyright (C) 2005,2007 Free Software Foundation, Inc. -* -* GRUB is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* GRUB is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with GRUB. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <setjmp.h> - -#include <grub/util/misc.h> - -void -grub_reboot (void ) -{ -longjmp (main_env,1 ); -} - -void -grub_halt (void ) -{ -grub_reboot (); -}
sparc64/ieee1275/misc.c +0 -33
@@ -1,33 +0,0 @@ -/* -* GRUB -- GRand Unified Bootloader -* Copyright (C) 2009 Free Software Foundation, Inc. -* -* GRUB is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* GRUB is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with GRUB. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <setjmp.h> - -#include <grub/util/misc.h> - -void -grub_reboot (void ) -{ -longjmp (main_env,1 ); -} - -void -grub_halt (void ) -{ -grub_reboot (); -}
i386/pc/misc.c +0 -33
@@ -1,33 +0,0 @@ -/* -* GRUB -- GRand Unified Bootloader -* Copyright (C) 2005,2007 Free Software Foundation, Inc. -* -* GRUB is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* GRUB is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with GRUB. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <setjmp.h> - -#include <grub/util/misc.h> - -void -grub_reboot (void ) -{ -longjmp (main_env,1 ); -} - -void -grub_halt (int no_apm __attribute__ ((unused))) -{ -grub_reboot (); -}
misc.c +18 -0
@@ -18,6 +18,7 @@#include <config.h> +#include <setjmp.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h>
@@ -36,6 +37,7 @@#include <grub/term.h> #include <grub/time.h> #include <grub/machine/time.h> +#include <grub/machine/machine.h> /* Include malloc.h, only if memalign is available. It is known that memalign is declared in malloc.h in all systems, if present. */
@@ -436,4 +438,20 @@return size; } +#endif /* __MINGW32__ */ + +void +grub_reboot (void ) +{ +longjmp (main_env,1 ); +} + +void +grub_halt ( +#ifdef GRUB_MACHINE_PCBIOS + int no_apm __attribute__ ((unused)) #endif + ) +{ +grub_reboot (); +}
Committed.
Quoted 266 lines · Robert Millan
This patch gets rid of util/$(target_cpu)/$(platform)/misc.c by integrating them into
util/misc.c.It paves the way for unification of grub-emu.
Signature · 17 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all." 2009-06-29 Robert Millan <[email protected]> * util/misc.c: Include `<setjmp.h>' and `<grub/machine/machine.h>'. (grub_reboot, grub_halt): New functions. * util/i386/pc/misc.c: Delete. Update all users. * util/sparc64/ieee1275/misc.c: Likewise. * util/powerpc/ieee1275/misc.c: Likewise. Index: conf/i386-pc.rmk ===================================================================i386-pc.rmk +0
-1@@ -158,7 +158,6 @@ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \Index: conf/i386-efi.rmk
===================================================================i386-efi.rmk +0
-1@@ -65,7 +65,6 @@ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \Index: conf/i386-ieee1275.rmk
===================================================================i386-ieee1275.rmk +0
-1@@ -92,7 +92,6 @@ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \Index: conf/x86_64-efi.rmk
===================================================================x86_64-efi.rmk +0
-1@@ -62,7 +62,6 @@ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \Index: conf/powerpc-ieee1275.rmk
===================================================================powerpc-ieee1275.rmk +0
-1@@ -73,7 +73,6 @@ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/powerpc/ieee1275/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \Index: conf/i386-coreboot.rmk
===================================================================i386-coreboot.rmk +0
-1@@ -138,7 +138,6 @@ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \Index: conf/sparc64-ieee1275.rmk
===================================================================sparc64-ieee1275.rmk +0
-1@@ -129,7 +129,6 @@ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/sparc64/ieee1275/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \Index:
util/powerpc/ieee1275/misc.c
===================================================================powerpc/ieee1275/misc.c +0
-33@@ -1,33 +0,0 @@ -/* -* GRUB -- GRand Unified Bootloader -* Copyright (C) 2005,2007 Free Software Foundation, Inc. -* -* GRUB is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* GRUB is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with GRUB. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <setjmp.h> - -#include <grub/util/misc.h> - -void -grub_reboot (void ) -{ -longjmp (main_env,1 ); -} - -void -grub_halt (void ) -{ -grub_reboot (); -}Index:
util/sparc64/ieee1275/misc.c
===================================================================sparc64/ieee1275/misc.c +0
-33@@ -1,33 +0,0 @@ -/* -* GRUB -- GRand Unified Bootloader -* Copyright (C) 2009 Free Software Foundation, Inc. -* -* GRUB is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* GRUB is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with GRUB. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <setjmp.h> - -#include <grub/util/misc.h> - -void -grub_reboot (void ) -{ -longjmp (main_env,1 ); -} - -void -grub_halt (void ) -{ -grub_reboot (); -}Index:
util/i386/pc/misc.c
===================================================================i386/pc/misc.c +0
-33@@ -1,33 +0,0 @@ -/* -* GRUB -- GRand Unified Bootloader -* Copyright (C) 2005,2007 Free Software Foundation, Inc. -* -* GRUB is free software: you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation, either version 3 of the License, or -* (at your option) any later version. -* -* GRUB is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with GRUB. If not, see <http://www.gnu.org/licenses/>. -*/ - -#include <setjmp.h> - -#include <grub/util/misc.h> - -void -grub_reboot (void ) -{ -longjmp (main_env,1 ); -} - -void -grub_halt (int no_apm __attribute__ ((unused))) -{ -grub_reboot (); -}Index:
util/misc.c
===================================================================misc.c +18
-0@@ -18,6 +18,7 @@#include <config.h> +#include <setjmp.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h> @@ -36,6 +37,7 @@#include <grub/term.h> #include <grub/time.h> #include <grub/machine/time.h> +#include <grub/machine/machine.h> /* Include malloc.h, only if memalign is available. It is known that memalign is declared in malloc.h in all systems, if present. */ @@ -436,4 +438,20 @@return size; } +#endif /* __MINGW32__ */ + +void +grub_reboot (void ) +{ +longjmp (main_env,1 ); +} + +void +grub_halt ( +#ifdef GRUB_MACHINE_PCBIOS + int no_apm __attribute__ ((unused)) #endif + ) +{ +grub_reboot (); +}_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Quoted 4 lines · Robert Millan
This patch gets rid of util/$(target_cpu)/$(platform)/misc.c by integrating them into
util/misc.c.It paves the way for unification of grub-emu.
The patch breaks compilation of any utilities other than grub-emu due to undefined main_env :-(
Signature · 2 lines
Regards, Pavel Roskin
Quoted 8 lines · Pavel Roskin
Quoted 4 lines · Robert Millan
This patch gets rid of util/$(target_cpu)/$(platform)/misc.c by integrating them into
util/misc.c.It paves the way for unification of grub-emu.
The patch breaks compilation of any utilities other than grub-emu due to undefined
main_env:-(
I can't reproduce this. In which port did you find it?
Signature · 5 lines
Robert Millan The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."
Quoted 11 lines · Robert Millan
Quoted 8 lines · Pavel Roskin
Quoted 4 lines · Robert Millan
This patch gets rid of util/$(target_cpu)/$(platform)/misc.c by integrating them into
util/misc.c.It paves the way for unification of grub-emu.
The patch breaks compilation of any utilities other than grub-emu due to undefined
main_env:-(I can't reproduce this. In which port did you find it?
Actually, I applied that patch already. It was happening on i386-pc. The code moved from util/$(target_cpu)/$(platform)/misc.c belongs to grub-emu only.
Signature · 2 lines
Regards, Pavel Roskin