Does this break glibc2 support?
Hi,
I've been looking at kernels ... I'm thinking of compiling a whole new set
fairly soon, since the one I found on Pasi's site was broken, and many of
them seem to be untested (I don't even know what source he used).
Nikita, I used your patches (with the reversed patch to
include/linux/types.h and the extra one to drivers/scsi/aic7xxx.c) with no
problems.
I then had a look at alpha-patches-0.2. I've generated a patch to go from
0.1 to 0.2, hopefully keeping the glibc2 compatibility which was reversed
in 0.1. Could someone have a look through to make sure this doesn't have
any glibc2 problems? I don't know what to look for.
With one exception, it applied cleanly to my patched tree: someone had
kindly corrected two spelling mistakes in comments, which broke the
context of one hunk! AAARGH!!! Anyway, the patch I enclose below is the
one for our tree, which differs by all of *two bytes* from the
autogenerated alpha-patches-0.1-0.2 one.
BTW, I've been running this kernel (patched with Nikita's stuff, my
corrections and ap0.2) since this morning - seems to be stable. EM86,
however, is a different story: the binaries depend on shared libs which
have the wrong names (sorry RedHat, but ...), and I can't get the source
to compile ... trying to convert unsigned long's to __sigset_t's indeed!
GLIBC1/GLIB2 problem, possibly.
Cheers,
Nikhil.
--
Nikhil Nair
Trinity College, Cambridge, England
Tel.: +44 1223 368353
Email: nn201@cus.cam.ac.uk
nnair@debian.org
---------------------------------------
diff -uNr linux.old/arch/alpha/defconfig linux/arch/alpha/defconfig
--- linux.old/arch/alpha/defconfig Mon Sep 29 09:44:37 1997
+++ linux/arch/alpha/defconfig Mon Sep 29 09:47:32 1997
@@ -45,6 +45,7 @@
CONFIG_SYSVIPC=y
CONFIG_BINFMT_AOUT=y
CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_EM86=y
#
# Floppy, IDE, and other block devices
diff -uNr linux.old/drivers/sound/Config.in linux/drivers/sound/Config.in
--- linux.old/drivers/sound/Config.in Wed Jul 10 12:34:03 1996
+++ linux/drivers/sound/Config.in Mon Sep 29 09:47:32 1997
@@ -1,15 +1,251 @@
-#
-# Sound driver configuration
-#
-#--------
-# There is another config script which is compatible with rest of
-# the kernel. It can be activated by running 'make mkscript' in this
-# directory. Please note that this is an _experimental_ feature which
-# doesn't work with all cards (PSS, SM Wave, AudioTrix Pro, Maui).
-#--------
-#
-$MAKE -C drivers/sound config || exit 1
+bool 'ProAudioSpectrum 16 support' CONFIG_PAS
+bool 'Sound Blaster (SB, SBPro, SB16, clones) support' CONFIG_SB
+bool 'Generic OPL2/OPL3 FM synthesizer support' CONFIG_ADLIB
+bool 'Gravis Ultrasound support' CONFIG_GUS
+bool 'MPU-401 support (NOT for SB16)' CONFIG_MPU401
+bool '6850 UART Midi support' CONFIG_UART6850
+bool 'PSS (ECHO-ADI2111) support' CONFIG_PSS
+bool '16 bit sampling option of GUS (_NOT_ GUS MAX)' CONFIG_GUS16
+bool 'GUS MAX support' CONFIG_GUSMAX
+bool 'Microsoft Sound System support' CONFIG_MSS
+bool 'Ensoniq SoundScape support' CONFIG_SSCAPE
+bool 'MediaTrix AudioTrix Pro support' CONFIG_TRIX
+bool 'Support for MAD16 and/or Mozart based cards' CONFIG_MAD16
+bool 'Support for Crystal CS4232 based (PnP) cards' CONFIG_CS4232
+bool 'Support for Turtle Beach Wave Front (Maui, Tropez) synthesizers' CONFIG_MAUI
+bool '/dev/dsp and /dev/audio support' CONFIG_AUDIO
+bool 'MIDI interface support' CONFIG_MIDI
+bool 'FM synthesizer (YM3812/OPL-3) support' CONFIG_YM3812
+
+if [ "$CONFIG_SB" = "y" ]; then
+hex 'I/O base for SB Check from manual of the card' SBC_BASE 220
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+int 'Sound Blaster IRQ Check from manual of the card' SBC_IRQ 7
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+int 'Sound Blaster DMA 0, 1 or 3' SBC_DMA 1
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+int 'Sound Blaster 16 bit DMA (_REQUIRED_for SB16, Jazz16, SMW) 5, 6 or 7 (use 1 for 8 bit cards)' SB_DMA2 5
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+hex 'MPU401 I/O base of SB16, Jazz16 and ES1688 Check from manual of the card' SB_MPU_BASE 0
+fi
+
+if [ "$CONFIG_SB" = "y" ]; then
+int 'SB MPU401 IRQ (Jazz16, SM Wave and ES1688) Use -1 with SB16' SB_MPU_IRQ -1
+fi
+
+if [ "$CONFIG_PAS" = "y" ]; then
+int 'PAS16 IRQ 3, 4, 5, 7, 9, 10, 11, 12, 14 or 15' PAS_IRQ 10
+fi
+
+if [ "$CONFIG_PAS" = "y" ]; then
+int 'PAS16 DMA 0, 1, 3, 5, 6 or 7' PAS_DMA 3
+fi
+
+if [ "$CONFIG_GUS" = "y" ]; then
+hex 'I/O base for GUS 210, 220, 230, 240, 250 or 260' GUS_BASE 220
+fi
+
+if [ "$CONFIG_GUS" = "y" ]; then
+int 'GUS IRQ 3, 5, 7, 9, 11, 12 or 15' GUS_IRQ 15
+fi
+
+if [ "$CONFIG_GUS" = "y" ]; then
+int 'GUS DMA 1, 3, 5, 6 or 7' GUS_DMA 6
+fi
+
+if [ "$CONFIG_GUS" = "y" ]; then
+int 'Second DMA channel for GUS 1, 3, 5, 6 or 7' GUS_DMA2 -1
+fi
+
+if [ "$CONFIG_GUS16" = "y" ]; then
+hex 'I/O base for the 16 bit daughtercard of GUS 530, 604, E80 or F40' GUS16_BASE 530
+fi
+
+if [ "$CONFIG_GUS16" = "y" ]; then
+int 'GUS 16 bit daughtercard IRQ 3, 4, 5, 7, or 9' GUS16_IRQ 7
+fi
+
+if [ "$CONFIG_GUS16" = "y" ]; then
+int 'GUS DMA 0, 1 or 3' GUS16_DMA 3
+fi
+
+if [ "$CONFIG_MPU401" = "y" ]; then
+hex 'I/O base for MPU401 Check from manual of the card' MPU_BASE 330
+fi
+
+if [ "$CONFIG_MPU401" = "y" ]; then
+int 'MPU401 IRQ Check from manual of the card' MPU_IRQ 9
+fi
+
+if [ "$CONFIG_MAUI" = "y" ]; then
+hex 'I/O base for Maui 210, 230, 260, 290, 300, 320, 338 or 330' MAUI_BASE 330
+fi
+
+if [ "$CONFIG_MAUI" = "y" ]; then
+int 'Maui IRQ 5, 9, 12 or 15' MAUI_IRQ 9
+fi
+
+if [ "$CONFIG_UART6850" = "y" ]; then
+hex 'I/O base for UART 6850 MIDI port (Unknown)' U6850_BASE 0
+fi
+
+if [ "$CONFIG_UART6850" = "y" ]; then
+int 'UART6850 IRQ (Unknown)' U6850_IRQ -1
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+hex 'PSS I/O base 220 or 240' PSS_BASE 220
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+hex 'PSS audio I/O base 530, 604, E80 or F40' PSS_MSS_BASE 530
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+int 'PSS audio IRQ 7, 9, 10 or 11' PSS_MSS_IRQ 11
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+int 'PSS audio DMA 0, 1 or 3' PSS_MSS_DMA 3
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+hex 'PSS MIDI I/O base ' PSS_MPU_BASE 330
+fi
+
+if [ "$CONFIG_PSS" = "y" ]; then
+int 'PSS MIDI IRQ 3, 4, 5, 7 or 9' PSS_MPU_IRQ 9
+fi
+if [ "$CONFIG_MSS" = "y" ]; then
+hex 'MSS/WSS I/O base 530, 604, E80 or F40' MSS_BASE 530
+fi
+
+if [ "$CONFIG_MSS" = "y" ]; then
+int 'MSS/WSS IRQ 7, 9, 10 or 11' MSS_IRQ 11
+fi
+
+if [ "$CONFIG_MSS" = "y" ]; then
+int 'MSS/WSS DMA 0, 1 or 3' MSS_DMA 3
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+hex 'SoundScape MIDI I/O base 320, 330, 340 or 350' SSCAPE_BASE 330
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+int 'SoundScape MIDI IRQ ' SSCAPE_IRQ 9
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+int 'SoundScape initialization DMA 0, 1 or 3' SSCAPE_DMA 3
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+hex 'SoundScape audio I/O base 534, 608, E84 or F44' SSCAPE_MSS_BASE 534
+fi
+
+if [ "$CONFIG_SSCAPE" = "y" ]; then
+int 'SoundScape audio IRQ 7, 9, 10 or 11' SSCAPE_MSS_IRQ 11
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+hex 'AudioTrix audio I/O base 530, 604, E80 or F40' TRIX_BASE 530
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix audio IRQ 7, 9, 10 or 11' TRIX_IRQ 11
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix audio DMA 0, 1 or 3' TRIX_DMA 0
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix second (duplex) DMA 0, 1 or 3' TRIX_DMA2 3
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+hex 'AudioTrix MIDI I/O base 330, 370, 3B0 or 3F0' TRIX_MPU_BASE 330
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix MIDI IRQ 3, 4, 5, 7 or 9' TRIX_MPU_IRQ 9
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+hex 'AudioTrix SB I/O base 220, 210, 230, 240, 250, 260 or 270' TRIX_SB_BASE 220
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix SB IRQ 3, 4, 5 or 7' TRIX_SB_IRQ 7
+fi
+
+if [ "$CONFIG_TRIX" = "y" ]; then
+int 'AudioTrix SB DMA 1 or 3' TRIX_SB_DMA 1
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+hex 'CS4232 audio I/O base 530, 604, E80 or F40' CS4232_BASE 530
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+int 'CS4232 audio IRQ 5, 7, 9, 11, 12 or 15' CS4232_IRQ 11
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+int 'CS4232 audio DMA 0, 1 or 3' CS4232_DMA 0
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+int 'CS4232 second (duplex) DMA 0, 1 or 3' CS4232_DMA2 3
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+hex 'CS4232 MIDI I/O base 330, 370, 3B0 or 3F0' CS4232_MPU_BASE 330
+fi
+
+if [ "$CONFIG_CS4232" = "y" ]; then
+int 'CS4232 MIDI IRQ 5, 7, 9, 11, 12 or 15' CS4232_MPU_IRQ 9
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+hex 'MAD16 audio I/O base 530, 604, E80 or F40' MAD16_BASE 530
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+int 'MAD16 audio IRQ 7, 9, 10 or 11' MAD16_IRQ 11
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+int 'MAD16 audio DMA 0, 1 or 3' MAD16_DMA 3
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+int 'MAD16 second (duplex) DMA 0, 1 or 3' MAD16_DMA2 0
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+hex 'MAD16 MIDI I/O base 300, 310, 320 or 330 (0 disables)' MAD16_MPU_BASE 330
+fi
+
+if [ "$CONFIG_MAD16" = "y" ]; then
+int 'MAD16 MIDI IRQ 5, 7, 9 or 10' MAD16_MPU_IRQ 9
+fi
+
+if [ "$CONFIG_AUDIO" = "y" ]; then
+int 'Audio DMA buffer size 4096, 16384, 32768 or 65536' DSP_BUFFSIZE 65536
+fi
+#
+$MAKE -C drivers/sound kernelconfig || exit 1
bool 'Additional low level drivers' CONFIG_LOWLEVEL_SOUND
if [ "$CONFIG_LOWLEVEL_SOUND" = "y" ]; then
diff -uNr linux.old/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- linux.old/fs/binfmt_elf.c Thu Jan 2 18:29:30 1997
+++ linux/fs/binfmt_elf.c Mon Sep 29 09:47:32 1997
@@ -413,6 +413,13 @@
return -ENOMEM;
}
+#if CONFIG_BINFMT_EM86
+ /* JRP - some special-case hackery here for EM86 */
+ if((strcmp(bprm->filename, "em86") == 0) ||
+ (strcmp(strrchr(bprm->filename, '/'), "/em86") == 0)) {
+ current->personality = PER_LINUX_EM86;
+ }
+#endif
retval = read_exec(bprm->inode, elf_ex.e_phoff, (char *) elf_phdata,
elf_ex.e_phentsize * elf_ex.e_phnum, 1);
if (retval < 0) {
@@ -470,8 +477,9 @@
then assume an iBCS2 image. Otherwise assume
a native linux image. */
if (strcmp(elf_interpreter,"/usr/lib/libc.so.1") == 0 ||
- strcmp(elf_interpreter,"/usr/lib/ld.so.1") == 0)
+ strcmp(elf_interpreter,"/usr/lib/ld.so.1") == 0) {
ibcs2_interpreter = 1;
+ }
#if 0
printk("Using ELF interpreter %s\n", elf_interpreter);
#endif
@@ -637,7 +645,14 @@
kfree(elf_phdata);
if (interpreter_type != INTERPRETER_AOUT) sys_close(elf_exec_fileno);
- current->personality = (ibcs2_interpreter ? PER_SVR4 : PER_LINUX);
+
+ /* JRP - Since we're now creating processes with the default
+ * PER_LINUX personality type, we only need to change this
+ * when we know it's different.
+ */
+ if(ibcs2_interpreter) {
+ current->personality = PER_SVR4;
+ }
if (current->exec_domain && current->exec_domain->use_count)
(*current->exec_domain->use_count)--;
diff -uNr linux.old/fs/binfmt_em86.c linux/fs/binfmt_em86.c
--- linux.old/fs/binfmt_em86.c Mon Sep 29 09:44:37 1997
+++ linux/fs/binfmt_em86.c Mon Sep 29 09:47:32 1997
@@ -23,6 +23,8 @@
char *cp, *interp, *i_name, *i_arg;
int retval;
struct elfhdr elf_ex;
+ uid_t x86_uid;
+ gid_t x86_gid;
/* Make sure this is a Linux/Intel ELF executable... */
elf_ex = *((struct elfhdr *)bprm->buf);
@@ -81,9 +83,18 @@
if (retval)
return retval;
bprm->dont_iput=0;
+
+ /* Remember the uid/gid that was set by this executable */
+ x86_uid = bprm->e_uid;
+ x86_gid = bprm->e_gid;
retval=prepare_binprm(bprm);
if(retval<0)
return retval;
+
+ /* ...so that we may propagate them to em86 */
+ bprm->e_uid = x86_uid;
+ bprm->e_gid = x86_gid;
+ current->personality = PER_LINUX_EM86;
return search_binary_handler(bprm,regs);
}
diff -uNr linux.old/fs/exec.c linux/fs/exec.c
--- linux.old/fs/exec.c Mon Sep 29 09:44:37 1997
+++ linux/fs/exec.c Mon Sep 29 09:47:32 1997
@@ -628,22 +628,32 @@
struct linux_binprm bprm;
int retval;
int i;
+ unsigned long prev_personality = current->personality;
+
+ /* We always do the exec in PER_LINUX mode... */
+ current->personality = PER_LINUX;
bprm.p = PAGE_SIZE*MAX_ARG_PAGES-sizeof(void *);
for (i=0 ; i<MAX_ARG_PAGES ; i++) /* clear page-table */
bprm.page[i] = 0;
retval = open_namei(filename, 0, 0, &bprm.inode, NULL);
- if (retval)
+ if (retval) {
+ current->personality = prev_personality;
return retval;
+ }
bprm.filename = filename;
bprm.sh_bang = 0;
bprm.loader = 0;
bprm.exec = 0;
bprm.dont_iput = 0;
- if ((bprm.argc = count(argv)) < 0)
+ if ((bprm.argc = count(argv)) < 0) {
+ current->personality = prev_personality;
return bprm.argc;
- if ((bprm.envc = count(envp)) < 0)
+ }
+ if ((bprm.envc = count(envp)) < 0) {
+ current->personality = prev_personality;
return bprm.envc;
+ }
retval = prepare_binprm(&bprm);
@@ -667,5 +677,6 @@
iput(bprm.inode);
for (i=0 ; i<MAX_ARG_PAGES ; i++)
free_page(bprm.page[i]);
+ current->personality = prev_personality;
return(retval);
}
diff -uNr linux.old/include/asm-alpha/a.out.h linux/include/asm-alpha/a.out.h
--- linux.old/include/asm-alpha/a.out.h Thu Nov 9 08:04:33 1995
+++ linux/include/asm-alpha/a.out.h Mon Sep 29 09:47:32 1997
@@ -90,7 +90,8 @@
#ifdef __KERNEL__
-#define STACK_TOP (0x00120000000UL)
+#define STACK_TOP ((current->personality & ADDR_MAX_32BIT) ? 0x100000000UL : \
+ ((current->personality&ADDR_MAX_31BIT) ? 0x80000000UL : 0x00120000000UL))
#endif
diff -uNr linux.old/include/asm-alpha/processor.h linux/include/asm-alpha/processor.h
--- linux.old/include/asm-alpha/processor.h Sun Sep 15 08:34:18 1996
+++ linux/include/asm-alpha/processor.h Mon Sep 29 09:47:32 1997
@@ -8,9 +8,17 @@
#define __ASM_ALPHA_PROCESSOR_H
/*
- * We have a 41-bit user address space: 2TB user VM...
+ * We have a 41-bit user address space: 2TB user VM.
+ * Under certain circumstances (e.g. when emulating 32-bit code)
+ * we may want to voluntarily limit this...
*/
#define TASK_SIZE (0x40000000000UL)
+#define MAX_USER_ADDR ((current->personality&ADDR_MAX_32BIT) ? 0x100000000UL : \
+ ((current->personality & ADDR_MAX_31BIT) ? 0x80000000UL : \
+ 0x40000000000UL))
+#define MMAP_SEARCH_START ((current->personality & ADDR_MAX_31BIT) ? \
+ (MAX_USER_ADDR/2) : (MAX_USER_ADDR/3))
+
/*
* Bus types
diff -uNr linux.old/include/asm-i386/processor.h linux/include/asm-i386/processor.h
--- linux.old/include/asm-i386/processor.h Tue Mar 11 21:52:29 1997
+++ linux/include/asm-i386/processor.h Mon Sep 29 09:47:32 1997
@@ -40,6 +40,8 @@
* so don't change it unless you know what you are doing.
*/
#define TASK_SIZE (0xC0000000UL)
+#define MAX_USER_ADDR TASK_SIZE
+#define MMAP_SEARCH_START (TASK_SIZE/3)
/*
* Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
diff -uNr linux.old/include/asm-m68k/processor.h linux/include/asm-m68k/processor.h
--- linux.old/include/asm-m68k/processor.h Sun Mar 24 10:21:16 1996
+++ linux/include/asm-m68k/processor.h Mon Sep 29 09:47:32 1997
@@ -14,6 +14,8 @@
* so don't change it unless you know what you are doing.
*/
#define TASK_SIZE (0xF0000000UL)
+#define MAX_USER_ADDR TASK_SIZE
+#define MMAP_SEARCH_START (TASK_SIZE/3)
/*
* Bus types
diff -uNr linux.old/include/asm-mips/processor.h linux/include/asm-mips/processor.h
--- linux.old/include/asm-mips/processor.h Fri Apr 12 07:49:44 1996
+++ linux/include/asm-mips/processor.h Mon Sep 29 09:47:32 1997
@@ -44,6 +44,8 @@
* so don't change it unless you know what you are doing.
*/
#define TASK_SIZE (0x80000000UL)
+#define MAX_USER_ADDR TASK_SIZE
+#define MMAP_SEARCH_START (TASK_SIZE/3)
/*
* Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
diff -uNr linux.old/include/asm-ppc/processor.h linux/include/asm-ppc/processor.h
--- linux.old/include/asm-ppc/processor.h Mon May 27 10:00:59 1996
+++ linux/include/asm-ppc/processor.h Mon Sep 29 09:47:32 1997
@@ -80,6 +80,8 @@
* "this is gonna have to change to 1gig for the sparc" - David S. Miller
*/
#define TASK_SIZE (0x80000000UL)
+#define MAX_USER_ADDR TASK_SIZE
+#define MMAP_SEARCH_START (TASK_SIZE/3)
struct thread_struct
{
diff -uNr linux.old/include/asm-sparc/processor.h linux/include/asm-sparc/processor.h
--- linux.old/include/asm-sparc/processor.h Sun Apr 21 10:30:33 1996
+++ linux/include/asm-sparc/processor.h Mon Sep 29 09:47:33 1997
@@ -31,6 +31,8 @@
/* Whee, this is STACK_TOP and the lowest kernel address too... */
#define TASK_SIZE (KERNBASE)
+#define MAX_USER_ADDR TASK_SIZE
+#define MMAP_SEARCH_START (TASK_SIZE/3)
/* The Sparc processor specific thread struct. */
struct thread_struct {
diff -uNr linux.old/include/linux/personality.h linux/include/linux/personality.h
--- linux.old/include/linux/personality.h Wed Aug 21 07:18:10 1996
+++ linux/include/linux/personality.h Mon Sep 29 09:47:33 1997
@@ -8,12 +8,16 @@
/* Flags for bug emulation. These occupy the top three bytes. */
#define STICKY_TIMEOUTS 0x4000000
#define WHOLE_SECONDS 0x2000000
+#define ADDR_MAX_32BIT 0x1000000
+#define ADDR_MAX_31BIT 0x0800000
/* Personality types. These go in the low byte. Avoid using the top bit,
* it will conflict with error returns.
*/
#define PER_MASK (0x00ff)
#define PER_LINUX (0x0000)
+#define PER_LINUX_32BIT (PER_LINUX | ADDR_MAX_32BIT)
+#define PER_LINUX_EM86 (PER_LINUX | ADDR_MAX_31BIT)
#define PER_SVR4 (0x0001 | STICKY_TIMEOUTS)
#define PER_SVR3 (0x0002 | STICKY_TIMEOUTS)
#define PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)
diff -uNr linux.old/ipc/shm.c linux/ipc/shm.c
--- linux.old/ipc/shm.c Fri Nov 22 14:25:18 1996
+++ linux/ipc/shm.c Mon Sep 29 09:47:33 1997
@@ -493,10 +493,10 @@
return -EINVAL;
}
/*
- * Check if addr exceeds TASK_SIZE (from do_mmap)
+ * Check if addr exceeds MAX_USER_ADDR (from do_mmap)
*/
len = PAGE_SIZE*shp->shm_npages;
- if (addr >= TASK_SIZE || len > TASK_SIZE || addr > TASK_SIZE - len)
+ if (addr >= MAX_USER_ADDR || len > MAX_USER_ADDR || addr > MAX_USER_ADDR - len)
return -EINVAL;
/*
* If shm segment goes below stack, make sure there is some
diff -uNr linux.old/mm/mmap.c linux/mm/mmap.c
--- linux.old/mm/mmap.c Fri Nov 22 14:25:17 1996
+++ linux/mm/mmap.c Mon Sep 29 09:47:33 1997
@@ -146,7 +146,7 @@
if ((len = PAGE_ALIGN(len)) == 0)
return addr;
- if (len > TASK_SIZE || addr > TASK_SIZE-len)
+ if (len > MAX_USER_ADDR || addr > MAX_USER_ADDR-len)
return -EINVAL;
/* offset overflow? */
@@ -305,15 +305,15 @@
{
struct vm_area_struct * vmm;
- if (len > TASK_SIZE)
+ if (len > MAX_USER_ADDR)
return 0;
if (!addr)
- addr = TASK_SIZE / 3;
+ addr = MMAP_SEARCH_START;
addr = PAGE_ALIGN(addr);
for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
/* At this point: (!vmm || addr < vmm->vm_end). */
- if (TASK_SIZE - len < addr)
+ if (MAX_USER_ADDR - len < addr)
return 0;
if (!vmm || addr + len <= vmm->vm_start)
return addr;
@@ -793,7 +793,7 @@
{
struct vm_area_struct *mpnt, *prev, *next, **npp, *free;
- if ((addr & ~PAGE_MASK) || addr > TASK_SIZE || len > TASK_SIZE-addr)
+ if ((addr & ~PAGE_MASK) || addr > MAX_USER_ADDR || len > MAX_USER_ADDR-addr)
return -EINVAL;
if ((len = PAGE_ALIGN(len)) == 0)
diff -uNr linux.old/mm/mremap.c linux/mm/mremap.c
--- linux.old/mm/mremap.c Fri Nov 22 14:25:17 1996
+++ linux/mm/mremap.c Mon Sep 29 09:47:33 1997
@@ -200,7 +200,7 @@
/* old_len exactly to the end of the area.. */
if (old_len == vma->vm_end - addr &&
(old_len != new_len || !(flags & MREMAP_MAYMOVE))) {
- unsigned long max_addr = TASK_SIZE;
+ unsigned long max_addr = MAX_USER_ADDR;
if (vma->vm_next)
max_addr = vma->vm_next->vm_start;
/* can we just expand the current mapping? */
--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-alpha-request@lists.debian.org .
Trouble? e-mail to templin@bucknell.edu .
Reply to: