1 Index: linux-2.4.19-pre1/arch/i386/kernel/entry.S
2 ===================================================================
3 --- linux-2.4.19-pre1.orig/arch/i386/kernel/entry.S 2003-11-21 03:38:55.000000000 +0300
4 +++ linux-2.4.19-pre1/arch/i386/kernel/entry.S 2003-12-01 18:14:32.000000000 +0300
6 #include <linux/linkage.h>
7 #include <asm/segment.h>
9 +#include <asm/current.h>
17 -#define GET_CURRENT(reg) \
22 pushfl # We get a different stack layout with call gates,
23 pushl %eax # which has to be cleaned up later..
28 - andl $-8192,%ebx # GET_CURRENT
29 + andl $-THREAD_SIZE,%ebx # GET_CURRENT
30 movl exec_domain(%ebx),%edx # Get the execution domain
31 movl 4(%edx),%edx # Get the lcall7 handler for the domain
37 - andl $-8192,%ebx # GET_CURRENT
38 + andl $-THREAD_SIZE,%ebx # GET_CURRENT
39 movl exec_domain(%ebx),%edx # Get the execution domain
40 movl 4(%edx),%edx # Get the lcall7 handler for the domain
42 Index: linux-2.4.19-pre1/arch/i386/kernel/smpboot.c
43 ===================================================================
44 --- linux-2.4.19-pre1.orig/arch/i386/kernel/smpboot.c 2001-12-21 20:41:53.000000000 +0300
45 +++ linux-2.4.19-pre1/arch/i386/kernel/smpboot.c 2003-12-01 18:14:32.000000000 +0300
48 /* So we see what's up */
49 printk("Booting processor %d/%d eip %lx\n", cpu, apicid, start_eip);
50 - stack_start.esp = (void *) (1024 + PAGE_SIZE + (char *)idle);
51 + stack_start.esp = (void *)idle->thread.esp;
54 * This grunge runs the startup process for
56 Dprintk("CPU has booted.\n");
59 - if (*((volatile unsigned char *)phys_to_virt(8192))
60 + if (*((volatile unsigned char *)phys_to_virt(THREAD_SIZE))
62 /* trampoline started but...? */
67 /* mark "stuck" area as not stuck */
68 - *((volatile unsigned long *)phys_to_virt(8192)) = 0;
69 + *((volatile unsigned long *)phys_to_virt(THREAD_SIZE)) = 0;
71 if(clustered_apic_mode) {
72 printk("Restoring NMI vector\n");
73 Index: linux-2.4.19-pre1/arch/i386/kernel/traps.c
74 ===================================================================
75 --- linux-2.4.19-pre1.orig/arch/i386/kernel/traps.c 2003-12-01 18:11:31.000000000 +0300
76 +++ linux-2.4.19-pre1/arch/i386/kernel/traps.c 2003-12-01 18:14:32.000000000 +0300
78 unsigned long esp = tsk->thread.esp;
80 /* User space on another CPU? */
81 - if ((esp ^ (unsigned long)tsk) & (PAGE_MASK<<1))
82 + if ((esp ^ (unsigned long)tsk) & ~(THREAD_SIZE - 1))
84 show_trace((unsigned long *)esp);
86 Index: linux-2.4.19-pre1/arch/i386/kernel/head.S
87 ===================================================================
88 --- linux-2.4.19-pre1.orig/arch/i386/kernel/head.S 2003-11-20 19:01:35.000000000 +0300
89 +++ linux-2.4.19-pre1/arch/i386/kernel/head.S 2003-12-01 18:14:32.000000000 +0300
92 #include <asm/pgtable.h>
94 +#include <asm/current.h>
96 #define OLD_CL_MAGIC_ADDR 0x90020
97 #define OLD_CL_MAGIC 0xA33F
102 - .long SYMBOL_NAME(init_task_union)+8192
103 + .long SYMBOL_NAME(init_task_union)+THREAD_SIZE
106 /* This is the default interrupt "handler" :-) */
107 Index: linux-2.4.19-pre1/arch/i386/lib/getuser.S
108 ===================================================================
109 --- linux-2.4.19-pre1.orig/arch/i386/lib/getuser.S 1998-01-13 00:42:52.000000000 +0300
110 +++ linux-2.4.19-pre1/arch/i386/lib/getuser.S 2003-12-01 18:14:32.000000000 +0300
112 * as they get called from within inline assembly.
115 +/* Duplicated from asm/processor.h */
116 +#include <asm/current.h>
117 +#include <linux/config.h>
126 - andl $0xffffe000,%edx
127 + andl $~(THREAD_SIZE - 1),%edx
128 cmpl addr_limit(%edx),%eax
130 1: movzbl (%eax),%edx
135 - andl $0xffffe000,%edx
136 + andl $~(THREAD_SIZE - 1),%edx
137 cmpl addr_limit(%edx),%eax
139 2: movzwl -1(%eax),%edx
144 - andl $0xffffe000,%edx
145 + andl $~(THREAD_SIZE - 1),%edx
146 cmpl addr_limit(%edx),%eax
148 3: movl -3(%eax),%edx
149 Index: linux-2.4.19-pre1/arch/i386/config.in
150 ===================================================================
151 --- linux-2.4.19-pre1.orig/arch/i386/config.in 2003-11-20 19:01:35.000000000 +0300
152 +++ linux-2.4.19-pre1/arch/i386/config.in 2003-12-01 18:14:32.000000000 +0300
154 if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then
155 define_bool CONFIG_HAVE_DEC_LOCK y
158 +choice 'Bigger Stack Size Support' \
159 + "off CONFIG_NOBIGSTACK \
160 + 16KB CONFIG_STACK_SIZE_16KB \
161 + 32KB CONFIG_STACK_SIZE_32KB \
162 + 64KB CONFIG_STACK_SIZE_64KB" off
164 +if [ "$CONFIG_NOBIGSTACK" = "y" ]; then
165 + define_int CONFIG_STACK_SIZE_SHIFT 1
167 + if [ "$CONFIG_STACK_SIZE_16KB" = "y" ]; then
168 + define_int CONFIG_STACK_SIZE_SHIFT 2
170 + if [ "$CONFIG_STACK_SIZE_32KB" = "y" ]; then
171 + define_int CONFIG_STACK_SIZE_SHIFT 3
173 + if [ "$CONFIG_STACK_SIZE_64KB" = "y" ]; then
174 + define_int CONFIG_STACK_SIZE_SHIFT 4
182 mainmenu_option next_comment
183 Index: linux-2.4.19-pre1/arch/i386/vmlinux.lds
184 ===================================================================
185 --- linux-2.4.19-pre1.orig/arch/i386/vmlinux.lds 2003-11-20 19:01:35.000000000 +0300
186 +++ linux-2.4.19-pre1/arch/i386/vmlinux.lds 2003-12-01 18:14:32.000000000 +0300
189 _edata = .; /* End of data section */
191 - . = ALIGN(8192); /* init_task */
192 +/* chose the biggest of the possible stack sizes here? */
193 + . = ALIGN(65536); /* init_task */
194 .data.init_task : { *(.data.init_task) }
196 . = ALIGN(4096); /* Init code and data */
197 Index: linux-2.4.19-pre1/include/asm-i386/current.h
198 ===================================================================
199 --- linux-2.4.19-pre1.orig/include/asm-i386/current.h 1998-08-15 03:35:22.000000000 +0400
200 +++ linux-2.4.19-pre1/include/asm-i386/current.h 2003-12-01 18:14:32.000000000 +0300
202 #ifndef _I386_CURRENT_H
203 #define _I386_CURRENT_H
204 +#include <asm/page.h>
207 + * Configurable page sizes on i386, mainly for debugging purposes.
213 +#define PAGE_SIZE 4096 /* as cannot handle 1UL << 12 */
214 +#define THREAD_SIZE ((1 << CONFIG_STACK_SIZE_SHIFT) * PAGE_SIZE)
216 +#define GET_CURRENT(reg) \
217 + movl $-THREAD_SIZE, reg; \
220 +#else /* __ASSEMBLY__ */
222 +#define THREAD_SIZE ((1 << CONFIG_STACK_SIZE_SHIFT) * PAGE_SIZE)
223 +#define alloc_task_struct() \
224 + ((struct task_struct *) __get_free_pages(GFP_KERNEL,CONFIG_STACK_SIZE_SHIFT))
226 +#define free_task_struct(p) \
227 + free_pages((unsigned long) (p), CONFIG_STACK_SIZE_SHIFT)
229 +#define INIT_TASK_SIZE THREAD_SIZE
233 static inline struct task_struct * get_current(void)
235 struct task_struct *current;
236 - __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~8191UL));
237 + __asm__("andl %%esp,%0; ":"=r" (current) : "0" (~(THREAD_SIZE - 1)));
241 #define current get_current()
243 +#endif /* __ASSEMBLY__ */
245 #endif /* !(_I386_CURRENT_H) */
246 Index: linux-2.4.19-pre1/include/asm-i386/hw_irq.h
247 ===================================================================
248 --- linux-2.4.19-pre1.orig/include/asm-i386/hw_irq.h 2003-11-21 02:59:05.000000000 +0300
249 +++ linux-2.4.19-pre1/include/asm-i386/hw_irq.h 2003-12-01 18:14:32.000000000 +0300
251 #include <linux/config.h>
252 #include <asm/atomic.h>
254 +#include <asm/current.h>
257 * IDT vectors usable for external interrupt sources start
259 #define IRQ_NAME2(nr) nr##_interrupt(void)
260 #define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr)
262 -#define GET_CURRENT \
263 - "movl %esp, %ebx\n\t" \
264 - "andl $-8192, %ebx\n\t"
267 * SMP has a few special interrupts for IPI messages
269 Index: linux-2.4.19-pre1/include/asm-i386/processor.h
270 ===================================================================
271 --- linux-2.4.19-pre1.orig/include/asm-i386/processor.h 2003-11-21 02:59:05.000000000 +0300
272 +++ linux-2.4.19-pre1/include/asm-i386/processor.h 2003-12-01 18:14:32.000000000 +0300
274 #include <asm/types.h>
275 #include <asm/sigcontext.h>
276 #include <asm/cpufeature.h>
277 +#include <asm/current.h>
278 #include <linux/cache.h>
279 #include <linux/config.h>
280 #include <linux/threads.h>
282 #define KSTK_EIP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1019])
283 #define KSTK_ESP(tsk) (((unsigned long *)(4096+(unsigned long)(tsk)))[1022])
285 -#define THREAD_SIZE (2*PAGE_SIZE)
286 -#define alloc_task_struct() ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
287 -#define free_task_struct(p) free_pages((unsigned long) (p), 1)
288 #define get_task_struct(tsk) atomic_inc(&virt_to_page(tsk)->count)
290 #define init_task (init_task_union.task)
291 Index: linux-2.4.19-pre1/include/linux/sched.h
292 ===================================================================
293 --- linux-2.4.19-pre1.orig/include/linux/sched.h 2003-12-01 18:11:28.000000000 +0300
294 +++ linux-2.4.19-pre1/include/linux/sched.h 2003-12-01 18:14:32.000000000 +0300
296 #define _LINUX_SCHED_H
298 #include <asm/param.h> /* for HZ */
299 +#include <asm/current.h> /* maybe for INIT_TASK_SIZE */
301 extern unsigned long event;