--- linux-2.6.16-rc1/arch/i386/Kconfig 2006-01-26 22:34:42 +0100 +++ linux-2.6.16-rc1-vs2.1.0.9.4/arch/i386/Kconfig 2006-01-21 18:28:16 +0100 @@ -457,6 +457,46 @@ config HIGHMEM64G endchoice +choice + prompt "Memory Split User Space" + default SPLIT_3GB + help + A different Userspace/Kernel split allows you to + utilize up to alsmost 3GB of RAM without the requirement + for HIGHMEM. It also increases the available lowmem. + +config SPLIT_3GB + bool "3.0GB/1.0GB Kernel (Default)" + help + This is the default split of 3GB userspace to 1GB kernel + space, which will result in about 860MB of lowmem. + +config SPLIT_25GB + bool "2.5GB/1.5GB Kernel" + help + This split provides 2.5GB userspace and 1.5GB kernel + space, which will result in about 1370MB of lowmem. + +config SPLIT_2GB + bool "2.0GB/2.0GB Kernel" + help + This split provides 2GB userspace and 2GB kernel + space, which will result in about 1880MB of lowmem. + +config SPLIT_15GB + bool "1.5GB/2.5GB Kernel" + help + This split provides 1.5GB userspace and 2.5GB kernel + space, which will result in about 2390MB of lowmem. + +config SPLIT_1GB + bool "1.0GB/3.0GB Kernel" + help + This split provides 1GB userspace and 3GB kernel + space, which will result in about 2900MB of lowmem. + +endchoice + config HIGHMEM bool depends on HIGHMEM64G || HIGHMEM4G --- linux-2.6.16-rc1/arch/i386/boot/compressed/misc.c 2006-01-26 22:34:42 +0100 +++ linux-2.6.16-rc1-vs2.1.0.9.4/arch/i386/boot/compressed/misc.c 2006-01-21 18:28:16 +0100 @@ -309,7 +309,7 @@ static void setup_normal_output_buffer(v #else if ((RM_ALT_MEM_K > RM_EXT_MEM_K ? RM_ALT_MEM_K : RM_EXT_MEM_K) < 1024) error("Less than 2MB of memory"); #endif - output_data = (char *)__PHYSICAL_START; /* Normally Points to 1M */ + output_data = (char *)PHYSICAL_START; /* Normally Points to 1M */ free_mem_end_ptr = (long)real_mode; } --- linux-2.6.16-rc1/arch/i386/boot/compressed/misc.c 2006-01-26 22:34:42 +0100 +++ linux-2.6.16-rc1-vs2.1.0.9.4/arch/i386/boot/compressed/misc.c 2006-01-21 18:28:16 +0100 @@ -334,8 +334,8 @@ static void setup_output_buffer_if_we_ru low_buffer_size = low_buffer_end - LOW_BUFFER_START; high_loaded = 1; free_mem_end_ptr = (long)high_buffer_start; - if ( (__PHYSICAL_START + low_buffer_size) > ((ulg)high_buffer_start)) { - high_buffer_start = (uch *)(__PHYSICAL_START + low_buffer_size); + if ((PHYSICAL_START + low_buffer_size) > ((ulg)high_buffer_start)) { + high_buffer_start = (uch *)(PHYSICAL_START + low_buffer_size); mv->hcount = 0; /* say: we need not to move high_buffer */ } else mv->hcount = -1; --- linux-2.6.16-rc1/arch/i386/kernel/setup.c 2006-01-26 22:34:43 +0100 +++ linux-2.6.16-rc1-vs2.1.0.9.4/arch/i386/kernel/setup.c 2006-01-21 18:28:16 +0100 @@ -1192,8 +1192,8 @@ void __init setup_bootmem_allocator(void * the (very unlikely) case of us accidentally initializing the * bootmem allocator with an invalid RAM area. */ - reserve_bootmem(__PHYSICAL_START, (PFN_PHYS(min_low_pfn) + - bootmap_size + PAGE_SIZE-1) - (__PHYSICAL_START)); + reserve_bootmem(PHYSICAL_START, (PFN_PHYS(min_low_pfn) + + bootmap_size + PAGE_SIZE-1) - (PHYSICAL_START)); /* * reserve physical page 0 - it's a special BIOS page on many boxes, --- linux-2.6.16-rc1/include/asm-i386/elf.h 2006-01-03 17:30:04 +0100 +++ linux-2.6.16-rc1-vs2.1.0.9.4/include/asm-i386/elf.h 2006-01-21 18:28:16 +0100 @@ -71,7 +71,7 @@ typedef struct user_fxsr_struct elf_fpxr the loader. We need to make sure that it is out of the way of the program that it will "exec", and that there is sufficient room for the brk. */ -#define ELF_ET_DYN_BASE (TASK_SIZE / 3 * 2) +#define ELF_ET_DYN_BASE ((TASK_UNMAPPED_BASE) * 2) /* regs is struct pt_regs, pr_reg is elf_gregset_t (which is now struct_user_regs, they are different) */ --- linux-2.6.16-rc1/include/asm-i386/page.h 2005-10-28 20:49:49 +0200 +++ linux-2.6.16-rc1-vs2.1.0.9.4/include/asm-i386/page.h 2006-01-21 18:28:16 +0100 @@ -109,14 +109,21 @@ extern int page_is_ram(unsigned long pag #endif /* __ASSEMBLY__ */ -#ifdef __ASSEMBLY__ +#if defined(CONFIG_SPLIT_3GB) #define __PAGE_OFFSET (0xC0000000) -#define __PHYSICAL_START CONFIG_PHYSICAL_START -#else -#define __PAGE_OFFSET (0xC0000000UL) -#define __PHYSICAL_START ((unsigned long)CONFIG_PHYSICAL_START) +#elif defined(CONFIG_SPLIT_25GB) +#define __PAGE_OFFSET (0xA0000000) +#elif defined(CONFIG_SPLIT_2GB) +#define __PAGE_OFFSET (0x80000000) +#elif defined(CONFIG_SPLIT_15GB) +#define __PAGE_OFFSET (0x60000000) +#elif defined(CONFIG_SPLIT_1GB) +#define __PAGE_OFFSET (0x40000000) #endif + +#define __PHYSICAL_START CONFIG_PHYSICAL_START #define __KERNEL_START (__PAGE_OFFSET + __PHYSICAL_START) +#define __MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE) #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) --- linux-2.6.16-rc1/include/asm-i386/page.h 2005-10-28 20:49:49 +0200 +++ linux-2.6.16-rc1-vs2.1.0.9.4/include/asm-i386/page.h 2006-01-21 18:28:16 +0100 @@ -120,8 +127,9 @@ ***** #define PAGE_OFFSET ((unsigned long)__PAGE_OFFSET) +#define PHYSICAL_START ((unsigned long)__PHYSICAL_START) #define VMALLOC_RESERVE ((unsigned long)__VMALLOC_RESERVE) -#define MAXMEM (-__PAGE_OFFSET-__VMALLOC_RESERVE) +#define MAXMEM ((unsigned long)__MAXMEM) #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) #define __va(x) ((void *)((unsigned long)(x)+PAGE_OFFSET)) #define pfn_to_kaddr(pfn) __va((pfn) << PAGE_SHIFT) --- linux-2.6.16-rc1/include/asm-i386/processor.h 2006-01-26 22:35:17 +0100 +++ linux-2.6.16-rc1-vs2.1.0.9.4/include/asm-i386/processor.h 2006-01-21 18:28:16 +0100 @@ -316,9 +316,10 @@ extern unsigned int mca_pentium_flag; extern int bootloader_type; /* - * User space process size: 3GB (default). + * User space process size: (3GB default). */ -#define TASK_SIZE (PAGE_OFFSET) +#define __TASK_SIZE (__PAGE_OFFSET) +#define TASK_SIZE ((unsigned long)__TASK_SIZE) /* This decides where the kernel will search for a free chunk of vm * space during mmap's.