diff --recursive --unified --new-file linux-2.1.65/drivers/net/depca.c linux-2.1.65-em86/drivers/net/depca.c --- linux-2.1.65/drivers/net/depca.c Thu Nov 20 21:10:59 1997 +++ linux-2.1.65-em86/drivers/net/depca.c Thu Nov 20 22:11:21 1997 @@ -614,7 +614,7 @@ /* Trigger an initialization just for the interrupt. */ outw(INEA | INIT, DEPCA_DATA); - irqnum = autoirq_report(1); + irqnum = autoirq_report(10); if (!irqnum) { printk(" and failed to detect IRQ line.\n"); status = -ENXIO; diff --recursive --unified --new-file linux-2.1.65/fs/binfmt_elf.c linux-2.1.65-em86/fs/binfmt_elf.c --- linux-2.1.65/fs/binfmt_elf.c Thu Nov 20 21:10:52 1997 +++ linux-2.1.65-em86/fs/binfmt_elf.c Thu Nov 20 22:11:09 1997 @@ -409,6 +409,7 @@ unsigned long start_code, end_code, end_data; unsigned long elf_stack; char passed_fileno[6]; + unsigned long previous_personality = current->personality; ibcs2_interpreter = 0; status = 0; @@ -430,11 +431,20 @@ return -ENOEXEC; } +#ifdef __alpha + /* Adjust our personality if necessary */ + if(elf_ex.e_flags & EF_ALPHA_32BIT) { + printk("%s: 32-bit executable\n", bprm->filename); + current->personality = PER_LINUX_32BIT; + } +#endif + /* Now read in all of the header information */ elf_phdata = (struct elf_phdr *) kmalloc(elf_ex.e_phentsize * elf_ex.e_phnum, GFP_KERNEL); if (elf_phdata == NULL) { + current->personality = previous_personality; return -ENOMEM; } @@ -442,6 +452,7 @@ elf_ex.e_phentsize * elf_ex.e_phnum, 1); if (retval < 0) { kfree (elf_phdata); + current->personality = previous_personality; return retval; } @@ -454,6 +465,7 @@ if (elf_exec_fileno < 0) { kfree (elf_phdata); + current->personality = previous_personality; return elf_exec_fileno; } @@ -472,6 +484,7 @@ kfree (elf_phdata); kfree(elf_interpreter); sys_close(elf_exec_fileno); + current->personality = previous_personality; return -EINVAL; } @@ -485,6 +498,7 @@ if (elf_interpreter == NULL) { kfree (elf_phdata); sys_close(elf_exec_fileno); + current->personality = previous_personality; return -ENOMEM; } @@ -530,6 +544,7 @@ kfree (elf_phdata); kfree(elf_interpreter); sys_close(elf_exec_fileno); + current->personality = previous_personality; return retval; } } @@ -555,6 +570,7 @@ kfree(elf_interpreter); kfree(elf_phdata); sys_close(elf_exec_fileno); + current->personality = previous_personality; return -ELIBBAD; } } @@ -580,6 +596,7 @@ } kfree (elf_phdata); sys_close(elf_exec_fileno); + current->personality = previous_personality; return -E2BIG; } } @@ -699,7 +716,18 @@ kfree(elf_phdata); if (interpreter_type != INTERPRETER_AOUT) sys_close(elf_exec_fileno); - current->personality = (ibcs2_interpreter ? PER_SVR4 : PER_LINUX); + if(ibcs2_interpreter) { + current->personality = PER_SVR4; + } +#ifdef __alpha + else if(elf_ex.e_flags & EF_ALPHA_32BIT) { + printk("%s: 32-bit executable\n", bprm->filename); + current->personality = PER_LINUX_32BIT; + } +#endif + else { + current->personality = PER_LINUX; + } if (current->exec_domain && current->exec_domain->module) __MOD_DEC_USE_COUNT(current->exec_domain->module); diff --recursive --unified --new-file linux-2.1.65/include/asm-alpha/a.out.h linux-2.1.65-em86/include/asm-alpha/a.out.h --- linux-2.1.65/include/asm-alpha/a.out.h Thu Nov 20 21:18:06 1997 +++ linux-2.1.65-em86/include/asm-alpha/a.out.h Thu Nov 20 22:14:12 1997 @@ -90,7 +90,7 @@ #ifdef __KERNEL__ -#define STACK_TOP (0x00120000000UL) +#define STACK_TOP ((current->personality==PER_LINUX_32BIT) ? (0x80000000) : (0x00120000000UL)) #endif diff --recursive --unified --new-file linux-2.1.65/include/asm-alpha/elf.h linux-2.1.65-em86/include/asm-alpha/elf.h --- linux-2.1.65/include/asm-alpha/elf.h Thu Nov 20 21:10:26 1997 +++ linux-2.1.65-em86/include/asm-alpha/elf.h Thu Nov 20 12:18:51 1997 @@ -98,4 +98,10 @@ _dest[32] = _dump.regs[EF_PS]; \ } +/* Private flag definitions. Right now there is only one flag supported; + * EF_ALPHA_32BIT. This indicates a "32-bit" program where all addresses + * are 0x7fffffff or less. + */ +#define EF_ALPHA_32BIT 1 + #endif diff --recursive --unified --new-file linux-2.1.65/include/asm-alpha/processor.h linux-2.1.65-em86/include/asm-alpha/processor.h --- linux-2.1.65/include/asm-alpha/processor.h Mon Jun 16 19:35:59 1997 +++ linux-2.1.65-em86/include/asm-alpha/processor.h Thu Nov 20 12:18:51 1997 @@ -15,7 +15,7 @@ /* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ -#define TASK_UNMAPPED_BASE (TASK_SIZE / 3) +#define TASK_UNMAPPED_BASE ((current->personality & ADDR_LIMIT_32BIT) ? 0x40000000 : (TASK_SIZE / 3)) /* * Bus types diff --recursive --unified --new-file linux-2.1.65/include/linux/personality.h linux-2.1.65-em86/include/linux/personality.h --- linux-2.1.65/include/linux/personality.h Thu Nov 20 21:18:06 1997 +++ linux-2.1.65-em86/include/linux/personality.h Thu Nov 20 12:25:45 1997 @@ -8,12 +8,14 @@ /* Flags for bug emulation. These occupy the top three bytes. */ #define STICKY_TIMEOUTS 0x4000000 #define WHOLE_SECONDS 0x2000000 +#define ADDR_LIMIT_32BIT 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 (0x0000 | ADDR_LIMIT_32BIT) #define PER_SVR4 (0x0001 | STICKY_TIMEOUTS) #define PER_SVR3 (0x0002 | STICKY_TIMEOUTS) #define PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS) diff --recursive --unified --new-file linux-2.1.65/mm/mmap.c linux-2.1.65-em86/mm/mmap.c --- linux-2.1.65/mm/mmap.c Thu Nov 20 21:10:57 1997 +++ linux-2.1.65-em86/mm/mmap.c Thu Nov 20 22:11:17 1997 @@ -163,8 +163,9 @@ struct vm_area_struct * vma; int correct_wcount = 0, error; - if ((len = PAGE_ALIGN(len)) == 0) + if ((len = PAGE_ALIGN(len)) == 0) { return addr; + } if (len > TASK_SIZE || addr > TASK_SIZE-len) return -EINVAL;