]> git.pld-linux.org Git - packages/kernel.git/blame - 2.2.21-k7_p4_vm_scheduler-update.patch
- obsolete
[packages/kernel.git] / 2.2.21-k7_p4_vm_scheduler-update.patch
CommitLineData
fb9d2aaa
KT
1diff -urN linux.orig/Documentation/Configure.help linux/Documentation/Configure.help
2--- linux.orig/Documentation/Configure.help Tue May 21 01:32:34 2002
3+++ linux/Documentation/Configure.help Wed Aug 7 17:44:10 2002
4@@ -2099,6 +2099,11 @@
5 "PPro/6X86MX" Select this for the Cyrix/IBM/National Semiconductor
6 6x86MX/MII and Intel Pentium II/Pentium Pro.
7
8+ "K7" Select this for the AMD Athlon K7 CPUs with 64 bytes large L1
9+ cachelines.
10+ "P4" Select this for the Intel Pentium4 CPUs with 128 bytes large L1
11+ cachelines.
12+
13 If you don't know what to do, choose "386".
14
15 486
16diff -urN linux.orig/arch/alpha/kernel/time.c linux/arch/alpha/kernel/time.c
17--- linux.orig/arch/alpha/kernel/time.c Sun Mar 25 18:31:46 2001
18+++ linux/arch/alpha/kernel/time.c Wed Aug 7 17:53:48 2002
19@@ -339,6 +339,20 @@
20 irq_handler = timer_interrupt;
21 if (request_irq(TIMER_IRQ, irq_handler, 0, "timer", NULL))
22 panic("Could not allocate timer IRQ!");
23+ do_get_fast_time = do_gettimeofday;
24+}
25+
26+static inline void
27+timeval_normalize(struct timeval * tv)
28+{
29+ time_t __sec;
30+
31+ __sec = tv->tv_usec / 1000000;
32+ if (__sec)
33+ {
34+ tv->tv_usec %= 1000000;
35+ tv->tv_sec += __sec;
36+ }
37 }
38
39 /*
40@@ -389,13 +403,11 @@
41 #endif
42
43 usec += delta_usec;
44- if (usec >= 1000000) {
45- sec += 1;
46- usec -= 1000000;
47- }
48
49 tv->tv_sec = sec;
50 tv->tv_usec = usec;
51+
52+ timeval_normalize(tv);
53 }
54
55 void
56diff -urN linux.orig/arch/alpha/mm/fault.c linux/arch/alpha/mm/fault.c
57--- linux.orig/arch/alpha/mm/fault.c Sun Mar 25 18:37:29 2001
58+++ linux/arch/alpha/mm/fault.c Wed Aug 7 17:57:18 2002
59@@ -102,7 +102,7 @@
60 goto good_area;
61 if (!(vma->vm_flags & VM_GROWSDOWN))
62 goto bad_area;
63- if (expand_stack(vma, address))
64+ if (expand_stack(vma, address, NULL))
65 goto bad_area;
66 /*
67 * Ok, we have a good vm_area for this memory access, so
68diff -urN linux.orig/arch/i386/Makefile linux/arch/i386/Makefile
69--- linux.orig/arch/i386/Makefile Sun Mar 25 18:31:45 2001
70+++ linux/arch/i386/Makefile Wed Aug 7 17:44:10 2002
71@@ -43,6 +43,14 @@
72 CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686
73 endif
74
75+ifdef CONFIG_M686_L1_64
76+CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686
77+endif
78+
79+ifdef CONFIG_M686_L1_128
80+CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686
81+endif
82+
83 HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
84
85 SUBDIRS := $(SUBDIRS) arch/i386/kernel arch/i386/mm arch/i386/lib
86diff -urN linux.orig/arch/i386/config.in linux/arch/i386/config.in
87--- linux.orig/arch/i386/config.in Fri Nov 2 17:39:05 2001
88+++ linux/arch/i386/config.in Wed Aug 7 17:44:10 2002
89@@ -18,7 +18,9 @@
90 486/Cx486 CONFIG_M486 \
91 586/K5/5x86/6x86 CONFIG_M586 \
92 Pentium/K6/TSC/CyrixIII CONFIG_M586TSC \
93- PPro/6x86MX CONFIG_M686" PPro
94+ PPro/6x86MX CONFIG_M686 \
95+ K7 CONFIG_M686_L1_64 \
96+ P4 CONFIG_M686_L1_128" PPro
97 #
98 # Define implied options from the CPU selection here
99 #
100@@ -28,10 +30,10 @@
101 define_bool CONFIG_X86_BSWAP y
102 define_bool CONFIG_X86_POPAD_OK y
103 fi
104-if [ "$CONFIG_M686" = "y" -o "$CONFIG_M586TSC" = "y" ]; then
105+if [ "$CONFIG_M686" = "y" -o "$CONFIG_M586TSC" = "y" -o "$CONFIG_M686_L1_64" = "y" -o "$CONFIG_M686_L1_128" = "y" ]; then
106 define_bool CONFIG_X86_TSC y
107 fi
108-if [ "$CONFIG_M686" = "y" ]; then
109+if [ "$CONFIG_M686" = "y" -o "$CONFIG_M686_L1_64" = "y" -o "$CONFIG_M686_L1_128" = "y" ]; then
110 define_bool CONFIG_X86_GOOD_APIC y
111 fi
112
113diff -urN linux.orig/arch/i386/kernel/Makefile linux/arch/i386/kernel/Makefile
114--- linux.orig/arch/i386/kernel/Makefile Sun Mar 25 18:37:29 2001
115+++ linux/arch/i386/kernel/Makefile Wed Aug 7 17:44:42 2002
116@@ -15,7 +15,7 @@
117 O_TARGET := kernel.o
118 O_OBJS := process.o signal.o entry.o traps.o irq.o vm86.o \
119 ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \
120- bluesmoke.o
121+ bluesmoke.o i387.o
122 OX_OBJS := i386_ksyms.o dmi_scan.o
123 MX_OBJS :=
124
125diff -urN linux.orig/arch/i386/kernel/entry.S linux/arch/i386/kernel/entry.S
126--- linux.orig/arch/i386/kernel/entry.S Tue May 21 01:32:34 2002
127+++ linux/arch/i386/kernel/entry.S Wed Aug 7 17:44:43 2002
128@@ -288,6 +288,11 @@
129 pushl $ SYMBOL_NAME(do_coprocessor_error)
130 jmp error_code
131
132+ENTRY(simd_coprocessor_error)
133+ pushl $0
134+ pushl $ SYMBOL_NAME(do_simd_coprocessor_error)
135+ jmp error_code
136+
137 ENTRY(device_not_available)
138 pushl $-1 # mark this as an int
139 SAVE_ALL
140diff -urN linux.orig/arch/i386/kernel/head.S linux/arch/i386/kernel/head.S
141--- linux.orig/arch/i386/kernel/head.S Tue May 21 01:32:34 2002
142+++ linux/arch/i386/kernel/head.S Wed Aug 7 17:44:43 2002
143@@ -64,10 +64,13 @@
144 * NOTE! We have to correct for the fact that we're
145 * not yet offset PAGE_OFFSET..
146 */
147-#define cr4_bits mmu_cr4_features-__PAGE_OFFSET
148+#define cr4_bits x86_cr4-__PAGE_OFFSET
149 movl %cr4,%eax # Turn on 4Mb pages
150 orl cr4_bits,%eax
151 movl %eax,%cr4
152+ movl %cr3,%eax # Intel specification clarification says
153+ movl %eax,%cr3 # to do this. Maybe it makes a difference.
154+ # Who knows ?
155 #endif
156 /*
157 * Setup paging (the tables are already set up, just switch them on)
158@@ -222,21 +225,6 @@
159 orl $2,%eax # set MP
160 2: movl %eax,%cr0
161 call check_x87
162-#ifdef __SMP__
163- movb ready,%al # First CPU if 0
164- orb %al,%al
165- jz 4f # First CPU skip this stuff
166- movl %cr4,%eax # Turn on 4Mb pages
167- orl $16,%eax
168- movl %eax,%cr4
169- movl %cr3,%eax # Intel specification clarification says
170- movl %eax,%cr3 # to do this. Maybe it makes a difference.
171- # Who knows ?
172-#endif
173-4:
174-#ifdef __SMP__
175- incb ready
176-#endif
177 lgdt gdt_descr
178 lidt idt_descr
179 ljmp $(__KERNEL_CS),$1f
180@@ -259,10 +247,6 @@
181 jmp L6 # main should never return here, but
182 # just in case, we know what happens.
183
184-#ifdef __SMP__
185-ready: .byte 0
186-#endif
187-
188 /*
189 * We depend on ET to be correct. This checks for 287/387.
190 */
191diff -urN linux.orig/arch/i386/kernel/i386_ksyms.c linux/arch/i386/kernel/i386_ksyms.c
192--- linux.orig/arch/i386/kernel/i386_ksyms.c Sun Mar 25 18:31:45 2001
193+++ linux/arch/i386/kernel/i386_ksyms.c Wed Aug 7 17:44:43 2002
194@@ -11,6 +11,7 @@
195
196 #include <asm/semaphore.h>
197 #include <asm/processor.h>
198+#include <asm/i387.h>
199 #include <asm/uaccess.h>
200 #include <asm/checksum.h>
201 #include <asm/io.h>
202@@ -19,7 +20,6 @@
203 #include <asm/irq.h>
204
205 extern void dump_thread(struct pt_regs *, struct user *);
206-extern int dump_fpu(elf_fpregset_t *);
207 extern spinlock_t rtc_lock;
208
209 #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
210@@ -34,6 +34,7 @@
211 EXPORT_SYMBOL(__verify_write);
212 EXPORT_SYMBOL(dump_thread);
213 EXPORT_SYMBOL(dump_fpu);
214+EXPORT_SYMBOL(dump_extended_fpu);
215 EXPORT_SYMBOL(__ioremap);
216 EXPORT_SYMBOL(iounmap);
217 EXPORT_SYMBOL(local_bh_count);
218diff -urN linux.orig/arch/i386/kernel/i387.c linux/arch/i386/kernel/i387.c
219--- linux.orig/arch/i386/kernel/i387.c Thu Jan 1 01:00:00 1970
220+++ linux/arch/i386/kernel/i387.c Wed Aug 7 17:44:43 2002
221@@ -0,0 +1,512 @@
222+/*
223+ * linux/arch/i386/kernel/i387.c
224+ *
225+ * Copyright (C) 1994 Linus Torvalds
226+ *
227+ * Pentium III FXSR, SSE support
228+ * General FPU state handling cleanups
229+ * Gareth Hughes <gareth@valinux.com>, May 2000
230+ */
231+
232+#include <linux/config.h>
233+#include <linux/sched.h>
234+#include <asm/processor.h>
235+#include <asm/i387.h>
236+#include <asm/math_emu.h>
237+#include <asm/sigcontext.h>
238+#include <asm/user.h>
239+#include <asm/ptrace.h>
240+#include <asm/uaccess.h>
241+
242+#define HAVE_FXSR cpu_has_fxsr
243+#define HAVE_XMM cpu_has_xmm
244+
245+#ifdef CONFIG_MATH_EMULATION
246+#define HAVE_HWFP (boot_cpu_data.hard_math)
247+#else
248+#define HAVE_HWFP 1
249+#endif
250+
251+/*
252+ * The _current_ task is using the FPU for the first time
253+ * so initialize it and set the mxcsr to its default
254+ * value at reset if we support XMM instructions and then
255+ * remeber the current task has used the FPU.
256+ */
257+void init_fpu(void)
258+{
259+ __asm__("fninit");
260+ if ( HAVE_XMM )
261+ load_mxcsr(0x1f80);
262+
263+ current->used_math = 1;
264+}
265+
266+/*
267+ * FPU lazy state save handling.
268+ */
269+
270+void save_init_fpu( struct task_struct *tsk )
271+{
272+ if ( HAVE_FXSR ) {
273+ asm volatile( "fxsave %0 ; fnclex"
274+ : "=m" (tsk->tss.i387.fxsave) );
275+ } else {
276+ asm volatile( "fnsave %0 ; fwait"
277+ : "=m" (tsk->tss.i387.fsave) );
278+ }
279+ tsk->flags &= ~PF_USEDFPU;
280+ stts();
281+}
282+
283+void restore_fpu( struct task_struct *tsk )
284+{
285+ if ( HAVE_FXSR ) {
286+ asm volatile( "fxrstor %0"
287+ : : "m" (tsk->tss.i387.fxsave) );
288+ } else {
289+ asm volatile( "frstor %0"
290+ : : "m" (tsk->tss.i387.fsave) );
291+ }
292+}
293+
294+/*
295+ * FPU tag word conversions.
296+ */
297+
298+static inline unsigned short twd_i387_to_fxsr( unsigned short twd )
299+{
300+ unsigned int tmp; /* to avoid 16 bit prefixes in the code */
301+
302+ /* Transform each pair of bits into 01 (valid) or 00 (empty) */
303+ tmp = ~twd;
304+ tmp = (tmp | (tmp>>1)) & 0x5555; /* 0V0V0V0V0V0V0V0V */
305+ /* and move the valid bits to the lower byte. */
306+ tmp = (tmp | (tmp >> 1)) & 0x3333; /* 00VV00VV00VV00VV */
307+ tmp = (tmp | (tmp >> 2)) & 0x0f0f; /* 0000VVVV0000VVVV */
308+ tmp = (tmp | (tmp >> 4)) & 0x00ff; /* 00000000VVVVVVVV */
309+ return tmp;
310+}
311+
312+static inline unsigned long twd_fxsr_to_i387( struct i387_fxsave_struct *fxsave )
313+{
314+ struct _fpxreg *st = NULL;
315+ unsigned long twd = (unsigned long) fxsave->twd;
316+ unsigned long tag;
317+ unsigned long ret = 0xffff0000;
318+ int i;
319+
320+#define FPREG_ADDR(f, n) ((char *)&(f)->st_space + (n) * 16);
321+
322+ for ( i = 0 ; i < 8 ; i++ ) {
323+ if ( twd & 0x1 ) {
324+ st = (struct _fpxreg *) FPREG_ADDR( fxsave, i );
325+
326+ switch ( st->exponent & 0x7fff ) {
327+ case 0x7fff:
328+ tag = 2; /* Special */
329+ break;
330+ case 0x0000:
331+ if ( !st->significand[0] &&
332+ !st->significand[1] &&
333+ !st->significand[2] &&
334+ !st->significand[3] ) {
335+ tag = 1; /* Zero */
336+ } else {
337+ tag = 2; /* Special */
338+ }
339+ break;
340+ default:
341+ if ( st->significand[3] & 0x8000 ) {
342+ tag = 0; /* Valid */
343+ } else {
344+ tag = 2; /* Special */
345+ }
346+ break;
347+ }
348+ } else {
349+ tag = 3; /* Empty */
350+ }
351+ ret |= (tag << (2 * i));
352+ twd = twd >> 1;
353+ }
354+ return ret;
355+}
356+
357+/*
358+ * FPU state interaction.
359+ */
360+
361+unsigned short get_fpu_cwd( struct task_struct *tsk )
362+{
363+ if ( HAVE_FXSR ) {
364+ return tsk->tss.i387.fxsave.cwd;
365+ } else {
366+ return (unsigned short)tsk->tss.i387.fsave.cwd;
367+ }
368+}
369+
370+unsigned short get_fpu_swd( struct task_struct *tsk )
371+{
372+ if ( HAVE_FXSR ) {
373+ return tsk->tss.i387.fxsave.swd;
374+ } else {
375+ return (unsigned short)tsk->tss.i387.fsave.swd;
376+ }
377+}
378+
379+unsigned short get_fpu_twd( struct task_struct *tsk )
380+{
381+ if ( HAVE_FXSR ) {
382+ return tsk->tss.i387.fxsave.twd;
383+ } else {
384+ return (unsigned short)tsk->tss.i387.fsave.twd;
385+ }
386+}
387+
388+unsigned short get_fpu_mxcsr( struct task_struct *tsk )
389+{
390+ if ( HAVE_XMM ) {
391+ return tsk->tss.i387.fxsave.mxcsr;
392+ } else {
393+ return 0x1f80;
394+ }
395+}
396+
397+void set_fpu_cwd( struct task_struct *tsk, unsigned short cwd )
398+{
399+ if ( HAVE_FXSR ) {
400+ tsk->tss.i387.fxsave.cwd = cwd;
401+ } else {
402+ tsk->tss.i387.fsave.cwd = ((long)cwd | 0xffff0000);
403+ }
404+}
405+
406+void set_fpu_swd( struct task_struct *tsk, unsigned short swd )
407+{
408+ if ( HAVE_FXSR ) {
409+ tsk->tss.i387.fxsave.swd = swd;
410+ } else {
411+ tsk->tss.i387.fsave.swd = ((long)swd | 0xffff0000);
412+ }
413+}
414+
415+void set_fpu_twd( struct task_struct *tsk, unsigned short twd )
416+{
417+ if ( HAVE_FXSR ) {
418+ tsk->tss.i387.fxsave.twd = twd_i387_to_fxsr(twd);
419+ } else {
420+ tsk->tss.i387.fsave.twd = ((long)twd | 0xffff0000);
421+ }
422+}
423+
424+void set_fpu_mxcsr( struct task_struct *tsk, unsigned short mxcsr )
425+{
426+ if ( HAVE_XMM ) {
427+ tsk->tss.i387.fxsave.mxcsr = (mxcsr & 0xffbf);
428+ }
429+}
430+
431+/*
432+ * FXSR floating point environment conversions.
433+ */
434+
435+static inline int convert_fxsr_to_user( struct _fpstate *buf,
436+ struct i387_fxsave_struct *fxsave )
437+{
438+ unsigned long env[7];
439+ struct _fpreg *to;
440+ struct _fpxreg *from;
441+ int i;
442+
443+ env[0] = (unsigned long)fxsave->cwd | 0xffff0000;
444+ env[1] = (unsigned long)fxsave->swd | 0xffff0000;
445+ env[2] = twd_fxsr_to_i387(fxsave);
446+ env[3] = fxsave->fip;
447+ env[4] = fxsave->fcs | ((unsigned long)fxsave->fop << 16);
448+ env[5] = fxsave->foo;
449+ env[6] = fxsave->fos;
450+
451+ if ( __copy_to_user( buf, env, 7 * sizeof(unsigned long) ) )
452+ return 1;
453+
454+ to = &buf->_st[0];
455+ from = (struct _fpxreg *) &fxsave->st_space[0];
456+ for ( i = 0 ; i < 8 ; i++, to++, from++ ) {
457+ if ( __copy_to_user( to, from, sizeof(*to) ) )
458+ return 1;
459+ }
460+ return 0;
461+}
462+
463+static inline int convert_fxsr_from_user( struct i387_fxsave_struct *fxsave,
464+ struct _fpstate *buf )
465+{
466+ unsigned long env[7];
467+ struct _fpxreg *to;
468+ struct _fpreg *from;
469+ int i;
470+
471+ if ( __copy_from_user( env, buf, 7 * sizeof(long) ) )
472+ return 1;
473+
474+ fxsave->cwd = (unsigned short)(env[0] & 0xffff);
475+ fxsave->swd = (unsigned short)(env[1] & 0xffff);
476+ fxsave->twd = twd_i387_to_fxsr((unsigned short)(env[2] & 0xffff));
477+ fxsave->fip = env[3];
478+ fxsave->fop = (unsigned short)((env[4] & 0xffff0000) >> 16);
479+ fxsave->fcs = (env[4] & 0xffff);
480+ fxsave->foo = env[5];
481+ fxsave->fos = env[6];
482+
483+ to = (struct _fpxreg *) &fxsave->st_space[0];
484+ from = &buf->_st[0];
485+ for ( i = 0 ; i < 8 ; i++, to++, from++ ) {
486+ if ( __copy_from_user( to, from, sizeof(*from) ) )
487+ return 1;
488+ }
489+ return 0;
490+}
491+
492+/*
493+ * Signal frame handlers.
494+ */
495+
496+static inline int save_i387_fsave( struct _fpstate *buf )
497+{
498+ struct task_struct *tsk = current;
499+
500+ unlazy_fpu( tsk );
501+ tsk->tss.i387.fsave.status = tsk->tss.i387.fsave.swd;
502+ if ( __copy_to_user( buf, &tsk->tss.i387.fsave,
503+ sizeof(struct i387_fsave_struct) ) )
504+ return -1;
505+ return 1;
506+}
507+
508+static inline int save_i387_fxsave( struct _fpstate *buf )
509+{
510+ struct task_struct *tsk = current;
511+ int err = 0;
512+
513+ unlazy_fpu( tsk );
514+
515+ if ( convert_fxsr_to_user( buf, &tsk->tss.i387.fxsave ) )
516+ return -1;
517+
518+ err |= __put_user( tsk->tss.i387.fxsave.swd, &buf->status );
519+ err |= __put_user( X86_FXSR_MAGIC, &buf->magic );
520+ if ( err )
521+ return -1;
522+
523+ if ( __copy_to_user( &buf->_fxsr_env[0], &tsk->tss.i387.fxsave,
524+ sizeof(struct i387_fxsave_struct) ) )
525+ return -1;
526+ return 1;
527+}
528+
529+int save_i387( struct _fpstate *buf )
530+{
531+ if ( !current->used_math )
532+ return 0;
533+
534+ /* This will cause a "finit" to be triggered by the next
535+ * attempted FPU operation by the 'current' process.
536+ */
537+ current->used_math = 0;
538+
539+ if ( HAVE_HWFP ) {
540+ if ( HAVE_FXSR ) {
541+ return save_i387_fxsave( buf );
542+ } else {
543+ return save_i387_fsave( buf );
544+ }
545+ } else {
546+ return save_i387_soft( &current->tss.i387.soft, buf );
547+ }
548+}
549+
550+static inline int restore_i387_fsave( struct _fpstate *buf )
551+{
552+ struct task_struct *tsk = current;
553+ clear_fpu( tsk );
554+ return __copy_from_user( &tsk->tss.i387.fsave, buf,
555+ sizeof(struct i387_fsave_struct) );
556+}
557+
558+static inline int restore_i387_fxsave( struct _fpstate *buf )
559+{
560+ struct task_struct *tsk = current;
561+ clear_fpu( tsk );
562+ if ( __copy_from_user( &tsk->tss.i387.fxsave, &buf->_fxsr_env[0],
563+ sizeof(struct i387_fxsave_struct) ) )
564+ return 1;
565+ /* bit 6 and 31-16 must be zero for security reasons */
566+ tsk->tss.i387.fxsave.mxcsr &= 0xffbf;
567+ return convert_fxsr_from_user( &tsk->tss.i387.fxsave, buf );
568+}
569+
570+int restore_i387( struct _fpstate *buf )
571+{
572+ int err;
573+
574+ if ( HAVE_HWFP ) {
575+ if ( HAVE_FXSR ) {
576+ err = restore_i387_fxsave( buf );
577+ } else {
578+ err = restore_i387_fsave( buf );
579+ }
580+ } else {
581+ err = restore_i387_soft( &current->tss.i387.soft, buf );
582+ }
583+ current->used_math = 1;
584+ return err;
585+}
586+
587+/*
588+ * ptrace request handlers.
589+ */
590+
591+static inline int get_fpregs_fsave( struct user_i387_struct *buf,
592+ struct task_struct *tsk )
593+{
594+ return __copy_to_user( buf, &tsk->tss.i387.fsave,
595+ sizeof(struct user_i387_struct) );
596+}
597+
598+static inline int get_fpregs_fxsave( struct user_i387_struct *buf,
599+ struct task_struct *tsk )
600+{
601+ return convert_fxsr_to_user( (struct _fpstate *)buf,
602+ &tsk->tss.i387.fxsave );
603+}
604+
605+int get_fpregs( struct user_i387_struct *buf, struct task_struct *tsk )
606+{
607+ if ( HAVE_HWFP ) {
608+ if ( HAVE_FXSR ) {
609+ return get_fpregs_fxsave( buf, tsk );
610+ } else {
611+ return get_fpregs_fsave( buf, tsk );
612+ }
613+ } else {
614+ return save_i387_soft( &tsk->tss.i387.soft,
615+ (struct _fpstate *)buf );
616+ }
617+}
618+
619+static inline int set_fpregs_fsave( struct task_struct *tsk,
620+ struct user_i387_struct *buf )
621+{
622+ return __copy_from_user( &tsk->tss.i387.fsave, buf,
623+ sizeof(struct user_i387_struct) );
624+}
625+
626+static inline int set_fpregs_fxsave( struct task_struct *tsk,
627+ struct user_i387_struct *buf )
628+{
629+ return convert_fxsr_from_user( &tsk->tss.i387.fxsave,
630+ (struct _fpstate *)buf );
631+}
632+
633+int set_fpregs( struct task_struct *tsk, struct user_i387_struct *buf )
634+{
635+ if ( HAVE_HWFP ) {
636+ if ( HAVE_FXSR ) {
637+ return set_fpregs_fxsave( tsk, buf );
638+ } else {
639+ return set_fpregs_fsave( tsk, buf );
640+ }
641+ } else {
642+ return restore_i387_soft( &tsk->tss.i387.soft,
643+ (struct _fpstate *)buf );
644+ }
645+}
646+
647+int get_fpxregs( struct user_fxsr_struct *buf, struct task_struct *tsk )
648+{
649+ if ( HAVE_FXSR ) {
650+ if (__copy_to_user( (void *)buf, &tsk->tss.i387.fxsave,
651+ sizeof(struct user_fxsr_struct) ))
652+ return -EFAULT;
653+ return 0;
654+ } else {
655+ return -EIO;
656+ }
657+}
658+
659+int set_fpxregs( struct task_struct *tsk, struct user_fxsr_struct *buf )
660+{
661+ if ( HAVE_FXSR ) {
662+ int error;
663+
664+ error = __copy_from_user(&tsk->tss.i387.fxsave, (void *)buf,
665+ sizeof(struct user_fxsr_struct));
666+ /* bit 6 and 31-16 must be zero for security reasons */
667+ tsk->tss.i387.fxsave.mxcsr &= 0xffbf;
668+
669+ return error ? -EFAULT : 0;
670+ } else {
671+ return -EIO;
672+ }
673+}
674+
675+/*
676+ * FPU state for core dumps.
677+ */
678+
679+static inline void copy_fpu_fsave( struct task_struct *tsk,
680+ struct user_i387_struct *fpu )
681+{
682+ memcpy( fpu, &tsk->tss.i387.fsave,
683+ sizeof(struct user_i387_struct) );
684+}
685+
686+static inline void copy_fpu_fxsave( struct task_struct *tsk,
687+ struct user_i387_struct *fpu )
688+{
689+ unsigned short *to;
690+ unsigned short *from;
691+ int i;
692+
693+ memcpy( fpu, &tsk->tss.i387.fxsave, 7 * sizeof(long) );
694+
695+ to = (unsigned short *)&fpu->st_space[0];
696+ from = (unsigned short *)&tsk->tss.i387.fxsave.st_space[0];
697+ for ( i = 0 ; i < 8 ; i++, to += 5, from += 8 ) {
698+ memcpy( to, from, 5 * sizeof(unsigned short) );
699+ }
700+}
701+
702+int dump_fpu( struct pt_regs *regs, struct user_i387_struct *fpu )
703+{
704+ int fpvalid;
705+ struct task_struct *tsk = current;
706+
707+ fpvalid = tsk->used_math;
708+ if ( fpvalid ) {
709+ unlazy_fpu( tsk );
710+ if ( HAVE_FXSR ) {
711+ copy_fpu_fxsave( tsk, fpu );
712+ } else {
713+ copy_fpu_fsave( tsk, fpu );
714+ }
715+ }
716+
717+ return fpvalid;
718+}
719+
720+int dump_extended_fpu( struct pt_regs *regs, struct user_fxsr_struct *fpu )
721+{
722+ int fpvalid;
723+ struct task_struct *tsk = current;
724+
725+ fpvalid = tsk->used_math && HAVE_FXSR;
726+ if ( fpvalid ) {
727+ unlazy_fpu( tsk );
728+ memcpy( fpu, &tsk->tss.i387.fxsave,
729+ sizeof(struct user_fxsr_struct) );
730+ }
731+
732+ return fpvalid;
733+}
734diff -urN linux.orig/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
735--- linux.orig/arch/i386/kernel/irq.c Sun Mar 25 18:31:45 2001
736+++ linux/arch/i386/kernel/irq.c Wed Aug 7 17:44:43 2002
737@@ -381,10 +381,11 @@
738
739 static void math_error_irq(int cpl, void *dev_id, struct pt_regs *regs)
740 {
741+ extern void math_error(void *);
742 outb(0,0xF0);
743 if (ignore_irq13 || !boot_cpu_data.hard_math)
744 return;
745- math_error();
746+ math_error((void *)regs->eip);
747 }
748
749 static struct irqaction irq13 = { math_error_irq, 0, 0, "fpu", NULL, NULL };
750diff -urN linux.orig/arch/i386/kernel/irq.h linux/arch/i386/kernel/irq.h
751--- linux.orig/arch/i386/kernel/irq.h Fri Nov 2 17:39:05 2001
752+++ linux/arch/i386/kernel/irq.h Wed Aug 7 17:44:10 2002
753@@ -40,7 +40,9 @@
754 struct hw_interrupt_type *handler; /* handle/enable/disable functions */
755 struct irqaction *action; /* IRQ action list */
756 unsigned int depth; /* Disable depth for nested irq disables */
757- unsigned int unused[4];
758+#ifdef CONFIG_SMP
759+ unsigned char unused[L1_CACHE_BYTES-16];
760+#endif
761 } irq_desc_t;
762
763 /*
764diff -urN linux.orig/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
765--- linux.orig/arch/i386/kernel/process.c Fri Nov 2 17:39:05 2001
766+++ linux/arch/i386/kernel/process.c Wed Aug 7 17:56:44 2002
767@@ -2,6 +2,9 @@
768 * linux/arch/i386/kernel/process.c
769 *
770 * Copyright (C) 1995 Linus Torvalds
771+ *
772+ * Pentium III FXSR, SSE support
773+ * Gareth Hughes <gareth@valinux.com>, May 2000
774 */
775
776 /*
777@@ -40,6 +43,7 @@
778 #include <asm/ldt.h>
779 #include <asm/processor.h>
780 #include <asm/desc.h>
781+#include <asm/i387.h>
782 #ifdef CONFIG_MATH_EMULATION
783 #include <asm/math_emu.h>
784 #endif
785@@ -384,23 +388,15 @@
786
787 void show_regs(struct pt_regs * regs)
788 {
789+ extern void show_registers(struct pt_regs *);
790 long cr0 = 0L, cr2 = 0L, cr3 = 0L;
791
792 printk("\n");
793- printk("EIP: %04x:[<%08lx>]",0xffff & regs->xcs,regs->eip);
794- if (regs->xcs & 3)
795- printk(" ESP: %04x:%08lx",0xffff & regs->xss,regs->esp);
796- printk(" EFLAGS: %08lx\n",regs->eflags);
797- printk("EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
798- regs->eax,regs->ebx,regs->ecx,regs->edx);
799- printk("ESI: %08lx EDI: %08lx EBP: %08lx",
800- regs->esi, regs->edi, regs->ebp);
801- printk(" DS: %04x ES: %04x\n",
802- 0xffff & regs->xds,0xffff & regs->xes);
803 __asm__("movl %%cr0, %0": "=r" (cr0));
804 __asm__("movl %%cr2, %0": "=r" (cr2));
805 __asm__("movl %%cr3, %0": "=r" (cr3));
806 printk("CR0: %08lx CR2: %08lx CR3: %08lx\n", cr0, cr2, cr3);
807+ show_registers(regs);
808 }
809
810 /*
811@@ -615,23 +611,6 @@
812 }
813
814 /*
815- * fill in the FPU structure for a core dump.
816- */
817-int dump_fpu (struct pt_regs * regs, struct user_i387_struct* fpu)
818-{
819- int fpvalid;
820- struct task_struct *tsk = current;
821-
822- fpvalid = tsk->used_math;
823- if (fpvalid) {
824- unlazy_fpu(tsk);
825- memcpy(fpu,&tsk->tss.i387.hard,sizeof(*fpu));
826- }
827-
828- return fpvalid;
829-}
830-
831-/*
832 * fill in the user structure for a core dump..
833 */
834 void dump_thread(struct pt_regs * regs, struct user * dump)
835diff -urN linux.orig/arch/i386/kernel/ptrace.c linux/arch/i386/kernel/ptrace.c
836--- linux.orig/arch/i386/kernel/ptrace.c Fri Nov 2 17:39:05 2001
837+++ linux/arch/i386/kernel/ptrace.c Wed Aug 7 17:44:43 2002
838@@ -1,8 +1,11 @@
839 /* ptrace.c */
840 /* By Ross Biro 1/23/92 */
841 /* edited by Linus Torvalds */
842+/*
843+ * Pentium III FXSR, SSE support
844+ * Gareth Hughes <gareth@valinux.com>, May 2000
845+ */
846
847-#include <linux/config.h> /* for CONFIG_MATH_EMULATION */
848 #include <linux/kernel.h>
849 #include <linux/sched.h>
850 #include <linux/mm.h>
851@@ -18,6 +21,7 @@
852 #include <asm/system.h>
853 #include <asm/processor.h>
854 #include <asm/debugreg.h>
855+#include <asm/i387.h>
856
857 /*
858 * does not yet catch signals sent when the child dies.
859@@ -658,21 +662,11 @@
860 ret = 0;
861 if ( !child->used_math ) {
862 /* Simulate an empty FPU. */
863- child->tss.i387.hard.cwd = 0xffff037f;
864- child->tss.i387.hard.swd = 0xffff0000;
865- child->tss.i387.hard.twd = 0xffffffff;
866- }
867-#ifdef CONFIG_MATH_EMULATION
868- if ( boot_cpu_data.hard_math ) {
869-#endif
870- __copy_to_user((void *)data, &child->tss.i387.hard,
871- sizeof(struct user_i387_struct));
872-#ifdef CONFIG_MATH_EMULATION
873- } else {
874- save_i387_soft(&child->tss.i387.soft,
875- (struct _fpstate *)data);
876+ set_fpu_cwd(child, 0x037f);
877+ set_fpu_swd(child, 0x0000);
878+ set_fpu_twd(child, 0xffff);
879 }
880-#endif
881+ get_fpregs((struct user_i387_struct *)data, child);
882 goto out;
883 };
884
885@@ -684,21 +678,39 @@
886 goto out;
887 }
888 child->used_math = 1;
889-#ifdef CONFIG_MATH_EMULATION
890- if ( boot_cpu_data.hard_math ) {
891-#endif
892- __copy_from_user(&child->tss.i387.hard, (void *)data,
893- sizeof(struct user_i387_struct));
894-#ifdef CONFIG_MATH_EMULATION
895- } else {
896- restore_i387_soft(&child->tss.i387.soft,
897- (struct _fpstate *)data);
898- }
899-#endif
900+ set_fpregs(child, (struct user_i387_struct *)data);
901 ret = 0;
902 goto out;
903 };
904
905+ case PTRACE_GETFPXREGS: { /* Get the child extended FPU state. */
906+ if (!access_ok(VERIFY_WRITE, (unsigned *)data,
907+ sizeof(struct user_fxsr_struct))) {
908+ ret = -EIO;
909+ goto out;
910+ }
911+ if ( !child->used_math ) {
912+ /* Simulate an empty FPU. */
913+ set_fpu_cwd(child, 0x037f);
914+ set_fpu_swd(child, 0x0000);
915+ set_fpu_twd(child, 0xffff);
916+ set_fpu_mxcsr(child, 0x1f80);
917+ }
918+ ret = get_fpxregs((struct user_fxsr_struct *)data, child);
919+ goto out;
920+ };
921+
922+ case PTRACE_SETFPXREGS: { /* Set the child extended FPU state. */
923+ if (!access_ok(VERIFY_READ, (unsigned *)data,
924+ sizeof(struct user_fxsr_struct))) {
925+ ret = -EIO;
926+ goto out;
927+ }
928+ child->used_math = 1;
929+ ret = set_fpxregs(child, (struct user_fxsr_struct *)data);
930+ goto out;
931+ };
932+
933 default:
934 ret = -EIO;
935 goto out;
936diff -urN linux.orig/arch/i386/kernel/setup.c linux/arch/i386/kernel/setup.c
937--- linux.orig/arch/i386/kernel/setup.c Tue May 21 01:32:34 2002
938+++ linux/arch/i386/kernel/setup.c Wed Aug 7 17:44:43 2002
939@@ -86,6 +86,8 @@
940 char ignore_irq13 = 0; /* set if exception 16 works */
941 struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1, 1, 0, 0, -1 };
942
943+unsigned long x86_cr4;
944+
945 /*
946 * Bus types ..
947 */
948@@ -124,6 +126,7 @@
949 extern unsigned long cpu_khz;
950
951 static int disable_x86_serial_nr __initdata = 1;
952+static int disable_x86_fxsr __initdata = 0;
953
954 /*
955 * This is set up by the setup-routine at boot-time
956@@ -1308,7 +1311,8 @@
957
958 static void __init squash_the_stupid_serial_number(struct cpuinfo_x86 *c)
959 {
960- if (c->x86_capability&(X86_FEATURE_PN) && disable_x86_serial_nr) {
961+ if (c->x86_capability&(X86_FEATURE_PN) && (c->x86_vendor == X86_VENDOR_INTEL || c->x86_vendor == X86_VENDOR_TRANSMETA) &&
962+ disable_x86_serial_nr) {
963 /* Disable processor serial number */
964 unsigned long lo,hi;
965 rdmsr(0x119,lo,hi);
966@@ -1326,6 +1330,12 @@
967 }
968 __setup("serialnumber", x86_serial_nr_setup);
969
970+int __init x86_fxsr_setup(char * s)
971+{
972+ disable_x86_fxsr = 1;
973+ return 1;
974+}
975+__setup("nofxsr", x86_fxsr_setup);
976
977 __initfunc(void identify_cpu(struct cpuinfo_x86 *c))
978 {
979@@ -1377,6 +1387,13 @@
980 break;
981 }
982
983+ /* FXSR disabled? */
984+ if (disable_x86_fxsr) {
985+ printk(KERN_INFO "Disabling fast FPU save and restore.\n");
986+ clear_bit(X86_FEATURE_FXSR, &c->x86_capability);
987+ clear_bit(X86_FEATURE_XMM, &c->x86_capability);
988+ }
989+
990 squash_the_stupid_serial_number(c);
991
992 mcheck_init(c);
993diff -urN linux.orig/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c
994--- linux.orig/arch/i386/kernel/signal.c Fri Nov 2 17:39:05 2001
995+++ linux/arch/i386/kernel/signal.c Wed Aug 7 17:44:43 2002
996@@ -4,6 +4,7 @@
997 * Copyright (C) 1991, 1992 Linus Torvalds
998 *
999 * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson
1000+ * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes
1001 */
1002
1003 #include <linux/config.h>
1004@@ -21,6 +22,7 @@
1005 #include <linux/stddef.h>
1006 #include <asm/ucontext.h>
1007 #include <asm/uaccess.h>
1008+#include <asm/i387.h>
1009
1010 #define DEBUG_SIG 0
1011
1012@@ -150,29 +152,6 @@
1013 char retcode[8];
1014 };
1015
1016-
1017-static inline int restore_i387_hard(struct _fpstate *buf)
1018-{
1019- struct task_struct *tsk = current;
1020- clear_fpu(tsk);
1021- return __copy_from_user(&tsk->tss.i387.hard, buf, sizeof(*buf));
1022-}
1023-
1024-static inline int restore_i387(struct _fpstate *buf)
1025-{
1026- int err;
1027-#ifndef CONFIG_MATH_EMULATION
1028- err = restore_i387_hard(buf);
1029-#else
1030- if (boot_cpu_data.hard_math)
1031- err = restore_i387_hard(buf);
1032- else
1033- err = restore_i387_soft(&current->tss.i387.soft, buf);
1034-#endif
1035- current->used_math = 1;
1036- return err;
1037-}
1038-
1039 static int
1040 restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc, int *peax)
1041 {
1042@@ -299,39 +278,6 @@
1043 return 0;
1044 }
1045
1046-/*
1047- * Set up a signal frame.
1048- */
1049-
1050-static inline int save_i387_hard(struct _fpstate * buf)
1051-{
1052- struct task_struct *tsk = current;
1053-
1054- unlazy_fpu(tsk);
1055- tsk->tss.i387.hard.status = tsk->tss.i387.hard.swd;
1056- if (__copy_to_user(buf, &tsk->tss.i387.hard, sizeof(*buf)))
1057- return -1;
1058- return 1;
1059-}
1060-
1061-static int save_i387(struct _fpstate *buf)
1062-{
1063- if (!current->used_math)
1064- return 0;
1065-
1066- /* This will cause a "finit" to be triggered by the next
1067- attempted FPU operation by the 'current' process.
1068- */
1069- current->used_math = 0;
1070-
1071-#ifndef CONFIG_MATH_EMULATION
1072- return save_i387_hard(buf);
1073-#else
1074- return boot_cpu_data.hard_math ? save_i387_hard(buf)
1075- : save_i387_soft(&current->tss.i387.soft, buf);
1076-#endif
1077-}
1078-
1079 static int
1080 setup_sigcontext(struct sigcontext *sc, struct _fpstate *fpstate,
1081 struct pt_regs *regs, unsigned long mask)
1082diff -urN linux.orig/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
1083--- linux.orig/arch/i386/kernel/smp.c Sun Mar 25 18:37:29 2001
1084+++ linux/arch/i386/kernel/smp.c Wed Aug 7 17:58:31 2002
1085@@ -112,7 +112,7 @@
1086 static volatile unsigned long cpu_callout_map[NR_CPUS] = {0,}; /* We always use 0 the rest is ready for parallel delivery */
1087 volatile unsigned long smp_invalidate_needed; /* Used for the invalidate map that's also checked in the spinlock */
1088 volatile unsigned long kstack_ptr; /* Stack vector for booting CPUs */
1089-struct cpuinfo_x86 cpu_data[NR_CPUS]; /* Per CPU bogomips and other parameters */
1090+struct cpuinfo_x86 cpu_data[NR_CPUS] __cacheline_aligned = { { 0, }, }; /* Per CPU bogomips and other parameters */
1091 static unsigned int num_processors = 1; /* Internal processor count */
1092 unsigned char boot_cpu_id = 0; /* Processor that is doing the boot up */
1093 static int smp_activated = 0; /* Tripped once we need to start cross invalidating */
1094@@ -737,12 +737,6 @@
1095 {
1096 unsigned long value;
1097
1098- value = apic_read(APIC_SPIV);
1099- value |= (1<<8); /* Enable APIC (bit==1) */
1100- value &= ~(1<<9); /* Enable focus processor (bit==0) */
1101- value |= 0xff; /* Set spurious IRQ vector to 0xff */
1102- apic_write(APIC_SPIV,value);
1103-
1104 /*
1105 * Set Task Priority to 'accept all'
1106 */
1107@@ -762,6 +756,12 @@
1108 value |= SET_APIC_DFR(0xf);
1109 apic_write(APIC_DFR, value);
1110
1111+ value = apic_read(APIC_SPIV);
1112+ value |= (1<<8); /* Enable APIC (bit==1) */
1113+ value &= ~(1<<9); /* Enable focus processor (bit==0) */
1114+ value |= 0xff; /* Set spurious IRQ vector to 0xff */
1115+ apic_write(APIC_SPIV,value);
1116+
1117 udelay(100); /* B safe */
1118 }
1119
1120@@ -810,7 +810,6 @@
1121 return memory_start;
1122 }
1123
1124-#ifdef CONFIG_X86_TSC
1125 /*
1126 * TSC synchronization.
1127 *
1128@@ -1010,8 +1009,6 @@
1129 }
1130 #undef NR_LOOPS
1131
1132-#endif
1133-
1134 extern void calibrate_delay(void);
1135
1136 void __init smp_callin(void)
1137@@ -1098,12 +1095,11 @@
1138 */
1139 set_bit(cpuid, (unsigned long *)&cpu_callin_map[0]);
1140
1141-#ifdef CONFIG_X86_TSC
1142 /*
1143 * Synchronize the TSC with the BP
1144 */
1145- synchronize_tsc_ap ();
1146-#endif
1147+ if (boot_cpu_data.x86_capability & X86_FEATURE_TSC)
1148+ synchronize_tsc_ap ();
1149 }
1150
1151 int cpucount = 0;
1152@@ -1640,13 +1636,11 @@
1153
1154 smp_done:
1155
1156-#ifdef CONFIG_X86_TSC
1157 /*
1158 * Synchronize the TSC with the AP
1159 */
1160- if (cpucount)
1161+ if (boot_cpu_data.x86_capability & X86_FEATURE_TSC && cpucount)
1162 synchronize_tsc_bp();
1163-#endif
1164 }
1165
1166 /*
1167diff -urN linux.orig/arch/i386/kernel/time.c linux/arch/i386/kernel/time.c
1168--- linux.orig/arch/i386/kernel/time.c Sun Mar 25 18:37:30 2001
1169+++ linux/arch/i386/kernel/time.c Wed Aug 7 17:53:48 2002
1170@@ -247,6 +247,20 @@
1171
1172 #endif
1173
1174+/* FIXME: should be inline but gcc is buggy and breaks */
1175+static void
1176+timeval_normalize(struct timeval * tv)
1177+{
1178+ time_t __sec;
1179+
1180+ __sec = tv->tv_usec / 1000000;
1181+ if (__sec)
1182+ {
1183+ tv->tv_usec %= 1000000;
1184+ tv->tv_sec += __sec;
1185+ }
1186+}
1187+
1188 /*
1189 * This version of gettimeofday has microsecond resolution
1190 * and better than microsecond precision on fast x86 machines with TSC.
1191@@ -267,13 +281,10 @@
1192 usec += xtime.tv_usec;
1193 read_unlock_irqrestore(&xtime_lock, flags);
1194
1195- while (usec >= 1000000) {
1196- usec -= 1000000;
1197- sec++;
1198- }
1199-
1200 tv->tv_sec = sec;
1201 tv->tv_usec = usec;
1202+
1203+ timeval_normalize(tv);
1204 }
1205
1206 void do_settimeofday(struct timeval *tv)
1207diff -urN linux.orig/arch/i386/kernel/traps.c linux/arch/i386/kernel/traps.c
1208--- linux.orig/arch/i386/kernel/traps.c Tue May 21 01:32:34 2002
1209+++ linux/arch/i386/kernel/traps.c Wed Aug 7 17:56:44 2002
1210@@ -2,6 +2,9 @@
1211 * linux/arch/i386/traps.c
1212 *
1213 * Copyright (C) 1991, 1992 Linus Torvalds
1214+ *
1215+ * Pentium III FXSR, SSE support
1216+ * Gareth Hughes <gareth@valinux.com>, May 2000
1217 */
1218
1219 /*
1220@@ -33,6 +36,7 @@
1221 #include <asm/atomic.h>
1222 #include <asm/debugreg.h>
1223 #include <asm/desc.h>
1224+#include <asm/i387.h>
1225
1226 #include <asm/smp.h>
1227
1228@@ -106,6 +110,7 @@
1229 asmlinkage void general_protection(void);
1230 asmlinkage void page_fault(void);
1231 asmlinkage void coprocessor_error(void);
1232+asmlinkage void simd_coprocessor_error(void);
1233 asmlinkage void alignment_check(void);
1234 asmlinkage void spurious_interrupt_bug(void);
1235 asmlinkage void machine_check(void);
1236@@ -120,7 +125,7 @@
1237 #define VMALLOC_OFFSET (8*1024*1024)
1238 #define MODULE_RANGE (8*1024*1024)
1239
1240-static void show_registers(struct pt_regs *regs)
1241+void show_registers(struct pt_regs *regs)
1242 {
1243 int i;
1244 int in_kernel = 1;
1245@@ -428,25 +433,138 @@
1246 * the correct behaviour even in the presence of the asynchronous
1247 * IRQ13 behaviour
1248 */
1249-void math_error(void)
1250+void math_error(void *eip)
1251 {
1252 struct task_struct * task;
1253+ siginfo_t info;
1254+ unsigned short cwd, swd;
1255
1256 /*
1257 * Save the info for the exception handler
1258 * (this will also clear the error)
1259 */
1260 task = current;
1261- save_fpu(task);
1262+ save_init_fpu(task);
1263 task->tss.trap_no = 16;
1264 task->tss.error_code = 0;
1265- force_sig(SIGFPE, task);
1266+ info.si_signo = SIGFPE;
1267+ info.si_errno = 0;
1268+ info.si_code = __SI_FAULT;
1269+ info.si_addr = eip;
1270+ /*
1271+ * (~cwd & swd) will mask out exceptions that are not set to unmasked
1272+ * status. 0x3f is the exception bits in these regs, 0x200 is the
1273+ * C1 reg you need in case of a stack fault, 0x040 is the stack
1274+ * fault bit. We should only be taking one exception at a time,
1275+ * so if this combination doesn't produce any single exception,
1276+ * then we have a bad program that isn't syncronizing its FPU usage
1277+ * and it will suffer the consequences since we won't be able to
1278+ * fully reproduce the context of the exception
1279+ */
1280+ cwd = get_fpu_cwd(task);
1281+ swd = get_fpu_swd(task);
1282+ switch (((~cwd) & swd & 0x3f) | (swd & 0x240)) {
1283+ case 0x000:
1284+ default:
1285+ break;
1286+ case 0x001: /* Invalid Op */
1287+ case 0x040: /* Stack Fault */
1288+ case 0x240: /* Stack Fault | Direction */
1289+ info.si_code = FPE_FLTINV;
1290+ break;
1291+ case 0x002: /* Denormalize */
1292+ case 0x010: /* Underflow */
1293+ info.si_code = FPE_FLTUND;
1294+ break;
1295+ case 0x004: /* Zero Divide */
1296+ info.si_code = FPE_FLTDIV;
1297+ break;
1298+ case 0x008: /* Overflow */
1299+ info.si_code = FPE_FLTOVF;
1300+ break;
1301+ case 0x020: /* Precision */
1302+ info.si_code = FPE_FLTRES;
1303+ break;
1304+ }
1305+ force_sig_info(SIGFPE, &info, task);
1306 }
1307
1308 asmlinkage void do_coprocessor_error(struct pt_regs * regs, long error_code)
1309 {
1310 ignore_irq13 = 1;
1311- math_error();
1312+ math_error((void *)regs->eip);
1313+}
1314+
1315+void simd_math_error(void *eip)
1316+{
1317+ struct task_struct * task;
1318+ siginfo_t info;
1319+ unsigned short mxcsr;
1320+
1321+ /*
1322+ * Save the info for the exception handler and clear the error.
1323+ */
1324+ task = current;
1325+ save_init_fpu(task);
1326+ task->tss.trap_no = 19;
1327+ task->tss.error_code = 0;
1328+ info.si_signo = SIGFPE;
1329+ info.si_errno = 0;
1330+ info.si_code = __SI_FAULT;
1331+ info.si_addr = eip;
1332+ /*
1333+ * The SIMD FPU exceptions are handled a little differently, as there
1334+ * is only a single status/control register. Thus, to determine which
1335+ * unmasked exception was caught we must mask the exception mask bits
1336+ * at 0x1f80, and then use these to mask the exception bits at 0x3f.
1337+ */
1338+ mxcsr = get_fpu_mxcsr(task);
1339+ switch (~((mxcsr & 0x1f80) >> 7) & (mxcsr & 0x3f)) {
1340+ case 0x000:
1341+ default:
1342+ break;
1343+ case 0x001: /* Invalid Op */
1344+ info.si_code = FPE_FLTINV;
1345+ break;
1346+ case 0x002: /* Denormalize */
1347+ case 0x010: /* Underflow */
1348+ info.si_code = FPE_FLTUND;
1349+ break;
1350+ case 0x004: /* Zero Divide */
1351+ info.si_code = FPE_FLTDIV;
1352+ break;
1353+ case 0x008: /* Overflow */
1354+ info.si_code = FPE_FLTOVF;
1355+ break;
1356+ case 0x020: /* Precision */
1357+ info.si_code = FPE_FLTRES;
1358+ break;
1359+ }
1360+ force_sig_info(SIGFPE, &info, task);
1361+}
1362+
1363+asmlinkage void do_simd_coprocessor_error(struct pt_regs * regs,
1364+ long error_code)
1365+{
1366+ if (cpu_has_xmm) {
1367+ /* Handle SIMD FPU exceptions on PIII+ processors. */
1368+ ignore_irq13 = 1;
1369+ simd_math_error((void *)regs->eip);
1370+ } else {
1371+ /*
1372+ * Handle strange cache flush from user space exception
1373+ * in all other cases. This is undocumented behaviour.
1374+ */
1375+ if (regs->eflags & VM_MASK) {
1376+ handle_vm86_fault((struct kernel_vm86_regs *)regs,
1377+ error_code);
1378+ return;
1379+ }
1380+ die_if_kernel("cache flush denied", regs, error_code);
1381+ current->tss.trap_no = 19;
1382+ current->tss.error_code = error_code;
1383+ force_sig(SIGSEGV, current);
1384+ }
1385 }
1386
1387 asmlinkage void do_spurious_interrupt_bug(struct pt_regs * regs,
1388@@ -468,17 +586,13 @@
1389 asmlinkage void math_state_restore(struct pt_regs regs)
1390 {
1391 __asm__ __volatile__("clts"); /* Allow maths ops (or we recurse) */
1392- if(current->used_math)
1393- __asm__("frstor %0": :"m" (current->tss.i387));
1394- else
1395- {
1396- /*
1397- * Our first FPU usage, clean the chip.
1398- */
1399- __asm__("fninit");
1400- current->used_math = 1;
1401+
1402+ if (current->used_math) {
1403+ restore_fpu(current);
1404+ } else {
1405+ init_fpu();
1406 }
1407- current->flags|=PF_USEDFPU; /* So we fnsave on switch_to() */
1408+ current->flags |= PF_USEDFPU; /* So we fnsave on switch_to() */
1409 }
1410
1411 #ifndef CONFIG_MATH_EMULATION
1412@@ -708,6 +822,7 @@
1413 set_trap_gate(16,&coprocessor_error);
1414 set_trap_gate(17,&alignment_check);
1415 set_trap_gate(18,&machine_check);
1416+ set_trap_gate(19,&simd_coprocessor_error);
1417 set_system_gate(SYSCALL_VECTOR,&system_call);
1418
1419 /* set up GDT task & ldt entries */
1420diff -urN linux.orig/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
1421--- linux.orig/arch/i386/mm/fault.c Sun Mar 25 18:31:45 2001
1422+++ linux/arch/i386/mm/fault.c Wed Aug 7 17:57:18 2002
1423@@ -29,13 +29,13 @@
1424 */
1425 int __verify_write(const void * addr, unsigned long size)
1426 {
1427- struct vm_area_struct * vma;
1428+ struct vm_area_struct * vma, * prev_vma;
1429 unsigned long start = (unsigned long) addr;
1430
1431 if (!size)
1432 return 1;
1433
1434- vma = find_vma(current->mm, start);
1435+ vma = find_vma_prev(current->mm, start, &prev_vma);
1436 if (!vma)
1437 goto bad_area;
1438 if (vma->vm_start > start)
1439@@ -75,7 +75,7 @@
1440 check_stack:
1441 if (!(vma->vm_flags & VM_GROWSDOWN))
1442 goto bad_area;
1443- if (expand_stack(vma, start) == 0)
1444+ if (expand_stack(vma, start, prev_vma) == 0)
1445 goto good_area;
1446
1447 bad_area:
1448@@ -112,7 +112,7 @@
1449 {
1450 struct task_struct *tsk;
1451 struct mm_struct *mm;
1452- struct vm_area_struct * vma;
1453+ struct vm_area_struct * vma, * prev_vma;
1454 unsigned long address;
1455 unsigned long page;
1456 unsigned long fixup;
1457@@ -133,7 +133,7 @@
1458
1459 down(&mm->mmap_sem);
1460
1461- vma = find_vma(mm, address);
1462+ vma = find_vma_prev(mm, address, &prev_vma);
1463 if (!vma)
1464 goto bad_area;
1465 if (vma->vm_start <= address)
1466@@ -150,7 +150,7 @@
1467 if (address + 32 < regs->esp)
1468 goto bad_area;
1469 }
1470- if (expand_stack(vma, address))
1471+ if (expand_stack(vma, address, prev_vma))
1472 goto bad_area;
1473 /*
1474 * Ok, we have a good vm_area for this memory access, so
1475diff -urN linux.orig/arch/i386/vmlinux.lds.S linux/arch/i386/vmlinux.lds.S
1476--- linux.orig/arch/i386/vmlinux.lds.S Sun Mar 25 18:31:45 2001
1477+++ linux/arch/i386/vmlinux.lds.S Wed Aug 7 17:44:10 2002
1478@@ -1,6 +1,7 @@
1479 /* ld script to make i386 Linux kernel
1480 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
1481 */
1482+#include <asm/cache.h>
1483 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
1484 OUTPUT_ARCH(i386)
1485 ENTRY(_start)
1486@@ -53,7 +54,7 @@
1487 __init_end = .;
1488
1489
1490- . = ALIGN(32);
1491+ . = ALIGN(L1_CACHE_BYTES);
1492 .data.cacheline_aligned : { *(.data.cacheline_aligned) }
1493
1494 . = ALIGN(4096);
1495diff -urN linux.orig/arch/ppc/kernel/time.c linux/arch/ppc/kernel/time.c
1496--- linux.orig/arch/ppc/kernel/time.c Sun Mar 25 18:31:49 2001
1497+++ linux/arch/ppc/kernel/time.c Wed Aug 7 17:53:48 2002
1498@@ -147,6 +147,19 @@
1499 hardirq_exit(cpu);
1500 }
1501
1502+static inline void
1503+timeval_normalize(struct timeval * tv)
1504+{
1505+ time_t __sec;
1506+
1507+ __sec = tv->tv_usec / 1000000;
1508+ if (__sec)
1509+ {
1510+ tv->tv_usec %= 1000000;
1511+ tv->tv_sec += __sec;
1512+ }
1513+}
1514+
1515 /*
1516 * This version of gettimeofday has microsecond resolution.
1517 */
1518@@ -161,10 +174,7 @@
1519 #ifndef __SMP__
1520 tv->tv_usec += (decrementer_count - get_dec())
1521 * count_period_num / count_period_den;
1522- if (tv->tv_usec >= 1000000) {
1523- tv->tv_usec -= 1000000;
1524- tv->tv_sec++;
1525- }
1526+ timeval_normalize(tv);
1527 #endif
1528 restore_flags(flags);
1529 }
1530diff -urN linux.orig/arch/ppc/mm/fault.c linux/arch/ppc/mm/fault.c
1531--- linux.orig/arch/ppc/mm/fault.c Sun Mar 25 18:31:48 2001
1532+++ linux/arch/ppc/mm/fault.c Wed Aug 7 17:57:18 2002
1533@@ -58,7 +58,7 @@
1534 void do_page_fault(struct pt_regs *regs, unsigned long address,
1535 unsigned long error_code)
1536 {
1537- struct vm_area_struct * vma;
1538+ struct vm_area_struct * vma, * prev_vma;
1539 struct mm_struct *mm = current->mm;
1540 int fault;
1541
1542@@ -92,14 +92,14 @@
1543 }
1544
1545 down(&mm->mmap_sem);
1546- vma = find_vma(mm, address);
1547+ vma = find_vma_prev(mm, address, &prev_vma);
1548 if (!vma)
1549 goto bad_area;
1550 if (vma->vm_start <= address)
1551 goto good_area;
1552 if (!(vma->vm_flags & VM_GROWSDOWN))
1553 goto bad_area;
1554- if (expand_stack(vma, address))
1555+ if (expand_stack(vma, address, prev_vma))
1556 goto bad_area;
1557
1558 good_area:
1559diff -urN linux.orig/arch/s390/mm/fault.c linux/arch/s390/mm/fault.c
1560--- linux.orig/arch/s390/mm/fault.c Fri Nov 2 17:39:06 2001
1561+++ linux/arch/s390/mm/fault.c Wed Aug 7 17:57:18 2002
1562@@ -125,7 +125,7 @@
1563 goto good_area;
1564 if (!(vma->vm_flags & VM_GROWSDOWN))
1565 goto bad_area;
1566- if (expand_stack(vma, address))
1567+ if (expand_stack(vma, address, NULL))
1568 goto bad_area;
1569 /*
1570 * Ok, we have a good vm_area for this memory access, so
1571diff -urN linux.orig/arch/sparc/mm/fault.c linux/arch/sparc/mm/fault.c
1572--- linux.orig/arch/sparc/mm/fault.c Sun Mar 25 18:31:47 2001
1573+++ linux/arch/sparc/mm/fault.c Wed Aug 7 17:57:18 2002
1574@@ -222,7 +222,7 @@
1575 goto good_area;
1576 if(!(vma->vm_flags & VM_GROWSDOWN))
1577 goto bad_area;
1578- if(expand_stack(vma, address))
1579+ if(expand_stack(vma, address, NULL))
1580 goto bad_area;
1581 /*
1582 * Ok, we have a good vm_area for this memory access, so
1583@@ -414,7 +414,7 @@
1584 goto good_area;
1585 if(!(vma->vm_flags & VM_GROWSDOWN))
1586 goto bad_area;
1587- if(expand_stack(vma, address))
1588+ if(expand_stack(vma, address, NULL))
1589 goto bad_area;
1590 good_area:
1591 if(write) {
1592diff -urN linux.orig/arch/sparc64/mm/fault.c linux/arch/sparc64/mm/fault.c
1593--- linux.orig/arch/sparc64/mm/fault.c Sun Mar 25 18:31:53 2001
1594+++ linux/arch/sparc64/mm/fault.c Wed Aug 7 17:57:18 2002
1595@@ -194,7 +194,7 @@
1596 goto good_area;
1597 if(!(vma->vm_flags & VM_GROWSDOWN))
1598 goto bad_area;
1599- if(expand_stack(vma, address))
1600+ if(expand_stack(vma, address, NULL))
1601 goto bad_area;
1602 /*
1603 * Ok, we have a good vm_area for this memory access, so
1604diff -urN linux.orig/arch/sparc64/solaris/timod.c linux/arch/sparc64/solaris/timod.c
1605--- linux.orig/arch/sparc64/solaris/timod.c Sun Mar 25 18:31:53 2001
1606+++ linux/arch/sparc64/solaris/timod.c Wed Aug 7 17:45:22 2002
1607@@ -154,7 +154,7 @@
1608 sock = &current->files->fd[fd]->f_dentry->d_inode->u.socket_i;
1609 wake_up_interruptible(&sock->wait);
1610 if (sock->fasync_list && !(sock->flags & SO_WAITDATA))
1611- kill_fasync(sock->fasync_list, SIGIO);
1612+ kill_fasync(sock->fasync_list, SIGIO, POLL_IN);
1613 SOLD("done");
1614 }
1615
1616diff -urN linux.orig/drivers/block/ide-probe.c linux/drivers/block/ide-probe.c
1617--- linux.orig/drivers/block/ide-probe.c Sun Mar 25 18:31:24 2001
1618+++ linux/drivers/block/ide-probe.c Wed Aug 7 17:50:35 2002
1619@@ -393,6 +393,7 @@
1620 extern struct drive_info_struct drive_info;
1621 byte cmos_disks, *BIOS = (byte *) &drive_info;
1622 int unit;
1623+ extern spinlock_t rtc_lock;
1624
1625 #ifdef CONFIG_BLK_DEV_PDC4030
1626 if (hwif->chipset == ide_pdc4030 && hwif->channel != 0)
1627diff -urN linux.orig/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
1628--- linux.orig/drivers/block/ll_rw_blk.c Tue May 21 01:32:34 2002
1629+++ linux/drivers/block/ll_rw_blk.c Wed Aug 7 17:52:39 2002
1630@@ -419,7 +419,8 @@
1631 case COMPAQ_CISS_MAJOR+4: \
1632 case COMPAQ_CISS_MAJOR+5: \
1633 case COMPAQ_CISS_MAJOR+6: \
1634- case COMPAQ_CISS_MAJOR+7:
1635+ case COMPAQ_CISS_MAJOR+7: \
1636+ case LOOP_MAJOR:
1637
1638 #define elevator_starve_rest_of_queue(req) \
1639 do { \
1640@@ -574,10 +575,9 @@
1641 void make_request(int major, int rw, struct buffer_head * bh)
1642 {
1643 unsigned int sector, count;
1644- struct request * req, * prev;
1645+ struct request * req, * prev, * freereq = NULL;
1646 int rw_ahead, max_req, max_sectors, max_segments;
1647 unsigned long flags;
1648- int back, front;
1649
1650 count = bh->b_size >> 9;
1651 sector = bh->b_rsector;
1652@@ -654,6 +654,7 @@
1653 max_sectors = get_max_sectors(bh->b_rdev);
1654 max_segments = get_max_segments(bh->b_rdev);
1655
1656+ again:
1657 /*
1658 * Now we acquire the request spinlock, we have to be mega careful
1659 * not to schedule or do something nonatomic
1660@@ -684,29 +685,23 @@
1661
1662 req = seek_to_not_starving_chunk(req);
1663 prev = NULL;
1664- back = front = 0;
1665 do {
1666 if (req->cmd != rw)
1667 continue;
1668 if (req->rq_dev != bh->b_rdev)
1669 continue;
1670- if (req->sector + req->nr_sectors == sector)
1671- back = 1;
1672- else if (req->sector - count == sector)
1673- front = 1;
1674-
1675 if (req->nr_sectors + count > max_sectors)
1676 continue;
1677 if (req->sem)
1678 continue;
1679
1680 /* Can we add it to the end of this request? */
1681- if (back) {
1682+ if (req->sector + req->nr_sectors == sector) {
1683 if (req->bhtail->b_data + req->bhtail->b_size
1684 != bh->b_data) {
1685 if (req->nr_segments < max_segments)
1686 req->nr_segments++;
1687- else break;
1688+ else continue;
1689 }
1690 req->bhtail->b_reqnext = bh;
1691 req->bhtail = bh;
1692@@ -717,19 +712,19 @@
1693 /* Can we now merge this req with the next? */
1694 attempt_merge(req, max_sectors, max_segments);
1695 /* or to the beginning? */
1696- } else if (front) {
1697+ } else if (req->sector - count == sector) {
1698 /*
1699 * Check that we didn't seek on a starving request,
1700 * that could happen only at the first pass, thus
1701 * do that only if prev is NULL.
1702 */
1703 if (!prev && ((req->cmd != READ && req->cmd != WRITE) || !req->elevator_latency))
1704- break;
1705+ continue;
1706 if (bh->b_data + bh->b_size
1707 != req->bh->b_data) {
1708 if (req->nr_segments < max_segments)
1709 req->nr_segments++;
1710- else break;
1711+ else continue;
1712 }
1713 bh->b_reqnext = req->bh;
1714 req->bh = bh;
1715@@ -749,15 +744,22 @@
1716 continue;
1717
1718 mark_buffer_clean(bh);
1719+ if (freereq) {
1720+ freereq->rq_status = RQ_INACTIVE;
1721+ wake_up(&wait_for_request);
1722+ }
1723 spin_unlock_irqrestore(&io_request_lock,flags);
1724 return;
1725
1726- } while (prev = req,
1727- !front && !back && (req = req->next) != NULL);
1728+ } while (prev = req, (req = req->next) != NULL);
1729 }
1730
1731 /* find an unused request. */
1732- req = get_request(max_req, bh->b_rdev);
1733+ if (freereq) {
1734+ req = freereq;
1735+ freereq = NULL;
1736+ } else
1737+ req = get_request(max_req, bh->b_rdev);
1738
1739 spin_unlock_irqrestore(&io_request_lock,flags);
1740
1741@@ -765,7 +767,8 @@
1742 if (!req) {
1743 if (rw_ahead)
1744 goto end_io;
1745- req = __get_request_wait(max_req, bh->b_rdev);
1746+ freereq = __get_request_wait(max_req, bh->b_rdev);
1747+ goto again;
1748 }
1749
1750 /* fill up the request-info, and add it to the queue */
1751diff -urN linux.orig/drivers/block/loop.c linux/drivers/block/loop.c
1752--- linux.orig/drivers/block/loop.c Sun Mar 25 18:31:24 2001
1753+++ linux/drivers/block/loop.c Wed Aug 7 17:52:39 2002
1754@@ -274,6 +274,8 @@
1755 block++;
1756 }
1757 spin_lock_irq(&io_request_lock);
1758+ current_request->sector += current_request->current_nr_sectors;
1759+ current_request->nr_sectors -= current_request->current_nr_sectors;
1760 current_request->next=CURRENT;
1761 CURRENT=current_request;
1762 end_request(1);
1763diff -urN linux.orig/drivers/char/adbmouse.c linux/drivers/char/adbmouse.c
1764--- linux.orig/drivers/char/adbmouse.c Sun Mar 25 18:31:26 2001
1765+++ linux/drivers/char/adbmouse.c Wed Aug 7 17:45:22 2002
1766@@ -135,7 +135,7 @@
1767 mouse.ready = 1;
1768 wake_up_interruptible(&mouse.wait);
1769 if (mouse.fasyncptr)
1770- kill_fasync(mouse.fasyncptr, SIGIO);
1771+ kill_fasync(mouse.fasyncptr, SIGIO, POLL_IN);
1772 }
1773
1774 static int fasync_mouse(int fd, struct file *filp, int on)
1775diff -urN linux.orig/drivers/char/amigamouse.c linux/drivers/char/amigamouse.c
1776--- linux.orig/drivers/char/amigamouse.c Sun Mar 25 18:31:26 2001
1777+++ linux/drivers/char/amigamouse.c Wed Aug 7 17:45:22 2002
1778@@ -154,7 +154,7 @@
1779 mouse.dy = 2048;
1780
1781 if (mouse.fasyncptr)
1782- kill_fasync(mouse.fasyncptr, SIGIO);
1783+ kill_fasync(mouse.fasyncptr, SIGIO, POLL_IN);
1784 }
1785 AMI_MSE_INT_ON();
1786 }
1787diff -urN linux.orig/drivers/char/atarimouse.c linux/drivers/char/atarimouse.c
1788--- linux.orig/drivers/char/atarimouse.c Sun Mar 25 18:31:26 2001
1789+++ linux/drivers/char/atarimouse.c Wed Aug 7 17:45:22 2002
1790@@ -49,7 +49,7 @@
1791 mouse.ready = 1;
1792 wake_up_interruptible(&mouse.wait);
1793 if (mouse.fasyncptr)
1794- kill_fasync(mouse.fasyncptr, SIGIO);
1795+ kill_fasync(mouse.fasyncptr, SIGIO, POLL_IN);
1796
1797 /* ikbd_mouse_rel_pos(); */
1798 }
1799diff -urN linux.orig/drivers/char/atixlmouse.c linux/drivers/char/atixlmouse.c
1800--- linux.orig/drivers/char/atixlmouse.c Sun Mar 25 18:31:24 2001
1801+++ linux/drivers/char/atixlmouse.c Wed Aug 7 17:45:22 2002
1802@@ -90,7 +90,7 @@
1803 mouse.ready = 1;
1804 wake_up_interruptible(&mouse.wait);
1805 if (mouse.fasync)
1806- kill_fasync(mouse.fasync, SIGIO);
1807+ kill_fasync(mouse.fasync, SIGIO, POLL_IN);
1808 }
1809 ATIXL_MSE_ENABLE_UPDATE();
1810 }
1811diff -urN linux.orig/drivers/char/busmouse.c linux/drivers/char/busmouse.c
1812--- linux.orig/drivers/char/busmouse.c Sun Mar 25 18:31:24 2001
1813+++ linux/drivers/char/busmouse.c Wed Aug 7 17:45:22 2002
1814@@ -105,7 +105,7 @@
1815 mouse.dy = 2048;
1816
1817 if (mouse.fasyncptr)
1818- kill_fasync(mouse.fasyncptr, SIGIO);
1819+ kill_fasync(mouse.fasyncptr, SIGIO, POLL_IN);
1820 }
1821 MSE_INT_ON();
1822 }
1823diff -urN linux.orig/drivers/char/dn_keyb.c linux/drivers/char/dn_keyb.c
1824--- linux.orig/drivers/char/dn_keyb.c Sun Mar 25 18:31:26 2001
1825+++ linux/drivers/char/dn_keyb.c Wed Aug 7 17:45:22 2002
1826@@ -468,7 +468,7 @@
1827 if (mouse_dy > 2048)
1828 mouse_dy = 2048;
1829 if (mouse_fasyncptr)
1830- kill_fasync(mouse_fasyncptr, SIGIO);
1831+ kill_fasync(mouse_fasyncptr, SIGIO, POLL_IN);
1832 }
1833 mouse_byte_count=0;
1834 /* printk("mouse: %d, %d, %x\n",mouse_x,mouse_y,buttons); */
1835diff -urN linux.orig/drivers/char/drm/fops.c linux/drivers/char/drm/fops.c
1836--- linux.orig/drivers/char/drm/fops.c Fri Nov 2 17:39:06 2001
1837+++ linux/drivers/char/drm/fops.c Wed Aug 7 17:45:22 2002
1838@@ -219,7 +219,7 @@
1839 }
1840
1841 #if LINUX_VERSION_CODE < 0x020400
1842- if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO);
1843+ if (dev->buf_async) kill_fasync(dev->buf_async, SIGIO, POLL_IN);
1844 #else
1845 /* Type of first parameter changed in
1846 Linux 2.4.0-test2... */
1847diff -urN linux.orig/drivers/char/msbusmouse.c linux/drivers/char/msbusmouse.c
1848--- linux.orig/drivers/char/msbusmouse.c Sun Mar 25 18:31:24 2001
1849+++ linux/drivers/char/msbusmouse.c Wed Aug 7 17:45:22 2002
1850@@ -89,7 +89,7 @@
1851 mouse.ready = 1;
1852 wake_up_interruptible(&mouse.wait);
1853 if (mouse.fasyncptr)
1854- kill_fasync(mouse.fasyncptr, SIGIO);
1855+ kill_fasync(mouse.fasyncptr, SIGIO, POLL_IN);
1856 }
1857 }
1858
1859diff -urN linux.orig/drivers/char/n_hdlc.c linux/drivers/char/n_hdlc.c
1860--- linux.orig/drivers/char/n_hdlc.c Fri Nov 2 17:39:06 2001
1861+++ linux/drivers/char/n_hdlc.c Wed Aug 7 17:45:22 2002
1862@@ -584,11 +584,7 @@
1863 wake_up_interruptible (&n_hdlc->read_wait);
1864 wake_up_interruptible (&n_hdlc->poll_wait);
1865 if (n_hdlc->tty->fasync != NULL)
1866-#if LINUX_VERSION_CODE >= VERSION(2,2,14) && defined(__rh_config_h__)
1867 kill_fasync (n_hdlc->tty->fasync, SIGIO, POLL_IN);
1868-#else
1869- kill_fasync (n_hdlc->tty->fasync, SIGIO);
1870-#endif
1871 } /* end of n_hdlc_tty_receive() */
1872
1873 /* n_hdlc_tty_read()
1874diff -urN linux.orig/drivers/char/n_tty.c linux/drivers/char/n_tty.c
1875--- linux.orig/drivers/char/n_tty.c Sun Mar 25 18:31:25 2001
1876+++ linux/drivers/char/n_tty.c Wed Aug 7 17:45:23 2002
1877@@ -635,7 +635,7 @@
1878 tty->canon_head = tty->read_head;
1879 tty->canon_data++;
1880 if (tty->fasync)
1881- kill_fasync(tty->fasync, SIGIO);
1882+ kill_fasync(tty->fasync, SIGIO, POLL_IN);
1883 if (tty->read_wait || tty->poll_wait)
1884 {
1885 wake_up_interruptible(&tty->read_wait);
1886@@ -743,7 +743,7 @@
1887
1888 if (!tty->icanon && (tty->read_cnt >= tty->minimum_to_wake)) {
1889 if (tty->fasync)
1890- kill_fasync(tty->fasync, SIGIO);
1891+ kill_fasync(tty->fasync, SIGIO, POLL_IN);
1892 if (tty->read_wait||tty->poll_wait)
1893 {
1894 wake_up_interruptible(&tty->read_wait);
1895diff -urN linux.orig/drivers/char/pc110pad.c linux/drivers/char/pc110pad.c
1896--- linux.orig/drivers/char/pc110pad.c Fri Nov 2 17:39:06 2001
1897+++ linux/drivers/char/pc110pad.c Wed Aug 7 17:45:23 2002
1898@@ -75,7 +75,7 @@
1899 {
1900 wake_up_interruptible(&queue);
1901 if(asyncptr)
1902- kill_fasync(asyncptr, SIGIO);
1903+ kill_fasync(asyncptr, SIGIO, POLL_IN);
1904 }
1905
1906
1907diff -urN linux.orig/drivers/char/pc_keyb.c linux/drivers/char/pc_keyb.c
1908--- linux.orig/drivers/char/pc_keyb.c Sun Mar 25 18:31:26 2001
1909+++ linux/drivers/char/pc_keyb.c Wed Aug 7 17:45:23 2002
1910@@ -424,7 +424,7 @@
1911 if (head != queue->tail) {
1912 queue->head = head;
1913 if (queue->fasync)
1914- kill_fasync(queue->fasync, SIGIO);
1915+ kill_fasync(queue->fasync, SIGIO, POLL_IN);
1916 wake_up_interruptible(&queue->proc_list);
1917 }
1918 }
1919diff -urN linux.orig/drivers/char/qpmouse.c linux/drivers/char/qpmouse.c
1920--- linux.orig/drivers/char/qpmouse.c Sun Mar 25 18:31:26 2001
1921+++ linux/drivers/char/qpmouse.c Wed Aug 7 17:45:23 2002
1922@@ -134,7 +134,7 @@
1923 }
1924 queue->head = head;
1925 if (queue->fasync)
1926- kill_fasync(queue->fasync, SIGIO);
1927+ kill_fasync(queue->fasync, SIGIO, POLL_IN);
1928 wake_up_interruptible(&queue->proc_list);
1929 }
1930
1931diff -urN linux.orig/drivers/i2o/i2o_config.c linux/drivers/i2o/i2o_config.c
1932--- linux.orig/drivers/i2o/i2o_config.c Sun Mar 25 18:31:44 2001
1933+++ linux/drivers/i2o/i2o_config.c Wed Aug 7 17:45:23 2002
1934@@ -164,7 +164,7 @@
1935 // inf->fp, inf->q_id, inf->q_len);
1936
1937 if(inf->fasync)
1938- kill_fasync(inf->fasync, SIGIO);
1939+ kill_fasync(inf->fasync, SIGIO, POLL_IN);
1940 }
1941
1942 return;
1943diff -urN linux.orig/drivers/net/ppp.c linux/drivers/net/ppp.c
1944--- linux.orig/drivers/net/ppp.c Sun Mar 25 18:31:15 2001
1945+++ linux/drivers/net/ppp.c Wed Aug 7 17:45:23 2002
1946@@ -2382,7 +2382,7 @@
1947
1948 wake_up_interruptible (&ppp->read_wait);
1949 if (ppp->tty->fasync != NULL)
1950- kill_fasync (ppp->tty->fasync, SIGIO);
1951+ kill_fasync (ppp->tty->fasync, SIGIO, POLL_IN);
1952
1953 return 1;
1954 }
1955diff -urN linux.orig/drivers/sbus/char/pcikbd.c linux/drivers/sbus/char/pcikbd.c
1956--- linux.orig/drivers/sbus/char/pcikbd.c Fri Nov 2 17:39:07 2001
1957+++ linux/drivers/sbus/char/pcikbd.c Wed Aug 7 17:45:23 2002
1958@@ -874,7 +874,7 @@
1959 queue->head = head;
1960 aux_ready = 1;
1961 if (queue->fasync)
1962- kill_fasync(queue->fasync, SIGIO);
1963+ kill_fasync(queue->fasync, SIGIO, POLL_IN);
1964 wake_up_interruptible(&queue->proc_list);
1965 }
1966
1967diff -urN linux.orig/drivers/sbus/char/sunkbd.c linux/drivers/sbus/char/sunkbd.c
1968--- linux.orig/drivers/sbus/char/sunkbd.c Sun Mar 25 18:31:38 2001
1969+++ linux/drivers/sbus/char/sunkbd.c Wed Aug 7 17:45:23 2002
1970@@ -1278,7 +1278,7 @@
1971 kbd_head = next;
1972 }
1973 if (kb_fasync)
1974- kill_fasync (kb_fasync, SIGIO);
1975+ kill_fasync (kb_fasync, SIGIO, POLL_IN);
1976 wake_up_interruptible (&kbd_wait);
1977 }
1978
1979diff -urN linux.orig/drivers/sbus/char/sunmouse.c linux/drivers/sbus/char/sunmouse.c
1980--- linux.orig/drivers/sbus/char/sunmouse.c Sun Mar 25 18:31:39 2001
1981+++ linux/drivers/sbus/char/sunmouse.c Wed Aug 7 17:45:23 2002
1982@@ -137,7 +137,7 @@
1983 }
1984 sunmouse.ready = 1;
1985 if (sunmouse.fasync)
1986- kill_fasync (sunmouse.fasync, SIGIO);
1987+ kill_fasync (sunmouse.fasync, SIGIO, POLL_IN);
1988 wake_up_interruptible (&sunmouse.proc_list);
1989 }
1990
1991@@ -365,7 +365,7 @@
1992 */
1993 sunmouse.ready = 1;
1994 if (sunmouse.fasync)
1995- kill_fasync (sunmouse.fasync, SIGIO);
1996+ kill_fasync (sunmouse.fasync, SIGIO, POLL_IN);
1997 wake_up_interruptible(&sunmouse.proc_list);
1998 }
1999 return;
2000diff -urN linux.orig/drivers/scsi/sg.c linux/drivers/scsi/sg.c
2001--- linux.orig/drivers/scsi/sg.c Tue May 21 01:32:35 2002
2002+++ linux/drivers/scsi/sg.c Wed Aug 7 17:45:23 2002
2003@@ -831,7 +831,7 @@
2004 if (sfp && srp) {
2005 wake_up_interruptible(&sfp->read_wait);
2006 if (sfp->async_qp)
2007- kill_fasync(sfp->async_qp, SIGPOLL);
2008+ kill_fasync(sfp->async_qp, SIGIO, POLL_IN);
2009 }
2010 }
2011
2012diff -urN linux.orig/drivers/sgi/char/shmiq.c linux/drivers/sgi/char/shmiq.c
2013--- linux.orig/drivers/sgi/char/shmiq.c Sun Mar 25 18:31:42 2001
2014+++ linux/drivers/sgi/char/shmiq.c Wed Aug 7 17:45:23 2002
2015@@ -118,7 +118,7 @@
2016 s->tail = tail_next;
2017 shmiqs [device].tail = tail_next;
2018 if (shmiqs [device].fasync)
2019- kill_fasync (shmiqs [device].fasync, SIGIO);
2020+ kill_fasync (shmiqs [device].fasync, SIGIO, POLL_IN);
2021 wake_up_interruptible (&shmiqs [device].proc_list);
2022 }
2023
2024diff -urN linux.orig/drivers/telephony/ixj.c linux/drivers/telephony/ixj.c
2025--- linux.orig/drivers/telephony/ixj.c Sun Mar 25 18:31:44 2001
2026+++ linux/drivers/telephony/ixj.c Wed Aug 7 17:45:23 2002
2027@@ -536,7 +536,7 @@
2028 extern __inline__ void ixj_kill_fasync(int board)
2029 {
2030 if (ixj[board].async_queue)
2031- kill_fasync(ixj[board].async_queue, SIGIO); // Send apps notice of change
2032+ kill_fasync(ixj[board].async_queue, SIGIO, POLL_IN); // Send apps notice of change
2033
2034 }
2035 static void ixj_timeout(unsigned long ptr)
2036diff -urN linux.orig/drivers/usb/evdev.c linux/drivers/usb/evdev.c
2037--- linux.orig/drivers/usb/evdev.c Sun Mar 25 18:31:43 2001
2038+++ linux/drivers/usb/evdev.c Wed Aug 7 17:45:23 2002
2039@@ -74,7 +74,7 @@
2040 list->buffer[list->head].value = value;
2041 list->head = (list->head + 1) & (EVDEV_BUFFER_SIZE - 1);
2042
2043- kill_fasync(list->fasync, SIGIO);
2044+ kill_fasync(list->fasync, SIGIO, POLL_IN);
2045
2046 list = list->next;
2047 }
2048diff -urN linux.orig/drivers/usb/joydev.c linux/drivers/usb/joydev.c
2049--- linux.orig/drivers/usb/joydev.c Sun Mar 25 18:31:43 2001
2050+++ linux/drivers/usb/joydev.c Wed Aug 7 17:45:23 2002
2051@@ -143,7 +143,7 @@
2052 if (list->tail == (list->head = (list->head + 1) & (JOYDEV_BUFFER_SIZE - 1)))
2053 list->startup = 0;
2054
2055- kill_fasync(list->fasync, SIGIO);
2056+ kill_fasync(list->fasync, SIGIO, POLL_IN);
2057
2058 list = list->next;
2059 }
2060diff -urN linux.orig/drivers/usb/mousedev.c linux/drivers/usb/mousedev.c
2061--- linux.orig/drivers/usb/mousedev.c Sun Mar 25 18:31:42 2001
2062+++ linux/drivers/usb/mousedev.c Wed Aug 7 17:45:23 2002
2063@@ -143,7 +143,7 @@
2064
2065 list->ready = 1;
2066
2067- kill_fasync(list->fasync, SIGIO);
2068+ kill_fasync(list->fasync, SIGIO, POLL_IN);
2069
2070 list = list->next;
2071 }
2072@@ -321,7 +321,7 @@
2073 list->buffer = list->bufsiz;
2074 }
2075
2076- kill_fasync(list->fasync, SIGIO);
2077+ kill_fasync(list->fasync, SIGIO, POLL_IN);
2078
2079 wake_up_interruptible(&list->mousedev->wait);
2080
2081diff -urN linux.orig/fs/buffer.c linux/fs/buffer.c
2082--- linux.orig/fs/buffer.c Sun Mar 25 18:37:38 2001
2083+++ linux/fs/buffer.c Wed Aug 7 17:52:06 2002
2084@@ -123,7 +123,7 @@
2085
2086 /* These are the min and max parameter values that we will allow to be assigned */
2087 int bdflush_min[N_PARAM] = { 0, 10, 5, 25, 0, 1*HZ, 1*HZ, 1, 1};
2088-int bdflush_max[N_PARAM] = {100,5000, 2000, 2000,60*HZ, 600*HZ, 600*HZ, 2047, 5};
2089+int bdflush_max[N_PARAM] = {100,5000, 2000, 2000,INT_MAX, 600*HZ, 600*HZ, 2047, 5};
2090
2091 void wakeup_bdflush(int);
2092
2093@@ -144,13 +144,13 @@
2094 bh->b_count++;
2095 wait.task = tsk;
2096 add_wait_queue(&bh->b_wait, &wait);
2097-repeat:
2098- tsk->state = TASK_UNINTERRUPTIBLE;
2099- run_task_queue(&tq_disk);
2100- if (buffer_locked(bh)) {
2101+ do {
2102+ set_current_state(TASK_UNINTERRUPTIBLE);
2103+ run_task_queue(&tq_disk);
2104+ if (!buffer_locked(bh))
2105+ break;
2106 schedule();
2107- goto repeat;
2108- }
2109+ } while (buffer_locked(bh));
2110 tsk->state = TASK_RUNNING;
2111 remove_wait_queue(&bh->b_wait, &wait);
2112 bh->b_count--;
2113@@ -1530,9 +1530,13 @@
2114 struct buffer_head *p = tmp;
2115 tmp = tmp->b_this_page;
2116
2117- if (buffer_dirty(p))
2118- if (test_and_set_bit(BH_Wait_IO, &p->b_state))
2119- ll_rw_block(WRITE, 1, &p);
2120+ if (buffer_dirty(p) || buffer_locked(p))
2121+ if (test_and_set_bit(BH_Wait_IO, &p->b_state)) {
2122+ if (buffer_dirty(p))
2123+ ll_rw_block(WRITE, 1, &p);
2124+ else if (buffer_locked(p))
2125+ wait_on_buffer(p);
2126+ }
2127 } while (tmp != bh);
2128
2129 /* Restore the visibility of the page before returning. */
2130@@ -1788,7 +1792,6 @@
2131 if (ncount) printk("sync_old_buffers: %d dirty buffers not on dirty list\n", ncount);
2132 printk("Wrote %d/%d buffers\n", nwritten, ndirty);
2133 #endif
2134- run_task_queue(&tq_disk);
2135 return 0;
2136 }
2137
2138@@ -1986,13 +1989,18 @@
2139 tsk->session = 1;
2140 tsk->pgrp = 1;
2141 strcpy(tsk->comm, "kupdate");
2142+
2143+ /* sigstop and sigcont will stop and wakeup kupdate */
2144+ spin_lock_irq(&tsk->sigmask_lock);
2145 sigfillset(&tsk->blocked);
2146- /* sigcont will wakeup kupdate after setting interval to 0 */
2147 sigdelset(&tsk->blocked, SIGCONT);
2148+ sigdelset(&tsk->blocked, SIGSTOP);
2149+ spin_unlock_irq(&tsk->sigmask_lock);
2150
2151 lock_kernel();
2152
2153 for (;;) {
2154+ /* update interval */
2155 interval = bdf_prm.b_un.interval;
2156 if (interval)
2157 {
2158@@ -2001,9 +2009,25 @@
2159 }
2160 else
2161 {
2162+ stop_kupdate:
2163 tsk->state = TASK_STOPPED;
2164 schedule(); /* wait for SIGCONT */
2165 }
2166+ /* check for sigstop */
2167+ if (signal_pending(tsk))
2168+ {
2169+ int stopped = 0;
2170+ spin_lock_irq(&tsk->sigmask_lock);
2171+ if (sigismember(&tsk->signal, SIGSTOP))
2172+ {
2173+ sigdelset(&tsk->signal, SIGSTOP);
2174+ stopped = 1;
2175+ }
2176+ recalc_sigpending(tsk);
2177+ spin_unlock_irq(&tsk->sigmask_lock);
2178+ if (stopped)
2179+ goto stop_kupdate;
2180+ }
2181 #ifdef DEBUG
2182 printk("kupdate() activated...\n");
2183 #endif
2184diff -urN linux.orig/fs/ext2/inode.c linux/fs/ext2/inode.c
2185--- linux.orig/fs/ext2/inode.c Sun Mar 25 18:30:58 2001
2186+++ linux/fs/ext2/inode.c Wed Aug 7 17:54:11 2002
2187@@ -739,7 +739,7 @@
2188 }
2189
2190 #if BITS_PER_LONG == 64
2191- if (size >> 33) {
2192+ if (size >> 31) {
2193 struct super_block *sb = inode->i_sb;
2194 struct ext2_super_block *es = sb->u.ext2_sb.s_es;
2195 if (!(es->s_feature_ro_compat &
2196diff -urN linux.orig/fs/fcntl.c linux/fs/fcntl.c
2197--- linux.orig/fs/fcntl.c Sun Mar 25 18:30:58 2001
2198+++ linux/fs/fcntl.c Wed Aug 7 17:45:23 2002
2199@@ -8,6 +8,8 @@
2200 #include <linux/file.h>
2201 #include <linux/smp_lock.h>
2202
2203+#include <asm/poll.h>
2204+#include <asm/siginfo.h>
2205 #include <asm/uaccess.h>
2206
2207 extern int sock_fcntl (struct file *, unsigned int cmd, unsigned long arg);
2208@@ -223,7 +225,19 @@
2209 return err;
2210 }
2211
2212-static void send_sigio(struct fown_struct *fown, struct fasync_struct *fa)
2213+/* Table to convert sigio signal codes into poll band bitmaps */
2214+
2215+static int band_table[NSIGPOLL] = {
2216+ POLLIN | POLLRDNORM, /* POLL_IN */
2217+ POLLOUT | POLLWRNORM | POLLWRBAND, /* POLL_OUT */
2218+ POLLIN | POLLRDNORM | POLLMSG, /* POLL_MSG */
2219+ POLLERR, /* POLL_ERR */
2220+ POLLPRI | POLLRDBAND, /* POLL_PRI */
2221+ POLLHUP | POLLERR /* POLL_HUP */
2222+};
2223+
2224+static void send_sigio(struct fown_struct *fown, struct fasync_struct *fa,
2225+ int reason)
2226 {
2227 struct task_struct * p;
2228 int pid = fown->pid;
2229@@ -252,9 +266,12 @@
2230 back to SIGIO in that case. --sct */
2231 si.si_signo = fown->signum;
2232 si.si_errno = 0;
2233- si.si_code = SI_SIGIO;
2234- si.si_pid = pid;
2235- si.si_uid = uid;
2236+ si.si_code = reason;
2237+ if (reason - POLL_IN >= NSIGPOLL ||
2238+ reason <= 0)
2239+ panic("send_sigio got `reason' != POLL_*");
2240+ else
2241+ si.si_band = band_table[reason - POLL_IN];
2242 si.si_fd = fa->fa_fd;
2243 if (!send_sig_info(fown->signum, &si, p))
2244 break;
2245@@ -266,7 +283,7 @@
2246 read_unlock(&tasklist_lock);
2247 }
2248
2249-void kill_fasync(struct fasync_struct *fa, int sig)
2250+void kill_fasync(struct fasync_struct *fa, int sig, int band)
2251 {
2252 while (fa) {
2253 struct fown_struct * fown;
2254@@ -276,8 +293,11 @@
2255 return;
2256 }
2257 fown = &fa->fa_file->f_owner;
2258- if (fown->pid)
2259- send_sigio(fown, fa);
2260+ /* Don't send SIGURG to processes which have not set a
2261+ queued signum: SIGURG has its own default signalling
2262+ mechanism. */
2263+ if (fown->pid && !(sig == SIGURG && fown->signum == 0))
2264+ send_sigio(fown, fa, band);
2265 fa = fa->fa_next;
2266 }
2267 }
2268diff -urN linux.orig/fs/inode.c linux/fs/inode.c
2269--- linux.orig/fs/inode.c Sun Mar 25 18:37:38 2001
2270+++ linux/fs/inode.c Wed Aug 7 17:57:41 2002
2271@@ -11,6 +11,8 @@
2272 #include <linux/init.h>
2273 #include <linux/quotaops.h>
2274 #include <linux/random.h>
2275+#include <linux/bigmem.h>
2276+#include <linux/slab.h>
2277
2278 /*
2279 * New inode.c implementation.
2280@@ -29,9 +31,8 @@
2281 * Inode lookup is no longer as critical as it used to be:
2282 * most of the lookups are going to be through the dcache.
2283 */
2284-#define HASH_BITS 8
2285-#define HASH_SIZE (1UL << HASH_BITS)
2286-#define HASH_MASK (HASH_SIZE-1)
2287+#define HASH_BITS i_hash_bits
2288+#define HASH_MASK i_hash_mask
2289
2290 /*
2291 * Each inode can be on two separate lists. One is
2292@@ -47,7 +48,9 @@
2293
2294 LIST_HEAD(inode_in_use);
2295 static LIST_HEAD(inode_unused);
2296-static struct list_head inode_hashtable[HASH_SIZE];
2297+static unsigned int i_hash_bits;
2298+static unsigned int i_hash_mask;
2299+static struct list_head *inode_hashtable;
2300
2301 __u32 inode_generation_count = 0;
2302
2303@@ -569,6 +572,7 @@
2304 inode->i_writecount = 0;
2305 inode->i_size = 0;
2306 inode->i_generation = 0;
2307+ inode->i_blocks = 0;
2308 memset(&inode->i_dquot, 0, sizeof(inode->i_dquot));
2309 sema_init(&inode->i_sem, 1);
2310 }
2311@@ -680,7 +684,7 @@
2312
2313 static inline unsigned long hash(struct super_block *sb, unsigned long i_ino)
2314 {
2315- unsigned long tmp = i_ino | (unsigned long) sb;
2316+ unsigned long tmp = i_ino + (unsigned long) sb / (sizeof(struct super_block) & ~(sizeof(struct super_block) - 1));
2317 tmp = tmp + (tmp >> HASH_BITS);
2318 return tmp & HASH_MASK;
2319 }
2320@@ -835,30 +839,85 @@
2321 return 0;
2322 }
2323
2324-/*
2325- * Initialize the hash tables and default
2326- * value for max inodes
2327- */
2328-#define MAX_INODE (16384)
2329-
2330 void __init inode_init(void)
2331 {
2332- int i, max;
2333- struct list_head *head = inode_hashtable;
2334+ int i, order;
2335+ struct list_head *d;
2336+ unsigned long nr_hash, hash_size, tmp;
2337+
2338+#ifndef CONFIG_BIGMEM
2339+ nr_hash = num_physpages;
2340+#else
2341+ nr_hash = bigmem_mapnr;
2342+#endif
2343+ nr_hash <<= PAGE_SHIFT;
2344+ nr_hash >>= 13;
2345+
2346+ /* scale logaritmically over 32768 inodes */
2347+ if (nr_hash > 16384) {
2348+ if (nr_hash > 32768)
2349+ nr_hash >>= 1;
2350+ else
2351+ nr_hash = 16384;
2352+ }
2353+ if (nr_hash > 32768) {
2354+ if (nr_hash > 65536)
2355+ nr_hash >>= 1;
2356+ else
2357+ nr_hash = 32768;
2358+ }
2359+
2360+ /* This limit triggers with more than 1G of RAM */
2361+ if (nr_hash > 65536)
2362+ nr_hash = 65536;
2363+
2364+ max_inodes = nr_hash;
2365+
2366+ hash_size = nr_hash * sizeof(struct list_head);
2367+
2368+ if (hash_size < PAGE_SIZE) {
2369+ /* Embedded systems */
2370+ inode_hashtable = kmalloc(hash_size, GFP_ATOMIC);
2371+
2372+ i_hash_mask = (nr_hash - 1);
2373
2374- i = HASH_SIZE;
2375+ tmp = nr_hash;
2376+ i_hash_bits = 0;
2377+ while((tmp >>= 1UL) != 0UL)
2378+ i_hash_bits++;
2379+ } else {
2380+ for (order = 0; ((1UL << order) << PAGE_SHIFT) < hash_size;
2381+ order++);
2382+
2383+ do {
2384+ hash_size = 1UL << (order+PAGE_SHIFT);
2385+ nr_hash = hash_size / sizeof(struct list_head);
2386+
2387+ i_hash_mask = (nr_hash - 1);
2388+
2389+ tmp = nr_hash;
2390+ i_hash_bits = 0;
2391+ while((tmp >>= 1UL) != 0UL)
2392+ i_hash_bits++;
2393+
2394+ inode_hashtable = (struct list_head *) __get_free_pages(GFP_ATOMIC, order);
2395+ } while(inode_hashtable == NULL && --order >= 0);
2396+ }
2397+
2398+ printk("Inode hash table entries: %lu (%ldk), inode-max: %d\n",
2399+ nr_hash, hash_size >> 10, max_inodes);
2400+
2401+ if (!inode_hashtable)
2402+ panic("Failed to allocate inode hash table\n");
2403+
2404+ d = inode_hashtable;
2405+ i = nr_hash;
2406 do {
2407- INIT_LIST_HEAD(head);
2408- head++;
2409+ INIT_LIST_HEAD(d);
2410+ d++;
2411 i--;
2412 } while (i);
2413
2414- /* Initial guess at reasonable inode number */
2415- max = num_physpages >> 1;
2416- if (max > MAX_INODE)
2417- max = MAX_INODE;
2418- max_inodes = max;
2419-
2420 /* Get a random number. */
2421 get_random_bytes (&inode_generation_count,
2422 sizeof (inode_generation_count));
2423diff -urN linux.orig/fs/proc/fd.c linux/fs/proc/fd.c
2424--- linux.orig/fs/proc/fd.c Sun Mar 25 18:30:58 2001
2425+++ linux/fs/proc/fd.c Wed Aug 7 17:51:29 2002
2426@@ -87,7 +87,6 @@
2427 fd = 0;
2428 len = dentry->d_name.len;
2429 name = dentry->d_name.name;
2430- if (len > 1 && *name == '0') goto out;
2431 while (len-- > 0) {
2432 c = *name - '0';
2433 name++;
2434diff -urN linux.orig/fs/proc/root.c linux/fs/proc/root.c
2435--- linux.orig/fs/proc/root.c Tue May 21 01:32:35 2002
2436+++ linux/fs/proc/root.c Wed Aug 7 17:51:29 2002
2437@@ -844,7 +844,6 @@
2438 }
2439 pid *= 10;
2440 pid += c;
2441- if (!pid) break;
2442 if (pid & 0xffff0000) {
2443 pid = 0;
2444 break;
2445diff -urN linux.orig/fs/select.c linux/fs/select.c
2446--- linux.orig/fs/select.c Sun Mar 25 18:30:58 2001
2447+++ linux/fs/select.c Wed Aug 7 17:55:44 2002
2448@@ -412,7 +412,7 @@
2449 lock_kernel();
2450 /* Do a sanity check on nfds ... */
2451 err = -EINVAL;
2452- if (nfds > current->files->max_fds)
2453+ if (nfds > current->rlim[RLIMIT_NOFILE].rlim_cur)
2454 goto out;
2455
2456 if (timeout) {
2457diff -urN linux.orig/fs/smbfs/sock.c linux/fs/smbfs/sock.c
2458--- linux.orig/fs/smbfs/sock.c Sun Mar 25 18:30:59 2001
2459+++ linux/fs/smbfs/sock.c Wed Aug 7 17:45:23 2002
2460@@ -96,7 +96,7 @@
2461 */
2462 if(!sk->dead) {
2463 wake_up_interruptible(sk->sleep);
2464- sock_wake_async(sk->socket,1);
2465+ sock_wake_async(sk->socket,1,POLL_IN);
2466 }
2467 }
2468
2469diff -urN linux.orig/include/asm-i386/bugs.h linux/include/asm-i386/bugs.h
2470--- linux.orig/include/asm-i386/bugs.h Sun Mar 25 18:37:39 2001
2471+++ linux/include/asm-i386/bugs.h Wed Aug 7 17:44:43 2002
2472@@ -8,6 +8,9 @@
2473 * <rreilova@ececs.uc.edu>
2474 * - Channing Corn (tests & fixes),
2475 * - Andrew D. Balsa (code cleanup).
2476+ *
2477+ * Pentium III FXSR, SSE support
2478+ * Gareth Hughes <gareth@valinux.com>, May 2000
2479 */
2480
2481 /*
2482@@ -20,6 +23,7 @@
2483 #include <linux/config.h>
2484 #include <asm/processor.h>
2485 #include <asm/msr.h>
2486+#include <asm/i387.h>
2487
2488 #define CONFIG_BUGi386
2489
2490@@ -69,6 +73,25 @@
2491 #endif
2492 return;
2493 }
2494+
2495+ /*
2496+ * Verify that the FXSAVE/FXRSTOR data will be 16-byte aligned.
2497+ */
2498+ if (offsetof(struct task_struct, tss.i387.fxsave) & 15) {
2499+ extern void __buggy_fxsr_alignment(void);
2500+ __buggy_fxsr_alignment();
2501+ }
2502+ if (cpu_has_fxsr) {
2503+ printk(KERN_INFO "Enabling fast FPU save and restore... ");
2504+ set_in_cr4(X86_CR4_OSFXSR);
2505+ printk("done.\n");
2506+ }
2507+ if (cpu_has_xmm) {
2508+ printk(KERN_INFO "Enabling unmasked SIMD FPU exception support... ");
2509+ set_in_cr4(X86_CR4_OSXMMEXCPT);
2510+ printk("done.\n");
2511+ }
2512+
2513 if (mca_pentium_flag) {
2514 /* The IBM Model 95 machines with pentiums lock up on
2515 * fpu test, so we avoid it. All pentiums have inbuilt
2516diff -urN linux.orig/include/asm-i386/cache.h linux/include/asm-i386/cache.h
2517--- linux.orig/include/asm-i386/cache.h Sun Mar 25 18:31:05 2001
2518+++ linux/include/asm-i386/cache.h Wed Aug 7 17:44:10 2002
2519@@ -5,7 +5,11 @@
2520 #define __ARCH_I386_CACHE_H
2521
2522 /* bytes per L1 cache line */
2523-#if CPU==586 || CPU==686
2524+#ifdef CONFIG_M686_L1_64
2525+#define L1_CACHE_BYTES 64
2526+#elif defined(CONFIG_M686_L1_128)
2527+#define L1_CACHE_BYTES 128
2528+#elif CPU==586 || CPU==686
2529 #define L1_CACHE_BYTES 32
2530 #else
2531 #define L1_CACHE_BYTES 16
2532diff -urN linux.orig/include/asm-i386/elf.h linux/include/asm-i386/elf.h
2533--- linux.orig/include/asm-i386/elf.h Sun Mar 25 18:31:05 2001
2534+++ linux/include/asm-i386/elf.h Wed Aug 7 17:44:43 2002
2535@@ -15,6 +15,7 @@
2536 typedef elf_greg_t elf_gregset_t[ELF_NGREG];
2537
2538 typedef struct user_i387_struct elf_fpregset_t;
2539+typedef struct user_fxsr_struct elf_fpxregset_t;
2540
2541 /*
2542 * This is used to ensure we don't load something for the wrong architecture.
2543diff -urN linux.orig/include/asm-i386/i387.h linux/include/asm-i386/i387.h
2544--- linux.orig/include/asm-i386/i387.h Thu Jan 1 01:00:00 1970
2545+++ linux/include/asm-i386/i387.h Wed Aug 7 17:44:43 2002
2546@@ -0,0 +1,83 @@
2547+/*
2548+ * include/asm-i386/i387.h
2549+ *
2550+ * Copyright (C) 1994 Linus Torvalds
2551+ *
2552+ * Pentium III FXSR, SSE support
2553+ * General FPU state handling cleanups
2554+ * Gareth Hughes <gareth@valinux.com>, May 2000
2555+ */
2556+
2557+#ifndef __ASM_I386_I387_H
2558+#define __ASM_I386_I387_H
2559+
2560+#include <linux/sched.h>
2561+#include <asm/processor.h>
2562+#include <asm/sigcontext.h>
2563+#include <asm/user.h>
2564+
2565+extern void init_fpu(void);
2566+/*
2567+ * FPU lazy state save handling...
2568+ */
2569+extern void save_init_fpu( struct task_struct *tsk );
2570+extern void restore_fpu( struct task_struct *tsk );
2571+
2572+#define unlazy_fpu( tsk ) do { \
2573+ if ( tsk->flags & PF_USEDFPU ) \
2574+ save_init_fpu( tsk ); \
2575+} while (0)
2576+
2577+#define clear_fpu( tsk ) do { \
2578+ if ( tsk->flags & PF_USEDFPU ) { \
2579+ tsk->flags &= ~PF_USEDFPU; \
2580+ stts(); \
2581+ } \
2582+} while (0)
2583+
2584+/*
2585+ * FPU state interaction...
2586+ */
2587+extern unsigned short get_fpu_cwd( struct task_struct *tsk );
2588+extern unsigned short get_fpu_swd( struct task_struct *tsk );
2589+extern unsigned short get_fpu_twd( struct task_struct *tsk );
2590+extern unsigned short get_fpu_mxcsr( struct task_struct *tsk );
2591+
2592+extern void set_fpu_cwd( struct task_struct *tsk, unsigned short cwd );
2593+extern void set_fpu_swd( struct task_struct *tsk, unsigned short swd );
2594+extern void set_fpu_twd( struct task_struct *tsk, unsigned short twd );
2595+extern void set_fpu_mxcsr( struct task_struct *tsk, unsigned short mxcsr );
2596+
2597+#define load_mxcsr( val ) do { \
2598+ unsigned long __mxcsr = ((unsigned long)(val) & 0xffbf); \
2599+ asm volatile( "ldmxcsr %0" : : "m" (__mxcsr) ); \
2600+} while (0)
2601+
2602+/*
2603+ * Signal frame handlers...
2604+ */
2605+extern int save_i387( struct _fpstate *buf );
2606+extern int restore_i387( struct _fpstate *buf );
2607+
2608+/*
2609+ * ptrace request handers...
2610+ */
2611+extern int get_fpregs( struct user_i387_struct *buf,
2612+ struct task_struct *tsk );
2613+extern int set_fpregs( struct task_struct *tsk,
2614+ struct user_i387_struct *buf );
2615+
2616+extern int get_fpxregs( struct user_fxsr_struct *buf,
2617+ struct task_struct *tsk );
2618+extern int set_fpxregs( struct task_struct *tsk,
2619+ struct user_fxsr_struct *buf );
2620+
2621+/*
2622+ * FPU state for core dumps...
2623+ */
2624+extern int dump_fpu( struct pt_regs *regs,
2625+ struct user_i387_struct *fpu );
2626+extern int dump_extended_fpu( struct pt_regs *regs,
2627+ struct user_fxsr_struct *fpu );
2628+
2629+#endif /* __ASM_I386_I387_H */
2630diff -urN linux.orig/include/asm-i386/processor.h linux/include/asm-i386/processor.h
2631--- linux.orig/include/asm-i386/processor.h Tue May 21 01:32:35 2002
2632+++ linux/include/asm-i386/processor.h Wed Aug 7 17:44:43 2002
2633@@ -40,7 +40,7 @@
2634 unsigned long *pgd_quick;
2635 unsigned long *pte_quick;
2636 unsigned long pgtable_cache_sz;
2637-};
2638+} __attribute__((__aligned__(SMP_CACHE_BYTES)));
2639
2640 #define X86_VENDOR_INTEL 0
2641 #define X86_VENDOR_CYRIX 1
2642@@ -82,7 +82,7 @@
2643 #define X86_FEATURE_22 0x00400000
2644 #define X86_FEATURE_MMX 0x00800000 /* multimedia extensions */
2645 #define X86_FEATURE_FXSR 0x01000000 /* FXSAVE and FXRSTOR instructions (fast save and restore of FPU context), and CR4.OSFXSR (OS uses these instructions) available */
2646-#define X86_FEATURE_25 0x02000000
2647+#define X86_FEATURE_XMM 0x02000000 /* Intel MMX2 instruction set */
2648 #define X86_FEATURE_26 0x04000000
2649 #define X86_FEATURE_27 0x08000000
2650 #define X86_FEATURE_28 0x10000000
2651@@ -100,6 +100,23 @@
2652 #define current_cpu_data boot_cpu_data
2653 #endif
2654
2655+#define cpu_has_pge \
2656+ (boot_cpu_data.x86_capability & X86_FEATURE_PGE)
2657+#define cpu_has_pse \
2658+ (boot_cpu_data.x86_capability & X86_FEATURE_PSE)
2659+#define cpu_has_pae \
2660+ (boot_cpu_data.x86_capability & X86_FEATURE_PAE)
2661+#define cpu_has_tsc \
2662+ (boot_cpu_data.x86_capability & X86_FEATURE_TSC)
2663+#define cpu_has_de \
2664+ (boot_cpu_data.x86_capability & X86_FEATURE_DE)
2665+#define cpu_has_vme \
2666+ (boot_cpu_data.x86_capability & X86_FEATURE_VME)
2667+#define cpu_has_fxsr \
2668+ ((boot_cpu_data.x86_vendor != X86_VENDOR_CYRIX) && (boot_cpu_data.x86_capability & X86_FEATURE_FXSR))
2669+#define cpu_has_xmm \
2670+ (boot_cpu_data.x86_capability & X86_FEATURE_XMM)
2671+
2672 extern char ignore_irq13;
2673
2674 extern void identify_cpu(struct cpuinfo_x86 *);
2675@@ -184,6 +201,49 @@
2676 return edx;
2677 }
2678 /*
2679+ * Intel CPU features in CR4
2680+ */
2681+#define X86_CR4_VME 0x0001 /* enable vm86 extensions */
2682+#define X86_CR4_PVI 0x0002 /* virtual interrupts flag enable */
2683+#define X86_CR4_TSD 0x0004 /* disable time stamp at ipl 3 */
2684+#define X86_CR4_DE 0x0008 /* enable debugging extensions */
2685+#define X86_CR4_PSE 0x0010 /* enable page size extensions */
2686+#define X86_CR4_PAE 0x0020 /* enable physical address extensions */
2687+#define X86_CR4_MCE 0x0040 /* Machine check enable */
2688+#define X86_CR4_PGE 0x0080 /* enable global pages */
2689+#define X86_CR4_PCE 0x0100 /* enable performance counters at ipl 3 */
2690+#define X86_CR4_OSFXSR 0x0200 /* enable fast FPU save and restore */
2691+#define X86_CR4_OSXMMEXCPT 0x0400 /* enable unmasked SSE exceptions */
2692+
2693+/*
2694+ * Save the cr4 feature set we're using (ie
2695+ * Pentium 4MB enable and PPro Global page
2696+ * enable), so that any CPU's that boot up
2697+ * after us can get the correct flags.
2698+ */
2699+extern unsigned long x86_cr4;
2700+
2701+static inline void set_in_cr4 (unsigned long mask)
2702+{
2703+ x86_cr4 |= mask;
2704+ __asm__("movl %%cr4,%%eax\n\t"
2705+ "orl %0,%%eax\n\t"
2706+ "movl %%eax,%%cr4\n"
2707+ : : "irg" (mask)
2708+ :"ax");
2709+}
2710+
2711+static inline void clear_in_cr4 (unsigned long mask)
2712+{
2713+ x86_cr4 &= ~mask;
2714+ __asm__("movl %%cr4,%%eax\n\t"
2715+ "andl %0,%%eax\n\t"
2716+ "movl %%eax,%%cr4\n"
2717+ : : "irg" (~mask)
2718+ :"ax");
2719+}
2720+
2721+/*
2722 * Cyrix CPU configuration register indexes
2723 */
2724 #define CX86_CCR0 0xc0
2725@@ -211,39 +271,6 @@
2726 } while (0)
2727
2728 /*
2729- * * Intel CPU features in CR4
2730- * */
2731-#define X86_CR4_VME 0x0001 /* enable vm86 extensions */
2732-#define X86_CR4_PVI 0x0002 /* virtual interrupts flag enable */
2733-#define X86_CR4_TSD 0x0004 /* disable time stamp at ipl 3 */
2734-#define X86_CR4_DE 0x0008 /* enable debugging extensions */
2735-#define X86_CR4_PSE 0x0010 /* enable page size extensions */
2736-#define X86_CR4_PAE 0x0020 /* enable physical address extensions */
2737-#define X86_CR4_MCE 0x0040 /* Machine check enable */
2738-#define X86_CR4_PGE 0x0080 /* enable global pages */
2739-#define X86_CR4_PCE 0x0100 /* enable performance counters at ipl 3 */
2740-#define X86_CR4_OSFXSR 0x0200 /* enable fast FPU save and restore */
2741-#define X86_CR4_OSXMMEXCPT 0x0400 /* enable unmasked SSE exceptions */
2742-
2743-/*
2744- * Save the cr4 feature set we're using (ie
2745- * Pentium 4MB enable and PPro Global page
2746- * enable), so that any CPU's that boot up
2747- * after us can get the correct flags.
2748- */
2749-extern unsigned long mmu_cr4_features;
2750-
2751-static inline void set_in_cr4 (unsigned long mask)
2752-{
2753- mmu_cr4_features |= mask;
2754- __asm__("movl %%cr4,%%eax\n\t"
2755- "orl %0,%%eax\n\t"
2756- "movl %%eax,%%cr4\n"
2757- : : "irg" (mask)
2758- :"ax");
2759-}
2760-
2761-/*
2762 * Bus types (default is ISA, but people can check others with these..)
2763 */
2764 extern int EISA_bus;
2765@@ -271,7 +298,7 @@
2766 */
2767 #define IO_BITMAP_SIZE 32
2768
2769-struct i387_hard_struct {
2770+struct i387_fsave_struct {
2771 long cwd;
2772 long swd;
2773 long twd;
2774@@ -283,22 +310,42 @@
2775 long status; /* software status information */
2776 };
2777
2778-struct i387_soft_struct {
2779- long cwd;
2780- long swd;
2781- long twd;
2782+/*
2783+ * has to be 128-bit aligned
2784+ */
2785+struct i387_fxsave_struct {
2786+ unsigned short cwd;
2787+ unsigned short swd;
2788+ unsigned short twd;
2789+ unsigned short fop;
2790 long fip;
2791 long fcs;
2792 long foo;
2793 long fos;
2794- long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
2795- unsigned char ftop, changed, lookahead, no_update, rm, alimit;
2796- struct info *info;
2797- unsigned long entry_eip;
2798+ long mxcsr;
2799+ long reserved;
2800+ long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
2801+ long xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
2802+ long padding[56];
2803+} __attribute__ ((aligned (16)));
2804+
2805+struct i387_soft_struct {
2806+ long cwd;
2807+ long swd;
2808+ long twd;
2809+ long fip;
2810+ long fcs;
2811+ long foo;
2812+ long fos;
2813+ long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
2814+ unsigned char ftop, changed, lookahead, no_update, rm, alimit;
2815+ struct info *info;
2816+ unsigned long entry_eip;
2817 };
2818
2819 union i387_union {
2820- struct i387_hard_struct hard;
2821+ struct i387_fsave_struct fsave;
2822+ struct i387_fxsave_struct fxsave;
2823 struct i387_soft_struct soft;
2824 };
2825
2826@@ -391,27 +438,6 @@
2827 extern void forget_segments(void);
2828
2829 /*
2830- * FPU lazy state save handling..
2831- */
2832-#define save_fpu(tsk) do { \
2833- asm volatile("fnsave %0\n\tfwait":"=m" (tsk->tss.i387)); \
2834- tsk->flags &= ~PF_USEDFPU; \
2835- stts(); \
2836-} while (0)
2837-
2838-#define unlazy_fpu(tsk) do { \
2839- if (tsk->flags & PF_USEDFPU) \
2840- save_fpu(tsk); \
2841-} while (0)
2842-
2843-#define clear_fpu(tsk) do { \
2844- if (tsk->flags & PF_USEDFPU) { \
2845- tsk->flags &= ~PF_USEDFPU; \
2846- stts(); \
2847- } \
2848-} while (0)
2849-
2850-/*
2851 * Return saved PC of a blocked thread.
2852 */
2853 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
2854diff -urN linux.orig/include/asm-i386/ptrace.h linux/include/asm-i386/ptrace.h
2855--- linux.orig/include/asm-i386/ptrace.h Sun Mar 25 18:31:05 2001
2856+++ linux/include/asm-i386/ptrace.h Wed Aug 7 17:44:43 2002
2857@@ -46,6 +46,8 @@
2858 #define PTRACE_SETREGS 13
2859 #define PTRACE_GETFPREGS 14
2860 #define PTRACE_SETFPREGS 15
2861+#define PTRACE_GETFPXREGS 18
2862+#define PTRACE_SETFPXREGS 19
2863
2864 #ifdef __KERNEL__
2865 #define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs))
2866diff -urN linux.orig/include/asm-i386/sigcontext.h linux/include/asm-i386/sigcontext.h
2867--- linux.orig/include/asm-i386/sigcontext.h Sun Mar 25 18:31:05 2001
2868+++ linux/include/asm-i386/sigcontext.h Wed Aug 7 17:44:43 2002
2869@@ -8,24 +8,53 @@
2870 * normal i387 hardware setup, the extra "status"
2871 * word is used to save the coprocessor status word
2872 * before entering the handler.
2873+ *
2874+ * Pentium III FXSR, SSE support
2875+ * Gareth Hughes <gareth@valinux.com>, May 2000
2876+ *
2877+ * The FPU state data structure has had to grow to accomodate the
2878+ * extended FPU state required by the Streaming SIMD Extensions.
2879+ * There is no documented standard to accomplish this at the moment.
2880 */
2881 struct _fpreg {
2882 unsigned short significand[4];
2883 unsigned short exponent;
2884 };
2885
2886+struct _fpxreg {
2887+ unsigned short significand[4];
2888+ unsigned short exponent;
2889+ unsigned short padding[3];
2890+};
2891+
2892+struct _xmmreg {
2893+ unsigned long element[4];
2894+};
2895+
2896 struct _fpstate {
2897- unsigned long cw,
2898- sw,
2899- tag,
2900- ipoff,
2901- cssel,
2902- dataoff,
2903- datasel;
2904+ /* Regular FPU environment */
2905+ unsigned long cw;
2906+ unsigned long sw;
2907+ unsigned long tag;
2908+ unsigned long ipoff;
2909+ unsigned long cssel;
2910+ unsigned long dataoff;
2911+ unsigned long datasel;
2912 struct _fpreg _st[8];
2913- unsigned long status;
2914+ unsigned short status;
2915+ unsigned short magic; /* 0xffff = regular FPU data only */
2916+
2917+ /* FXSR FPU environment */
2918+ unsigned long _fxsr_env[6]; /* FXSR FPU env is ignored */
2919+ unsigned long mxcsr;
2920+ unsigned long reserved;
2921+ struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
2922+ struct _xmmreg _xmm[8];
2923+ unsigned long padding[56];
2924 };
2925
2926+#define X86_FXSR_MAGIC 0x0000
2927+
2928 struct sigcontext {
2929 unsigned short gs, __gsh;
2930 unsigned short fs, __fsh;
2931diff -urN linux.orig/include/asm-i386/siginfo.h linux/include/asm-i386/siginfo.h
2932--- linux.orig/include/asm-i386/siginfo.h Sun Mar 25 18:37:39 2001
2933+++ linux/include/asm-i386/siginfo.h Wed Aug 7 17:44:43 2002
2934@@ -77,6 +77,25 @@
2935 #define si_band _sifields._sigpoll._band
2936 #define si_fd _sifields._sigpoll._fd
2937
2938+#ifdef __KERNEL__
2939+#define __SI_MASK 0xffff0000
2940+#define __SI_KILL (0 << 16)
2941+#define __SI_TIMER (1 << 16)
2942+#define __SI_POLL (2 << 16)
2943+#define __SI_FAULT (3 << 16)
2944+#define __SI_CHLD (4 << 16)
2945+#define __SI_RT (5 << 16)
2946+#define __SI_CODE(T,N) ((T) << 16 | ((N) & 0xffff))
2947+#else
2948+#define __SI_KILL 0
2949+#define __SI_TIMER 0
2950+#define __SI_POLL 0
2951+#define __SI_FAULT 0
2952+#define __SI_CHLD 0
2953+#define __SI_RT 0
2954+#define __SI_CODE(T,N) (N)
2955+#endif
2956+
2957 /*
2958 * si_code values
2959 * Digital reserves positive values for kernel-generated signals.
2960diff -urN linux.orig/include/asm-i386/user.h linux/include/asm-i386/user.h
2961--- linux.orig/include/asm-i386/user.h Sun Mar 25 18:31:05 2001
2962+++ linux/include/asm-i386/user.h Wed Aug 7 17:44:43 2002
2963@@ -30,6 +30,18 @@
2964 The minimum core file size is 3 pages, or 12288 bytes.
2965 */
2966
2967+/*
2968+ * Pentium III FXSR, SSE support
2969+ * Gareth Hughes <gareth@valinux.com>, May 2000
2970+ *
2971+ * Provide support for the GDB 5.0+ PTRACE_{GET|SET}FPXREGS requests for
2972+ * interacting with the FXSR-format floating point environment. Floating
2973+ * point data can be accessed in the regular format in the usual manner,
2974+ * and both the standard and SIMD floating point data can be accessed via
2975+ * the new ptrace requests. In either case, changes to the FPU environment
2976+ * will be reflected in the task's state as expected.
2977+ */
2978+
2979 struct user_i387_struct {
2980 long cwd;
2981 long swd;
2982@@ -41,6 +53,22 @@
2983 long st_space[20]; /* 8*10 bytes for each FP-reg = 80 bytes */
2984 };
2985
2986+struct user_fxsr_struct {
2987+ unsigned short cwd;
2988+ unsigned short swd;
2989+ unsigned short twd;
2990+ unsigned short fop;
2991+ long fip;
2992+ long fcs;
2993+ long foo;
2994+ long fos;
2995+ long mxcsr;
2996+ long reserved;
2997+ long st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
2998+ long xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */
2999+ long padding[56];
3000+};
3001+
3002 /*
3003 * This is the old layout of "struct pt_regs", and
3004 * is still the layout used by user mode (the new
3005diff -urN linux.orig/include/asm-sparc/asm_offsets.h linux/include/asm-sparc/asm_offsets.h
3006--- linux.orig/include/asm-sparc/asm_offsets.h Fri Nov 2 17:39:08 2001
3007+++ linux/include/asm-sparc/asm_offsets.h Wed Aug 7 17:55:29 2002
3008@@ -26,179 +26,181 @@
3009 #define ASIZ_task_priority 0x00000004
3010 #define AOFF_task_avg_slice 0x00000024
3011 #define ASIZ_task_avg_slice 0x00000004
3012-#define AOFF_task_has_cpu 0x00000028
3013+#define AOFF_task_counter_refresh 0x00000028
3014+#define ASIZ_task_counter_refresh 0x00000004
3015+#define AOFF_task_has_cpu 0x0000002c
3016 #define ASIZ_task_has_cpu 0x00000004
3017-#define AOFF_task_processor 0x0000002c
3018+#define AOFF_task_processor 0x00000030
3019 #define ASIZ_task_processor 0x00000004
3020-#define AOFF_task_last_processor 0x00000030
3021+#define AOFF_task_last_processor 0x00000034
3022 #define ASIZ_task_last_processor 0x00000004
3023-#define AOFF_task_lock_depth 0x00000034
3024+#define AOFF_task_lock_depth 0x00000038
3025 #define ASIZ_task_lock_depth 0x00000004
3026-#define AOFF_task_next_task 0x00000038
3027+#define AOFF_task_next_task 0x0000003c
3028 #define ASIZ_task_next_task 0x00000004
3029-#define AOFF_task_prev_task 0x0000003c
3030+#define AOFF_task_prev_task 0x00000040
3031 #define ASIZ_task_prev_task 0x00000004
3032-#define AOFF_task_next_run 0x00000040
3033+#define AOFF_task_next_run 0x00000044
3034 #define ASIZ_task_next_run 0x00000004
3035-#define AOFF_task_prev_run 0x00000044
3036+#define AOFF_task_prev_run 0x00000048
3037 #define ASIZ_task_prev_run 0x00000004
3038-#define AOFF_task_task_exclusive 0x00000048
3039+#define AOFF_task_task_exclusive 0x0000004c
3040 #define ASIZ_task_task_exclusive 0x00000004
3041-#define AOFF_task_binfmt 0x0000004c
3042+#define AOFF_task_binfmt 0x00000050
3043 #define ASIZ_task_binfmt 0x00000004
3044-#define AOFF_task_exit_code 0x00000050
3045+#define AOFF_task_exit_code 0x00000054
3046 #define ASIZ_task_exit_code 0x00000004
3047-#define AOFF_task_exit_signal 0x00000054
3048+#define AOFF_task_exit_signal 0x00000058
3049 #define ASIZ_task_exit_signal 0x00000004
3050-#define AOFF_task_pdeath_signal 0x00000058
3051+#define AOFF_task_pdeath_signal 0x0000005c
3052 #define ASIZ_task_pdeath_signal 0x00000004
3053-#define AOFF_task_personality 0x0000005c
3054+#define AOFF_task_personality 0x00000060
3055 #define ASIZ_task_personality 0x00000004
3056-#define AOFF_task_pid 0x00000064
3057+#define AOFF_task_pid 0x00000068
3058 #define ASIZ_task_pid 0x00000004
3059-#define AOFF_task_pgrp 0x00000068
3060+#define AOFF_task_pgrp 0x0000006c
3061 #define ASIZ_task_pgrp 0x00000004
3062-#define AOFF_task_tty_old_pgrp 0x0000006c
3063+#define AOFF_task_tty_old_pgrp 0x00000070
3064 #define ASIZ_task_tty_old_pgrp 0x00000004
3065-#define AOFF_task_session 0x00000070
3066+#define AOFF_task_session 0x00000074
3067 #define ASIZ_task_session 0x00000004
3068-#define AOFF_task_leader 0x00000074
3069+#define AOFF_task_leader 0x00000078
3070 #define ASIZ_task_leader 0x00000004
3071-#define AOFF_task_p_opptr 0x00000078
3072+#define AOFF_task_p_opptr 0x0000007c
3073 #define ASIZ_task_p_opptr 0x00000004
3074-#define AOFF_task_p_pptr 0x0000007c
3075+#define AOFF_task_p_pptr 0x00000080
3076 #define ASIZ_task_p_pptr 0x00000004
3077-#define AOFF_task_p_cptr 0x00000080
3078+#define AOFF_task_p_cptr 0x00000084
3079 #define ASIZ_task_p_cptr 0x00000004
3080-#define AOFF_task_p_ysptr 0x00000084
3081+#define AOFF_task_p_ysptr 0x00000088
3082 #define ASIZ_task_p_ysptr 0x00000004
3083-#define AOFF_task_p_osptr 0x00000088
3084+#define AOFF_task_p_osptr 0x0000008c
3085 #define ASIZ_task_p_osptr 0x00000004
3086-#define AOFF_task_pidhash_next 0x0000008c
3087+#define AOFF_task_pidhash_next 0x00000090
3088 #define ASIZ_task_pidhash_next 0x00000004
3089-#define AOFF_task_pidhash_pprev 0x00000090
3090+#define AOFF_task_pidhash_pprev 0x00000094
3091 #define ASIZ_task_pidhash_pprev 0x00000004
3092-#define AOFF_task_tarray_ptr 0x00000094
3093+#define AOFF_task_tarray_ptr 0x00000098
3094 #define ASIZ_task_tarray_ptr 0x00000004
3095-#define AOFF_task_wait_chldexit 0x00000098
3096+#define AOFF_task_wait_chldexit 0x0000009c
3097 #define ASIZ_task_wait_chldexit 0x00000004
3098-#define AOFF_task_vfork_sem 0x0000009c
3099+#define AOFF_task_vfork_sem 0x000000a0
3100 #define ASIZ_task_vfork_sem 0x00000004
3101-#define AOFF_task_policy 0x000000a0
3102+#define AOFF_task_policy 0x000000a4
3103 #define ASIZ_task_policy 0x00000004
3104-#define AOFF_task_rt_priority 0x000000a4
3105+#define AOFF_task_rt_priority 0x000000a8
3106 #define ASIZ_task_rt_priority 0x00000004
3107-#define AOFF_task_it_real_value 0x000000a8
3108+#define AOFF_task_it_real_value 0x000000ac
3109 #define ASIZ_task_it_real_value 0x00000004
3110-#define AOFF_task_it_prof_value 0x000000ac
3111+#define AOFF_task_it_prof_value 0x000000b0
3112 #define ASIZ_task_it_prof_value 0x00000004
3113-#define AOFF_task_it_virt_value 0x000000b0
3114+#define AOFF_task_it_virt_value 0x000000b4
3115 #define ASIZ_task_it_virt_value 0x00000004
3116-#define AOFF_task_it_real_incr 0x000000b4
3117+#define AOFF_task_it_real_incr 0x000000b8
3118 #define ASIZ_task_it_real_incr 0x00000004
3119-#define AOFF_task_it_prof_incr 0x000000b8
3120+#define AOFF_task_it_prof_incr 0x000000bc
3121 #define ASIZ_task_it_prof_incr 0x00000004
3122-#define AOFF_task_it_virt_incr 0x000000bc
3123+#define AOFF_task_it_virt_incr 0x000000c0
3124 #define ASIZ_task_it_virt_incr 0x00000004
3125-#define AOFF_task_real_timer 0x000000c0
3126+#define AOFF_task_real_timer 0x000000c4
3127 #define ASIZ_task_real_timer 0x00000014
3128-#define AOFF_task_times 0x000000d4
3129+#define AOFF_task_times 0x000000d8
3130 #define ASIZ_task_times 0x00000010
3131-#define AOFF_task_start_time 0x000000e4
3132+#define AOFF_task_start_time 0x000000e8
3133 #define ASIZ_task_start_time 0x00000004
3134-#define AOFF_task_per_cpu_utime 0x000000e8
3135+#define AOFF_task_per_cpu_utime 0x000000ec
3136 #define ASIZ_task_per_cpu_utime 0x00000004
3137-#define AOFF_task_min_flt 0x000000f0
3138+#define AOFF_task_min_flt 0x000000f4
3139 #define ASIZ_task_min_flt 0x00000004
3140-#define AOFF_task_maj_flt 0x000000f4
3141+#define AOFF_task_maj_flt 0x000000f8
3142 #define ASIZ_task_maj_flt 0x00000004
3143-#define AOFF_task_nswap 0x000000f8
3144+#define AOFF_task_nswap 0x000000fc
3145 #define ASIZ_task_nswap 0x00000004
3146-#define AOFF_task_cmin_flt 0x000000fc
3147+#define AOFF_task_cmin_flt 0x00000100
3148 #define ASIZ_task_cmin_flt 0x00000004
3149-#define AOFF_task_cmaj_flt 0x00000100
3150+#define AOFF_task_cmaj_flt 0x00000104
3151 #define ASIZ_task_cmaj_flt 0x00000004
3152-#define AOFF_task_cnswap 0x00000104
3153+#define AOFF_task_cnswap 0x00000108
3154 #define ASIZ_task_cnswap 0x00000004
3155-#define AOFF_task_uid 0x0000010a
3156+#define AOFF_task_uid 0x0000010e
3157 #define ASIZ_task_uid 0x00000002
3158-#define AOFF_task_euid 0x0000010c
3159+#define AOFF_task_euid 0x00000110
3160 #define ASIZ_task_euid 0x00000002
3161-#define AOFF_task_suid 0x0000010e
3162+#define AOFF_task_suid 0x00000112
3163 #define ASIZ_task_suid 0x00000002
3164-#define AOFF_task_fsuid 0x00000110
3165+#define AOFF_task_fsuid 0x00000114
3166 #define ASIZ_task_fsuid 0x00000002
3167-#define AOFF_task_gid 0x00000112
3168+#define AOFF_task_gid 0x00000116
3169 #define ASIZ_task_gid 0x00000002
3170-#define AOFF_task_egid 0x00000114
3171+#define AOFF_task_egid 0x00000118
3172 #define ASIZ_task_egid 0x00000002
3173-#define AOFF_task_sgid 0x00000116
3174+#define AOFF_task_sgid 0x0000011a
3175 #define ASIZ_task_sgid 0x00000002
3176-#define AOFF_task_fsgid 0x00000118
3177+#define AOFF_task_fsgid 0x0000011c
3178 #define ASIZ_task_fsgid 0x00000002
3179-#define AOFF_task_ngroups 0x0000011c
3180+#define AOFF_task_ngroups 0x00000120
3181 #define ASIZ_task_ngroups 0x00000004
3182-#define AOFF_task_groups 0x00000120
3183+#define AOFF_task_groups 0x00000124
3184 #define ASIZ_task_groups 0x00000040
3185-#define AOFF_task_cap_effective 0x00000160
3186+#define AOFF_task_cap_effective 0x00000164
3187 #define ASIZ_task_cap_effective 0x00000004
3188-#define AOFF_task_cap_inheritable 0x00000164
3189+#define AOFF_task_cap_inheritable 0x00000168
3190 #define ASIZ_task_cap_inheritable 0x00000004
3191-#define AOFF_task_cap_permitted 0x00000168
3192+#define AOFF_task_cap_permitted 0x0000016c
3193 #define ASIZ_task_cap_permitted 0x00000004
3194-#define AOFF_task_user 0x00000170
3195+#define AOFF_task_user 0x00000174
3196 #define ASIZ_task_user 0x00000004
3197-#define AOFF_task_rlim 0x00000174
3198+#define AOFF_task_rlim 0x00000178
3199 #define ASIZ_task_rlim 0x00000050
3200-#define AOFF_task_used_math 0x000001c4
3201+#define AOFF_task_used_math 0x000001c8
3202 #define ASIZ_task_used_math 0x00000002
3203-#define AOFF_task_comm 0x000001c6
3204+#define AOFF_task_comm 0x000001ca
3205 #define ASIZ_task_comm 0x00000010
3206-#define AOFF_task_link_count 0x000001d8
3207+#define AOFF_task_link_count 0x000001dc
3208 #define ASIZ_task_link_count 0x00000004
3209-#define AOFF_task_tty 0x000001dc
3210+#define AOFF_task_tty 0x000001e0
3211 #define ASIZ_task_tty 0x00000004
3212-#define AOFF_task_semundo 0x000001e0
3213+#define AOFF_task_semundo 0x000001e4
3214 #define ASIZ_task_semundo 0x00000004
3215-#define AOFF_task_semsleeping 0x000001e4
3216+#define AOFF_task_semsleeping 0x000001e8
3217 #define ASIZ_task_semsleeping 0x00000004
3218-#define AOFF_task_tss 0x000001e8
3219+#define AOFF_task_tss 0x000001f0
3220 #define ASIZ_task_tss 0x00000388
3221-#define AOFF_task_fs 0x00000570
3222+#define AOFF_task_fs 0x00000578
3223 #define ASIZ_task_fs 0x00000004
3224-#define AOFF_task_files 0x00000574
3225+#define AOFF_task_files 0x0000057c
3226 #define ASIZ_task_files 0x00000004
3227-#define AOFF_task_mm 0x00000578
3228+#define AOFF_task_mm 0x00000580
3229 #define ASIZ_task_mm 0x00000004
3230-#define AOFF_task_local_pages 0x0000057c
3231+#define AOFF_task_local_pages 0x00000584
3232 #define ASIZ_task_local_pages 0x00000008
3233-#define AOFF_task_allocation_order 0x00000584
3234+#define AOFF_task_allocation_order 0x0000058c
3235 #define ASIZ_task_allocation_order 0x00000004
3236-#define AOFF_task_nr_local_pages 0x00000588
3237+#define AOFF_task_nr_local_pages 0x00000590
3238 #define ASIZ_task_nr_local_pages 0x00000004
3239-#define AOFF_task_fs_locks 0x0000058c
3240+#define AOFF_task_fs_locks 0x00000594
3241 #define ASIZ_task_fs_locks 0x00000004
3242-#define AOFF_task_sigmask_lock 0x00000590
3243+#define AOFF_task_sigmask_lock 0x00000598
3244 #define ASIZ_task_sigmask_lock 0x00000001
3245-#define AOFF_task_sig 0x00000594
3246+#define AOFF_task_sig 0x0000059c
3247 #define ASIZ_task_sig 0x00000004
3248-#define AOFF_task_signal 0x00000598
3249+#define AOFF_task_signal 0x000005a0
3250 #define ASIZ_task_signal 0x00000008
3251-#define AOFF_task_blocked 0x000005a0
3252+#define AOFF_task_blocked 0x000005a8
3253 #define ASIZ_task_blocked 0x00000008
3254-#define AOFF_task_sigqueue 0x000005a8
3255+#define AOFF_task_sigqueue 0x000005b0
3256 #define ASIZ_task_sigqueue 0x00000004
3257-#define AOFF_task_sigqueue_tail 0x000005ac
3258+#define AOFF_task_sigqueue_tail 0x000005b4
3259 #define ASIZ_task_sigqueue_tail 0x00000004
3260-#define AOFF_task_sas_ss_sp 0x000005b0
3261+#define AOFF_task_sas_ss_sp 0x000005b8
3262 #define ASIZ_task_sas_ss_sp 0x00000004
3263-#define AOFF_task_sas_ss_size 0x000005b4
3264+#define AOFF_task_sas_ss_size 0x000005bc
3265 #define ASIZ_task_sas_ss_size 0x00000004
3266-#define AOFF_task_parent_exec_id 0x000005b8
3267+#define AOFF_task_parent_exec_id 0x000005c0
3268 #define ASIZ_task_parent_exec_id 0x00000004
3269-#define AOFF_task_self_exec_id 0x000005bc
3270+#define AOFF_task_self_exec_id 0x000005c4
3271 #define ASIZ_task_self_exec_id 0x00000004
3272-#define AOFF_task_oom_kill_try 0x000005c0
3273+#define AOFF_task_oom_kill_try 0x000005c8
3274 #define ASIZ_task_oom_kill_try 0x00000004
3275 #define AOFF_mm_mmap 0x00000000
3276 #define ASIZ_mm_mmap 0x00000004
3277@@ -319,179 +321,181 @@
3278 #define ASIZ_task_priority 0x00000004
3279 #define AOFF_task_avg_slice 0x00000024
3280 #define ASIZ_task_avg_slice 0x00000004
3281-#define AOFF_task_has_cpu 0x00000028
3282+#define AOFF_task_counter_refresh 0x00000028
3283+#define ASIZ_task_counter_refresh 0x00000004
3284+#define AOFF_task_has_cpu 0x0000002c
3285 #define ASIZ_task_has_cpu 0x00000004
3286-#define AOFF_task_processor 0x0000002c
3287+#define AOFF_task_processor 0x00000030
3288 #define ASIZ_task_processor 0x00000004
3289-#define AOFF_task_last_processor 0x00000030
3290+#define AOFF_task_last_processor 0x00000034
3291 #define ASIZ_task_last_processor 0x00000004
3292-#define AOFF_task_lock_depth 0x00000034
3293+#define AOFF_task_lock_depth 0x00000038
3294 #define ASIZ_task_lock_depth 0x00000004
3295-#define AOFF_task_next_task 0x00000038
3296+#define AOFF_task_next_task 0x0000003c
3297 #define ASIZ_task_next_task 0x00000004
3298-#define AOFF_task_prev_task 0x0000003c
3299+#define AOFF_task_prev_task 0x00000040
3300 #define ASIZ_task_prev_task 0x00000004
3301-#define AOFF_task_next_run 0x00000040
3302+#define AOFF_task_next_run 0x00000044
3303 #define ASIZ_task_next_run 0x00000004
3304-#define AOFF_task_prev_run 0x00000044
3305+#define AOFF_task_prev_run 0x00000048
3306 #define ASIZ_task_prev_run 0x00000004
3307-#define AOFF_task_task_exclusive 0x00000048
3308+#define AOFF_task_task_exclusive 0x0000004c
3309 #define ASIZ_task_task_exclusive 0x00000004
3310-#define AOFF_task_binfmt 0x0000004c
3311+#define AOFF_task_binfmt 0x00000050
3312 #define ASIZ_task_binfmt 0x00000004
3313-#define AOFF_task_exit_code 0x00000050
3314+#define AOFF_task_exit_code 0x00000054
3315 #define ASIZ_task_exit_code 0x00000004
3316-#define AOFF_task_exit_signal 0x00000054
3317+#define AOFF_task_exit_signal 0x00000058
3318 #define ASIZ_task_exit_signal 0x00000004
3319-#define AOFF_task_pdeath_signal 0x00000058
3320+#define AOFF_task_pdeath_signal 0x0000005c
3321 #define ASIZ_task_pdeath_signal 0x00000004
3322-#define AOFF_task_personality 0x0000005c
3323+#define AOFF_task_personality 0x00000060
3324 #define ASIZ_task_personality 0x00000004
3325-#define AOFF_task_pid 0x00000064
3326+#define AOFF_task_pid 0x00000068
3327 #define ASIZ_task_pid 0x00000004
3328-#define AOFF_task_pgrp 0x00000068
3329+#define AOFF_task_pgrp 0x0000006c
3330 #define ASIZ_task_pgrp 0x00000004
3331-#define AOFF_task_tty_old_pgrp 0x0000006c
3332+#define AOFF_task_tty_old_pgrp 0x00000070
3333 #define ASIZ_task_tty_old_pgrp 0x00000004
3334-#define AOFF_task_session 0x00000070
3335+#define AOFF_task_session 0x00000074
3336 #define ASIZ_task_session 0x00000004
3337-#define AOFF_task_leader 0x00000074
3338+#define AOFF_task_leader 0x00000078
3339 #define ASIZ_task_leader 0x00000004
3340-#define AOFF_task_p_opptr 0x00000078
3341+#define AOFF_task_p_opptr 0x0000007c
3342 #define ASIZ_task_p_opptr 0x00000004
3343-#define AOFF_task_p_pptr 0x0000007c
3344+#define AOFF_task_p_pptr 0x00000080
3345 #define ASIZ_task_p_pptr 0x00000004
3346-#define AOFF_task_p_cptr 0x00000080
3347+#define AOFF_task_p_cptr 0x00000084
3348 #define ASIZ_task_p_cptr 0x00000004
3349-#define AOFF_task_p_ysptr 0x00000084
3350+#define AOFF_task_p_ysptr 0x00000088
3351 #define ASIZ_task_p_ysptr 0x00000004
3352-#define AOFF_task_p_osptr 0x00000088
3353+#define AOFF_task_p_osptr 0x0000008c
3354 #define ASIZ_task_p_osptr 0x00000004
3355-#define AOFF_task_pidhash_next 0x0000008c
3356+#define AOFF_task_pidhash_next 0x00000090
3357 #define ASIZ_task_pidhash_next 0x00000004
3358-#define AOFF_task_pidhash_pprev 0x00000090
3359+#define AOFF_task_pidhash_pprev 0x00000094
3360 #define ASIZ_task_pidhash_pprev 0x00000004
3361-#define AOFF_task_tarray_ptr 0x00000094
3362+#define AOFF_task_tarray_ptr 0x00000098
3363 #define ASIZ_task_tarray_ptr 0x00000004
3364-#define AOFF_task_wait_chldexit 0x00000098
3365+#define AOFF_task_wait_chldexit 0x0000009c
3366 #define ASIZ_task_wait_chldexit 0x00000004
3367-#define AOFF_task_vfork_sem 0x0000009c
3368+#define AOFF_task_vfork_sem 0x000000a0
3369 #define ASIZ_task_vfork_sem 0x00000004
3370-#define AOFF_task_policy 0x000000a0
3371+#define AOFF_task_policy 0x000000a4
3372 #define ASIZ_task_policy 0x00000004
3373-#define AOFF_task_rt_priority 0x000000a4
3374+#define AOFF_task_rt_priority 0x000000a8
3375 #define ASIZ_task_rt_priority 0x00000004
3376-#define AOFF_task_it_real_value 0x000000a8
3377+#define AOFF_task_it_real_value 0x000000ac
3378 #define ASIZ_task_it_real_value 0x00000004
3379-#define AOFF_task_it_prof_value 0x000000ac
3380+#define AOFF_task_it_prof_value 0x000000b0
3381 #define ASIZ_task_it_prof_value 0x00000004
3382-#define AOFF_task_it_virt_value 0x000000b0
3383+#define AOFF_task_it_virt_value 0x000000b4
3384 #define ASIZ_task_it_virt_value 0x00000004
3385-#define AOFF_task_it_real_incr 0x000000b4
3386+#define AOFF_task_it_real_incr 0x000000b8
3387 #define ASIZ_task_it_real_incr 0x00000004
3388-#define AOFF_task_it_prof_incr 0x000000b8
3389+#define AOFF_task_it_prof_incr 0x000000bc
3390 #define ASIZ_task_it_prof_incr 0x00000004
3391-#define AOFF_task_it_virt_incr 0x000000bc
3392+#define AOFF_task_it_virt_incr 0x000000c0
3393 #define ASIZ_task_it_virt_incr 0x00000004
3394-#define AOFF_task_real_timer 0x000000c0
3395+#define AOFF_task_real_timer 0x000000c4
3396 #define ASIZ_task_real_timer 0x00000014
3397-#define AOFF_task_times 0x000000d4
3398+#define AOFF_task_times 0x000000d8
3399 #define ASIZ_task_times 0x00000010
3400-#define AOFF_task_start_time 0x000000e4
3401+#define AOFF_task_start_time 0x000000e8
3402 #define ASIZ_task_start_time 0x00000004
3403-#define AOFF_task_per_cpu_utime 0x000000e8
3404+#define AOFF_task_per_cpu_utime 0x000000ec
3405 #define ASIZ_task_per_cpu_utime 0x00000080
3406-#define AOFF_task_min_flt 0x000001e8
3407+#define AOFF_task_min_flt 0x000001ec
3408 #define ASIZ_task_min_flt 0x00000004
3409-#define AOFF_task_maj_flt 0x000001ec
3410+#define AOFF_task_maj_flt 0x000001f0
3411 #define ASIZ_task_maj_flt 0x00000004
3412-#define AOFF_task_nswap 0x000001f0
3413+#define AOFF_task_nswap 0x000001f4
3414 #define ASIZ_task_nswap 0x00000004
3415-#define AOFF_task_cmin_flt 0x000001f4
3416+#define AOFF_task_cmin_flt 0x000001f8
3417 #define ASIZ_task_cmin_flt 0x00000004
3418-#define AOFF_task_cmaj_flt 0x000001f8
3419+#define AOFF_task_cmaj_flt 0x000001fc
3420 #define ASIZ_task_cmaj_flt 0x00000004
3421-#define AOFF_task_cnswap 0x000001fc
3422+#define AOFF_task_cnswap 0x00000200
3423 #define ASIZ_task_cnswap 0x00000004
3424-#define AOFF_task_uid 0x00000202
3425+#define AOFF_task_uid 0x00000206
3426 #define ASIZ_task_uid 0x00000002
3427-#define AOFF_task_euid 0x00000204
3428+#define AOFF_task_euid 0x00000208
3429 #define ASIZ_task_euid 0x00000002
3430-#define AOFF_task_suid 0x00000206
3431+#define AOFF_task_suid 0x0000020a
3432 #define ASIZ_task_suid 0x00000002
3433-#define AOFF_task_fsuid 0x00000208
3434+#define AOFF_task_fsuid 0x0000020c
3435 #define ASIZ_task_fsuid 0x00000002
3436-#define AOFF_task_gid 0x0000020a
3437+#define AOFF_task_gid 0x0000020e
3438 #define ASIZ_task_gid 0x00000002
3439-#define AOFF_task_egid 0x0000020c
3440+#define AOFF_task_egid 0x00000210
3441 #define ASIZ_task_egid 0x00000002
3442-#define AOFF_task_sgid 0x0000020e
3443+#define AOFF_task_sgid 0x00000212
3444 #define ASIZ_task_sgid 0x00000002
3445-#define AOFF_task_fsgid 0x00000210
3446+#define AOFF_task_fsgid 0x00000214
3447 #define ASIZ_task_fsgid 0x00000002
3448-#define AOFF_task_ngroups 0x00000214
3449+#define AOFF_task_ngroups 0x00000218
3450 #define ASIZ_task_ngroups 0x00000004
3451-#define AOFF_task_groups 0x00000218
3452+#define AOFF_task_groups 0x0000021c
3453 #define ASIZ_task_groups 0x00000040
3454-#define AOFF_task_cap_effective 0x00000258
3455+#define AOFF_task_cap_effective 0x0000025c
3456 #define ASIZ_task_cap_effective 0x00000004
3457-#define AOFF_task_cap_inheritable 0x0000025c
3458+#define AOFF_task_cap_inheritable 0x00000260
3459 #define ASIZ_task_cap_inheritable 0x00000004
3460-#define AOFF_task_cap_permitted 0x00000260
3461+#define AOFF_task_cap_permitted 0x00000264
3462 #define ASIZ_task_cap_permitted 0x00000004
3463-#define AOFF_task_user 0x00000268
3464+#define AOFF_task_user 0x0000026c
3465 #define ASIZ_task_user 0x00000004
3466-#define AOFF_task_rlim 0x0000026c
3467+#define AOFF_task_rlim 0x00000270
3468 #define ASIZ_task_rlim 0x00000050
3469-#define AOFF_task_used_math 0x000002bc
3470+#define AOFF_task_used_math 0x000002c0
3471 #define ASIZ_task_used_math 0x00000002
3472-#define AOFF_task_comm 0x000002be
3473+#define AOFF_task_comm 0x000002c2
3474 #define ASIZ_task_comm 0x00000010
3475-#define AOFF_task_link_count 0x000002d0
3476+#define AOFF_task_link_count 0x000002d4
3477 #define ASIZ_task_link_count 0x00000004
3478-#define AOFF_task_tty 0x000002d4
3479+#define AOFF_task_tty 0x000002d8
3480 #define ASIZ_task_tty 0x00000004
3481-#define AOFF_task_semundo 0x000002d8
3482+#define AOFF_task_semundo 0x000002dc
3483 #define ASIZ_task_semundo 0x00000004
3484-#define AOFF_task_semsleeping 0x000002dc
3485+#define AOFF_task_semsleeping 0x000002e0
3486 #define ASIZ_task_semsleeping 0x00000004
3487-#define AOFF_task_tss 0x000002e0
3488+#define AOFF_task_tss 0x000002e8
3489 #define ASIZ_task_tss 0x00000388
3490-#define AOFF_task_fs 0x00000668
3491+#define AOFF_task_fs 0x00000670
3492 #define ASIZ_task_fs 0x00000004
3493-#define AOFF_task_files 0x0000066c
3494+#define AOFF_task_files 0x00000674
3495 #define ASIZ_task_files 0x00000004
3496-#define AOFF_task_mm 0x00000670
3497+#define AOFF_task_mm 0x00000678
3498 #define ASIZ_task_mm 0x00000004
3499-#define AOFF_task_local_pages 0x00000674
3500+#define AOFF_task_local_pages 0x0000067c
3501 #define ASIZ_task_local_pages 0x00000008
3502-#define AOFF_task_allocation_order 0x0000067c
3503+#define AOFF_task_allocation_order 0x00000684
3504 #define ASIZ_task_allocation_order 0x00000004
3505-#define AOFF_task_nr_local_pages 0x00000680
3506+#define AOFF_task_nr_local_pages 0x00000688
3507 #define ASIZ_task_nr_local_pages 0x00000004
3508-#define AOFF_task_fs_locks 0x00000684
3509+#define AOFF_task_fs_locks 0x0000068c
3510 #define ASIZ_task_fs_locks 0x00000004
3511-#define AOFF_task_sigmask_lock 0x00000688
3512+#define AOFF_task_sigmask_lock 0x00000690
3513 #define ASIZ_task_sigmask_lock 0x00000001
3514-#define AOFF_task_sig 0x0000068c
3515+#define AOFF_task_sig 0x00000694
3516 #define ASIZ_task_sig 0x00000004
3517-#define AOFF_task_signal 0x00000690
3518+#define AOFF_task_signal 0x00000698
3519 #define ASIZ_task_signal 0x00000008
3520-#define AOFF_task_blocked 0x00000698
3521+#define AOFF_task_blocked 0x000006a0
3522 #define ASIZ_task_blocked 0x00000008
3523-#define AOFF_task_sigqueue 0x000006a0
3524+#define AOFF_task_sigqueue 0x000006a8
3525 #define ASIZ_task_sigqueue 0x00000004
3526-#define AOFF_task_sigqueue_tail 0x000006a4
3527+#define AOFF_task_sigqueue_tail 0x000006ac
3528 #define ASIZ_task_sigqueue_tail 0x00000004
3529-#define AOFF_task_sas_ss_sp 0x000006a8
3530+#define AOFF_task_sas_ss_sp 0x000006b0
3531 #define ASIZ_task_sas_ss_sp 0x00000004
3532-#define AOFF_task_sas_ss_size 0x000006ac
3533+#define AOFF_task_sas_ss_size 0x000006b4
3534 #define ASIZ_task_sas_ss_size 0x00000004
3535-#define AOFF_task_parent_exec_id 0x000006b0
3536+#define AOFF_task_parent_exec_id 0x000006b8
3537 #define ASIZ_task_parent_exec_id 0x00000004
3538-#define AOFF_task_self_exec_id 0x000006b4
3539+#define AOFF_task_self_exec_id 0x000006bc
3540 #define ASIZ_task_self_exec_id 0x00000004
3541-#define AOFF_task_oom_kill_try 0x000006b8
3542+#define AOFF_task_oom_kill_try 0x000006c0
3543 #define ASIZ_task_oom_kill_try 0x00000004
3544 #define AOFF_mm_mmap 0x00000000
3545 #define ASIZ_mm_mmap 0x00000004
3546diff -urN linux.orig/include/asm-sparc/poll.h linux/include/asm-sparc/poll.h
3547--- linux.orig/include/asm-sparc/poll.h Sun Mar 25 18:31:07 2001
3548+++ linux/include/asm-sparc/poll.h Wed Aug 7 17:45:23 2002
3549@@ -11,6 +11,7 @@
3550 #define POLLWRNORM POLLOUT
3551 #define POLLRDBAND 128
3552 #define POLLWRBAND 256
3553+#define POLLMSG 512
3554
3555 struct pollfd {
3556 int fd;
3557diff -urN linux.orig/include/asm-sparc64/asm_offsets.h linux/include/asm-sparc64/asm_offsets.h
3558--- linux.orig/include/asm-sparc64/asm_offsets.h Fri Nov 2 17:39:08 2001
3559+++ linux/include/asm-sparc64/asm_offsets.h Wed Aug 7 17:55:29 2002
3560@@ -26,181 +26,183 @@
3561 #define ASIZ_task_priority 0x00000008
3562 #define AOFF_task_avg_slice 0x00000048
3563 #define ASIZ_task_avg_slice 0x00000008
3564-#define AOFF_task_has_cpu 0x00000050
3565+#define AOFF_task_counter_refresh 0x00000050
3566+#define ASIZ_task_counter_refresh 0x00000004
3567+#define AOFF_task_has_cpu 0x00000054
3568 #define ASIZ_task_has_cpu 0x00000004
3569-#define AOFF_task_processor 0x00000054
3570+#define AOFF_task_processor 0x00000058
3571 #define ASIZ_task_processor 0x00000004
3572-#define AOFF_task_last_processor 0x00000058
3573+#define AOFF_task_last_processor 0x0000005c
3574 #define ASIZ_task_last_processor 0x00000004
3575-#define AOFF_task_lock_depth 0x0000005c
3576+#define AOFF_task_lock_depth 0x00000060
3577 #define ASIZ_task_lock_depth 0x00000004
3578-#define AOFF_task_next_task 0x00000060
3579+#define AOFF_task_next_task 0x00000068
3580 #define ASIZ_task_next_task 0x00000008
3581-#define AOFF_task_prev_task 0x00000068
3582+#define AOFF_task_prev_task 0x00000070
3583 #define ASIZ_task_prev_task 0x00000008
3584-#define AOFF_task_next_run 0x00000070
3585+#define AOFF_task_next_run 0x00000078
3586 #define ASIZ_task_next_run 0x00000008
3587-#define AOFF_task_prev_run 0x00000078
3588+#define AOFF_task_prev_run 0x00000080
3589 #define ASIZ_task_prev_run 0x00000008
3590-#define AOFF_task_task_exclusive 0x00000080
3591+#define AOFF_task_task_exclusive 0x00000088
3592 #define ASIZ_task_task_exclusive 0x00000004
3593-#define AOFF_task_binfmt 0x00000088
3594+#define AOFF_task_binfmt 0x00000090
3595 #define ASIZ_task_binfmt 0x00000008
3596-#define AOFF_task_exit_code 0x00000090
3597+#define AOFF_task_exit_code 0x00000098
3598 #define ASIZ_task_exit_code 0x00000004
3599-#define AOFF_task_exit_signal 0x00000094
3600+#define AOFF_task_exit_signal 0x0000009c
3601 #define ASIZ_task_exit_signal 0x00000004
3602-#define AOFF_task_pdeath_signal 0x00000098
3603+#define AOFF_task_pdeath_signal 0x000000a0
3604 #define ASIZ_task_pdeath_signal 0x00000004
3605-#define AOFF_task_personality 0x000000a0
3606+#define AOFF_task_personality 0x000000a8
3607 #define ASIZ_task_personality 0x00000008
3608-#define AOFF_task_pid 0x000000ac
3609+#define AOFF_task_pid 0x000000b4
3610 #define ASIZ_task_pid 0x00000004
3611-#define AOFF_task_pgrp 0x000000b0
3612+#define AOFF_task_pgrp 0x000000b8
3613 #define ASIZ_task_pgrp 0x00000004
3614-#define AOFF_task_tty_old_pgrp 0x000000b4
3615+#define AOFF_task_tty_old_pgrp 0x000000bc
3616 #define ASIZ_task_tty_old_pgrp 0x00000004
3617-#define AOFF_task_session 0x000000b8
3618+#define AOFF_task_session 0x000000c0
3619 #define ASIZ_task_session 0x00000004
3620-#define AOFF_task_leader 0x000000bc
3621+#define AOFF_task_leader 0x000000c4
3622 #define ASIZ_task_leader 0x00000004
3623-#define AOFF_task_p_opptr 0x000000c0
3624+#define AOFF_task_p_opptr 0x000000c8
3625 #define ASIZ_task_p_opptr 0x00000008
3626-#define AOFF_task_p_pptr 0x000000c8
3627+#define AOFF_task_p_pptr 0x000000d0
3628 #define ASIZ_task_p_pptr 0x00000008
3629-#define AOFF_task_p_cptr 0x000000d0
3630+#define AOFF_task_p_cptr 0x000000d8
3631 #define ASIZ_task_p_cptr 0x00000008
3632-#define AOFF_task_p_ysptr 0x000000d8
3633+#define AOFF_task_p_ysptr 0x000000e0
3634 #define ASIZ_task_p_ysptr 0x00000008
3635-#define AOFF_task_p_osptr 0x000000e0
3636+#define AOFF_task_p_osptr 0x000000e8
3637 #define ASIZ_task_p_osptr 0x00000008
3638-#define AOFF_task_pidhash_next 0x000000e8
3639+#define AOFF_task_pidhash_next 0x000000f0
3640 #define ASIZ_task_pidhash_next 0x00000008
3641-#define AOFF_task_pidhash_pprev 0x000000f0
3642+#define AOFF_task_pidhash_pprev 0x000000f8
3643 #define ASIZ_task_pidhash_pprev 0x00000008
3644-#define AOFF_task_tarray_ptr 0x000000f8
3645+#define AOFF_task_tarray_ptr 0x00000100
3646 #define ASIZ_task_tarray_ptr 0x00000008
3647-#define AOFF_task_wait_chldexit 0x00000100
3648+#define AOFF_task_wait_chldexit 0x00000108
3649 #define ASIZ_task_wait_chldexit 0x00000008
3650-#define AOFF_task_vfork_sem 0x00000108
3651+#define AOFF_task_vfork_sem 0x00000110
3652 #define ASIZ_task_vfork_sem 0x00000008
3653-#define AOFF_task_policy 0x00000110
3654+#define AOFF_task_policy 0x00000118
3655 #define ASIZ_task_policy 0x00000008
3656-#define AOFF_task_rt_priority 0x00000118
3657+#define AOFF_task_rt_priority 0x00000120
3658 #define ASIZ_task_rt_priority 0x00000008
3659-#define AOFF_task_it_real_value 0x00000120
3660+#define AOFF_task_it_real_value 0x00000128
3661 #define ASIZ_task_it_real_value 0x00000008
3662-#define AOFF_task_it_prof_value 0x00000128
3663+#define AOFF_task_it_prof_value 0x00000130
3664 #define ASIZ_task_it_prof_value 0x00000008
3665-#define AOFF_task_it_virt_value 0x00000130
3666+#define AOFF_task_it_virt_value 0x00000138
3667 #define ASIZ_task_it_virt_value 0x00000008
3668-#define AOFF_task_it_real_incr 0x00000138
3669+#define AOFF_task_it_real_incr 0x00000140
3670 #define ASIZ_task_it_real_incr 0x00000008
3671-#define AOFF_task_it_prof_incr 0x00000140
3672+#define AOFF_task_it_prof_incr 0x00000148
3673 #define ASIZ_task_it_prof_incr 0x00000008
3674-#define AOFF_task_it_virt_incr 0x00000148
3675+#define AOFF_task_it_virt_incr 0x00000150
3676 #define ASIZ_task_it_virt_incr 0x00000008
3677-#define AOFF_task_real_timer 0x00000150
3678+#define AOFF_task_real_timer 0x00000158
3679 #define ASIZ_task_real_timer 0x00000028
3680-#define AOFF_task_times 0x00000178
3681+#define AOFF_task_times 0x00000180
3682 #define ASIZ_task_times 0x00000020
3683-#define AOFF_task_start_time 0x00000198
3684+#define AOFF_task_start_time 0x000001a0
3685 #define ASIZ_task_start_time 0x00000008
3686-#define AOFF_task_per_cpu_utime 0x000001a0
3687+#define AOFF_task_per_cpu_utime 0x000001a8
3688 #define ASIZ_task_per_cpu_utime 0x00000008
3689-#define AOFF_task_min_flt 0x000001b0
3690+#define AOFF_task_min_flt 0x000001b8
3691 #define ASIZ_task_min_flt 0x00000008
3692-#define AOFF_task_maj_flt 0x000001b8
3693+#define AOFF_task_maj_flt 0x000001c0
3694 #define ASIZ_task_maj_flt 0x00000008
3695-#define AOFF_task_nswap 0x000001c0
3696+#define AOFF_task_nswap 0x000001c8
3697 #define ASIZ_task_nswap 0x00000008
3698-#define AOFF_task_cmin_flt 0x000001c8
3699+#define AOFF_task_cmin_flt 0x000001d0
3700 #define ASIZ_task_cmin_flt 0x00000008
3701-#define AOFF_task_cmaj_flt 0x000001d0
3702+#define AOFF_task_cmaj_flt 0x000001d8
3703 #define ASIZ_task_cmaj_flt 0x00000008
3704-#define AOFF_task_cnswap 0x000001d8
3705+#define AOFF_task_cnswap 0x000001e0
3706 #define ASIZ_task_cnswap 0x00000008
3707-#define AOFF_task_uid 0x000001e4
3708+#define AOFF_task_uid 0x000001ec
3709 #define ASIZ_task_uid 0x00000004
3710-#define AOFF_task_euid 0x000001e8
3711+#define AOFF_task_euid 0x000001f0
3712 #define ASIZ_task_euid 0x00000004
3713-#define AOFF_task_suid 0x000001ec
3714+#define AOFF_task_suid 0x000001f4
3715 #define ASIZ_task_suid 0x00000004
3716-#define AOFF_task_fsuid 0x000001f0
3717+#define AOFF_task_fsuid 0x000001f8
3718 #define ASIZ_task_fsuid 0x00000004
3719-#define AOFF_task_gid 0x000001f4
3720+#define AOFF_task_gid 0x000001fc
3721 #define ASIZ_task_gid 0x00000004
3722-#define AOFF_task_egid 0x000001f8
3723+#define AOFF_task_egid 0x00000200
3724 #define ASIZ_task_egid 0x00000004
3725-#define AOFF_task_sgid 0x000001fc
3726+#define AOFF_task_sgid 0x00000204
3727 #define ASIZ_task_sgid 0x00000004
3728-#define AOFF_task_fsgid 0x00000200
3729+#define AOFF_task_fsgid 0x00000208
3730 #define ASIZ_task_fsgid 0x00000004
3731-#define AOFF_task_ngroups 0x00000204
3732+#define AOFF_task_ngroups 0x0000020c
3733 #define ASIZ_task_ngroups 0x00000004
3734-#define AOFF_task_groups 0x00000208
3735+#define AOFF_task_groups 0x00000210
3736 #define ASIZ_task_groups 0x00000080
3737-#define AOFF_task_cap_effective 0x00000288
3738+#define AOFF_task_cap_effective 0x00000290
3739 #define ASIZ_task_cap_effective 0x00000004
3740-#define AOFF_task_cap_inheritable 0x0000028c
3741+#define AOFF_task_cap_inheritable 0x00000294
3742 #define ASIZ_task_cap_inheritable 0x00000004
3743-#define AOFF_task_cap_permitted 0x00000290
3744+#define AOFF_task_cap_permitted 0x00000298
3745 #define ASIZ_task_cap_permitted 0x00000004
3746-#define AOFF_task_user 0x00000298
3747+#define AOFF_task_user 0x000002a0
3748 #define ASIZ_task_user 0x00000008
3749-#define AOFF_task_rlim 0x000002a0
3750+#define AOFF_task_rlim 0x000002a8
3751 #define ASIZ_task_rlim 0x000000a0
3752-#define AOFF_task_used_math 0x00000340
3753+#define AOFF_task_used_math 0x00000348
3754 #define ASIZ_task_used_math 0x00000002
3755-#define AOFF_task_comm 0x00000342
3756+#define AOFF_task_comm 0x0000034a
3757 #define ASIZ_task_comm 0x00000010
3758-#define AOFF_task_link_count 0x00000354
3759+#define AOFF_task_link_count 0x0000035c
3760 #define ASIZ_task_link_count 0x00000004
3761-#define AOFF_task_tty 0x00000358
3762+#define AOFF_task_tty 0x00000360
3763 #define ASIZ_task_tty 0x00000008
3764-#define AOFF_task_semundo 0x00000360
3765+#define AOFF_task_semundo 0x00000368
3766 #define ASIZ_task_semundo 0x00000008
3767-#define AOFF_task_semsleeping 0x00000368
3768+#define AOFF_task_semsleeping 0x00000370
3769 #define ASIZ_task_semsleeping 0x00000008
3770-#define AOFF_task_tss 0x00000370
3771+#define AOFF_task_tss 0x00000380
3772 #define ASIZ_task_tss 0x00000470
3773-#define AOFF_task_fs 0x000007e0
3774+#define AOFF_task_fs 0x000007f0
3775 #define ASIZ_task_fs 0x00000008
3776-#define AOFF_task_files 0x000007e8
3777+#define AOFF_task_files 0x000007f8
3778 #define ASIZ_task_files 0x00000008
3779-#define AOFF_task_mm 0x000007f0
3780+#define AOFF_task_mm 0x00000800
3781 #define ASIZ_task_mm 0x00000008
3782-#define AOFF_task_local_pages 0x000007f8
3783+#define AOFF_task_local_pages 0x00000808
3784 #define ASIZ_task_local_pages 0x00000010
3785-#define AOFF_task_allocation_order 0x00000808
3786+#define AOFF_task_allocation_order 0x00000818
3787 #define ASIZ_task_allocation_order 0x00000004
3788-#define AOFF_task_nr_local_pages 0x0000080c
3789+#define AOFF_task_nr_local_pages 0x0000081c
3790 #define ASIZ_task_nr_local_pages 0x00000004
3791-#define AOFF_task_fs_locks 0x00000810
3792+#define AOFF_task_fs_locks 0x00000820
3793 #define ASIZ_task_fs_locks 0x00000004
3794-#define AOFF_task_sigmask_lock 0x00000814
3795+#define AOFF_task_sigmask_lock 0x00000824
3796 #define ASIZ_task_sigmask_lock 0x00000001
3797-#define AOFF_task_sig 0x00000818
3798+#define AOFF_task_sig 0x00000828
3799 #define ASIZ_task_sig 0x00000008
3800-#define AOFF_task_signal 0x00000820
3801+#define AOFF_task_signal 0x00000830
3802 #define ASIZ_task_signal 0x00000008
3803-#define AOFF_task_blocked 0x00000828
3804+#define AOFF_task_blocked 0x00000838
3805 #define ASIZ_task_blocked 0x00000008
3806-#define AOFF_task_sigqueue 0x00000830
3807+#define AOFF_task_sigqueue 0x00000840
3808 #define ASIZ_task_sigqueue 0x00000008
3809-#define AOFF_task_sigqueue_tail 0x00000838
3810+#define AOFF_task_sigqueue_tail 0x00000848
3811 #define ASIZ_task_sigqueue_tail 0x00000008
3812-#define AOFF_task_sas_ss_sp 0x00000840
3813+#define AOFF_task_sas_ss_sp 0x00000850
3814 #define ASIZ_task_sas_ss_sp 0x00000008
3815-#define AOFF_task_sas_ss_size 0x00000848
3816+#define AOFF_task_sas_ss_size 0x00000858
3817 #define ASIZ_task_sas_ss_size 0x00000008
3818-#define AOFF_task_parent_exec_id 0x00000850
3819+#define AOFF_task_parent_exec_id 0x00000860
3820 #define ASIZ_task_parent_exec_id 0x00000004
3821-#define AOFF_task_self_exec_id 0x00000854
3822+#define AOFF_task_self_exec_id 0x00000864
3823 #define ASIZ_task_self_exec_id 0x00000004
3824-#define AOFF_task_oom_kill_try 0x00000858
3825+#define AOFF_task_oom_kill_try 0x00000868
3826 #define ASIZ_task_oom_kill_try 0x00000004
3827-#define ASIZ_task 0x00000860
3828+#define ASIZ_task 0x00000870
3829 #define AOFF_mm_mmap 0x00000000
3830 #define ASIZ_mm_mmap 0x00000008
3831 #define AOFF_mm_mmap_avl 0x00000008
3832@@ -330,181 +332,183 @@
3833 #define ASIZ_task_priority 0x00000008
3834 #define AOFF_task_avg_slice 0x00000048
3835 #define ASIZ_task_avg_slice 0x00000008
3836-#define AOFF_task_has_cpu 0x00000050
3837+#define AOFF_task_counter_refresh 0x00000050
3838+#define ASIZ_task_counter_refresh 0x00000004
3839+#define AOFF_task_has_cpu 0x00000054
3840 #define ASIZ_task_has_cpu 0x00000004
3841-#define AOFF_task_processor 0x00000054
3842+#define AOFF_task_processor 0x00000058
3843 #define ASIZ_task_processor 0x00000004
3844-#define AOFF_task_last_processor 0x00000058
3845+#define AOFF_task_last_processor 0x0000005c
3846 #define ASIZ_task_last_processor 0x00000004
3847-#define AOFF_task_lock_depth 0x0000005c
3848+#define AOFF_task_lock_depth 0x00000060
3849 #define ASIZ_task_lock_depth 0x00000004
3850-#define AOFF_task_next_task 0x00000060
3851+#define AOFF_task_next_task 0x00000068
3852 #define ASIZ_task_next_task 0x00000008
3853-#define AOFF_task_prev_task 0x00000068
3854+#define AOFF_task_prev_task 0x00000070
3855 #define ASIZ_task_prev_task 0x00000008
3856-#define AOFF_task_next_run 0x00000070
3857+#define AOFF_task_next_run 0x00000078
3858 #define ASIZ_task_next_run 0x00000008
3859-#define AOFF_task_prev_run 0x00000078
3860+#define AOFF_task_prev_run 0x00000080
3861 #define ASIZ_task_prev_run 0x00000008
3862-#define AOFF_task_task_exclusive 0x00000080
3863+#define AOFF_task_task_exclusive 0x00000088
3864 #define ASIZ_task_task_exclusive 0x00000004
3865-#define AOFF_task_binfmt 0x00000088
3866+#define AOFF_task_binfmt 0x00000090
3867 #define ASIZ_task_binfmt 0x00000008
3868-#define AOFF_task_exit_code 0x00000090
3869+#define AOFF_task_exit_code 0x00000098
3870 #define ASIZ_task_exit_code 0x00000004
3871-#define AOFF_task_exit_signal 0x00000094
3872+#define AOFF_task_exit_signal 0x0000009c
3873 #define ASIZ_task_exit_signal 0x00000004
3874-#define AOFF_task_pdeath_signal 0x00000098
3875+#define AOFF_task_pdeath_signal 0x000000a0
3876 #define ASIZ_task_pdeath_signal 0x00000004
3877-#define AOFF_task_personality 0x000000a0
3878+#define AOFF_task_personality 0x000000a8
3879 #define ASIZ_task_personality 0x00000008
3880-#define AOFF_task_pid 0x000000ac
3881+#define AOFF_task_pid 0x000000b4
3882 #define ASIZ_task_pid 0x00000004
3883-#define AOFF_task_pgrp 0x000000b0
3884+#define AOFF_task_pgrp 0x000000b8
3885 #define ASIZ_task_pgrp 0x00000004
3886-#define AOFF_task_tty_old_pgrp 0x000000b4
3887+#define AOFF_task_tty_old_pgrp 0x000000bc
3888 #define ASIZ_task_tty_old_pgrp 0x00000004
3889-#define AOFF_task_session 0x000000b8
3890+#define AOFF_task_session 0x000000c0
3891 #define ASIZ_task_session 0x00000004
3892-#define AOFF_task_leader 0x000000bc
3893+#define AOFF_task_leader 0x000000c4
3894 #define ASIZ_task_leader 0x00000004
3895-#define AOFF_task_p_opptr 0x000000c0
3896+#define AOFF_task_p_opptr 0x000000c8
3897 #define ASIZ_task_p_opptr 0x00000008
3898-#define AOFF_task_p_pptr 0x000000c8
3899+#define AOFF_task_p_pptr 0x000000d0
3900 #define ASIZ_task_p_pptr 0x00000008
3901-#define AOFF_task_p_cptr 0x000000d0
3902+#define AOFF_task_p_cptr 0x000000d8
3903 #define ASIZ_task_p_cptr 0x00000008
3904-#define AOFF_task_p_ysptr 0x000000d8
3905+#define AOFF_task_p_ysptr 0x000000e0
3906 #define ASIZ_task_p_ysptr 0x00000008
3907-#define AOFF_task_p_osptr 0x000000e0
3908+#define AOFF_task_p_osptr 0x000000e8
3909 #define ASIZ_task_p_osptr 0x00000008
3910-#define AOFF_task_pidhash_next 0x000000e8
3911+#define AOFF_task_pidhash_next 0x000000f0
3912 #define ASIZ_task_pidhash_next 0x00000008
3913-#define AOFF_task_pidhash_pprev 0x000000f0
3914+#define AOFF_task_pidhash_pprev 0x000000f8
3915 #define ASIZ_task_pidhash_pprev 0x00000008
3916-#define AOFF_task_tarray_ptr 0x000000f8
3917+#define AOFF_task_tarray_ptr 0x00000100
3918 #define ASIZ_task_tarray_ptr 0x00000008
3919-#define AOFF_task_wait_chldexit 0x00000100
3920+#define AOFF_task_wait_chldexit 0x00000108
3921 #define ASIZ_task_wait_chldexit 0x00000008
3922-#define AOFF_task_vfork_sem 0x00000108
3923+#define AOFF_task_vfork_sem 0x00000110
3924 #define ASIZ_task_vfork_sem 0x00000008
3925-#define AOFF_task_policy 0x00000110
3926+#define AOFF_task_policy 0x00000118
3927 #define ASIZ_task_policy 0x00000008
3928-#define AOFF_task_rt_priority 0x00000118
3929+#define AOFF_task_rt_priority 0x00000120
3930 #define ASIZ_task_rt_priority 0x00000008
3931-#define AOFF_task_it_real_value 0x00000120
3932+#define AOFF_task_it_real_value 0x00000128
3933 #define ASIZ_task_it_real_value 0x00000008
3934-#define AOFF_task_it_prof_value 0x00000128
3935+#define AOFF_task_it_prof_value 0x00000130
3936 #define ASIZ_task_it_prof_value 0x00000008
3937-#define AOFF_task_it_virt_value 0x00000130
3938+#define AOFF_task_it_virt_value 0x00000138
3939 #define ASIZ_task_it_virt_value 0x00000008
3940-#define AOFF_task_it_real_incr 0x00000138
3941+#define AOFF_task_it_real_incr 0x00000140
3942 #define ASIZ_task_it_real_incr 0x00000008
3943-#define AOFF_task_it_prof_incr 0x00000140
3944+#define AOFF_task_it_prof_incr 0x00000148
3945 #define ASIZ_task_it_prof_incr 0x00000008
3946-#define AOFF_task_it_virt_incr 0x00000148
3947+#define AOFF_task_it_virt_incr 0x00000150
3948 #define ASIZ_task_it_virt_incr 0x00000008
3949-#define AOFF_task_real_timer 0x00000150
3950+#define AOFF_task_real_timer 0x00000158
3951 #define ASIZ_task_real_timer 0x00000028
3952-#define AOFF_task_times 0x00000178
3953+#define AOFF_task_times 0x00000180
3954 #define ASIZ_task_times 0x00000020
3955-#define AOFF_task_start_time 0x00000198
3956+#define AOFF_task_start_time 0x000001a0
3957 #define ASIZ_task_start_time 0x00000008
3958-#define AOFF_task_per_cpu_utime 0x000001a0
3959+#define AOFF_task_per_cpu_utime 0x000001a8
3960 #define ASIZ_task_per_cpu_utime 0x00000100
3961-#define AOFF_task_min_flt 0x000003a0
3962+#define AOFF_task_min_flt 0x000003a8
3963 #define ASIZ_task_min_flt 0x00000008
3964-#define AOFF_task_maj_flt 0x000003a8
3965+#define AOFF_task_maj_flt 0x000003b0
3966 #define ASIZ_task_maj_flt 0x00000008
3967-#define AOFF_task_nswap 0x000003b0
3968+#define AOFF_task_nswap 0x000003b8
3969 #define ASIZ_task_nswap 0x00000008
3970-#define AOFF_task_cmin_flt 0x000003b8
3971+#define AOFF_task_cmin_flt 0x000003c0
3972 #define ASIZ_task_cmin_flt 0x00000008
3973-#define AOFF_task_cmaj_flt 0x000003c0
3974+#define AOFF_task_cmaj_flt 0x000003c8
3975 #define ASIZ_task_cmaj_flt 0x00000008
3976-#define AOFF_task_cnswap 0x000003c8
3977+#define AOFF_task_cnswap 0x000003d0
3978 #define ASIZ_task_cnswap 0x00000008
3979-#define AOFF_task_uid 0x000003d4
3980+#define AOFF_task_uid 0x000003dc
3981 #define ASIZ_task_uid 0x00000004
3982-#define AOFF_task_euid 0x000003d8
3983+#define AOFF_task_euid 0x000003e0
3984 #define ASIZ_task_euid 0x00000004
3985-#define AOFF_task_suid 0x000003dc
3986+#define AOFF_task_suid 0x000003e4
3987 #define ASIZ_task_suid 0x00000004
3988-#define AOFF_task_fsuid 0x000003e0
3989+#define AOFF_task_fsuid 0x000003e8
3990 #define ASIZ_task_fsuid 0x00000004
3991-#define AOFF_task_gid 0x000003e4
3992+#define AOFF_task_gid 0x000003ec
3993 #define ASIZ_task_gid 0x00000004
3994-#define AOFF_task_egid 0x000003e8
3995+#define AOFF_task_egid 0x000003f0
3996 #define ASIZ_task_egid 0x00000004
3997-#define AOFF_task_sgid 0x000003ec
3998+#define AOFF_task_sgid 0x000003f4
3999 #define ASIZ_task_sgid 0x00000004
4000-#define AOFF_task_fsgid 0x000003f0
4001+#define AOFF_task_fsgid 0x000003f8
4002 #define ASIZ_task_fsgid 0x00000004
4003-#define AOFF_task_ngroups 0x000003f4
4004+#define AOFF_task_ngroups 0x000003fc
4005 #define ASIZ_task_ngroups 0x00000004
4006-#define AOFF_task_groups 0x000003f8
4007+#define AOFF_task_groups 0x00000400
4008 #define ASIZ_task_groups 0x00000080
4009-#define AOFF_task_cap_effective 0x00000478
4010+#define AOFF_task_cap_effective 0x00000480
4011 #define ASIZ_task_cap_effective 0x00000004
4012-#define AOFF_task_cap_inheritable 0x0000047c
4013+#define AOFF_task_cap_inheritable 0x00000484
4014 #define ASIZ_task_cap_inheritable 0x00000004
4015-#define AOFF_task_cap_permitted 0x00000480
4016+#define AOFF_task_cap_permitted 0x00000488
4017 #define ASIZ_task_cap_permitted 0x00000004
4018-#define AOFF_task_user 0x00000488
4019+#define AOFF_task_user 0x00000490
4020 #define ASIZ_task_user 0x00000008
4021-#define AOFF_task_rlim 0x00000490
4022+#define AOFF_task_rlim 0x00000498
4023 #define ASIZ_task_rlim 0x000000a0
4024-#define AOFF_task_used_math 0x00000530
4025+#define AOFF_task_used_math 0x00000538
4026 #define ASIZ_task_used_math 0x00000002
4027-#define AOFF_task_comm 0x00000532
4028+#define AOFF_task_comm 0x0000053a
4029 #define ASIZ_task_comm 0x00000010
4030-#define AOFF_task_link_count 0x00000544
4031+#define AOFF_task_link_count 0x0000054c
4032 #define ASIZ_task_link_count 0x00000004
4033-#define AOFF_task_tty 0x00000548
4034+#define AOFF_task_tty 0x00000550
4035 #define ASIZ_task_tty 0x00000008
4036-#define AOFF_task_semundo 0x00000550
4037+#define AOFF_task_semundo 0x00000558
4038 #define ASIZ_task_semundo 0x00000008
4039-#define AOFF_task_semsleeping 0x00000558
4040+#define AOFF_task_semsleeping 0x00000560
4041 #define ASIZ_task_semsleeping 0x00000008
4042-#define AOFF_task_tss 0x00000560
4043+#define AOFF_task_tss 0x00000570
4044 #define ASIZ_task_tss 0x00000470
4045-#define AOFF_task_fs 0x000009d0
4046+#define AOFF_task_fs 0x000009e0
4047 #define ASIZ_task_fs 0x00000008
4048-#define AOFF_task_files 0x000009d8
4049+#define AOFF_task_files 0x000009e8
4050 #define ASIZ_task_files 0x00000008
4051-#define AOFF_task_mm 0x000009e0
4052+#define AOFF_task_mm 0x000009f0
4053 #define ASIZ_task_mm 0x00000008
4054-#define AOFF_task_local_pages 0x000009e8
4055+#define AOFF_task_local_pages 0x000009f8
4056 #define ASIZ_task_local_pages 0x00000010
4057-#define AOFF_task_allocation_order 0x000009f8
4058+#define AOFF_task_allocation_order 0x00000a08
4059 #define ASIZ_task_allocation_order 0x00000004
4060-#define AOFF_task_nr_local_pages 0x000009fc
4061+#define AOFF_task_nr_local_pages 0x00000a0c
4062 #define ASIZ_task_nr_local_pages 0x00000004
4063-#define AOFF_task_fs_locks 0x00000a00
4064+#define AOFF_task_fs_locks 0x00000a10
4065 #define ASIZ_task_fs_locks 0x00000004
4066-#define AOFF_task_sigmask_lock 0x00000a04
4067+#define AOFF_task_sigmask_lock 0x00000a14
4068 #define ASIZ_task_sigmask_lock 0x00000001
4069-#define AOFF_task_sig 0x00000a08
4070+#define AOFF_task_sig 0x00000a18
4071 #define ASIZ_task_sig 0x00000008
4072-#define AOFF_task_signal 0x00000a10
4073+#define AOFF_task_signal 0x00000a20
4074 #define ASIZ_task_signal 0x00000008
4075-#define AOFF_task_blocked 0x00000a18
4076+#define AOFF_task_blocked 0x00000a28
4077 #define ASIZ_task_blocked 0x00000008
4078-#define AOFF_task_sigqueue 0x00000a20
4079+#define AOFF_task_sigqueue 0x00000a30
4080 #define ASIZ_task_sigqueue 0x00000008
4081-#define AOFF_task_sigqueue_tail 0x00000a28
4082+#define AOFF_task_sigqueue_tail 0x00000a38
4083 #define ASIZ_task_sigqueue_tail 0x00000008
4084-#define AOFF_task_sas_ss_sp 0x00000a30
4085+#define AOFF_task_sas_ss_sp 0x00000a40
4086 #define ASIZ_task_sas_ss_sp 0x00000008
4087-#define AOFF_task_sas_ss_size 0x00000a38
4088+#define AOFF_task_sas_ss_size 0x00000a48
4089 #define ASIZ_task_sas_ss_size 0x00000008
4090-#define AOFF_task_parent_exec_id 0x00000a40
4091+#define AOFF_task_parent_exec_id 0x00000a50
4092 #define ASIZ_task_parent_exec_id 0x00000004
4093-#define AOFF_task_self_exec_id 0x00000a44
4094+#define AOFF_task_self_exec_id 0x00000a54
4095 #define ASIZ_task_self_exec_id 0x00000004
4096-#define AOFF_task_oom_kill_try 0x00000a48
4097+#define AOFF_task_oom_kill_try 0x00000a58
4098 #define ASIZ_task_oom_kill_try 0x00000004
4099-#define ASIZ_task 0x00000a50
4100+#define ASIZ_task 0x00000a60
4101 #define AOFF_mm_mmap 0x00000000
4102 #define ASIZ_mm_mmap 0x00000008
4103 #define AOFF_mm_mmap_avl 0x00000008
4104@@ -632,181 +636,183 @@
4105 #define ASIZ_task_priority 0x00000008
4106 #define AOFF_task_avg_slice 0x00000048
4107 #define ASIZ_task_avg_slice 0x00000008
4108-#define AOFF_task_has_cpu 0x00000050
4109+#define AOFF_task_counter_refresh 0x00000050
4110+#define ASIZ_task_counter_refresh 0x00000004
4111+#define AOFF_task_has_cpu 0x00000054
4112 #define ASIZ_task_has_cpu 0x00000004
4113-#define AOFF_task_processor 0x00000054
4114+#define AOFF_task_processor 0x00000058
4115 #define ASIZ_task_processor 0x00000004
4116-#define AOFF_task_last_processor 0x00000058
4117+#define AOFF_task_last_processor 0x0000005c
4118 #define ASIZ_task_last_processor 0x00000004
4119-#define AOFF_task_lock_depth 0x0000005c
4120+#define AOFF_task_lock_depth 0x00000060
4121 #define ASIZ_task_lock_depth 0x00000004
4122-#define AOFF_task_next_task 0x00000060
4123+#define AOFF_task_next_task 0x00000068
4124 #define ASIZ_task_next_task 0x00000008
4125-#define AOFF_task_prev_task 0x00000068
4126+#define AOFF_task_prev_task 0x00000070
4127 #define ASIZ_task_prev_task 0x00000008
4128-#define AOFF_task_next_run 0x00000070
4129+#define AOFF_task_next_run 0x00000078
4130 #define ASIZ_task_next_run 0x00000008
4131-#define AOFF_task_prev_run 0x00000078
4132+#define AOFF_task_prev_run 0x00000080
4133 #define ASIZ_task_prev_run 0x00000008
4134-#define AOFF_task_task_exclusive 0x00000080
4135+#define AOFF_task_task_exclusive 0x00000088
4136 #define ASIZ_task_task_exclusive 0x00000004
4137-#define AOFF_task_binfmt 0x00000088
4138+#define AOFF_task_binfmt 0x00000090
4139 #define ASIZ_task_binfmt 0x00000008
4140-#define AOFF_task_exit_code 0x00000090
4141+#define AOFF_task_exit_code 0x00000098
4142 #define ASIZ_task_exit_code 0x00000004
4143-#define AOFF_task_exit_signal 0x00000094
4144+#define AOFF_task_exit_signal 0x0000009c
4145 #define ASIZ_task_exit_signal 0x00000004
4146-#define AOFF_task_pdeath_signal 0x00000098
4147+#define AOFF_task_pdeath_signal 0x000000a0
4148 #define ASIZ_task_pdeath_signal 0x00000004
4149-#define AOFF_task_personality 0x000000a0
4150+#define AOFF_task_personality 0x000000a8
4151 #define ASIZ_task_personality 0x00000008
4152-#define AOFF_task_pid 0x000000ac
4153+#define AOFF_task_pid 0x000000b4
4154 #define ASIZ_task_pid 0x00000004
4155-#define AOFF_task_pgrp 0x000000b0
4156+#define AOFF_task_pgrp 0x000000b8
4157 #define ASIZ_task_pgrp 0x00000004
4158-#define AOFF_task_tty_old_pgrp 0x000000b4
4159+#define AOFF_task_tty_old_pgrp 0x000000bc
4160 #define ASIZ_task_tty_old_pgrp 0x00000004
4161-#define AOFF_task_session 0x000000b8
4162+#define AOFF_task_session 0x000000c0
4163 #define ASIZ_task_session 0x00000004
4164-#define AOFF_task_leader 0x000000bc
4165+#define AOFF_task_leader 0x000000c4
4166 #define ASIZ_task_leader 0x00000004
4167-#define AOFF_task_p_opptr 0x000000c0
4168+#define AOFF_task_p_opptr 0x000000c8
4169 #define ASIZ_task_p_opptr 0x00000008
4170-#define AOFF_task_p_pptr 0x000000c8
4171+#define AOFF_task_p_pptr 0x000000d0
4172 #define ASIZ_task_p_pptr 0x00000008
4173-#define AOFF_task_p_cptr 0x000000d0
4174+#define AOFF_task_p_cptr 0x000000d8
4175 #define ASIZ_task_p_cptr 0x00000008
4176-#define AOFF_task_p_ysptr 0x000000d8
4177+#define AOFF_task_p_ysptr 0x000000e0
4178 #define ASIZ_task_p_ysptr 0x00000008
4179-#define AOFF_task_p_osptr 0x000000e0
4180+#define AOFF_task_p_osptr 0x000000e8
4181 #define ASIZ_task_p_osptr 0x00000008
4182-#define AOFF_task_pidhash_next 0x000000e8
4183+#define AOFF_task_pidhash_next 0x000000f0
4184 #define ASIZ_task_pidhash_next 0x00000008
4185-#define AOFF_task_pidhash_pprev 0x000000f0
4186+#define AOFF_task_pidhash_pprev 0x000000f8
4187 #define ASIZ_task_pidhash_pprev 0x00000008
4188-#define AOFF_task_tarray_ptr 0x000000f8
4189+#define AOFF_task_tarray_ptr 0x00000100
4190 #define ASIZ_task_tarray_ptr 0x00000008
4191-#define AOFF_task_wait_chldexit 0x00000100
4192+#define AOFF_task_wait_chldexit 0x00000108
4193 #define ASIZ_task_wait_chldexit 0x00000008
4194-#define AOFF_task_vfork_sem 0x00000108
4195+#define AOFF_task_vfork_sem 0x00000110
4196 #define ASIZ_task_vfork_sem 0x00000008
4197-#define AOFF_task_policy 0x00000110
4198+#define AOFF_task_policy 0x00000118
4199 #define ASIZ_task_policy 0x00000008
4200-#define AOFF_task_rt_priority 0x00000118
4201+#define AOFF_task_rt_priority 0x00000120
4202 #define ASIZ_task_rt_priority 0x00000008
4203-#define AOFF_task_it_real_value 0x00000120
4204+#define AOFF_task_it_real_value 0x00000128
4205 #define ASIZ_task_it_real_value 0x00000008
4206-#define AOFF_task_it_prof_value 0x00000128
4207+#define AOFF_task_it_prof_value 0x00000130
4208 #define ASIZ_task_it_prof_value 0x00000008
4209-#define AOFF_task_it_virt_value 0x00000130
4210+#define AOFF_task_it_virt_value 0x00000138
4211 #define ASIZ_task_it_virt_value 0x00000008
4212-#define AOFF_task_it_real_incr 0x00000138
4213+#define AOFF_task_it_real_incr 0x00000140
4214 #define ASIZ_task_it_real_incr 0x00000008
4215-#define AOFF_task_it_prof_incr 0x00000140
4216+#define AOFF_task_it_prof_incr 0x00000148
4217 #define ASIZ_task_it_prof_incr 0x00000008
4218-#define AOFF_task_it_virt_incr 0x00000148
4219+#define AOFF_task_it_virt_incr 0x00000150
4220 #define ASIZ_task_it_virt_incr 0x00000008
4221-#define AOFF_task_real_timer 0x00000150
4222+#define AOFF_task_real_timer 0x00000158
4223 #define ASIZ_task_real_timer 0x00000028
4224-#define AOFF_task_times 0x00000178
4225+#define AOFF_task_times 0x00000180
4226 #define ASIZ_task_times 0x00000020
4227-#define AOFF_task_start_time 0x00000198
4228+#define AOFF_task_start_time 0x000001a0
4229 #define ASIZ_task_start_time 0x00000008
4230-#define AOFF_task_per_cpu_utime 0x000001a0
4231+#define AOFF_task_per_cpu_utime 0x000001a8
4232 #define ASIZ_task_per_cpu_utime 0x00000100
4233-#define AOFF_task_min_flt 0x000003a0
4234+#define AOFF_task_min_flt 0x000003a8
4235 #define ASIZ_task_min_flt 0x00000008
4236-#define AOFF_task_maj_flt 0x000003a8
4237+#define AOFF_task_maj_flt 0x000003b0
4238 #define ASIZ_task_maj_flt 0x00000008
4239-#define AOFF_task_nswap 0x000003b0
4240+#define AOFF_task_nswap 0x000003b8
4241 #define ASIZ_task_nswap 0x00000008
4242-#define AOFF_task_cmin_flt 0x000003b8
4243+#define AOFF_task_cmin_flt 0x000003c0
4244 #define ASIZ_task_cmin_flt 0x00000008
4245-#define AOFF_task_cmaj_flt 0x000003c0
4246+#define AOFF_task_cmaj_flt 0x000003c8
4247 #define ASIZ_task_cmaj_flt 0x00000008
4248-#define AOFF_task_cnswap 0x000003c8
4249+#define AOFF_task_cnswap 0x000003d0
4250 #define ASIZ_task_cnswap 0x00000008
4251-#define AOFF_task_uid 0x000003d4
4252+#define AOFF_task_uid 0x000003dc
4253 #define ASIZ_task_uid 0x00000004
4254-#define AOFF_task_euid 0x000003d8
4255+#define AOFF_task_euid 0x000003e0
4256 #define ASIZ_task_euid 0x00000004
4257-#define AOFF_task_suid 0x000003dc
4258+#define AOFF_task_suid 0x000003e4
4259 #define ASIZ_task_suid 0x00000004
4260-#define AOFF_task_fsuid 0x000003e0
4261+#define AOFF_task_fsuid 0x000003e8
4262 #define ASIZ_task_fsuid 0x00000004
4263-#define AOFF_task_gid 0x000003e4
4264+#define AOFF_task_gid 0x000003ec
4265 #define ASIZ_task_gid 0x00000004
4266-#define AOFF_task_egid 0x000003e8
4267+#define AOFF_task_egid 0x000003f0
4268 #define ASIZ_task_egid 0x00000004
4269-#define AOFF_task_sgid 0x000003ec
4270+#define AOFF_task_sgid 0x000003f4
4271 #define ASIZ_task_sgid 0x00000004
4272-#define AOFF_task_fsgid 0x000003f0
4273+#define AOFF_task_fsgid 0x000003f8
4274 #define ASIZ_task_fsgid 0x00000004
4275-#define AOFF_task_ngroups 0x000003f4
4276+#define AOFF_task_ngroups 0x000003fc
4277 #define ASIZ_task_ngroups 0x00000004
4278-#define AOFF_task_groups 0x000003f8
4279+#define AOFF_task_groups 0x00000400
4280 #define ASIZ_task_groups 0x00000080
4281-#define AOFF_task_cap_effective 0x00000478
4282+#define AOFF_task_cap_effective 0x00000480
4283 #define ASIZ_task_cap_effective 0x00000004
4284-#define AOFF_task_cap_inheritable 0x0000047c
4285+#define AOFF_task_cap_inheritable 0x00000484
4286 #define ASIZ_task_cap_inheritable 0x00000004
4287-#define AOFF_task_cap_permitted 0x00000480
4288+#define AOFF_task_cap_permitted 0x00000488
4289 #define ASIZ_task_cap_permitted 0x00000004
4290-#define AOFF_task_user 0x00000488
4291+#define AOFF_task_user 0x00000490
4292 #define ASIZ_task_user 0x00000008
4293-#define AOFF_task_rlim 0x00000490
4294+#define AOFF_task_rlim 0x00000498
4295 #define ASIZ_task_rlim 0x000000a0
4296-#define AOFF_task_used_math 0x00000530
4297+#define AOFF_task_used_math 0x00000538
4298 #define ASIZ_task_used_math 0x00000002
4299-#define AOFF_task_comm 0x00000532
4300+#define AOFF_task_comm 0x0000053a
4301 #define ASIZ_task_comm 0x00000010
4302-#define AOFF_task_link_count 0x00000544
4303+#define AOFF_task_link_count 0x0000054c
4304 #define ASIZ_task_link_count 0x00000004
4305-#define AOFF_task_tty 0x00000548
4306+#define AOFF_task_tty 0x00000550
4307 #define ASIZ_task_tty 0x00000008
4308-#define AOFF_task_semundo 0x00000550
4309+#define AOFF_task_semundo 0x00000558
4310 #define ASIZ_task_semundo 0x00000008
4311-#define AOFF_task_semsleeping 0x00000558
4312+#define AOFF_task_semsleeping 0x00000560
4313 #define ASIZ_task_semsleeping 0x00000008
4314-#define AOFF_task_tss 0x00000560
4315+#define AOFF_task_tss 0x00000570
4316 #define ASIZ_task_tss 0x00000470
4317-#define AOFF_task_fs 0x000009d0
4318+#define AOFF_task_fs 0x000009e0
4319 #define ASIZ_task_fs 0x00000008
4320-#define AOFF_task_files 0x000009d8
4321+#define AOFF_task_files 0x000009e8
4322 #define ASIZ_task_files 0x00000008
4323-#define AOFF_task_mm 0x000009e0
4324+#define AOFF_task_mm 0x000009f0
4325 #define ASIZ_task_mm 0x00000008
4326-#define AOFF_task_local_pages 0x000009e8
4327+#define AOFF_task_local_pages 0x000009f8
4328 #define ASIZ_task_local_pages 0x00000010
4329-#define AOFF_task_allocation_order 0x000009f8
4330+#define AOFF_task_allocation_order 0x00000a08
4331 #define ASIZ_task_allocation_order 0x00000004
4332-#define AOFF_task_nr_local_pages 0x000009fc
4333+#define AOFF_task_nr_local_pages 0x00000a0c
4334 #define ASIZ_task_nr_local_pages 0x00000004
4335-#define AOFF_task_fs_locks 0x00000a00
4336+#define AOFF_task_fs_locks 0x00000a10
4337 #define ASIZ_task_fs_locks 0x00000004
4338-#define AOFF_task_sigmask_lock 0x00000a04
4339+#define AOFF_task_sigmask_lock 0x00000a14
4340 #define ASIZ_task_sigmask_lock 0x0000000c
4341-#define AOFF_task_sig 0x00000a10
4342+#define AOFF_task_sig 0x00000a20
4343 #define ASIZ_task_sig 0x00000008
4344-#define AOFF_task_signal 0x00000a18
4345+#define AOFF_task_signal 0x00000a28
4346 #define ASIZ_task_signal 0x00000008
4347-#define AOFF_task_blocked 0x00000a20
4348+#define AOFF_task_blocked 0x00000a30
4349 #define ASIZ_task_blocked 0x00000008
4350-#define AOFF_task_sigqueue 0x00000a28
4351+#define AOFF_task_sigqueue 0x00000a38
4352 #define ASIZ_task_sigqueue 0x00000008
4353-#define AOFF_task_sigqueue_tail 0x00000a30
4354+#define AOFF_task_sigqueue_tail 0x00000a40
4355 #define ASIZ_task_sigqueue_tail 0x00000008
4356-#define AOFF_task_sas_ss_sp 0x00000a38
4357+#define AOFF_task_sas_ss_sp 0x00000a48
4358 #define ASIZ_task_sas_ss_sp 0x00000008
4359-#define AOFF_task_sas_ss_size 0x00000a40
4360+#define AOFF_task_sas_ss_size 0x00000a50
4361 #define ASIZ_task_sas_ss_size 0x00000008
4362-#define AOFF_task_parent_exec_id 0x00000a48
4363+#define AOFF_task_parent_exec_id 0x00000a58
4364 #define ASIZ_task_parent_exec_id 0x00000004
4365-#define AOFF_task_self_exec_id 0x00000a4c
4366+#define AOFF_task_self_exec_id 0x00000a5c
4367 #define ASIZ_task_self_exec_id 0x00000004
4368-#define AOFF_task_oom_kill_try 0x00000a50
4369+#define AOFF_task_oom_kill_try 0x00000a60
4370 #define ASIZ_task_oom_kill_try 0x00000004
4371-#define ASIZ_task 0x00000a60
4372+#define ASIZ_task 0x00000a70
4373 #define AOFF_mm_mmap 0x00000000
4374 #define ASIZ_mm_mmap 0x00000008
4375 #define AOFF_mm_mmap_avl 0x00000008
4376diff -urN linux.orig/include/asm-sparc64/poll.h linux/include/asm-sparc64/poll.h
4377--- linux.orig/include/asm-sparc64/poll.h Sun Mar 25 18:31:09 2001
4378+++ linux/include/asm-sparc64/poll.h Wed Aug 7 17:45:23 2002
4379@@ -11,6 +11,7 @@
4380 #define POLLWRNORM POLLOUT
4381 #define POLLRDBAND 128
4382 #define POLLWRBAND 256
4383+#define POLLMSG 512
4384
4385 struct pollfd {
4386 int fd;
4387diff -urN linux.orig/include/linux/elfcore.h linux/include/linux/elfcore.h
4388--- linux.orig/include/linux/elfcore.h Sun Mar 25 18:31:04 2001
4389+++ linux/include/linux/elfcore.h Wed Aug 7 17:44:43 2002
4390@@ -20,6 +20,7 @@
4391 typedef elf_greg_t greg_t;
4392 typedef elf_gregset_t gregset_t;
4393 typedef elf_fpregset_t fpregset_t;
4394+typedef elf_fpxregset_t fpxregset_t;
4395 #define NGREG ELF_NGREG
4396 #endif
4397
4398diff -urN linux.orig/include/linux/fs.h linux/include/linux/fs.h
4399--- linux.orig/include/linux/fs.h Fri Nov 2 17:39:09 2001
4400+++ linux/include/linux/fs.h Wed Aug 7 17:46:35 2002
4401@@ -740,7 +740,7 @@
4402 #define __getname() ((char *) __get_free_page(GFP_KERNEL))
4403 #define putname(name) free_page((unsigned long)(name))
4404
4405-extern void kill_fasync(struct fasync_struct *fa, int sig);
4406+extern void kill_fasync(struct fasync_struct *fa, int sig, int band);
4407 extern int register_blkdev(unsigned int, const char *, struct file_operations *);
4408 extern int unregister_blkdev(unsigned int major, const char * name);
4409 extern int blkdev_open(struct inode * inode, struct file * filp);
4410@@ -810,7 +810,6 @@
4411 if (test_and_clear_bit(BH_Dirty, &bh->b_state)) {
4412 if (bh->b_list == BUF_DIRTY)
4413 refile_buffer(bh);
4414- clear_bit(BH_Wait_IO, &bh->b_state);
4415 }
4416 }
4417
4418diff -urN linux.orig/include/linux/kernel.h linux/include/linux/kernel.h
4419--- linux.orig/include/linux/kernel.h Sun Mar 25 18:31:03 2001
4420+++ linux/include/linux/kernel.h Wed Aug 7 17:44:43 2002
4421@@ -40,7 +40,6 @@
4422 #define FASTCALL(x) x
4423 #endif
4424
4425-extern void math_error(void);
4426 extern struct notifier_block *panic_notifier_list;
4427 NORET_TYPE void panic(const char * fmt, ...)
4428 __attribute__ ((NORET_AND format (printf, 1, 2)));
4429diff -urN linux.orig/include/linux/locks.h linux/include/linux/locks.h
4430--- linux.orig/include/linux/locks.h Sun Mar 25 18:37:40 2001
4431+++ linux/include/linux/locks.h Wed Aug 7 17:46:35 2002
4432@@ -29,6 +29,7 @@
4433 extern inline void unlock_buffer(struct buffer_head *bh)
4434 {
4435 clear_bit(BH_Lock, &bh->b_state);
4436+ clear_bit(BH_Wait_IO, &bh->b_state);
4437 wake_up(&bh->b_wait);
4438 }
4439
4440diff -urN linux.orig/include/linux/mm.h linux/include/linux/mm.h
4441--- linux.orig/include/linux/mm.h Sun Mar 25 18:31:03 2001
4442+++ linux/include/linux/mm.h Wed Aug 7 17:57:18 2002
4443@@ -81,6 +81,8 @@
4444 #define VM_LOCKED 0x2000
4445 #define VM_IO 0x4000 /* Memory mapped I/O or similar */
4446
4447+#define VM_RESERVED 0x8000 /* Don't unmap it from swap_out */
4448+
4449 #define VM_STACK_FLAGS 0x0177
4450
4451 /*
4452@@ -347,13 +349,18 @@
4453
4454 #define GFP_DMA __GFP_DMA
4455
4456+extern int heap_stack_gap;
4457+
4458 /* vma is the first one with address < vma->vm_end,
4459 * and even address < vma->vm_start. Have to extend vma. */
4460-static inline int expand_stack(struct vm_area_struct * vma, unsigned long address)
4461+static inline int expand_stack(struct vm_area_struct * vma, unsigned long address,
4462+ struct vm_area_struct * prev_vma)
4463 {
4464 unsigned long grow;
4465
4466 address &= PAGE_MASK;
4467+ if (prev_vma && prev_vma->vm_end + (heap_stack_gap << PAGE_SHIFT) > address)
4468+ return -ENOMEM;
4469 grow = vma->vm_start - address;
4470 if ((vma->vm_end - address
4471 > current->rlim[RLIMIT_STACK].rlim_cur) ||
4472@@ -371,6 +378,8 @@
4473
4474 /* Look up the first VMA which satisfies addr < vm_end, NULL if none. */
4475 extern struct vm_area_struct * find_vma(struct mm_struct * mm, unsigned long addr);
4476+extern struct vm_area_struct * find_vma_prev(struct mm_struct *, unsigned long,
4477+ struct vm_area_struct **);
4478
4479 /* Look up the first VMA which intersects the interval start_addr..end_addr-1,
4480 NULL if none. Assume start_addr < end_addr. */
4481diff -urN linux.orig/include/linux/net.h linux/include/linux/net.h
4482--- linux.orig/include/linux/net.h Sun Mar 25 18:31:03 2001
4483+++ linux/include/linux/net.h Wed Aug 7 17:45:23 2002
4484@@ -126,7 +126,7 @@
4485 };
4486
4487 extern struct net_proto_family *net_families[];
4488-extern int sock_wake_async(struct socket *sk, int how);
4489+extern int sock_wake_async(struct socket *sk, int how, int band);
4490 extern int sock_register(struct net_proto_family *fam);
4491 extern int sock_unregister(int family);
4492 extern struct socket *sock_alloc(void);
4493diff -urN linux.orig/include/linux/sched.h linux/include/linux/sched.h
4494--- linux.orig/include/linux/sched.h Fri Nov 2 17:39:09 2001
4495+++ linux/include/linux/sched.h Wed Aug 7 17:55:29 2002
4496@@ -260,6 +260,7 @@
4497 long counter;
4498 long priority;
4499 cycles_t avg_slice;
4500+ int counter_refresh;
4501 /* SMP and runqueue state */
4502 int has_cpu;
4503 int processor;
4504@@ -394,7 +395,7 @@
4505 */
4506 #define INIT_TASK \
4507 /* state etc */ { 0,0,0,KERNEL_DS,&default_exec_domain,0,0, \
4508-/* counter */ DEF_PRIORITY,DEF_PRIORITY,0, \
4509+/* counter */ DEF_PRIORITY,DEF_PRIORITY,0,0, \
4510 /* SMP */ 0,0,0,-1, \
4511 /* schedlink */ &init_task,&init_task, &init_task, &init_task, \
4512 /* task_exclusive */ 0, \
4513diff -urN linux.orig/include/linux/sysctl.h linux/include/linux/sysctl.h
4514--- linux.orig/include/linux/sysctl.h Sun Mar 25 18:37:40 2001
4515+++ linux/include/linux/sysctl.h Wed Aug 7 17:57:18 2002
4516@@ -123,7 +123,8 @@
4517 VM_PAGECACHE=7, /* struct: Set cache memory thresholds */
4518 VM_PAGERDAEMON=8, /* struct: Control kswapd behaviour */
4519 VM_PGT_CACHE=9, /* struct: Set page table cache parameters */
4520- VM_PAGE_CLUSTER=10 /* int: set number of pages to swap together */
4521+ VM_PAGE_CLUSTER=10, /* int: set number of pages to swap together */
4522+ VM_HEAP_STACK_GAP=11, /* int: page gap between heap and stack */
4523 };
4524
4525
4526diff -urN linux.orig/include/linux/time.h linux/include/linux/time.h
4527--- linux.orig/include/linux/time.h Sun Mar 25 18:31:03 2001
4528+++ linux/include/linux/time.h Wed Aug 7 17:53:48 2002
4529@@ -46,11 +46,54 @@
4530 value->tv_sec = jiffies / HZ;
4531 }
4532
4533+static __inline__ int
4534+timespec_before(struct timespec a, struct timespec b)
4535+{
4536+ if (a.tv_sec == b.tv_sec)
4537+ return a.tv_nsec < b.tv_nsec;
4538+ return a.tv_sec < b.tv_sec;
4539+}
4540+
4541+/* computes `a - b' and write the result in `result', assumes `a >= b' */
4542+static inline void
4543+timespec_less(struct timespec a, struct timespec b, struct timespec * result)
4544+{
4545+ if (a.tv_nsec < b.tv_nsec)
4546+ {
4547+ a.tv_sec--;
4548+ a.tv_nsec += 1000000000;
4549+ }
4550+
4551+ result->tv_sec = a.tv_sec - b.tv_sec;
4552+ result->tv_nsec = a.tv_nsec - b.tv_nsec;
4553+}
4554+
4555 struct timeval {
4556 time_t tv_sec; /* seconds */
4557 suseconds_t tv_usec; /* microseconds */
4558 };
4559
4560+/* computes `a - b' and write the result in `result', assumes `a >= b' */
4561+static inline void
4562+timeval_less(struct timeval a, struct timeval b, struct timeval * result)
4563+{
4564+ if (a.tv_usec < b.tv_usec)
4565+ {
4566+ a.tv_sec--;
4567+ a.tv_usec += 1000000;
4568+ }
4569+
4570+ result->tv_sec = a.tv_sec - b.tv_sec;
4571+ result->tv_usec = a.tv_usec - b.tv_usec;
4572+}
4573+
4574+static __inline__ void
4575+timeval_to_timespec(struct timeval tv, struct timespec * ts)
4576+{
4577+ ts->tv_sec = tv.tv_sec;
4578+ ts->tv_nsec = (long) tv.tv_usec * 1000;
4579+}
4580+
4581 struct timezone {
4582 int tz_minuteswest; /* minutes west of Greenwich */
4583 int tz_dsttime; /* type of dst correction */
4584diff -urN linux.orig/include/linux/wrapper.h linux/include/linux/wrapper.h
4585--- linux.orig/include/linux/wrapper.h Sun Mar 25 18:31:04 2001
4586+++ linux/include/linux/wrapper.h Wed Aug 7 17:46:42 2002
4587@@ -33,6 +33,14 @@
4588 #define vma_get_end(v) v->vm_end
4589 #define vma_get_page_prot(v) v->vm_page_prot
4590
4591+/*
4592+ * mem_map_reserve()/unreserve() are going to be obsoleted by
4593+ * setting the VM_RESERVED in vma->vm_flags.
4594+ *
4595+ * Instead of marking the pages as reserved, just mark the vma as reserved
4596+ * this will improve performance (it's zero cost unlike the PG_reserved check)
4597+ * and it will be trivial for not physically contigous mappings too.
4598+ */
4599 #define mem_map_reserve(p) set_bit(PG_reserved, &mem_map[p].flags)
4600 #define mem_map_unreserve(p) clear_bit(PG_reserved, &mem_map[p].flags)
4601 #define mem_map_inc_count(p) atomic_inc(&(mem_map[p].count))
4602diff -urN linux.orig/kernel/exit.c linux/kernel/exit.c
4603--- linux.orig/kernel/exit.c Fri Nov 2 17:39:16 2001
4604+++ linux/kernel/exit.c Wed Aug 7 17:55:29 2002
4605@@ -56,6 +56,17 @@
4606 current->cmin_flt += p->min_flt + p->cmin_flt;
4607 current->cmaj_flt += p->maj_flt + p->cmaj_flt;
4608 current->cnswap += p->nswap + p->cnswap;
4609+ /*
4610+ * Potentially available timeslices are retrieved
4611+ * here - this way the parent does not get penalized
4612+ * for creating too many processes.
4613+ *
4614+ * (this cannot be used to artificially 'generate'
4615+ * timeslices, because any timeslice recovered here
4616+ * was given away by the parent in the first place.)
4617+ */
4618+ if (!p->counter_refresh)
4619+ current->counter += p->counter;
4620 free_task_struct(p);
4621 } else {
4622 printk("task releasing itself\n");
4623@@ -150,6 +161,7 @@
4624 p->exit_signal = SIGCHLD;
4625 p->self_exec_id++;
4626 p->p_opptr = child_reaper; /* init */
4627+ p->counter_refresh = 1;
4628 if (p->pdeath_signal) send_sig(p->pdeath_signal, p, 0);
4629 }
4630 }
4631diff -urN linux.orig/kernel/fork.c linux/kernel/fork.c
4632--- linux.orig/kernel/fork.c Fri Nov 2 17:39:16 2001
4633+++ linux/kernel/fork.c Wed Aug 7 17:55:29 2002
4634@@ -700,6 +700,8 @@
4635 */
4636 current->counter >>= 1;
4637 p->counter = current->counter;
4638+ /* Tell the parent if it can get back its timeslice when child exits */
4639+ p->counter_refresh = 0;
4640
4641 /*
4642 * Ok, add it to the run-queues and make it
4643diff -urN linux.orig/kernel/sched.c linux/kernel/sched.c
4644--- linux.orig/kernel/sched.c Sun Mar 25 18:37:40 2001
4645+++ linux/kernel/sched.c Wed Aug 7 17:55:29 2002
4646@@ -212,101 +212,89 @@
4647 }
4648
4649 /*
4650- * If there is a dependency between p1 and p2,
4651- * don't be too eager to go into the slow schedule.
4652- * In particular, if p1 and p2 both want the kernel
4653- * lock, there is no point in trying to make them
4654- * extremely parallel..
4655- *
4656- * (No lock - lock_depth < 0)
4657- *
4658- * There are two additional metrics here:
4659- *
4660- * first, a 'cutoff' interval, currently 0-200 usecs on
4661- * x86 CPUs, depending on the size of the 'SMP-local cache'.
4662- * If the current process has longer average timeslices than
4663- * this, then we utilize the idle CPU.
4664- *
4665- * second, if the wakeup comes from a process context,
4666- * then the two processes are 'related'. (they form a
4667- * 'gang')
4668- *
4669- * An idle CPU is almost always a bad thing, thus we skip
4670- * the idle-CPU utilization only if both these conditions
4671- * are true. (ie. a 'process-gang' rescheduling with rather
4672- * high frequency should stay on the same CPU).
4673- *
4674- * [We can switch to something more finegrained in 2.3.]
4675- *
4676- * do not 'guess' if the to-be-scheduled task is RT.
4677+ * This is ugly, but reschedule_idle() is very timing-critical.
4678+ * We enter with the runqueue spinlock held, but we might end
4679+ * up unlocking it early, so the caller must not unlock the
4680+ * runqueue, it's always done by reschedule_idle().
4681 */
4682-#define related(p1,p2) (((p1)->lock_depth >= 0) && (p2)->lock_depth >= 0) && \
4683- (((p2)->policy == SCHED_OTHER) && ((p1)->avg_slice < cacheflush_time))
4684-
4685-static inline void reschedule_idle_slow(struct task_struct * p)
4686+static inline void reschedule_idle(struct task_struct * p, unsigned long flags)
4687 {
4688 #ifdef __SMP__
4689-/*
4690- * (see reschedule_idle() for an explanation first ...)
4691- *
4692- * Pass #2
4693- *
4694- * We try to find another (idle) CPU for this woken-up process.
4695- *
4696- * On SMP, we mostly try to see if the CPU the task used
4697- * to run on is idle.. but we will use another idle CPU too,
4698- * at this point we already know that this CPU is not
4699- * willing to reschedule in the near future.
4700- *
4701- * An idle CPU is definitely wasted, especially if this CPU is
4702- * running long-timeslice processes. The following algorithm is
4703- * pretty good at finding the best idle CPU to send this process
4704- * to.
4705- *
4706- * [We can try to preempt low-priority processes on other CPUs in
4707- * 2.3. Also we can try to use the avg_slice value to predict
4708- * 'likely reschedule' events even on other CPUs.]
4709- */
4710 int this_cpu = smp_processor_id(), target_cpu;
4711- struct task_struct *tsk, *target_tsk;
4712- int cpu, best_cpu, weight, best_weight, i;
4713- unsigned long flags;
4714-
4715- best_weight = 0; /* prevents negative weight */
4716-
4717- spin_lock_irqsave(&runqueue_lock, flags);
4718+ struct task_struct *tsk;
4719+ int cpu, best_cpu, i;
4720
4721 /*
4722 * shortcut if the woken up task's last CPU is
4723 * idle now.
4724 */
4725 best_cpu = p->processor;
4726- target_tsk = idle_task(best_cpu);
4727- if (cpu_curr(best_cpu) == target_tsk)
4728+ tsk = idle_task(best_cpu);
4729+ if (cpu_curr(best_cpu) == tsk)
4730 goto send_now;
4731
4732- target_tsk = NULL;
4733- for (i = 0; i < smp_num_cpus; i++) {
4734+ /*
4735+ * We know that the preferred CPU has a cache-affine current
4736+ * process, lets try to find a new idle CPU for the woken-up
4737+ * process:
4738+ */
4739+ for (i = smp_num_cpus - 1; i >= 0; i--) {
4740 cpu = cpu_logical_map(i);
4741+ if (cpu == best_cpu)
4742+ continue;
4743 tsk = cpu_curr(cpu);
4744- if (related(tsk, p))
4745- goto out_no_target;
4746- weight = preemption_goodness(tsk, p, cpu);
4747- if (weight > best_weight) {
4748- best_weight = weight;
4749- target_tsk = tsk;
4750- }
4751+ /*
4752+ * We use the last available idle CPU. This creates
4753+ * a priority list between idle CPUs, but this is not
4754+ * a problem.
4755+ */
4756+ if (tsk == idle_task(cpu))
4757+ goto send_now;
4758 }
4759
4760 /*
4761- * found any suitable CPU?
4762+ * No CPU is idle, but maybe this process has enough priority
4763+ * to preempt it's preferred CPU.
4764+ */
4765+ tsk = cpu_curr(best_cpu);
4766+ if (preemption_goodness(tsk, p, best_cpu) > 0)
4767+ goto send_now;
4768+
4769+ /*
4770+ * We will get here often - or in the high CPU contention
4771+ * case. No CPU is idle and this process is either lowprio or
4772+ * the preferred CPU is highprio. Try to preemt some other CPU
4773+ * only if it's RT or if it's iteractive and the preferred
4774+ * cpu won't reschedule shortly.
4775 */
4776- if (!target_tsk)
4777- goto out_no_target;
4778+ if ((p->avg_slice < cacheflush_time && cpu_curr(best_cpu)->avg_slice > cacheflush_time) ||
4779+ ((p->policy & ~SCHED_YIELD) != SCHED_OTHER))
4780+ {
4781+ int weight, best_weight = 0;
4782+ struct task_struct * best_tsk = NULL;
4783+
4784+ for (i = smp_num_cpus - 1; i >= 0; i--) {
4785+ cpu = cpu_logical_map(i);
4786+ if (cpu == best_cpu)
4787+ continue;
4788+ tsk = cpu_curr(cpu);
4789+ weight = preemption_goodness(tsk, p, cpu);
4790+ if (weight > best_weight) {
4791+ best_weight = weight;
4792+ best_tsk = tsk;
4793+ }
4794+ }
4795+
4796+ if ((tsk = best_tsk))
4797+ goto send_now;
4798+ }
4799+
4800+ spin_unlock_irqrestore(&runqueue_lock, flags);
4801+ return;
4802
4803 send_now:
4804- target_cpu = target_tsk->processor;
4805- target_tsk->need_resched = 1;
4806+ target_cpu = tsk->processor;
4807+ tsk->need_resched = 1;
4808 spin_unlock_irqrestore(&runqueue_lock, flags);
4809 /*
4810 * the APIC stuff can go outside of the lock because
4811@@ -315,9 +303,6 @@
4812 if (target_cpu != this_cpu)
4813 smp_send_reschedule(target_cpu);
4814 return;
4815-out_no_target:
4816- spin_unlock_irqrestore(&runqueue_lock, flags);
4817- return;
4818 #else /* UP */
4819 int this_cpu = smp_processor_id();
4820 struct task_struct *tsk;
4821@@ -325,38 +310,10 @@
4822 tsk = current;
4823 if (preemption_goodness(tsk, p, this_cpu) > 0)
4824 tsk->need_resched = 1;
4825+ spin_unlock_irqrestore(&runqueue_lock, flags);
4826 #endif
4827 }
4828
4829-static void reschedule_idle(struct task_struct * p)
4830-{
4831-#ifdef __SMP__
4832- int cpu = smp_processor_id();
4833- /*
4834- * ("wakeup()" should not be called before we've initialized
4835- * SMP completely.
4836- * Basically a not-yet initialized SMP subsystem can be
4837- * considered as a not-yet working scheduler, simply dont use
4838- * it before it's up and running ...)
4839- *
4840- * SMP rescheduling is done in 2 passes:
4841- * - pass #1: faster: 'quick decisions'
4842- * - pass #2: slower: 'lets try and find a suitable CPU'
4843- */
4844-
4845- /*
4846- * Pass #1. (subtle. We might be in the middle of __switch_to, so
4847- * to preserve scheduling atomicity we have to use cpu_curr)
4848- */
4849- if ((p->processor == cpu) && related(cpu_curr(cpu), p))
4850- return;
4851-#endif /* __SMP__ */
4852- /*
4853- * Pass #2
4854- */
4855- reschedule_idle_slow(p);
4856-}
4857-
4858 /*
4859 * Careful!
4860 *
4861@@ -453,9 +410,8 @@
4862 if (p->next_run)
4863 goto out;
4864 add_to_runqueue(p);
4865- spin_unlock_irqrestore(&runqueue_lock, flags);
4866+ reschedule_idle(p, flags); // spin_unlocks runqueue
4867
4868- reschedule_idle(p);
4869 return;
4870 out:
4871 spin_unlock_irqrestore(&runqueue_lock, flags);
4872@@ -668,9 +624,13 @@
4873 {
4874 #ifdef __SMP__
4875 if ((prev->state == TASK_RUNNING) &&
4876- (prev != idle_task(smp_processor_id())))
4877- reschedule_idle(prev);
4878- wmb();
4879+ (prev != idle_task(smp_processor_id()))) {
4880+ unsigned long flags;
4881+
4882+ spin_lock_irqsave(&runqueue_lock, flags);
4883+ reschedule_idle(prev, flags); // spin_unlocks runqueue
4884+ }
4885+ mb();
4886 prev->has_cpu = 0;
4887 #endif /* __SMP__ */
4888 }
4889@@ -841,8 +801,10 @@
4890 struct task_struct *p;
4891 spin_unlock_irq(&runqueue_lock);
4892 read_lock(&tasklist_lock);
4893- for_each_task(p)
4894+ for_each_task(p) {
4895 p->counter = (p->counter >> 1) + p->priority;
4896+ p->counter_refresh = 1;
4897+ }
4898 read_unlock(&tasklist_lock);
4899 spin_lock_irq(&runqueue_lock);
4900 goto repeat_schedule;
4901@@ -1922,6 +1884,7 @@
4902 {
4903 struct timespec t;
4904 unsigned long expire;
4905+ struct timeval before, after;
4906
4907 if(copy_from_user(&t, rqtp, sizeof(struct timespec)))
4908 return -EFAULT;
4909@@ -1954,11 +1917,20 @@
4910 expire = timespec_to_jiffies(&t) + (t.tv_sec || t.tv_nsec);
4911
4912 current->state = TASK_INTERRUPTIBLE;
4913+ get_fast_time(&before);
4914 expire = schedule_timeout(expire);
4915+ get_fast_time(&after);
4916
4917 if (expire) {
4918 if (rmtp) {
4919- jiffies_to_timespec(expire, &t);
4920+ struct timespec elapsed;
4921+
4922+ timeval_less(after, before, &after);
4923+ timeval_to_timespec(after, &elapsed);
4924+ if (timespec_before(elapsed, t))
4925+ timespec_less(t, elapsed, &t);
4926+ else
4927+ t.tv_nsec = t.tv_sec = 0;
4928 if (copy_to_user(rmtp, &t, sizeof(struct timespec)))
4929 return -EFAULT;
4930 }
4931diff -urN linux.orig/kernel/sysctl.c linux/kernel/sysctl.c
4932--- linux.orig/kernel/sysctl.c Sun Mar 25 18:37:40 2001
4933+++ linux/kernel/sysctl.c Wed Aug 7 17:57:18 2002
4934@@ -272,6 +272,8 @@
4935 &pgt_cache_water, 2*sizeof(int), 0600, NULL, &proc_dointvec},
4936 {VM_PAGE_CLUSTER, "page-cluster",
4937 &page_cluster, sizeof(int), 0600, NULL, &proc_dointvec},
4938+ {VM_HEAP_STACK_GAP, "heap-stack-gap",
4939+ &heap_stack_gap, sizeof(int), 0644, NULL, &proc_dointvec},
4940 {0}
4941 };
4942
4943diff -urN linux.orig/mm/filemap.c linux/mm/filemap.c
4944--- linux.orig/mm/filemap.c Sun Mar 25 18:37:40 2001
4945+++ linux/mm/filemap.c Wed Aug 7 17:56:23 2002
4946@@ -338,13 +338,13 @@
4947
4948 wait.task = tsk;
4949 add_wait_queue(&page->wait, &wait);
4950-repeat:
4951- tsk->state = TASK_UNINTERRUPTIBLE;
4952- sync_page(page);
4953- if (PageLocked(page)) {
4954+ do {
4955+ set_current_state(TASK_UNINTERRUPTIBLE);
4956+ sync_page(page);
4957+ if (!PageLocked(page))
4958+ break;
4959 schedule();
4960- goto repeat;
4961- }
4962+ } while (PageLocked(page));
4963 tsk->state = TASK_RUNNING;
4964 remove_wait_queue(&page->wait, &wait);
4965 }
4966@@ -560,9 +560,11 @@
4967 * accessed sequentially.
4968 */
4969 if (ahead) {
4970+#if 0
4971 if (reada_ok == 2) {
4972 run_task_queue(&tq_disk);
4973 }
4974+#endif
4975
4976 filp->f_ralen += ahead;
4977 filp->f_rawin += filp->f_ralen;
4978diff -urN linux.orig/mm/mmap.c linux/mm/mmap.c
4979--- linux.orig/mm/mmap.c Sun Mar 25 18:31:02 2001
4980+++ linux/mm/mmap.c Wed Aug 7 17:57:18 2002
4981@@ -40,6 +40,7 @@
4982 kmem_cache_t *vm_area_cachep;
4983
4984 int sysctl_overcommit_memory;
4985+int heap_stack_gap = 1;
4986
4987 /* Check that a process has enough memory to allocate a
4988 * new virtual mapping.
4989@@ -66,7 +67,6 @@
4990 free += page_cache_size;
4991 free += nr_free_pages;
4992 free += nr_swap_pages;
4993- free -= (page_cache.min_percent + buffer_mem.min_percent + 2)*num_physpages/100;
4994 return free > pages;
4995 }
4996
4997@@ -371,9 +371,14 @@
4998
4999 for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) {
5000 /* At this point: (!vmm || addr < vmm->vm_end). */
5001+ unsigned long __heap_stack_gap = 0;
5002 if (TASK_SIZE - len < addr)
5003 return 0;
5004- if (!vmm || addr + len <= vmm->vm_start)
5005+ if (!vmm)
5006+ return addr;
5007+ if (vmm->vm_flags & VM_GROWSDOWN)
5008+ __heap_stack_gap = heap_stack_gap << PAGE_SHIFT;
5009+ if (addr + len + __heap_stack_gap <= vmm->vm_start)
5010 return addr;
5011 addr = vmm->vm_end;
5012 }
5013diff -urN linux.orig/mm/mremap.c linux/mm/mremap.c
5014--- linux.orig/mm/mremap.c Sun Mar 25 18:31:03 2001
5015+++ linux/mm/mremap.c Wed Aug 7 17:53:05 2002
5016@@ -127,7 +127,7 @@
5017
5018 new_vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL);
5019 if (new_vma) {
5020- unsigned long new_addr = get_unmapped_area(addr, new_len);
5021+ unsigned long new_addr = get_unmapped_area(0, new_len);
5022
5023 if (new_addr && !move_page_tables(current->mm, new_addr, addr, old_len)) {
5024 *new_vma = *vma;
5025diff -urN linux.orig/mm/swap.c linux/mm/swap.c
5026--- linux.orig/mm/swap.c Sun Mar 25 18:31:02 2001
5027+++ linux/mm/swap.c Wed Aug 7 17:43:00 2002
5028@@ -47,13 +47,13 @@
5029 atomic_t nr_async_pages = ATOMIC_INIT(0);
5030
5031 buffer_mem_t buffer_mem = {
5032- 2, /* minimum percent buffer */
5033+ 4, /* minimum percent buffer */
5034 10, /* borrow percent buffer */
5035 60 /* maximum percent buffer */
5036 };
5037
5038 buffer_mem_t page_cache = {
5039- 2, /* minimum percent page cache */
5040+ 4, /* minimum percent page cache */
5041 15, /* borrow percent page cache */
5042 75 /* maximum */
5043 };
5044diff -urN linux.orig/mm/vmscan.c linux/mm/vmscan.c
5045--- linux.orig/mm/vmscan.c Tue May 21 01:32:35 2002
5046+++ linux/mm/vmscan.c Wed Aug 7 17:46:42 2002
5047@@ -256,7 +256,7 @@
5048 unsigned long end;
5049
5050 /* Don't swap out areas which are locked down */
5051- if (vma->vm_flags & VM_LOCKED)
5052+ if (vma->vm_flags & (VM_LOCKED|VM_RESERVED))
5053 return 0;
5054
5055 pgdir = pgd_offset(tsk->mm, address);
5056diff -urN linux.orig/net/core/sock.c linux/net/core/sock.c
5057--- linux.orig/net/core/sock.c Fri Nov 2 17:39:16 2001
5058+++ linux/net/core/sock.c Wed Aug 7 17:45:23 2002
5059@@ -1025,7 +1025,7 @@
5060 {
5061 if (!sk->dead) {
5062 wake_up_interruptible(sk->sleep);
5063- sock_wake_async(sk->socket,0);
5064+ sock_wake_async(sk->socket,0,POLL_ERR);
5065 }
5066 }
5067
5068@@ -1033,7 +1033,7 @@
5069 {
5070 if(!sk->dead) {
5071 wake_up_interruptible(sk->sleep);
5072- sock_wake_async(sk->socket,1);
5073+ sock_wake_async(sk->socket,1,POLL_IN);
5074 }
5075 }
5076
5077@@ -1048,7 +1048,7 @@
5078
5079 /* Should agree with poll, otherwise some programs break */
5080 if (sock_writeable(sk))
5081- sock_wake_async(sk->socket, 2);
5082+ sock_wake_async(sk->socket, 2, POLL_OUT);
5083 }
5084 }
5085
5086diff -urN linux.orig/net/ipv4/tcp.c linux/net/ipv4/tcp.c
5087--- linux.orig/net/ipv4/tcp.c Fri Nov 2 17:39:16 2001
5088+++ linux/net/ipv4/tcp.c Wed Aug 7 17:45:23 2002
5089@@ -615,7 +615,7 @@
5090 wake_up_interruptible(sk->sleep);
5091 if (sock_wspace(sk) >=
5092 tcp_min_write_space(sk))
5093- sock_wake_async(sk->socket, 2);
5094+ sock_wake_async(sk->socket, 2, POLL_OUT);
5095 }
5096
5097
5098diff -urN linux.orig/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
5099--- linux.orig/net/ipv4/tcp_input.c Fri Nov 2 17:39:16 2001
5100+++ linux/net/ipv4/tcp_input.c Wed Aug 7 17:58:04 2002
5101@@ -97,6 +97,7 @@
5102 */
5103 static void tcp_delack_estimator(struct tcp_opt *tp)
5104 {
5105+ tcp_exit_quickack_mode(tp);
5106 if(tp->ato == 0) {
5107 tp->lrcvtime = tcp_time_stamp;
5108
5109@@ -115,10 +116,7 @@
5110 if(m > tp->rto)
5111 tp->ato = tp->rto;
5112 else {
5113- /* This funny shift makes sure we
5114- * clear the "quick ack mode" bit.
5115- */
5116- tp->ato = ((tp->ato << 1) >> 2) + m;
5117+ tp->ato = (tp->ato >> 1) + m;
5118 }
5119 }
5120 }
5121@@ -1183,7 +1181,7 @@
5122
5123 if (!sk->dead) {
5124 sk->state_change(sk);
5125- sock_wake_async(sk->socket, 1);
5126+ sock_wake_async(sk->socket, 1, POLL_HUP);
5127 }
5128 }
5129
5130@@ -1697,6 +1695,7 @@
5131 kill_proc(sk->proc, SIGURG, 1);
5132 else
5133 kill_pg(-sk->proc, SIGURG, 1);
5134+ sock_wake_async(sk->socket, 3, POLL_PRI);
5135 }
5136
5137 /* We may be adding urgent data when the last byte read was
5138@@ -1933,19 +1932,23 @@
5139 tcp_send_ack(sk);
5140 goto discard;
5141 }
5142-
5143- if(th->syn && TCP_SKB_CB(skb)->seq != tp->syn_seq) {
5144- SOCK_DEBUG(sk, "syn in established state\n");
5145- tcp_statistics.TcpInErrs++;
5146- tcp_reset(sk);
5147- return 1;
5148- }
5149
5150 if(th->rst) {
5151 tcp_reset(sk);
5152 goto discard;
5153 }
5154
5155+ if(th->syn) {
5156+ if (TCP_SKB_CB(skb)->seq != tp->syn_seq ||
5157+ skb->len > th->doff*4) {
5158+ tcp_statistics.TcpInErrs++;
5159+ tcp_reset(sk);
5160+ return 1;
5161+ }
5162+ tcp_send_ack(sk);
5163+ goto discard;
5164+ }
5165+
5166 if(th->ack)
5167 tcp_ack(sk, th, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->ack_seq, len);
5168
5169@@ -2244,7 +2247,7 @@
5170
5171 if(!sk->dead) {
5172 sk->state_change(sk);
5173- sock_wake_async(sk->socket, 0);
5174+ sock_wake_async(sk->socket, 0, POLL_OUT);
5175 }
5176 } else {
5177 if(th->syn && !th->rst) {
5178diff -urN linux.orig/net/ipv4/tcp_ipv4.c linux/net/ipv4/tcp_ipv4.c
5179--- linux.orig/net/ipv4/tcp_ipv4.c Sun Mar 25 18:37:41 2001
5180+++ linux/net/ipv4/tcp_ipv4.c Wed Aug 7 17:49:21 2002
5181@@ -1404,6 +1404,7 @@
5182 newtp->snd_una = req->snt_isn + 1;
5183 newtp->srtt = 0;
5184 newtp->ato = 0;
5185+ tcp_enter_quickack_mode(newtp);
5186 newtp->snd_wl1 = req->rcv_isn;
5187 newtp->snd_wl2 = req->snt_isn;
5188
5189@@ -1958,6 +1959,7 @@
5190 skb_queue_head_init(&tp->out_of_order_queue);
5191 tcp_init_xmit_timers(sk);
5192
5193+ tcp_enter_quickack_mode(tp);
5194 tp->rto = TCP_TIMEOUT_INIT; /*TCP_WRITE_TIME*/
5195 tp->mdev = TCP_TIMEOUT_INIT;
5196 tp->mss_clamp = ~0;
5197diff -urN linux.orig/net/ipv4/tcp_output.c linux/net/ipv4/tcp_output.c
5198--- linux.orig/net/ipv4/tcp_output.c Fri Nov 2 17:39:16 2001
5199+++ linux/net/ipv4/tcp_output.c Wed Aug 7 17:49:21 2002
5200@@ -1044,6 +1044,17 @@
5201 timeout = (tp->ato << 1) >> 1;
5202 if (timeout > max_timeout)
5203 timeout = max_timeout;
5204+ if (!timeout)
5205+ {
5206+ timeout = tp->rto;
5207+ if ((signed) timeout <= 0)
5208+ {
5209+ printk(KERN_ERR
5210+ "tcp_send_delayed_ack: rto %ld!\n", timeout);
5211+ timeout = 1;
5212+ }
5213+ timeout = min(timeout, max_timeout);
5214+ }
5215 timeout += jiffies;
5216
5217 /* Use new timeout only if there wasn't a older one earlier. */
5218diff -urN linux.orig/net/ipv4/tcp_timer.c linux/net/ipv4/tcp_timer.c
5219--- linux.orig/net/ipv4/tcp_timer.c Sun Mar 25 18:31:12 2001
5220+++ linux/net/ipv4/tcp_timer.c Wed Aug 7 17:49:21 2002
5221@@ -195,7 +195,21 @@
5222 if (!atomic_read(&sk->sock_readers))
5223 tcp_send_ack(sk);
5224 else
5225- tcp_send_delayed_ack(&(sk->tp_pinfo.af_tcp), HZ/10);
5226+ {
5227+ struct tcp_opt * tp = &(sk->tp_pinfo.af_tcp);
5228+ int rto;
5229+
5230+ rto = tp->rto;
5231+ if (rto <= 0)
5232+ {
5233+ printk(KERN_ERR
5234+ "tcp_delack_timer: rto %d!\n", rto);
5235+ rto = 1;
5236+ }
5237+ rto = min(rto, HZ/10);
5238+ tp->delack_timer.expires = rto + jiffies;
5239+ add_timer(&tp->delack_timer);
5240+ }
5241 }
5242 }
5243
5244diff -urN linux.orig/net/ipv6/ip6_output.c linux/net/ipv6/ip6_output.c
5245--- linux.orig/net/ipv6/ip6_output.c Sun Mar 25 18:31:13 2001
5246+++ linux/net/ipv6/ip6_output.c Wed Aug 7 17:51:14 2002
5247@@ -627,7 +627,7 @@
5248 struct ipv6hdr *hdr = skb->nh.ipv6h;
5249 struct inet6_skb_parm *opt =(struct inet6_skb_parm*)skb->cb;
5250
5251- if (ipv6_devconf.forwarding == 0 && opt->srcrt == 0)
5252+ if (ipv6_devconf.forwarding == 0)
5253 goto drop;
5254
5255 /*
5256diff -urN linux.orig/net/socket.c linux/net/socket.c
5257--- linux.orig/net/socket.c Sun Mar 25 18:37:41 2001
5258+++ linux/net/socket.c Wed Aug 7 17:45:23 2002
5259@@ -546,7 +546,7 @@
5260 return 0;
5261 }
5262
5263-int sock_wake_async(struct socket *sock, int how)
5264+int sock_wake_async(struct socket *sock, int how, int band)
5265 {
5266 if (!sock || !sock->fasync_list)
5267 return -1;
5268@@ -563,8 +563,10 @@
5269 /* fall through */
5270 case 0:
5271 call_kill:
5272- kill_fasync(sock->fasync_list, SIGIO);
5273+ kill_fasync(sock->fasync_list, SIGIO, band);
5274 break;
5275+ case 3:
5276+ kill_fasync(sock->fasync_list, SIGURG, band);
5277 }
5278 return 0;
5279 }
5280diff -urN linux.orig/net/unix/af_unix.c linux/net/unix/af_unix.c
5281--- linux.orig/net/unix/af_unix.c Tue May 21 01:32:35 2002
5282+++ linux/net/unix/af_unix.c Wed Aug 7 17:47:52 2002
5283@@ -1017,9 +1017,6 @@
5284 }
5285 if (!other)
5286 {
5287- err = -ECONNRESET;
5288- if(sunaddr==NULL)
5289- goto out_free;
5290 other = unix_find_other(sunaddr, namelen, sk->type, hash, &err);
5291 if (other==NULL)
5292 goto out_free;
This page took 1.569653 seconds and 4 git commands to generate.