- Timestamp:
- Jul 25, 2010, 5:27:20 PM (14 years ago)
- Branches:
- clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
- Children:
- 658135a
- Parents:
- 29b19f9
- git-author:
- Joe Ciccone <jciccone@…> (07/25/10 17:24:51)
- git-committer:
- Joe Ciccone <jciccone@…> (07/25/10 17:27:20)
- Location:
- patches
- Files:
-
- 1 added
- 1 deleted
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
patches/grub-0.97-fixes-2.patch
r29b19f9 ra1811b6 850 850 --- grub-0.97.orig/grub/asmstub.c 2005-02-16 12:45:14.000000000 -0800 851 851 +++ grub-0.97/grub/asmstub.c 2006-07-04 00:01:50.000000000 -0700 852 @@ -42,6 +42,12 @@853 #include <sys/time.h>854 #include <termios.h>855 #include <signal.h>856 +#include <sys/mman.h>857 +858 +#include <limits.h>859 +#ifndef PAGESIZE860 +#define PAGESIZE 4096861 +#endif862 863 #ifdef __linux__864 # include <sys/ioctl.h> /* ioctl */865 852 @@ -55,6 +61,10 @@ 866 853 # endif /* ! BLKFLSBUF */ … … 874 861 libc name clashes. */ 875 862 #define WITHOUT_LIBC_STUBS 1 876 @@ -144,6 +154,22 @@877 assert (grub_scratch_mem == 0);878 scratch = malloc (0x100000 + EXTENDED_MEMSIZE + 15);879 assert (scratch);880 +881 + {882 + char *p;883 + int ret;884 +885 + /* Align to a multiple of PAGESIZE, assumed to be a power of two. */886 + p = (char *) (((long) scratch) & ~(PAGESIZE - 1));887 +888 + /* The simulated stack needs to be executable, since GCC uses stack889 + * trampolines to implement nested functions.890 + */891 + ret = mprotect (p, 0x100000 + EXTENDED_MEMSIZE + 15,892 + PROT_READ | PROT_WRITE | PROT_EXEC);893 + assert (ret == 0);894 + }895 +896 grub_scratch_mem = (char *) ((((int) scratch) >> 4) << 4);897 898 /* FIXME: simulate the memory holes using mprot, if available. */899 863 @@ -777,7 +803,39 @@ 900 864
Note:
See TracChangeset
for help on using the changeset viewer.