]> git.pld-linux.org Git - packages/kernel.git/blob - x86_64-2.6.0-1-pld.patch
- obsolete
[packages/kernel.git] / x86_64-2.6.0-1-pld.patch
1 diff -urN linux-2.6.0-orig/Makefile linux-2.6.0/Makefile
2 --- linux-2.6.0-orig/Makefile   2004-12-21 18:38:42.178680240 +0100
3 +++ linux-2.6.0/Makefile        2004-12-21 18:38:56.097564248 +0100
4 @@ -1,7 +1,7 @@
5  VERSION = 2
6  PATCHLEVEL = 6
7  SUBLEVEL = 0
8 -EXTRAVERSION =
9 +EXTRAVERSION = -X8664-1
10  
11  # *DOCUMENTATION*
12  # To see a list of typical targets execute "make help"
13 diff -urN linux-2.6.0-orig/arch/x86_64/Kconfig linux-2.6.0/arch/x86_64/Kconfig
14 --- linux-2.6.0-orig/arch/x86_64/Kconfig        2004-12-21 18:38:40.601919944 +0100
15 +++ linux-2.6.0/arch/x86_64/Kconfig     2004-12-21 18:38:56.098564096 +0100
16 @@ -505,6 +505,7 @@
17          Normally you should say N.
18  
19  config IOMMU_DEBUG
20 +       depends on GART_IOMMU && DEBUG_KERNEL
21         bool "Force IOMMU to on" 
22         help
23           Force the IOMMU to on even when you have less than 4GB of memory and add 
24 @@ -519,13 +520,6 @@
25           Add a simple leak tracer to the IOMMU code. This is useful when you
26          are debugging a buggy device driver that leaks IOMMU mappings.
27         
28 -config MCE_DEBUG
29 -       bool "K8 Machine check debugging mode"
30 -       default y 
31 -       help
32 -         Turn on all Machine Check debugging for device driver problems.         
33 -        This can cause panics, but is useful to find device driver problems.
34 -
35  #config X86_REMOTE_DEBUG
36  #       bool "kgdb debugging stub"
37  
38 diff -urN linux-2.6.0-orig/arch/x86_64/defconfig linux-2.6.0/arch/x86_64/defconfig
39 --- linux-2.6.0-orig/arch/x86_64/defconfig      2004-12-21 18:38:40.601919944 +0100
40 +++ linux-2.6.0/arch/x86_64/defconfig   2004-12-21 18:39:00.826845288 +0100
41 @@ -59,7 +59,6 @@
42  CONFIG_X86_IO_APIC=y
43  CONFIG_X86_LOCAL_APIC=y
44  CONFIG_MTRR=y
45 -# CONFIG_HUGETLB_PAGE is not set
46  CONFIG_SMP=y
47  # CONFIG_PREEMPT is not set
48  CONFIG_K8_NUMA=y
49 @@ -79,9 +78,9 @@
50  #
51  # ACPI (Advanced Configuration and Power Interface) Support
52  #
53 -# CONFIG_ACPI_HT is not set
54  CONFIG_ACPI=y
55  CONFIG_ACPI_BOOT=y
56 +CONFIG_ACPI_INTERPRETER=y
57  CONFIG_ACPI_SLEEP=y
58  CONFIG_ACPI_SLEEP_PROC_FS=y
59  CONFIG_ACPI_AC=y
60 @@ -94,11 +93,29 @@
61  CONFIG_ACPI_TOSHIBA=y
62  CONFIG_ACPI_DEBUG=y
63  CONFIG_ACPI_BUS=y
64 -CONFIG_ACPI_INTERPRETER=y
65  CONFIG_ACPI_EC=y
66  CONFIG_ACPI_POWER=y
67  CONFIG_ACPI_PCI=y
68  CONFIG_ACPI_SYSTEM=y
69 +CONFIG_ACPI_RELAXED_AML=y
70 +
71 +#
72 +# CPU Frequency scaling
73 +#
74 +CONFIG_CPU_FREQ=y
75 +CONFIG_CPU_FREQ_PROC_INTF=y
76 +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
77 +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
78 +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
79 +CONFIG_CPU_FREQ_GOV_POWERSAVE=y
80 +CONFIG_CPU_FREQ_GOV_USERSPACE=y
81 +# CONFIG_CPU_FREQ_24_API is not set
82 +CONFIG_CPU_FREQ_TABLE=y
83 +
84 +#
85 +# CPUFreq processor drivers
86 +#
87 +CONFIG_X86_POWERNOW_K8=y
88  
89  #
90  # Bus options (PCI etc.)
91 @@ -246,6 +263,7 @@
92  # CONFIG_SCSI_AIC79XX is not set
93  # CONFIG_SCSI_ADVANSYS is not set
94  # CONFIG_SCSI_MEGARAID is not set
95 +# CONFIG_SCSI_SATA is not set
96  # CONFIG_SCSI_BUSLOGIC is not set
97  # CONFIG_SCSI_CPQFCTS is not set
98  # CONFIG_SCSI_DMX3191D is not set
99 @@ -325,7 +343,9 @@
100  # CONFIG_IP_SCTP is not set
101  # CONFIG_ATM is not set
102  # CONFIG_VLAN_8021Q is not set
103 -# CONFIG_LLC is not set
104 +# CONFIG_LLC2 is not set
105 +# CONFIG_IPX is not set
106 +# CONFIG_ATALK is not set
107  # CONFIG_X25 is not set
108  # CONFIG_LAPB is not set
109  # CONFIG_NET_DIVERT is not set
110 @@ -358,7 +378,7 @@
111  # Ethernet (10 or 100Mbit)
112  #
113  CONFIG_NET_ETHERNET=y
114 -# CONFIG_MII is not set
115 +CONFIG_MII=y
116  # CONFIG_HAPPYMEAL is not set
117  # CONFIG_SUNGEM is not set
118  # CONFIG_NET_VENDOR_3COM is not set
119 @@ -388,7 +408,6 @@
120  # CONFIG_SIS900 is not set
121  # CONFIG_EPIC100 is not set
122  # CONFIG_SUNDANCE is not set
123 -# CONFIG_TLAN is not set
124  # CONFIG_VIA_RHINE is not set
125  
126  #
127 @@ -421,10 +440,10 @@
128  # CONFIG_NET_RADIO is not set
129  
130  #
131 -# Token Ring devices (depends on LLC=y)
132 +# Token Ring devices
133  #
134 +# CONFIG_TR is not set
135  # CONFIG_NET_FC is not set
136 -# CONFIG_RCPCI is not set
137  # CONFIG_SHAPER is not set
138  
139  #
140 @@ -443,6 +462,11 @@
141  # CONFIG_IRDA is not set
142  
143  #
144 +# Bluetooth support
145 +#
146 +# CONFIG_BT is not set
147 +
148 +#
149  # ISDN subsystem
150  #
151  # CONFIG_ISDN_BOOL is not set
152 @@ -485,6 +509,7 @@
153  # CONFIG_KEYBOARD_NEWTON is not set
154  CONFIG_INPUT_MOUSE=y
155  CONFIG_MOUSE_PS2=y
156 +# CONFIG_MOUSE_PS2_SYNAPTICS is not set
157  # CONFIG_MOUSE_SERIAL is not set
158  # CONFIG_INPUT_JOYSTICK is not set
159  # CONFIG_INPUT_TOUCHSCREEN is not set
160 @@ -504,6 +529,7 @@
161  CONFIG_SERIAL_8250=y
162  CONFIG_SERIAL_8250_CONSOLE=y
163  # CONFIG_SERIAL_8250_ACPI is not set
164 +CONFIG_SERIAL_8250_NR_UARTS=4
165  # CONFIG_SERIAL_8250_EXTENDED is not set
166  
167  #
168 @@ -520,7 +546,11 @@
169  # CONFIG_I2C is not set
170  
171  #
172 -# I2C Hardware Sensors Mainboard support
173 +# I2C Algorithms
174 +#
175 +
176 +#
177 +# I2C Hardware Bus support
178  #
179  
180  #
181 @@ -549,7 +579,6 @@
182  # CONFIG_DTLK is not set
183  # CONFIG_R3964 is not set
184  # CONFIG_APPLICOM is not set
185 -# CONFIG_SONYPI is not set
186  
187  #
188  # Ftape, the floppy tape device driver
189 @@ -559,6 +588,7 @@
190  # CONFIG_DRM is not set
191  # CONFIG_MWAVE is not set
192  CONFIG_RAW_DRIVER=y
193 +CONFIG_MAX_RAW_DEVS=256
194  CONFIG_HANGCHECK_TIMER=y
195  
196  #
197 @@ -619,10 +649,13 @@
198  # Pseudo filesystems
199  #
200  CONFIG_PROC_FS=y
201 +CONFIG_PROC_KCORE=y
202  # CONFIG_DEVFS_FS is not set
203  CONFIG_DEVPTS_FS=y
204  # CONFIG_DEVPTS_FS_XATTR is not set
205  CONFIG_TMPFS=y
206 +CONFIG_HUGETLBFS=y
207 +CONFIG_HUGETLB_PAGE=y
208  CONFIG_RAMFS=y
209  
210  #
211 @@ -647,6 +680,7 @@
212  CONFIG_NFS_FS=y
213  CONFIG_NFS_V3=y
214  # CONFIG_NFS_V4 is not set
215 +# CONFIG_NFS_DIRECTIO is not set
216  CONFIG_NFSD=y
217  CONFIG_NFSD_V3=y
218  # CONFIG_NFSD_V4 is not set
219 @@ -707,13 +741,15 @@
220  # CONFIG_SOUND_MAESTRO is not set
221  # CONFIG_SOUND_MAESTRO3 is not set
222  CONFIG_SOUND_ICH=y
223 -# CONFIG_SOUND_RME96XX is not set
224  # CONFIG_SOUND_SONICVIBES is not set
225  # CONFIG_SOUND_TRIDENT is not set
226 +# CONFIG_SOUND_MSNDCLAS is not set
227 +# CONFIG_SOUND_MSNDPIN is not set
228  # CONFIG_SOUND_VIA82CXXX is not set
229  # CONFIG_SOUND_OSS is not set
230  # CONFIG_SOUND_ALI5455 is not set
231  # CONFIG_SOUND_FORTE is not set
232 +# CONFIG_SOUND_RME96XX is not set
233  # CONFIG_SOUND_AD1980 is not set
234  
235  #
236 @@ -723,11 +759,6 @@
237  # CONFIG_USB_GADGET is not set
238  
239  #
240 -# Bluetooth support
241 -#
242 -# CONFIG_BT is not set
243 -
244 -#
245  # Profiling support
246  #
247  CONFIG_PROFILING=y
248 @@ -743,8 +774,7 @@
249  # CONFIG_INIT_DEBUG is not set
250  # CONFIG_DEBUG_INFO is not set
251  # CONFIG_FRAME_POINTER is not set
252 -CONFIG_IOMMU_DEBUG=y
253 -CONFIG_IOMMU_LEAK=y
254 +# CONFIG_IOMMU_DEBUG is not set
255  CONFIG_MCE_DEBUG=y
256  
257  #
258 @@ -760,4 +790,4 @@
259  #
260  # Library routines
261  #
262 -# CONFIG_CRC32 is not set
263 +CONFIG_CRC32=y
264 diff -urN linux-2.6.0-orig/arch/x86_64/ia32/ia32_signal.c linux-2.6.0/arch/x86_64/ia32/ia32_signal.c
265 --- linux-2.6.0-orig/arch/x86_64/ia32/ia32_signal.c     2004-12-21 18:38:40.599920248 +0100
266 +++ linux-2.6.0/arch/x86_64/ia32/ia32_signal.c  2004-12-21 18:39:00.826845288 +0100
267 @@ -46,25 +46,25 @@
268  
269  static int ia32_copy_siginfo_to_user(siginfo_t32 *to, siginfo_t *from)
270  {
271 +       int err;
272         if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
273                 return -EFAULT;
274 -       if (from->si_code < 0) { 
275 -               /* the only field that's different is the alignment
276 -                  of the pointer in sigval_t. Move that 4 bytes down including
277 -                  padding. */
278 -               memmove(&((siginfo_t32 *)&from)->si_int,
279 -                       &from->si_int, 
280 -                       sizeof(siginfo_t) - offsetof(siginfo_t, si_int));
281 -               /* last 4 bytes stay the same */
282 -               return __copy_to_user(to, from, sizeof(siginfo_t32));
283 -       } else {
284 -               int err;
285  
286 -               /* If you change siginfo_t structure, please be sure
287 +       /* If you change siginfo_t structure, please make sure that
288                    this code is fixed accordingly.
289                    It should never copy any pad contained in the structure
290                    to avoid security leaks, but must copy the generic
291                    3 ints plus the relevant union member.  */
292 +       
293 +       if (from->si_code < 0) {
294 +               err = __put_user(from->si_signo, &to->si_signo);
295 +               err |= __put_user(from->si_errno, &to->si_errno); 
296 +               err |= __put_user(from->si_code, &to->si_code); 
297 +               err |= __put_user(from->_sifields._rt._pid, &to->_sifields._rt._pid); 
298 +               err |= __put_user(from->_sifields._rt._uid, &to->_sifields._rt._uid); 
299 +               err |= __put_user((u32)(u64)from->_sifields._rt._sigval.sival_ptr, 
300 +                                 &to->_sifields._rt._sigval.sival_ptr); 
301 +       } else {
302                 err = __put_user(from->si_signo, &to->si_signo);
303                 err |= __put_user(from->si_errno, &to->si_errno);
304                 err |= __put_user(from->si_code, &to->si_code);
305 @@ -86,8 +86,8 @@
306                         break;
307                 /* case __SI_RT: This is not generated by the kernel as of now.  */
308                 }
309 -               return err;
310         }
311 +       return err;
312  }
313  
314  asmlinkage long
315 @@ -173,6 +173,9 @@
316  {
317         unsigned int err = 0;
318         
319 +       /* Always make any pending restarted system calls return -EINTR */
320 +       current_thread_info()->restart_block.fn = do_no_restart_syscall;
321 +       
322  #if DEBUG_SIG
323         printk("SIG restore_sigcontext: sc=%p err(%x) eip(%x) cs(%x) flg(%x)\n",
324                 sc, sc->err, sc->eip, sc->cs, sc->eflags);
325 diff -urN linux-2.6.0-orig/arch/x86_64/ia32/ia32entry.S linux-2.6.0/arch/x86_64/ia32/ia32entry.S
326 --- linux-2.6.0-orig/arch/x86_64/ia32/ia32entry.S       2004-12-21 18:38:40.598920400 +0100
327 +++ linux-2.6.0/arch/x86_64/ia32/ia32entry.S    2004-12-21 18:39:00.827845136 +0100
328 @@ -330,10 +330,10 @@
329         .quad sys32_adjtimex
330         .quad sys32_mprotect            /* 125 */
331         .quad compat_sys_sigprocmask
332 -       .quad sys32_module_warning      /* create_module */
333 +       .quad quiet_ni_syscall          /* create_module */
334         .quad sys_init_module
335         .quad sys_delete_module
336 -       .quad sys32_module_warning      /* 130  get_kernel_syms */
337 +       .quad quiet_ni_syscall          /* 130  get_kernel_syms */
338         .quad ni_syscall        /* quotactl */ 
339         .quad sys_getpgid
340         .quad sys_fchdir
341 @@ -396,8 +396,8 @@
342         .quad stub32_vfork            /* 190 */
343         .quad compat_sys_getrlimit
344         .quad sys32_mmap2
345 -       .quad sys_truncate
346 -       .quad sys_ftruncate
347 +       .quad sys32_truncate64
348 +       .quad sys32_ftruncate64
349         .quad sys32_stat64              /* 195 */
350         .quad sys32_lstat64
351         .quad sys32_fstat64
352 diff -urN linux-2.6.0-orig/arch/x86_64/ia32/sys_ia32.c linux-2.6.0/arch/x86_64/ia32/sys_ia32.c
353 --- linux-2.6.0-orig/arch/x86_64/ia32/sys_ia32.c        2004-12-21 18:38:40.598920400 +0100
354 +++ linux-2.6.0/arch/x86_64/ia32/sys_ia32.c     2004-12-21 18:39:00.828844984 +0100
355 @@ -110,6 +110,21 @@
356         return 0;
357  }
358  
359 +extern long sys_truncate(char *, loff_t); 
360 +extern long sys_ftruncate(int, loff_t); 
361 +
362 +asmlinkage long
363 +sys32_truncate64(char * filename, unsigned long offset_low, unsigned long offset_high)
364 +{
365 +       return sys_truncate(filename, ((loff_t) offset_high << 32) | offset_low);
366 +}
367 +
368 +asmlinkage long
369 +sys32_ftruncate64(unsigned int fd, unsigned long offset_low, unsigned long offset_high)
370 +{
371 +       return sys_ftruncate(fd, ((loff_t) offset_high << 32) | offset_low);
372 +}
373 +
374  /* Another set for IA32/LFS -- x86_64 struct stat is different due to 
375     support for 64bit inode numbers. */
376  
377 @@ -1817,13 +1832,6 @@
378  }
379  #endif
380  
381 -long sys32_module_warning(void)
382 -{ 
383 -               printk(KERN_INFO "%s: 32bit 2.4.x modutils not supported on 64bit kernel\n",
384 -                      current->comm);
385 -       return -ENOSYS ;
386 -} 
387 -
388  extern long sys_io_setup(unsigned nr_reqs, aio_context_t *ctx);
389  
390  long sys32_io_setup(unsigned nr_reqs, u32 *ctx32p)
391 @@ -1989,12 +1997,16 @@
392  
393  long sys32_vm86_warning(void)
394  { 
395 +       struct task_struct *me = current;
396 +       static char lastcomm[8];
397 +       if (strcmp(lastcomm, me->comm)) {
398                 printk(KERN_INFO "%s: vm86 mode not supported on 64 bit kernel\n",
399 -                      current->comm);
400 -       return -ENOSYS ;
401 +                      me->comm);
402 +               strcpy(lastcomm, me->comm); 
403 +       } 
404 +       return -ENOSYS;
405  } 
406  
407 -
408  struct exec_domain ia32_exec_domain = { 
409         .name = "linux/x86",
410         .pers_low = PER_LINUX32,
411 diff -urN linux-2.6.0-orig/arch/x86_64/ia32/syscall32.c linux-2.6.0/arch/x86_64/ia32/syscall32.c
412 --- linux-2.6.0-orig/arch/x86_64/ia32/syscall32.c       2004-12-21 18:38:40.599920248 +0100
413 +++ linux-2.6.0/arch/x86_64/ia32/syscall32.c    2004-12-21 18:39:00.828844984 +0100
414 @@ -30,10 +30,12 @@
415  int map_syscall32(struct mm_struct *mm, unsigned long address) 
416  { 
417         pte_t *pte;
418 +       pmd_t *pmd;
419         int err = 0;
420 +
421         down_read(&mm->mmap_sem);
422         spin_lock(&mm->page_table_lock); 
423 -       pmd_t *pmd = pmd_alloc(mm, pgd_offset(mm, address), address); 
424 +       pmd = pmd_alloc(mm, pgd_offset(mm, address), address); 
425         if (pmd && (pte = pte_alloc_map(mm, pmd, address)) != NULL) { 
426                 if (pte_none(*pte)) { 
427                         set_pte(pte, 
428 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/Makefile linux-2.6.0/arch/x86_64/kernel/Makefile
429 --- linux-2.6.0-orig/arch/x86_64/kernel/Makefile        2004-12-21 18:38:40.594921008 +0100
430 +++ linux-2.6.0/arch/x86_64/kernel/Makefile     2004-12-21 18:39:00.829844832 +0100
431 @@ -18,13 +18,16 @@
432  obj-$(CONFIG_X86_IO_APIC)      += io_apic.o mpparse.o
433  obj-$(CONFIG_PM)               += suspend.o
434  obj-$(CONFIG_SOFTWARE_SUSPEND) += suspend_asm.o
435 +obj-$(CONFIG_CPU_FREQ)         += cpufreq/
436  obj-$(CONFIG_EARLY_PRINTK)     += early_printk.o
437  obj-$(CONFIG_GART_IOMMU)       += pci-gart.o aperture.o
438  obj-$(CONFIG_DUMMY_IOMMU)      += pci-nommu.o pci-dma.o
439  
440  obj-$(CONFIG_MODULES)          += module.o
441  
442 +obj-y                          += topology.o
443 +
444  bootflag-y                     += ../../i386/kernel/bootflag.o
445 -cpuid-$(CONFIG_X86_CPUID)      += ../../i386/kernel/cpuid.o
446 +cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
447 +topology-y                     += ../../i386/mach-default/topology.o
448  
449 -obj-$(CONFIG_CPU_FREQ) +=      cpufreq/
450 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/acpi/sleep.c linux-2.6.0/arch/x86_64/kernel/acpi/sleep.c
451 --- linux-2.6.0-orig/arch/x86_64/kernel/acpi/sleep.c    2004-12-21 18:38:40.589921768 +0100
452 +++ linux-2.6.0/arch/x86_64/kernel/acpi/sleep.c 2004-12-21 18:39:00.829844832 +0100
453 @@ -56,6 +56,7 @@
454  
455  /* address in low memory of the wakeup routine. */
456  unsigned long acpi_wakeup_address = 0;
457 +unsigned long acpi_video_flags;
458  extern char wakeup_start, wakeup_end;
459  
460  extern unsigned long FASTCALL(acpi_copy_wakeup_routine(unsigned long));
461 @@ -116,6 +117,22 @@
462         printk(KERN_DEBUG "ACPI: have wakeup address 0x%8.8lx\n", acpi_wakeup_address);
463  }
464  
465 +static int __init acpi_sleep_setup(char *str)
466 +{
467 +       while ((str != NULL) && (*str != '\0')) {
468 +               if (strncmp(str, "s3_bios", 7) == 0)
469 +                       acpi_video_flags = 1;
470 +               if (strncmp(str, "s3_mode", 7) == 0)
471 +                       acpi_video_flags |= 2;
472 +               str = strchr(str, ',');
473 +               if (str != NULL)
474 +                       str += strspn(str, ", \t");
475 +       }
476 +       return 1;
477 +}
478 +
479 +__setup("acpi_sleep=", acpi_sleep_setup);
480 +
481  #endif /*CONFIG_ACPI_SLEEP*/
482  
483  void acpi_pci_link_exit(void) {}
484 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/acpi/wakeup.S linux-2.6.0/arch/x86_64/kernel/acpi/wakeup.S
485 --- linux-2.6.0-orig/arch/x86_64/kernel/acpi/wakeup.S   2004-12-21 18:38:40.590921616 +0100
486 +++ linux-2.6.0/arch/x86_64/kernel/acpi/wakeup.S        2004-12-21 18:39:00.829844832 +0100
487 @@ -41,7 +41,19 @@
488         cmpl    $0x12345678, %eax
489         jne     bogus_real_magic
490  
491 +       testl   $1, video_flags - wakeup_code
492 +       jz      1f
493         lcall   $0xc000,$3
494 +       movw    %cs, %ax
495 +       movw    %ax, %ds                                        # Bios might have played with that
496 +       movw    %ax, %ss
497 +1:
498 +
499 +       testl   $2, video_flags - wakeup_code
500 +       jz      1f
501 +       mov     video_mode - wakeup_code, %ax
502 +       call    mode_seta
503 +1:
504  
505         movw    $0xb800, %ax
506         movw    %ax,%fs
507 @@ -250,6 +262,7 @@
508                 .quad 0
509  real_magic:    .quad 0
510  video_mode:    .quad 0
511 +video_flags:   .quad 0
512  
513  bogus_real_magic:
514         movb    $0xba,%al       ;  outb %al,$0x80               
515 @@ -382,8 +395,10 @@
516         movl    %eax, saved_efer
517         movl    %edx, saved_efer2
518  
519 -#      movq    saved_videomode, %rdx                           # FIXME:         videomode
520 -       movq    %rdx, video_mode - wakeup_start (,%rdi)
521 +       movl    saved_video_mode, %edx
522 +       movl    %edx, video_mode - wakeup_start (,%rdi)
523 +       movl    acpi_video_flags, %edx
524 +       movl    %edx, video_flags - wakeup_start (,%rdi)
525         movq    $0x12345678, real_magic - wakeup_start (,%rdi)
526         movq    $0x123456789abcdef0, %rdx
527         movq    %rdx, saved_magic
528 @@ -415,8 +430,6 @@
529  .LFB5:
530         subq    $8, %rsp
531  .LCFI2:
532 -       testl   %edi, %edi
533 -       jne     .L99
534         xorl    %eax, %eax
535         call    save_processor_state
536  
537 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/apic.c linux-2.6.0/arch/x86_64/kernel/apic.c
538 --- linux-2.6.0-orig/arch/x86_64/kernel/apic.c  2004-12-21 18:38:40.590921616 +0100
539 +++ linux-2.6.0/arch/x86_64/kernel/apic.c       2004-12-21 18:39:00.830844680 +0100
540 @@ -42,6 +42,8 @@
541  static DEFINE_PER_CPU(int, prof_old_multiplier) = 1;
542  static DEFINE_PER_CPU(int, prof_counter) = 1;
543  
544 +static void apic_pm_activate(void);
545 +
546  void enable_NMI_through_LVT0 (void * dummy)
547  {
548         unsigned int v, ver;
549 @@ -435,6 +437,7 @@
550  
551         if (nmi_watchdog == NMI_LOCAL_APIC)
552                 setup_apic_nmi_watchdog();
553 +       apic_pm_activate();
554  }
555  
556  #ifdef CONFIG_PM
557 @@ -556,7 +559,7 @@
558  
559  #else  /* CONFIG_PM */
560  
561 -static inline void apic_pm_activate(void) { }
562 +static void apic_pm_activate(void) { }
563  
564  #endif /* CONFIG_PM */
565  
566 @@ -579,7 +582,6 @@
567         if (nmi_watchdog != NMI_NONE)
568                 nmi_watchdog = NMI_LOCAL_APIC;
569  
570 -       apic_pm_activate();
571         return 0;
572  }
573  
574 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/bluesmoke.c linux-2.6.0/arch/x86_64/kernel/bluesmoke.c
575 --- linux-2.6.0-orig/arch/x86_64/kernel/bluesmoke.c     2004-12-21 18:38:40.594921008 +0100
576 +++ linux-2.6.0/arch/x86_64/kernel/bluesmoke.c  2004-12-21 18:39:00.831844528 +0100
577 @@ -26,19 +26,6 @@
578  static int banks;
579  static unsigned long ignored_banks, disabled_banks;
580  
581 -/* Machine Check on everything dubious. This is a good setting
582 -   for device driver testing. */
583 -#define K8_DRIVER_DEBUG ((1<<13)-1)
584 -/* Report RAM errors and Hyper Transport Problems, but ignore Device
585 -   aborts and GART errors. */
586 -#define K8_NORMAL_OP    0xff
587 -
588 -#ifdef CONFIG_MCE_DEBUG
589 -static u32 k8_nb_flags __initdata = K8_DRIVER_DEBUG;
590 -#else
591 -static u32 k8_nb_flags __initdata = K8_NORMAL_OP;
592 -#endif
593 -
594  static void generic_machine_check(struct pt_regs * regs, long error_code)
595  {
596         int recover=1;
597 @@ -200,11 +187,14 @@
598  static void check_k8_nb(int header)
599  {
600         struct pci_dev *nb;
601 +       u32 statuslow, statushigh;
602 +       unsigned short errcode;
603 +       int i;
604 +
605         nb = find_k8_nb(); 
606         if (nb == NULL)
607                 return;
608  
609 -       u32 statuslow, statushigh;
610         pci_read_config_dword(nb, 0x48, &statuslow);
611         pci_read_config_dword(nb, 0x4c, &statushigh);
612         if (!(statushigh & (1<<31)))
613 @@ -215,50 +205,42 @@
614         printk(KERN_ERR "Northbridge status %08x%08x\n",
615                statushigh,statuslow); 
616  
617 -       unsigned short errcode = statuslow & 0xffff;    
618 -       switch (errcode >> 8) { 
619 -       case 0:                                         
620 +       printk(KERN_ERR "    Error %s\n", extendederr[(statuslow >> 16) & 0xf]); 
621 +
622 +       errcode = statuslow & 0xffff;   
623 +       switch ((statuslow >> 16) & 0xF) { 
624 +       case 5:                                         
625                 printk(KERN_ERR "    GART TLB error %s %s\n", 
626                        transaction[(errcode >> 2) & 3], 
627                        cachelevel[errcode & 3]);
628                 break;
629 -       case 1: 
630 -               if (errcode & (1<<11)) { 
631 -                       printk(KERN_ERR "    bus error %s %s %s %s %s\n",
632 -                              partproc[(errcode >> 10) & 0x3],
633 -                              timeout[(errcode >> 9) & 1],
634 +       case 8:
635 +               printk(KERN_ERR "    ECC error syndrome %x\n", 
636 +                      (((statuslow >> 24) & 0xff)  << 8) | ((statushigh >> 15) & 0x7f));               
637 +               /*FALL THROUGH*/
638 +       default:
639 +               printk(KERN_ERR "    bus error %s, %s\n    %s\n    %s, %s\n",
640 +                      partproc[(errcode >> 9) & 0x3],
641 +                      timeout[(errcode >> 8) & 1],
642                                memtrans[(errcode >> 4) & 0xf],
643                                memoryio[(errcode >> 2) & 0x3], 
644                                cachelevel[(errcode & 0x3)]); 
645 -               } else if (errcode & (1<<8)) { 
646 -                       printk(KERN_ERR "    memory error %s %s %s\n",
647 -                              memtrans[(errcode >> 4) & 0xf],
648 -                              transaction[(errcode >> 2) & 0x3],
649 -                              cachelevel[(errcode & 0x3)]);
650 -               } else {
651 -                       printk(KERN_ERR "    unknown error code %x\n", errcode); 
652 -               }
653 -               break;
654 -       } 
655 -       if (statushigh & ((1<<14)|(1<<13)))
656 -               printk(KERN_ERR "    ECC syndrome bits %x\n", 
657 -                      (((statuslow >> 24) & 0xff)  << 8) | ((statushigh >> 15) & 0x7f));
658 -       errcode = (statuslow >> 16) & 0xf;
659 -       printk(KERN_ERR "    extended error %s\n", extendederr[(statuslow >> 16) & 0xf]); 
660 -       
661         /* should only print when it was a HyperTransport related error. */
662         printk(KERN_ERR "    link number %x\n", (statushigh >> 4) & 3);
663 +               break;
664 +       } 
665  
666 -       int i;
667 -       for (i = 0; i < 32; i++) 
668 +       for (i = 0; i < 32; i++) {
669 +               if (i == 26 || i == 28) 
670 +                       continue;
671                 if (highbits[i] && (statushigh & (1<<i)))
672                         printk(KERN_ERR "    %s\n", highbits[i]); 
673 -
674 +       }
675         if (statushigh & (1<<26)) { 
676                 u32 addrhigh, addrlow; 
677                 pci_read_config_dword(nb, 0x54, &addrhigh); 
678                 pci_read_config_dword(nb, 0x50, &addrlow); 
679 -               printk(KERN_ERR "    error address %08x%08x\n", addrhigh,addrlow); 
680 +               printk(KERN_ERR "    NB error address %08x%08x\n", addrhigh,addrlow); 
681         }
682         statushigh &= ~(1<<31); 
683         pci_write_config_dword(nb, 0x4c, statushigh);           
684 @@ -307,9 +289,6 @@
685         wrmsrl(MSR_IA32_MC0_STATUS+4*4, 0); 
686         wrmsrl(MSR_IA32_MCG_STATUS, 0);
687         
688 -       if (regs && (status & (1<<1)))
689 -               printk(KERN_EMERG "MCE at RIP %lx RSP %lx\n", regs->rip, regs->rsp); 
690 -
691   others:
692         generic_machine_check(regs, error_code); 
693  
694 @@ -367,12 +346,13 @@
695         machine_check_vector = k8_machine_check; 
696         for (i = 0; i < banks; i++) { 
697                 u64 val = ((1UL<<i) & disabled_banks) ? 0 : ~0UL; 
698 -               if (val && i == 4) 
699 -                       val = k8_nb_flags;
700                 wrmsrl(MSR_IA32_MC0_CTL+4*i, val);
701                 wrmsrl(MSR_IA32_MC0_STATUS+4*i,0); 
702         }
703  
704 +       if (cap & (1<<8))
705 +               wrmsrl(MSR_IA32_MCG_CTL, 0xffffffffffffffffULL);
706 +
707         set_in_cr4(X86_CR4_MCE);                
708  
709         if (mcheck_interval && (smp_processor_id() == 0)) { 
710 @@ -469,7 +449,6 @@
711     mce=nok8 disable k8 specific features
712     mce=disable<NUMBER> disable bank NUMBER
713     mce=enable<NUMBER> enable bank number
714 -   mce=device  Enable device driver test reporting in NB
715     mce=NUMBER mcheck timer interval number seconds. 
716     Can be also comma separated in a single mce= */
717  static int __init mcheck_enable(char *str)
718 @@ -486,8 +465,6 @@
719                         disabled_banks |= ~(1<<simple_strtol(p+7,NULL,0));
720                 else if (!strcmp(p,"nok8"))
721                         nok8 = 1;
722 -               else if (!strcmp(p,"device"))
723 -                       k8_nb_flags = K8_DRIVER_DEBUG;
724         }
725         return 0;
726  }
727 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/e820.c linux-2.6.0/arch/x86_64/kernel/e820.c
728 --- linux-2.6.0-orig/arch/x86_64/kernel/e820.c  2004-12-21 18:38:40.591921464 +0100
729 +++ linux-2.6.0/arch/x86_64/kernel/e820.c       2004-12-21 18:39:00.831844528 +0100
730 @@ -2,10 +2,6 @@
731   * Handle the memory map.
732   * The functions here do the job until bootmem takes over.
733   * $Id$
734 -
735 - * AK: some of these functions are not used in 2.5 yet but they will be when
736 - * NUMA is completely merged.
737 -
738   */
739  #include <linux/config.h>
740  #include <linux/kernel.h>
741 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/head.S linux-2.6.0/arch/x86_64/kernel/head.S
742 --- linux-2.6.0-orig/arch/x86_64/kernel/head.S  2004-12-21 18:38:40.593921160 +0100
743 +++ linux-2.6.0/arch/x86_64/kernel/head.S       2004-12-21 18:39:00.832844376 +0100
744 @@ -38,6 +38,9 @@
745  
746         movl %ebx,%ebp  /* Save trampoline flag */
747         
748 +       movl $__KERNEL_DS,%eax
749 +       movl %eax,%ds
750 +       
751         /* If the CPU doesn't support CPUID this will double fault.
752          * Unfortunately it is hard to check for CPUID without a stack. 
753          */
754 @@ -114,25 +117,11 @@
755         movl    $(pGDT32 - __START_KERNEL_map), %eax
756         lgdt    (%eax)
757  
758 +second:        
759         movl    $(ljumpvector - __START_KERNEL_map), %eax
760         /* Finally jump in 64bit mode */
761         ljmp    *(%eax)
762  
763 -second:
764 -       /* abuse syscall to get into 64bit mode. this way we don't need
765 -          a working low identity mapping just for the short 32bit roundtrip. 
766 -          XXX kludge. this should not be needed. */
767 -       movl  $MSR_STAR,%ecx
768 -       xorl  %eax,%eax
769 -       movl  $(__USER32_CS<<16)|__KERNEL_CS,%edx
770 -       wrmsr
771 -
772 -       movl  $MSR_CSTAR,%ecx
773 -       movl  $0xffffffff,%edx
774 -       movl  $0x80100100,%eax  # reach_long64 absolute
775 -       wrmsr
776 -       syscall
777 -
778         .code64
779         .org 0x100      
780  reach_long64:
781 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/io_apic.c linux-2.6.0/arch/x86_64/kernel/io_apic.c
782 --- linux-2.6.0-orig/arch/x86_64/kernel/io_apic.c       2004-12-21 18:38:40.593921160 +0100
783 +++ linux-2.6.0/arch/x86_64/kernel/io_apic.c    2004-12-21 18:39:00.833844224 +0100
784 @@ -147,6 +147,13 @@
785         struct IO_APIC_route_entry entry;
786         unsigned long flags;
787  
788 +       /* Check delivery_mode to be sure we're not clearing an SMI pin */
789 +       spin_lock_irqsave(&ioapic_lock, flags);
790 +       *(((int*)&entry) + 0) = io_apic_read(apic, 0x10 + 2 * pin);
791 +       *(((int*)&entry) + 1) = io_apic_read(apic, 0x11 + 2 * pin);
792 +       spin_unlock_irqrestore(&ioapic_lock, flags);
793 +       if (entry.delivery_mode == dest_SMI)
794 +               return;
795         /*
796          * Disable it in the IO-APIC irq-routing table:
797          */
798 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/mpparse.c linux-2.6.0/arch/x86_64/kernel/mpparse.c
799 --- linux-2.6.0-orig/arch/x86_64/kernel/mpparse.c       2004-12-21 18:38:40.591921464 +0100
800 +++ linux-2.6.0/arch/x86_64/kernel/mpparse.c    2004-12-21 18:39:00.833844224 +0100
801 @@ -226,7 +226,7 @@
802         unsigned char *mpt=((unsigned char *)mpc)+count;
803  
804         if (memcmp(mpc->mpc_signature,MPC_SIGNATURE,4)) {
805 -               panic("SMP mptable: bad signature [%c%c%c%c]!\n",
806 +               printk("SMP mptable: bad signature [%c%c%c%c]!\n",
807                         mpc->mpc_signature[0],
808                         mpc->mpc_signature[1],
809                         mpc->mpc_signature[2],
810 @@ -234,7 +234,7 @@
811                 return 0;
812         }
813         if (mpf_checksum((unsigned char *)mpc,mpc->mpc_length)) {
814 -               panic("SMP mptable: checksum error!\n");
815 +               printk("SMP mptable: checksum error!\n");
816                 return 0;
817         }
818         if (mpc->mpc_spec!=0x01 && mpc->mpc_spec!=0x04) {
819 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/pci-gart.c linux-2.6.0/arch/x86_64/kernel/pci-gart.c
820 --- linux-2.6.0-orig/arch/x86_64/kernel/pci-gart.c      2004-12-21 18:38:40.592921312 +0100
821 +++ linux-2.6.0/arch/x86_64/kernel/pci-gart.c   2004-12-21 18:39:00.834844072 +0100
822 @@ -31,6 +31,10 @@
823  #include <asm/kdebug.h>
824  #include <asm/proto.h>
825  
826 +/* Workarounds for specific drivers */
827 +#define FUSION_WORKAROUND 1 
828 +#define FLUSH_WORKAROUND 1
829 +
830  dma_addr_t bad_dma_address;
831  
832  unsigned long iommu_bus_base;  /* GART remapping area (physical) */
833 @@ -44,12 +48,13 @@
834  #ifdef CONFIG_IOMMU_DEBUG
835  int panic_on_overflow = 1; 
836  int force_iommu = 1;
837 -int sac_force_size = 0; 
838  #else
839 -int panic_on_overflow = 1; /* for testing */
840 +int panic_on_overflow = 0;
841  int force_iommu = 0;
842 -int sac_force_size = 256*1024*1024;
843  #endif
844 +int iommu_merge = 0; 
845 +int iommu_sac_force = 0; 
846 +int iommu_fullflush = 0;
847  
848  /* Allocation bitmap for the remapping area */ 
849  static spinlock_t iommu_bitmap_lock = SPIN_LOCK_UNLOCKED;
850 @@ -125,7 +130,7 @@
851  /* 
852   * Use global flush state to avoid races with multiple flushers.
853   */
854 -static void __flush_gart(struct pci_dev *dev)
855 +static void flush_gart(struct pci_dev *dev)
856  { 
857         unsigned long flags;
858         int bus = dev ? dev->bus->number : -1;
859 @@ -134,13 +139,17 @@
860         int i;
861  
862         spin_lock_irqsave(&iommu_bitmap_lock, flags);
863 -       /* recheck flush count inside lock */
864 -       if (need_flush) { 
865 +       if (need_flush || iommu_fullflush) { 
866                 for (i = 0; northbridges[i]; i++) {
867 +                       u32 w;
868                         if (bus >= 0 && !(cpu_isset_const(i, bus_cpumask)))
869                                 continue;
870                         pci_write_config_dword(northbridges[i], 0x9c, 
871                                                northbridge_flush_word[i] | 1); 
872 +                       /* Make sure the hardware actually executed the flush. */
873 +                       do { 
874 +                               pci_read_config_dword(northbridges[i], 0x9c, &w);
875 +                       } while (w & 1);
876                         flushed++;
877                 } 
878                 if (!flushed) 
879 @@ -150,12 +159,6 @@
880         spin_unlock_irqrestore(&iommu_bitmap_lock, flags);
881  } 
882  
883 -static inline void flush_gart(struct pci_dev *dev)
884 -{ 
885 -       if (need_flush)
886 -               __flush_gart(dev);
887 -} 
888 -
889  /* 
890   * Allocate memory for a consistent mapping.
891   * All mappings are consistent here, so this is just a wrapper around
892 @@ -174,11 +177,16 @@
893         } else {
894                 dma_mask = hwdev->consistent_dma_mask; 
895         }
896 +
897         if (dma_mask == 0) 
898                 dma_mask = 0xffffffff; 
899         if (dma_mask < 0xffffffff || no_iommu)
900                 gfp |= GFP_DMA;
901  
902 +       /* Kludge to make it bug-to-bug compatible with i386. i386
903 +          uses the normal dma_mask for alloc_consistent. */
904 +       dma_mask &= hwdev->dma_mask;
905 +
906         memory = (void *)__get_free_pages(gfp, get_order(size));
907         if (memory == NULL) {
908                 return NULL; 
909 @@ -394,7 +402,9 @@
910         
911         for (i = start; i < stopat; i++) {
912                 struct scatterlist *s = &sg[i];
913 -               unsigned long start_addr = s->dma_address;
914 +               unsigned long pages, addr;
915 +               unsigned long phys_addr = s->dma_address;
916 +               
917                 BUG_ON(i > start && s->offset);
918                 if (i == start) {
919                         *sout = *s; 
920 @@ -403,8 +413,10 @@
921                 } else { 
922                         sout->length += s->length; 
923                 }
924 -               unsigned long addr = start_addr;
925 -               while (addr < start_addr + s->length) { 
926 +
927 +               addr = phys_addr;
928 +               pages = to_pages(s->offset, s->length); 
929 +               while (pages--) { 
930                         iommu_gatt_base[iommu_page] = GPTE_ENCODE(addr); 
931                         SET_LEAK(iommu_page);
932                         addr += PAGE_SIZE;
933 @@ -437,7 +449,7 @@
934         int out;
935         int start;
936         unsigned long pages = 0;
937 -       int need = 0;
938 +       int need = 0, nextneed;
939  
940         unsigned long size = 0; 
941  
942 @@ -453,13 +465,14 @@
943                 BUG_ON(s->length == 0); 
944  
945                 size += s->length; 
946 +               nextneed = need_iommu(dev, addr, s->length); 
947  
948                 /* Handle the previous not yet processed entries */
949                 if (i > start) {
950                         struct scatterlist *ps = &sg[i-1];
951                         /* Can only merge when the last chunk ends on a page 
952 -                          boundary. */
953 -                       if (!force_iommu || !need || (i-1 > start && ps->offset) ||
954 +                          boundary and the new one doesn't have an offset. */
955 +                       if (!iommu_merge || !nextneed || !need || s->offset ||
956                             (ps->offset + ps->length) % PAGE_SIZE) { 
957                                 if (pci_map_cont(sg, start, i, sg+out, pages, 
958                                                  need) < 0)
959 @@ -470,7 +483,7 @@
960                         }
961         }
962  
963 -               need = need_iommu(dev, addr, s->length); 
964 +               need = nextneed;
965                 pages += to_pages(s->offset, s->length);
966         }
967         if (pci_map_cont(sg, start, i, sg+out, pages, need) < 0)
968 @@ -539,19 +552,30 @@
969          if (mask < 0x00ffffff)
970                  return 0;
971  
972 +#ifdef FUSION_WORKAROUND
973 +       if (dev->vendor == PCI_VENDOR_ID_LSI_LOGIC && mask > 0xffffffff) { 
974 +               force_iommu = 1;
975 +               iommu_merge = 1; 
976 +               return 0; 
977 +       } 
978 +#endif
979 +#ifdef FLUSH_WORKAROUND
980 +       if ((dev->vendor == PCI_VENDOR_ID_3WARE && mask <= 0xffffffff) ||
981 +           (dev->vendor == PCI_VENDOR_ID_QLOGIC && force_iommu))
982 +               iommu_fullflush = 1;
983 +#endif
984 +
985         /* Tell the device to use SAC when IOMMU force is on. 
986            This allows the driver to use cheaper accesses in some cases.
987  
988            Problem with this is that if we overflow the IOMMU area
989            and return DAC as fallback address the device may not handle it correctly.
990 -          As a compromise we only do this if the IOMMU area is >= 256MB 
991 -          which should make overflow unlikely enough.
992            
993            As a special case some controllers have a 39bit address mode 
994            that is as efficient as 32bit (aic79xx). Don't force SAC for these.
995            Assume all masks <= 40 bits are of this type. Normally this doesn't
996            make any difference, but gives more gentle handling of IOMMU overflow. */
997 -       if (force_iommu && (mask > 0xffffffffffULL) && (iommu_size >= sac_force_size)){ 
998 +       if (iommu_sac_force && (mask >= 0xffffffffffULL)) { 
999                 printk(KERN_INFO "%s: Force SAC with mask %Lx\n", dev->slot_name,mask);
1000                 return 0; 
1001         }
1002 @@ -680,7 +704,7 @@
1003         unsigned long iommu_start;
1004         struct pci_dev *dev;
1005                 
1006 -#ifndef CONFIG_AGP_AMD_8151
1007 +#ifndef CONFIG_AGP_AMD64
1008         no_agp = 1; 
1009  #else
1010         /* Makefile puts PCI initialization via subsys_initcall first. */
1011 @@ -776,7 +800,8 @@
1012  /* Must execute after PCI subsystem */
1013  fs_initcall(pci_iommu_init);
1014  
1015 -/* iommu=[size][,noagp][,off][,force][,noforce][,leak][,memaper[=order]]
1016 +/* iommu=[size][,noagp][,off][,force][,noforce][,leak][,memaper[=order]][,merge]
1017 +         [,forcesac][,fullflush][,nomerge]
1018     size  set size of iommu (in bytes) 
1019     noagp don't initialize the AGP driver and use full aperture.
1020     off   don't use the IOMMU
1021 @@ -784,6 +809,10 @@
1022     memaper[=order] allocate an own aperture over RAM with size 32MB^order.  
1023     noforce don't force IOMMU usage. Default.
1024     force  Force IOMMU.
1025 +   merge  Do SG merging. Implies force (experimental)  
1026 +   nomerge Don't do SG merging.
1027 +   forcesac For SAC mode for masks <40bits  (experimental)
1028 +   fullflush Flush IOMMU on each allocation (for testing)
1029  */
1030  __init int iommu_setup(char *opt) 
1031  { 
1032 @@ -797,8 +826,10 @@
1033                     no_iommu = 1;
1034             if (!memcmp(p,"force", 5))
1035                     force_iommu = 1;
1036 -           if (!memcmp(p,"noforce", 7))
1037 +           if (!memcmp(p,"noforce", 7)) { 
1038 +                   iommu_merge = 0;
1039                     force_iommu = 0;
1040 +           }
1041             if (!memcmp(p, "memaper", 7)) { 
1042                     fallback_aper_force = 1; 
1043                     p += 7; 
1044 @@ -809,6 +840,16 @@
1045                     panic_on_overflow = 1;
1046             if (!memcmp(p, "nopanic", 7))
1047                     panic_on_overflow = 0;          
1048 +           if (!memcmp(p, "merge", 5)) { 
1049 +                   iommu_merge = 1;
1050 +                   force_iommu = 1; 
1051 +           }
1052 +           if (!memcmp(p, "nomerge", 7))
1053 +                   iommu_merge = 0;
1054 +           if (!memcmp(p, "forcesac", 8))
1055 +                   iommu_sac_force = 1;
1056 +           if (!memcmp(p, "fullflush", 9))
1057 +                   iommu_fullflush = 1;
1058  #ifdef CONFIG_IOMMU_LEAK
1059             if (!memcmp(p,"leak", 4)) { 
1060                     leak_trace = 1;
1061 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/pci-nommu.c linux-2.6.0/arch/x86_64/kernel/pci-nommu.c
1062 --- linux-2.6.0-orig/arch/x86_64/kernel/pci-nommu.c     2004-12-21 18:38:40.589921768 +0100
1063 +++ linux-2.6.0/arch/x86_64/kernel/pci-nommu.c  2004-12-21 18:39:00.835843920 +0100
1064 @@ -4,6 +4,8 @@
1065  #include <linux/string.h>
1066  #include <asm/proto.h>
1067  
1068 +int iommu_merge = 0;
1069 +
1070  /* 
1071   * Dummy IO MMU functions
1072   */
1073 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/process.c linux-2.6.0/arch/x86_64/kernel/process.c
1074 --- linux-2.6.0-orig/arch/x86_64/kernel/process.c       2004-12-21 18:38:40.593921160 +0100
1075 +++ linux-2.6.0/arch/x86_64/kernel/process.c    2004-12-21 18:39:00.835843920 +0100
1076 @@ -152,6 +152,19 @@
1077  
1078  __setup("idle=", idle_setup);
1079  
1080 +void idle_warning(void) 
1081 +{ 
1082 +       static int warned;
1083 +       if (warned)
1084 +               return; 
1085 +       warned = 1;
1086 +       if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) 
1087 +               BUG();
1088 +       printk(KERN_ERR "******* Your BIOS seems to not contain a fix for K8 errata #93\n"); 
1089 +       printk(KERN_ERR "******* Working around it, but it will cost you a lot of power\n");
1090 +       printk(KERN_ERR "******* Please consider a BIOS update.\n");
1091 +       printk(KERN_ERR "******* Disabling USB legacy in the BIOS may also help.\n");
1092 +} 
1093  
1094  /* Prints also some state that isn't saved in the pt_regs */ 
1095  void __show_regs(struct pt_regs * regs)
1096 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/setup.c linux-2.6.0/arch/x86_64/kernel/setup.c
1097 --- linux-2.6.0-orig/arch/x86_64/kernel/setup.c 2004-12-21 18:38:40.589921768 +0100
1098 +++ linux-2.6.0/arch/x86_64/kernel/setup.c      2004-12-21 18:39:00.836843768 +0100
1099 @@ -243,6 +243,9 @@
1100                 }
1101  #endif
1102  
1103 +               if (!memcmp(from,"oops=panic", 10))
1104 +                       panic_on_oops = 1;
1105 +
1106         next_char:
1107                 c = *(from++);
1108                 if (!c)
1109 @@ -338,6 +341,7 @@
1110  void __init setup_arch(char **cmdline_p)
1111  {
1112         unsigned long low_mem_size;
1113 +       unsigned long kernel_end;
1114  
1115         ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
1116         drive_info = DRIVE_INFO;
1117 @@ -386,7 +390,6 @@
1118                                 (table_end - table_start) << PAGE_SHIFT);
1119  
1120         /* reserve kernel */
1121 -       unsigned long kernel_end;
1122         kernel_end = round_up(__pa_symbol(&_end),PAGE_SIZE);
1123         reserve_bootmem_generic(HIGH_MEMORY, kernel_end - HIGH_MEMORY);
1124  
1125 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/signal.c linux-2.6.0/arch/x86_64/kernel/signal.c
1126 --- linux-2.6.0-orig/arch/x86_64/kernel/signal.c        2004-12-21 18:38:40.593921160 +0100
1127 +++ linux-2.6.0/arch/x86_64/kernel/signal.c     2004-12-21 18:39:00.836843768 +0100
1128 @@ -93,6 +93,8 @@
1129  {
1130         unsigned int err = 0;
1131  
1132 +       /* Always make any pending restarted system calls return -EINTR */
1133 +       current_thread_info()->restart_block.fn = do_no_restart_syscall;
1134  
1135  #define COPY(x)                err |= __get_user(regs->x, &sc->x)
1136  
1137 @@ -355,8 +357,6 @@
1138                 /* If so, check system call restarting.. */
1139                 switch (regs->rax) {
1140                         case -ERESTART_RESTARTBLOCK:
1141 -                               current_thread_info()->restart_block.fn = do_no_restart_syscall;
1142 -                               /* FALL THROUGH */
1143                         case -ERESTARTNOHAND:
1144                                 regs->rax = -EINTR;
1145                                 break;
1146 @@ -371,10 +371,6 @@
1147                                 regs->rax = regs->orig_rax;
1148                                 regs->rip -= 2;
1149                 }
1150 -               if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK){
1151 -                       regs->rax = __NR_restart_syscall;
1152 -                       regs->rip -= 2;
1153 -               }               
1154         }
1155  
1156  #ifdef CONFIG_IA32_EMULATION
1157 @@ -453,6 +449,10 @@
1158                         regs->rax = regs->orig_rax;
1159                         regs->rip -= 2;
1160                 }
1161 +               if (regs->rax == (unsigned long)-ERESTART_RESTARTBLOCK) {
1162 +                       regs->rax = __NR_restart_syscall;
1163 +                       regs->rip -= 2;
1164 +               }
1165         }
1166         return 0;
1167  }
1168 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/smpboot.c linux-2.6.0/arch/x86_64/kernel/smpboot.c
1169 --- linux-2.6.0-orig/arch/x86_64/kernel/smpboot.c       2004-12-21 18:38:40.595920856 +0100
1170 +++ linux-2.6.0/arch/x86_64/kernel/smpboot.c    2004-12-21 18:39:00.837843616 +0100
1171 @@ -54,7 +54,7 @@
1172  #include <asm/proto.h>
1173  
1174  /* Bitmask of currently online CPUs */
1175 -cpumask_t cpu_online_map;
1176 +cpumask_t cpu_online_map = { 1 };
1177  
1178  static cpumask_t cpu_callin_map;
1179  cpumask_t cpu_callout_map;
1180 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/time.c linux-2.6.0/arch/x86_64/kernel/time.c
1181 --- linux-2.6.0-orig/arch/x86_64/kernel/time.c  2004-12-21 18:38:40.593921160 +0100
1182 +++ linux-2.6.0/arch/x86_64/kernel/time.c       2004-12-21 18:39:00.837843616 +0100
1183 @@ -111,13 +111,21 @@
1184                 sec = xtime.tv_sec;
1185                 usec = xtime.tv_nsec / 1000;
1186  
1187 +#if 0
1188                 /*
1189                  * If time_adjust is negative then NTP is slowing the clock
1190                  * so make sure not to go into next possible interval.
1191                  * Better to lose some accuracy than have time go backwards..
1192                  */
1193 -               if (unlikely(time_adjust < 0) && usec > tickadj)
1194 -                       usec = tickadj;
1195 +               unsigned long lost = jiffies - wall_jiffies;
1196 +               if (unlikely(time_adjust < 0)) {
1197 +                       unsigned long max_ntp_tick = tick_usec - tickadj;
1198 +                       usec = min_t(unsigned, usec, max_ntp_tick);
1199 +                       if (lost)
1200 +                               usec += lost * max_ntp_tick;
1201 +               } else if (unlikely(lost))
1202 +                       usec += lost * tick_usec;
1203 +#endif                 
1204  
1205                 t = (jiffies - wall_jiffies) * (1000000L / HZ) +
1206                         do_gettimeoffset();
1207 @@ -592,6 +600,7 @@
1208         if (!vxtime.hpet_address)
1209                 return -1;
1210         set_fixmap_nocache(FIX_HPET_BASE, vxtime.hpet_address);
1211 +       __set_fixmap(VSYSCALL_HPET, vxtime.hpet_address, PAGE_KERNEL_VSYSCALL_NOCACHE);
1212  
1213  /*
1214   * Read the period, compute tick and quotient.
1215 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/traps.c linux-2.6.0/arch/x86_64/kernel/traps.c
1216 --- linux-2.6.0-orig/arch/x86_64/kernel/traps.c 2004-12-21 18:38:40.589921768 +0100
1217 +++ linux-2.6.0/arch/x86_64/kernel/traps.c      2004-12-21 18:39:00.838843464 +0100
1218 @@ -218,8 +218,12 @@
1219         // debugging aid: "show_stack(NULL, NULL);" prints the
1220         // back trace for this cpu.
1221  
1222 -       if(rsp==NULL)
1223 -               rsp=(unsigned long*)&rsp;
1224 +       if (rsp == NULL) { 
1225 +               if (tsk)
1226 +                       rsp = (unsigned long *)tsk->thread.rsp;
1227 +               else
1228 +                       rsp = (unsigned long *)&rsp;
1229 +       }
1230  
1231         stack = rsp;
1232         for(i=0; i < kstack_depth_to_print; i++) {
1233 @@ -341,6 +345,8 @@
1234         bust_spinlocks(0); 
1235         spin_unlock(&die_lock); 
1236         local_irq_enable();     /* make sure back scroll still works */
1237 +       if (panic_on_oops)
1238 +               panic("Oops"); 
1239  } 
1240  
1241  void __die(const char * str, struct pt_regs * regs, long err)
1242 @@ -844,3 +850,11 @@
1243         cpu_init();
1244  }
1245  
1246 +
1247 +/* Actual parsing is done early in setup.c. */
1248 +static int __init oops_dummy(char *s)
1249 +{ 
1250 +       panic_on_oops = 1;
1251 +       return -1; 
1252 +} 
1253 +__setup("oops=", oops_dummy); 
1254 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/vmlinux.lds.S linux-2.6.0/arch/x86_64/kernel/vmlinux.lds.S
1255 --- linux-2.6.0-orig/arch/x86_64/kernel/vmlinux.lds.S   2004-12-21 18:38:40.589921768 +0100
1256 +++ linux-2.6.0/arch/x86_64/kernel/vmlinux.lds.S        2004-12-21 18:39:00.838843464 +0100
1257 @@ -62,7 +62,13 @@
1258    .sysctl_vsyscall : AT ((LOADADDR(.sys_tz) + SIZEOF(.sys_tz) + 15) & ~(15)) { *(.sysctl_vsyscall) }
1259    sysctl_vsyscall = LOADADDR(.sysctl_vsyscall);
1260    . = ALIGN(16);
1261 -  .jiffies : AT ((LOADADDR(.sysctl_vsyscall) + SIZEOF(.sysctl_vsyscall) + 15) & ~(15)) { *(.jiffies) }
1262 +  .time_adjust : AT ((LOADADDR(.sysctl_vsyscall) + SIZEOF(.sysctl_vsyscall) + 16) & ~(15)) { *(.time_adjust) }
1263 +  time_adjust = LOADADDR(.time_adjust);
1264 +  . = ALIGN(16);
1265 +  .tick_usec : AT ((LOADADDR(.time_adjust) + SIZEOF(.time_adjust) + 16) & ~(15)) { *(.tick_usec) }
1266 +  tick_usec = LOADADDR(.tick_usec);    
1267 +  . = ALIGN(16);
1268 +  .jiffies : AT ((LOADADDR(.tick_usec) + SIZEOF(.tick_usec) + 16) & ~(15)) { *(.jiffies) }
1269    jiffies = LOADADDR(.jiffies);
1270    . = ALIGN(16);
1271    .xtime : AT ((LOADADDR(.jiffies) + SIZEOF(.jiffies) + 15) & ~(15)) { *(.xtime) }
1272 diff -urN linux-2.6.0-orig/arch/x86_64/kernel/vsyscall.c linux-2.6.0/arch/x86_64/kernel/vsyscall.c
1273 --- linux-2.6.0-orig/arch/x86_64/kernel/vsyscall.c      2004-12-21 18:38:40.594921008 +0100
1274 +++ linux-2.6.0/arch/x86_64/kernel/vsyscall.c   2004-12-21 18:39:00.839843312 +0100
1275 @@ -49,12 +49,15 @@
1276  #include <asm/page.h>
1277  #include <asm/fixmap.h>
1278  #include <asm/errno.h>
1279 +#include <asm/io.h>
1280  
1281  #define __vsyscall(nr) __attribute__ ((unused,__section__(".vsyscall_" #nr)))
1282  #define force_inline __attribute__((always_inline)) inline
1283  
1284  int __sysctl_vsyscall __section_sysctl_vsyscall = 1;
1285  seqlock_t __xtime_lock __section_xtime_lock = SEQLOCK_UNLOCKED;
1286 +long __time_adjust __section_time_adjust; 
1287 +long __tick_usec __section_tick_usec;
1288  
1289  #include <asm/unistd.h>
1290  
1291 @@ -82,6 +85,22 @@
1292                 usec = (__xtime.tv_nsec / 1000) +
1293                         (__jiffies - __wall_jiffies) * (1000000 / HZ);
1294  
1295 +#if 0
1296 +               /*
1297 +                * If time_adjust is negative then NTP is slowing the clock
1298 +                * so make sure not to go into next possible interval.
1299 +                * Better to lose some accuracy than have time go backwards..
1300 +                */
1301 +               unsigned long lost = __jiffies - __wall_jiffies;
1302 +               if (unlikely(__time_adjust < 0)) {
1303 +                       unsigned long max_ntp_tick = __tick_usec - tickadj;
1304 +                       usec = min(usec, max_ntp_tick);
1305 +                       if (lost)
1306 +                               usec += lost * max_ntp_tick;
1307 +               } else if (unlikely(lost))
1308 +                       usec += lost * __tick_usec;
1309 +#endif                 
1310 +
1311                 if (__vxtime.mode == VXTIME_TSC) {
1312                         sync_core();
1313                         rdtscll(t);
1314 @@ -89,10 +108,8 @@
1315                         usec += ((t - __vxtime.last_tsc) *
1316                                  __vxtime.tsc_quot) >> 32;
1317                 } else {
1318 -#if 0
1319                         usec += ((readl(fix_to_virt(VSYSCALL_HPET) + 0xf0) -
1320                                   __vxtime.last) * __vxtime.quot) >> 32;
1321 -#endif
1322                 }
1323         } while (read_seqretry(&__xtime_lock, sequence));
1324  
1325 diff -urN linux-2.6.0-orig/arch/x86_64/mm/fault.c linux-2.6.0/arch/x86_64/mm/fault.c
1326 --- linux-2.6.0-orig/arch/x86_64/mm/fault.c     2004-12-21 18:38:40.596920704 +0100
1327 +++ linux-2.6.0/arch/x86_64/mm/fault.c  2004-12-21 18:39:00.839843312 +0100
1328 @@ -73,6 +73,9 @@
1329         if (regs->cs & (1<<2))
1330                 return 0;
1331  
1332 +       if ((regs->cs & 3) != 0 && regs->rip >= TASK_SIZE)
1333 +               return 0;
1334 +
1335         while (scan_more && instr < max_instr) { 
1336                 unsigned char opcode;
1337                 unsigned char instr_hi;
1338 @@ -337,7 +340,8 @@
1339                 }
1340         
1341                 tsk->thread.cr2 = address;
1342 -               tsk->thread.error_code = error_code;
1343 +               /* Kernel addresses are always protection faults */
1344 +               tsk->thread.error_code = error_code | (address >= TASK_SIZE);
1345                 tsk->thread.trap_no = 14;
1346                 info.si_signo = SIGSEGV;
1347                 info.si_errno = 0;
1348 @@ -374,7 +378,7 @@
1349         printk_address(regs->rip);
1350         dump_pagetable(address);
1351         __die("Oops", regs, error_code);
1352 -       /* Execute summary in case the body of the oops scrolled away */
1353 +       /* Executive summary in case the body of the oops scrolled away */
1354         printk(KERN_EMERG "CR2: %016lx\n", address);
1355         oops_end(); 
1356         do_exit(SIGKILL);
1357 diff -urN linux-2.6.0-orig/drivers/block/paride/Kconfig linux-2.6.0/drivers/block/paride/Kconfig
1358 --- linux-2.6.0-orig/drivers/block/paride/Kconfig       2004-12-21 18:38:39.737051424 +0100
1359 +++ linux-2.6.0/drivers/block/paride/Kconfig    2004-12-21 18:39:00.840843160 +0100
1360 @@ -130,7 +130,7 @@
1361  
1362  config PARIDE_BPCK6
1363         tristate "MicroSolutions backpack (Series 6) protocol"
1364 -       depends on PARIDE
1365 +       depends on PARIDE && !64BIT
1366         ---help---
1367           This option enables support for the Micro Solutions BACKPACK
1368           parallel port Series 6 IDE protocol.  (Most BACKPACK drives made
1369 diff -urN linux-2.6.0-orig/drivers/char/agp/amd64-agp.c linux-2.6.0/drivers/char/agp/amd64-agp.c
1370 --- linux-2.6.0-orig/drivers/char/agp/amd64-agp.c       2004-12-21 18:38:39.505086688 +0100
1371 +++ linux-2.6.0/drivers/char/agp/amd64-agp.c    2004-12-21 18:39:00.841843008 +0100
1372 @@ -16,11 +16,7 @@
1373  #include "agp.h"
1374  
1375  /* Will need to be increased if AMD64 ever goes >8-way. */
1376 -#ifdef CONFIG_SMP
1377  #define MAX_HAMMER_GARTS   8
1378 -#else
1379 -#define MAX_HAMMER_GARTS   1
1380 -#endif
1381  
1382  /* PTE bits. */
1383  #define GPTE_VALID     1
1384 @@ -35,9 +31,18 @@
1385  #define INVGART                (1<<0)
1386  #define GARTPTEERR     (1<<1)
1387  
1388 +/* NVIDIA K8 registers */
1389 +#define NVIDIA_X86_64_0_APBASE         0x10
1390 +#define NVIDIA_X86_64_1_APBASE1                0x50
1391 +#define NVIDIA_X86_64_1_APLIMIT1       0x54
1392 +#define NVIDIA_X86_64_1_APSIZE         0xa8
1393 +#define NVIDIA_X86_64_1_APBASE2                0xd8
1394 +#define NVIDIA_X86_64_1_APLIMIT2       0xdc
1395 +
1396  static int nr_garts;
1397  static struct pci_dev * hammers[MAX_HAMMER_GARTS];
1398  
1399 +static struct resource *aperture_resource;
1400  static int __initdata agp_try_unsupported;
1401  
1402  static int gart_iterator;
1403 @@ -250,7 +255,6 @@
1404  /* Some basic sanity checks for the aperture. */
1405  static int __devinit aperture_valid(u64 aper, u32 size)
1406  { 
1407 -       static int not_first_call; 
1408         u32 pfn, c;
1409         if (aper == 0) { 
1410                 printk(KERN_ERR PFX "No aperture\n");
1411 @@ -279,12 +283,11 @@
1412  
1413            Maybe better to use pci_assign_resource/pci_enable_device instead trusting
1414            the bridges? */
1415 -       if (!not_first_call && request_mem_region(aper, size, "aperture") < 0) { 
1416 +       if (!aperture_resource && 
1417 +           !(aperture_resource = request_mem_region(aper, size, "aperture"))) {
1418                 printk(KERN_ERR PFX "Aperture conflicts with PCI mapping.\n"); 
1419                 return 0;
1420         }
1421 -
1422 -       not_first_call = 1;
1423         return 1;
1424  } 
1425  
1426 @@ -347,31 +350,124 @@
1427         /* cache pci_devs of northbridges. */
1428         while ((loop_dev = pci_find_device(PCI_VENDOR_ID_AMD, 0x1103, loop_dev)) 
1429                         != NULL) {
1430 +               if (i == MAX_HAMMER_GARTS) { 
1431 +                       printk(KERN_ERR PFX "Too many northbridges for AGP\n");
1432 +                       return -1;
1433 +               }
1434                 if (fix_northbridge(loop_dev, pdev, cap_ptr) < 0) { 
1435 -                       printk(KERN_INFO PFX "No usable aperture found.\n");
1436 +                       printk(KERN_ERR PFX "No usable aperture found.\n");
1437  #ifdef __x86_64__ 
1438                         /* should port this to i386 */
1439 -                       printk(KERN_INFO PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
1440 +                       printk(KERN_ERR PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n");
1441  #endif 
1442                         return -1;  
1443                 }
1444                 hammers[i++] = loop_dev;
1445 +       }
1446                 nr_garts = i;
1447 -               if (i == MAX_HAMMER_GARTS) { 
1448 -                       printk(KERN_INFO PFX "Too many northbridges for AGP\n");
1449 -                       return -1;
1450 +       return i == 0 ? -1 : 0;
1451 +}
1452 +
1453 +/* Handle AMD 8151 quirks */
1454 +static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data *bridge)
1455 +
1456 +{              
1457 +       char *revstring;
1458 +       u8 rev_id;
1459 +
1460 +       pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id);
1461 +       switch (rev_id) {
1462 +       case 0x01: revstring="A0"; break;
1463 +       case 0x02: revstring="A1"; break;
1464 +       case 0x11: revstring="B0"; break;
1465 +       case 0x12: revstring="B1"; break;
1466 +       case 0x13: revstring="B2"; break;
1467 +       default:   revstring="??"; break;
1468                 }
1469 +
1470 +       printk (KERN_INFO PFX "Detected AMD 8151 AGP Bridge rev %s\n", revstring);
1471 +
1472 +       /*
1473 +        * Work around errata.
1474 +        * Chips before B2 stepping incorrectly reporting v3.5
1475 +        */
1476 +       if (rev_id < 0x13) {
1477 +               printk (KERN_INFO PFX "Correcting AGP revision (reports 3.5, is really 3.0)\n");
1478 +               bridge->major_version = 3;
1479 +               bridge->minor_version = 0;
1480         }
1481 -       return i == 0 ? -1 : 0;
1482 +}
1483 +
1484 +static struct aper_size_info_32 nforce3_sizes[5] =
1485 +{
1486 +       {512,  131072, 7, 0x00000000 },
1487 +       {256,  65536,  6, 0x00000008 },
1488 +       {128,  32768,  5, 0x0000000C },
1489 +       {64,   16384,  4, 0x0000000E },
1490 +       {32,   8192,   3, 0x0000000F }
1491 +};
1492 +
1493 +/* Handle shadow device of the Nvidia NForce3 */
1494 +/* CHECK-ME original 2.4 version set up some IORRs. Check if that is needed. */
1495 +static int __devinit nforce3_agp_init(struct pci_dev *pdev) 
1496 +{ 
1497 +       u32 tmp, apbase, apbar, aplimit;
1498 +       struct pci_dev *dev1; 
1499 +       int i;
1500 +       unsigned size = amd64_fetch_size(); 
1501 +
1502 +       printk(KERN_INFO PFX "Setting up Nforce3 AGP.\n");
1503 +
1504 +       dev1 = pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(11, 0));
1505 +       if (dev1 == NULL) {
1506 +               printk(KERN_INFO PFX "agpgart: Detected an NVIDIA "
1507 +                       "nForce3 chipset, but could not find "
1508 +                       "the secondary device.\n");
1509 +               return -ENODEV;
1510 +       }       
1511 +
1512 +       for (i = 0; i < ARRAY_SIZE(nforce3_sizes); i++) 
1513 +               if (nforce3_sizes[i].size == size)
1514 +                       break; 
1515 +
1516 +       if (i == ARRAY_SIZE(nforce3_sizes)) {
1517 +               printk(KERN_INFO PFX "No NForce3 size found for %d\n", size); 
1518 +               return -ENODEV; 
1519 +       }
1520 +       
1521 +       pci_read_config_dword(dev1, NVIDIA_X86_64_1_APSIZE, &tmp);
1522 +       tmp &= ~(0xf);
1523 +       tmp |= nforce3_sizes[i].size_value;
1524 +       pci_write_config_dword(dev1, NVIDIA_X86_64_1_APSIZE, tmp);
1525 +
1526 +       /* shadow x86-64 registers into NVIDIA registers */
1527 +       pci_read_config_dword (hammers[0], AMD64_GARTAPERTUREBASE, &apbase);
1528 +
1529 +       /* if x86-64 aperture base is beyond 4G, exit here */
1530 +       if ( (apbase & 0x7fff) >> (32 - 25) )
1531 +                return -ENODEV;
1532 +
1533 +       apbase = (apbase & 0x7fff) << 25;
1534 +
1535 +       pci_read_config_dword(pdev, NVIDIA_X86_64_0_APBASE, &apbar);
1536 +       apbar &= ~PCI_BASE_ADDRESS_MEM_MASK;
1537 +       apbar |= apbase;
1538 +       pci_write_config_dword(pdev, NVIDIA_X86_64_0_APBASE, apbar);
1539 +
1540 +       aplimit = apbase + (size * 1024 * 1024) - 1;
1541 +       pci_write_config_dword(dev1, NVIDIA_X86_64_1_APBASE1, apbase);
1542 +       pci_write_config_dword(dev1, NVIDIA_X86_64_1_APLIMIT1, aplimit);
1543 +       pci_write_config_dword(dev1, NVIDIA_X86_64_1_APBASE2, apbase);
1544 +       pci_write_config_dword(dev1, NVIDIA_X86_64_1_APLIMIT2, aplimit);
1545 +
1546 +       return 0;
1547  }
1548  
1549  static int __devinit agp_amd64_probe(struct pci_dev *pdev,
1550                                      const struct pci_device_id *ent)
1551  {
1552         struct agp_bridge_data *bridge;
1553 -       u8 rev_id;
1554         u8 cap_ptr;
1555 -       char *revstring=NULL;
1556  
1557         cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
1558         if (!cap_ptr)
1559 @@ -385,32 +481,7 @@
1560  
1561         if (pdev->vendor == PCI_VENDOR_ID_AMD &&
1562             pdev->device == PCI_DEVICE_ID_AMD_8151_0) {
1563 -
1564 -               pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id);
1565 -               switch (rev_id) {
1566 -               case 0x01:      revstring="A0";
1567 -                               break;
1568 -               case 0x02:      revstring="A1";
1569 -                               break;
1570 -               case 0x11:      revstring="B0";
1571 -                               break;
1572 -               case 0x12:      revstring="B1";
1573 -                               break;
1574 -               case 0x13:      revstring="B2";
1575 -                               break;
1576 -               default:        revstring="??";
1577 -                               break;
1578 -               }
1579 -               printk (KERN_INFO PFX "Detected AMD 8151 AGP Bridge rev %s\n", revstring);
1580 -               /*
1581 -                * Work around errata.
1582 -                * Chips before B2 stepping incorrectly reporting v3.5
1583 -                */
1584 -               if (rev_id < 0x13) {
1585 -                       printk (KERN_INFO PFX "Correcting AGP revision (reports 3.5, is really 3.0)\n");
1586 -                       bridge->major_version = 3;
1587 -                       bridge->minor_version = 0;
1588 -               }
1589 +               amd8151_init(pdev, bridge);
1590         } else {
1591                 printk(KERN_INFO PFX "Detected AGP bridge %x\n",
1592                         pdev->devfn);
1593 @@ -428,6 +499,14 @@
1594                 return -ENODEV;
1595         }
1596  
1597 +       if (pdev->vendor == PCI_VENDOR_ID_NVIDIA) { 
1598 +               int ret = nforce3_agp_init(pdev);
1599 +               if (ret) { 
1600 +                       agp_put_bridge(bridge); 
1601 +                       return ret;
1602 +               }
1603 +       }
1604 +
1605         pci_set_drvdata(pdev, bridge);
1606         return agp_add_bridge(bridge);
1607  }
1608 @@ -472,8 +551,25 @@
1609         {
1610         .class          = (PCI_CLASS_BRIDGE_HOST << 8),
1611         .class_mask     = ~0,
1612 -       .vendor         = PCI_VENDOR_ID_SI,
1613 -       .device         = PCI_DEVICE_ID_SI_755,
1614 +       .vendor         = PCI_VENDOR_ID_VIA,
1615 +       .device         = PCI_DEVICE_ID_VIA_8380_0,
1616 +       .subvendor      = PCI_ANY_ID,
1617 +       .subdevice      = PCI_ANY_ID,
1618 +       },
1619 +       /* NForce3 */
1620 +       {
1621 +       .class          = (PCI_CLASS_BRIDGE_HOST << 8),
1622 +       .class_mask     = ~0,
1623 +       .vendor         = PCI_VENDOR_ID_NVIDIA,
1624 +       .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3,
1625 +       .subvendor      = PCI_ANY_ID,
1626 +       .subdevice      = PCI_ANY_ID,
1627 +       },
1628 +       {
1629 +       .class          = (PCI_CLASS_BRIDGE_HOST << 8),
1630 +       .class_mask     = ~0,
1631 +       .vendor         = PCI_VENDOR_ID_NVIDIA,
1632 +       .device         = PCI_DEVICE_ID_NVIDIA_NFORCE3S,
1633         .subvendor      = PCI_ANY_ID,
1634         .subdevice      = PCI_ANY_ID,
1635         },
1636 @@ -530,6 +626,8 @@
1637  
1638  static void __exit agp_amd64_cleanup(void)
1639  {
1640 +       if (aperture_resource) 
1641 +               release_resource(aperture_resource);
1642         pci_unregister_driver(&agp_amd64_pci_driver);
1643  }
1644  
1645 diff -urN linux-2.6.0-orig/drivers/char/drm/Kconfig linux-2.6.0/drivers/char/drm/Kconfig
1646 --- linux-2.6.0-orig/drivers/char/drm/Kconfig   2004-12-21 18:38:39.488089272 +0100
1647 +++ linux-2.6.0/drivers/char/drm/Kconfig        2004-12-21 18:39:00.841843008 +0100
1648 @@ -64,10 +64,9 @@
1649           module will be called i830.  AGP support is required for this driver
1650           to work.
1651  
1652 -
1653  config DRM_MGA
1654         tristate "Matrox g200/g400"
1655 -       depends on DRM && AGP
1656 +       depends on DRM && AGP && (!X86_64 || BROKEN) 
1657         help
1658           Choose this option if you have a Matrox G200, G400 or G450 graphics
1659           card.  If M is selected, the module will be called mga.  AGP
1660 diff -urN linux-2.6.0-orig/drivers/net/pcmcia/Kconfig linux-2.6.0/drivers/net/pcmcia/Kconfig
1661 --- linux-2.6.0-orig/drivers/net/pcmcia/Kconfig 2004-12-21 18:38:39.193134112 +0100
1662 +++ linux-2.6.0/drivers/net/pcmcia/Kconfig      2004-12-21 18:39:00.841843008 +0100
1663 @@ -119,7 +119,7 @@
1664  
1665  config PCMCIA_IBMTR
1666         tristate "IBM PCMCIA tokenring adapter support"
1667 -       depends on NET_PCMCIA && IBMTR!=y && TR && PCMCIA
1668 +       depends on NET_PCMCIA && IBMTR!=y && TR && PCMCIA && !64BIT
1669         help
1670           Say Y here if you intend to attach this type of Token Ring PCMCIA
1671           card to your computer. You then also need to say Y to "Token Ring
1672 diff -urN linux-2.6.0-orig/drivers/scsi/Kconfig linux-2.6.0/drivers/scsi/Kconfig
1673 --- linux-2.6.0-orig/drivers/scsi/Kconfig       2004-12-21 18:38:39.658063432 +0100
1674 +++ linux-2.6.0/drivers/scsi/Kconfig    2004-12-21 18:39:00.842842856 +0100
1675 @@ -1408,7 +1408,7 @@
1676  
1677  config SCSI_NSP32
1678         tristate "Workbit NinjaSCSI-32Bi/UDE support"
1679 -       depends on PCI && SCSI
1680 +       depends on PCI && SCSI && !64BIT
1681         help
1682           This is support for the Workbit NinjaSCSI-32Bi/UDE PCI/Cardbus
1683           SCSI host adapter. Please read the SCSI-HOWTO, available from
1684 diff -urN linux-2.6.0-orig/drivers/scsi/pcmcia/Kconfig linux-2.6.0/drivers/scsi/pcmcia/Kconfig
1685 --- linux-2.6.0-orig/drivers/scsi/pcmcia/Kconfig        2004-12-21 18:38:39.586074376 +0100
1686 +++ linux-2.6.0/drivers/scsi/pcmcia/Kconfig     2004-12-21 18:39:00.843842704 +0100
1687 @@ -27,7 +27,7 @@
1688  
1689  config PCMCIA_NINJA_SCSI
1690         tristate "NinjaSCSI-3 / NinjaSCSI-32Bi (16bit) PCMCIA support"
1691 -       depends on m
1692 +       depends on m && !64BIT
1693         help
1694           If you intend to attach this type of PCMCIA SCSI host adapter to
1695           your computer, say Y here and read
1696 diff -urN linux-2.6.0-orig/include/asm-generic/statfs.h linux-2.6.0/include/asm-generic/statfs.h
1697 --- linux-2.6.0-orig/include/asm-generic/statfs.h       2004-12-21 18:38:40.742898512 +0100
1698 +++ linux-2.6.0/include/asm-generic/statfs.h    2004-12-21 18:39:00.843842704 +0100
1699 @@ -34,4 +34,18 @@
1700         __u32 f_spare[5];
1701  };
1702  
1703 +struct compat_statfs64 {
1704 +       __u32 f_type;
1705 +       __u32 f_bsize;
1706 +       __u64 f_blocks;
1707 +       __u64 f_bfree;
1708 +       __u64 f_bavail;
1709 +       __u64 f_files;
1710 +       __u64 f_ffree;
1711 +       __kernel_fsid_t f_fsid;
1712 +       __u32 f_namelen;
1713 +       __u32 f_frsize;
1714 +       __u32 f_spare[5];
1715 +};
1716 +
1717  #endif
1718 diff -urN linux-2.6.0-orig/include/asm-ia64/statfs.h linux-2.6.0/include/asm-ia64/statfs.h
1719 --- linux-2.6.0-orig/include/asm-ia64/statfs.h  2004-12-21 18:38:40.809888328 +0100
1720 +++ linux-2.6.0/include/asm-ia64/statfs.h       2004-12-21 18:39:00.843842704 +0100
1721 @@ -43,5 +43,18 @@
1722         long f_spare[5];
1723  };
1724  
1725 +struct compat_statfs64 {
1726 +       __u32 f_type;
1727 +       __u32 f_bsize;
1728 +       __u64 f_blocks;
1729 +       __u64 f_bfree;
1730 +       __u64 f_bavail;
1731 +       __u64 f_files;
1732 +       __u64 f_ffree;
1733 +       __kernel_fsid_t f_fsid;
1734 +       __u32 f_namelen;
1735 +       __u32 f_frsize;
1736 +       __u32 f_spare[5];
1737 +};
1738  
1739  #endif /* _ASM_IA64_STATFS_H */
1740 diff -urN linux-2.6.0-orig/include/asm-mips/statfs.h linux-2.6.0/include/asm-mips/statfs.h
1741 --- linux-2.6.0-orig/include/asm-mips/statfs.h  2004-12-21 18:38:40.769894408 +0100
1742 +++ linux-2.6.0/include/asm-mips/statfs.h       2004-12-21 18:39:00.843842704 +0100
1743 @@ -75,6 +75,20 @@
1744         long            f_spare[6];
1745  };
1746  
1747 +struct compat_statfs64 {
1748 +       __u32 f_type;
1749 +       __u32 f_bsize;
1750 +       __u64 f_blocks;
1751 +       __u64 f_bfree;
1752 +       __u64 f_bavail;
1753 +       __u64 f_files;
1754 +       __u64 f_ffree;
1755 +       __kernel_fsid_t f_fsid;
1756 +       __u32 f_namelen;
1757 +       __u32 f_frsize;
1758 +       __u32 f_spare[5];
1759 +};
1760 +
1761  #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
1762  
1763  #endif /* _ASM_STATFS_H */
1764 diff -urN linux-2.6.0-orig/include/asm-parisc/statfs.h linux-2.6.0/include/asm-parisc/statfs.h
1765 --- linux-2.6.0-orig/include/asm-parisc/statfs.h        2004-12-21 18:38:40.638914320 +0100
1766 +++ linux-2.6.0/include/asm-parisc/statfs.h     2004-12-21 18:39:00.844842552 +0100
1767 @@ -41,4 +41,18 @@
1768         long f_spare[5];
1769  };
1770  
1771 +struct compat_statfs64 {
1772 +       __u32 f_type;
1773 +       __u32 f_bsize;
1774 +       __u64 f_blocks;
1775 +       __u64 f_bfree;
1776 +       __u64 f_bavail;
1777 +       __u64 f_files;
1778 +       __u64 f_ffree;
1779 +       __kernel_fsid_t f_fsid;
1780 +       __u32 f_namelen;
1781 +       __u32 f_frsize;
1782 +       __u32 f_spare[5];
1783 +};
1784 +
1785  #endif
1786 diff -urN linux-2.6.0-orig/include/asm-ppc64/statfs.h linux-2.6.0/include/asm-ppc64/statfs.h
1787 --- linux-2.6.0-orig/include/asm-ppc64/statfs.h 2004-12-21 18:38:40.738899120 +0100
1788 +++ linux-2.6.0/include/asm-ppc64/statfs.h      2004-12-21 18:39:00.844842552 +0100
1789 @@ -44,4 +44,18 @@
1790         long f_spare[5];
1791  };
1792  
1793 +struct compat_statfs64 {
1794 +       __u32 f_type;
1795 +       __u32 f_bsize;
1796 +       __u64 f_blocks;
1797 +       __u64 f_bfree;
1798 +       __u64 f_bavail;
1799 +       __u64 f_files;
1800 +       __u64 f_ffree;
1801 +       __kernel_fsid_t f_fsid;
1802 +       __u32 f_namelen;
1803 +       __u32 f_frsize;
1804 +       __u32 f_spare[5];
1805 +};
1806 +
1807  #endif  /* _PPC64_STATFS_H */
1808 diff -urN linux-2.6.0-orig/include/asm-s390/statfs.h linux-2.6.0/include/asm-s390/statfs.h
1809 --- linux-2.6.0-orig/include/asm-s390/statfs.h  2004-12-21 18:38:40.951866744 +0100
1810 +++ linux-2.6.0/include/asm-s390/statfs.h       2004-12-21 18:39:00.844842552 +0100
1811 @@ -53,5 +53,19 @@
1812         int  f_spare[5];
1813  };
1814  
1815 +struct compat_statfs64 {
1816 +       __u32 f_type;
1817 +       __u32 f_bsize;
1818 +       __u64 f_blocks;
1819 +       __u64 f_bfree;
1820 +       __u64 f_bavail;
1821 +       __u64 f_files;
1822 +       __u64 f_ffree;
1823 +       __kernel_fsid_t f_fsid;
1824 +       __u32 f_namelen;
1825 +       __u32 f_frsize;
1826 +       __u32 f_spare[5];
1827 +};
1828 +
1829  #endif /* __s390x__ */
1830  #endif
1831 diff -urN linux-2.6.0-orig/include/asm-sparc64/statfs.h linux-2.6.0/include/asm-sparc64/statfs.h
1832 --- linux-2.6.0-orig/include/asm-sparc64/statfs.h       2004-12-21 18:38:40.985861576 +0100
1833 +++ linux-2.6.0/include/asm-sparc64/statfs.h    2004-12-21 18:39:00.844842552 +0100
1834 @@ -38,4 +38,18 @@
1835         long f_spare[5];
1836  };
1837  
1838 +struct compat_statfs64 {
1839 +       __u32 f_type;
1840 +       __u32 f_bsize;
1841 +       __u64 f_blocks;
1842 +       __u64 f_bfree;
1843 +       __u64 f_bavail;
1844 +       __u64 f_files;
1845 +       __u64 f_ffree;
1846 +       __kernel_fsid_t f_fsid;
1847 +       __u32 f_namelen;
1848 +       __u32 f_frsize;
1849 +       __u32 f_spare[5];
1850 +};
1851 +
1852  #endif
1853 diff -urN linux-2.6.0-orig/include/asm-x86_64/acpi.h linux-2.6.0/include/asm-x86_64/acpi.h
1854 --- linux-2.6.0-orig/include/asm-x86_64/acpi.h  2004-12-21 18:38:40.627915992 +0100
1855 +++ linux-2.6.0/include/asm-x86_64/acpi.h       2004-12-21 18:39:00.845842400 +0100
1856 @@ -52,40 +52,36 @@
1857  #define ACPI_ENABLE_IRQS()  local_irq_enable()
1858  #define ACPI_FLUSH_CPU_CACHE() wbinvd()
1859  
1860 -/*
1861 - * A brief explanation as GNU inline assembly is a bit hairy
1862 - *  %0 is the output parameter in RAX ("=a")
1863 - *  %1 and %2 are the input parameters in RCX ("c")
1864 - *  and an immediate value ("i") respectively
1865 - *  All actual register references are preceded with "%%" as in "%%edx"
1866 - *  Immediate values in the assembly are preceded by "$" as in "$0x1"
1867 - *  The final asm parameter are the operation altered non-output registers.
1868 - */
1869 +
1870 +static inline int
1871 +__acpi_acquire_global_lock (unsigned int *lock)
1872 +{
1873 +       unsigned int old, new, val;
1874 +       do {
1875 +               old = *lock;
1876 +               new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1));
1877 +               val = cmpxchg4_locked(lock, new, old);
1878 +       } while (unlikely (val != old));
1879 +       return (new < 3) ? -1 : 0;
1880 +}
1881 +
1882 +static inline int
1883 +__acpi_release_global_lock (unsigned int *lock)
1884 +{
1885 +       unsigned int old, new, val;
1886 +       do {
1887 +               old = *lock;
1888 +               new = old & ~0x3;
1889 +               val = cmpxchg4_locked(lock, new, old);
1890 +       } while (unlikely (val != old));
1891 +       return old & 0x1;
1892 +}
1893 +
1894  #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \
1895 -       do { \
1896 -               unsigned long dummy; \
1897 -               asm("1:     movl (%2),%%eax;" \
1898 -                       "movl   %%eax,%%edx;" \
1899 -                       "andq   %2,%%rdx;" \
1900 -                       "btsl   $0x1,%%edx;" \
1901 -                       "adcl   $0x0,%%edx;" \
1902 -                       "lock;  cmpxchgl %%edx,(%1);" \
1903 -                       "jnz    1b;" \
1904 -                       "cmpb   $0x3,%%dl;" \
1905 -                       "sbbl   %%eax,%%eax" \
1906 -                       :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~1L):"dx"); \
1907 -       } while(0)
1908 +       ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr))
1909 +
1910  #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \
1911 -       do { \
1912 -               unsigned long dummy; \
1913 -               asm("1:     movl (%2),%%eax;" \
1914 -                       "movl   %%eax,%%edx;" \
1915 -                       "andq   %2,%%rdx;" \
1916 -                       "lock;  cmpxchgl %%edx,(%1);" \
1917 -                       "jnz    1b;" \
1918 -                       "andl   $0x1,%%eax" \
1919 -                       :"=a"(Acq),"=c"(dummy):"c"(GLptr),"i"(~3L):"dx"); \
1920 -       } while(0)
1921 +       ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr))
1922  
1923  /*
1924   * Math helper asm macros
1925 diff -urN linux-2.6.0-orig/include/asm-x86_64/apic.h linux-2.6.0/include/asm-x86_64/apic.h
1926 --- linux-2.6.0-orig/include/asm-x86_64/apic.h  2004-12-21 18:38:40.630915536 +0100
1927 +++ linux-2.6.0/include/asm-x86_64/apic.h       2004-12-21 18:39:00.845842400 +0100
1928 @@ -79,7 +79,7 @@
1929  extern void enable_lapic_nmi_watchdog(void);
1930  extern void disable_timer_nmi_watchdog(void);
1931  extern void enable_timer_nmi_watchdog(void);
1932 -extern inline void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
1933 +extern void nmi_watchdog_tick (struct pt_regs * regs, unsigned reason);
1934  extern int APIC_init_uniprocessor (void);
1935  extern void disable_APIC_timer(void);
1936  extern void enable_APIC_timer(void);
1937 diff -urN linux-2.6.0-orig/include/asm-x86_64/bitops.h linux-2.6.0/include/asm-x86_64/bitops.h
1938 --- linux-2.6.0-orig/include/asm-x86_64/bitops.h        2004-12-21 18:38:40.625916296 +0100
1939 +++ linux-2.6.0/include/asm-x86_64/bitops.h     2004-12-21 18:39:00.846842248 +0100
1940 @@ -7,14 +7,6 @@
1941  
1942  #include <linux/config.h>
1943  
1944 -/*
1945 - * These have to be done with inline assembly: that way the bit-setting
1946 - * is guaranteed to be atomic. All bit operations return 0 if the bit
1947 - * was cleared before the operation and != 0 if it was not.
1948 - *
1949 - * bit 0 is the LSB of addr; bit 32 is the LSB of (addr+1).
1950 - */
1951 -
1952  #ifdef CONFIG_SMP
1953  #define LOCK_PREFIX "lock ; "
1954  #else
1955 @@ -363,26 +355,26 @@
1956   */
1957  static __inline__ int find_next_bit(const unsigned long * addr, int size, int offset)
1958  {
1959 -       unsigned int * p = ((unsigned int *) addr) + (offset >> 5);
1960 -       int set = 0, bit = offset & 31, res;
1961 +       const unsigned long * p = addr + (offset >> 6);
1962 +       unsigned long set = 0, bit = offset & 63, res;
1963         
1964         if (bit) {
1965                 /*
1966 -                * Look for nonzero in the first 32 bits:
1967 +                * Look for nonzero in the first 64 bits:
1968                  */
1969 -               __asm__("bsfl %1,%0\n\t"
1970 -                       "cmovel %2,%0\n\t"
1971 +               __asm__("bsfq %1,%0\n\t"
1972 +                       "cmoveq %2,%0\n\t"
1973                         : "=r" (set)
1974 -                       : "r" (*p >> bit), "r" (32));
1975 -               if (set < (32 - bit))
1976 +                       : "r" (*p >> bit), "r" (64L));
1977 +               if (set < (64 - bit))
1978                         return set + offset;
1979 -               set = 32 - bit;
1980 +               set = 64 - bit;
1981                 p++;
1982         }
1983         /*
1984          * No set bit yet, search remaining full words for a bit
1985          */
1986 -       res = find_first_bit ((const unsigned long *)p, size - 32 * (p - (unsigned int *) addr));
1987 +       res = find_first_bit (p, size - 64 * (p - addr));
1988         return (offset + set + res);
1989  }
1990  
1991 diff -urN linux-2.6.0-orig/include/asm-x86_64/calling.h linux-2.6.0/include/asm-x86_64/calling.h
1992 --- linux-2.6.0-orig/include/asm-x86_64/calling.h       2004-12-21 18:38:40.627915992 +0100
1993 +++ linux-2.6.0/include/asm-x86_64/calling.h    2004-12-21 18:39:00.846842248 +0100
1994 @@ -8,7 +8,7 @@
1995  #define R14 8
1996  #define R13 16
1997  #define R12 24
1998 -#define RBP 36
1999 +#define RBP 32
2000  #define RBX 40
2001  /* arguments: interrupts/non tracing syscalls only save upto here*/
2002  #define R11 48
2003 diff -urN linux-2.6.0-orig/include/asm-x86_64/cpu.h linux-2.6.0/include/asm-x86_64/cpu.h
2004 --- linux-2.6.0-orig/include/asm-x86_64/cpu.h   1970-01-01 01:00:00.000000000 +0100
2005 +++ linux-2.6.0/include/asm-x86_64/cpu.h        2004-12-21 18:39:00.846842248 +0100
2006 @@ -0,0 +1 @@
2007 +#include <asm-i386/cpu.h>
2008 diff -urN linux-2.6.0-orig/include/asm-x86_64/desc.h linux-2.6.0/include/asm-x86_64/desc.h
2009 --- linux-2.6.0-orig/include/asm-x86_64/desc.h  2004-12-21 18:38:40.632915232 +0100
2010 +++ linux-2.6.0/include/asm-x86_64/desc.h       2004-12-21 18:39:00.846842248 +0100
2011 @@ -190,7 +190,7 @@
2012  /*
2013   * load one particular LDT into the current CPU
2014   */
2015 -extern inline void load_LDT_nolock (mm_context_t *pc, int cpu)
2016 +static inline void load_LDT_nolock (mm_context_t *pc, int cpu)
2017  {
2018         int count = pc->size;
2019  
2020 diff -urN linux-2.6.0-orig/include/asm-x86_64/fixmap.h linux-2.6.0/include/asm-x86_64/fixmap.h
2021 --- linux-2.6.0-orig/include/asm-x86_64/fixmap.h        2004-12-21 18:38:40.624916448 +0100
2022 +++ linux-2.6.0/include/asm-x86_64/fixmap.h     2004-12-21 18:39:00.847842096 +0100
2023 @@ -76,7 +76,7 @@
2024   * directly without translation, we catch the bug with a NULL-deference
2025   * kernel oops. Illegal ranges of incoming indices are caught too.
2026   */
2027 -extern inline unsigned long fix_to_virt(const unsigned int idx)
2028 +static inline unsigned long fix_to_virt(const unsigned int idx)
2029  {
2030         /*
2031          * this branch gets completely eliminated after inlining,
2032 diff -urN linux-2.6.0-orig/include/asm-x86_64/io.h linux-2.6.0/include/asm-x86_64/io.h
2033 --- linux-2.6.0-orig/include/asm-x86_64/io.h    2004-12-21 18:38:40.625916296 +0100
2034 +++ linux-2.6.0/include/asm-x86_64/io.h 2004-12-21 18:39:00.847842096 +0100
2035 @@ -52,7 +52,7 @@
2036   * Talk about misusing macros..
2037   */
2038  #define __OUT1(s,x) \
2039 -extern inline void out##s(unsigned x value, unsigned short port) {
2040 +static inline void out##s(unsigned x value, unsigned short port) {
2041  
2042  #define __OUT2(s,s1,s2) \
2043  __asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
2044 @@ -62,7 +62,7 @@
2045  __OUT1(s##_p,x) __OUT2(s,s1,"w") __FULL_SLOW_DOWN_IO : : "a" (value), "Nd" (port));} \
2046  
2047  #define __IN1(s) \
2048 -extern inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v;
2049 +static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v;
2050  
2051  #define __IN2(s,s1,s2) \
2052  __asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
2053 @@ -72,12 +72,12 @@
2054  __IN1(s##_p) __IN2(s,s1,"w") __FULL_SLOW_DOWN_IO : "=a" (_v) : "Nd" (port) ,##i ); return _v; } \
2055  
2056  #define __INS(s) \
2057 -extern inline void ins##s(unsigned short port, void * addr, unsigned long count) \
2058 +static inline void ins##s(unsigned short port, void * addr, unsigned long count) \
2059  { __asm__ __volatile__ ("rep ; ins" #s \
2060  : "=D" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
2061  
2062  #define __OUTS(s) \
2063 -extern inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
2064 +static inline void outs##s(unsigned short port, const void * addr, unsigned long count) \
2065  { __asm__ __volatile__ ("rep ; outs" #s \
2066  : "=S" (addr), "=c" (count) : "d" (port),"0" (addr),"1" (count)); }
2067  
2068 @@ -125,12 +125,12 @@
2069   * Change virtual addresses to physical addresses and vv.
2070   * These are pretty trivial
2071   */
2072 -extern inline unsigned long virt_to_phys(volatile void * address)
2073 +static inline unsigned long virt_to_phys(volatile void * address)
2074  {
2075         return __pa(address);
2076  }
2077  
2078 -extern inline void * phys_to_virt(unsigned long address)
2079 +static inline void * phys_to_virt(unsigned long address)
2080  {
2081         return __va(address);
2082  }
2083 @@ -148,7 +148,7 @@
2084  
2085  extern void * __ioremap(unsigned long offset, unsigned long size, unsigned long flags);
2086  
2087 -extern inline void * ioremap (unsigned long offset, unsigned long size)
2088 +static inline void * ioremap (unsigned long offset, unsigned long size)
2089  {
2090         return __ioremap(offset, size, 0);
2091  }
2092 @@ -304,8 +304,8 @@
2093  /* Disable vmerge for now. Need to fix the block layer code
2094     to check for non iommu addresses first.
2095     When the IOMMU is force it is safe to enable. */
2096 -extern int force_iommu; 
2097 -#define BIO_VERMGE_BOUNDARY (force_iommu ? 4096 : 0)
2098 +extern int iommu_merge;
2099 +#define BIO_VMERGE_BOUNDARY (iommu_merge ? 4096 : 0)
2100  
2101  #endif /* __KERNEL__ */
2102  
2103 diff -urN linux-2.6.0-orig/include/asm-x86_64/memblk.h linux-2.6.0/include/asm-x86_64/memblk.h
2104 --- linux-2.6.0-orig/include/asm-x86_64/memblk.h        1970-01-01 01:00:00.000000000 +0100
2105 +++ linux-2.6.0/include/asm-x86_64/memblk.h     2004-12-21 18:39:00.847842096 +0100
2106 @@ -0,0 +1 @@
2107 +#include <asm-i386/memblk.h>
2108 diff -urN linux-2.6.0-orig/include/asm-x86_64/msr.h linux-2.6.0/include/asm-x86_64/msr.h
2109 --- linux-2.6.0-orig/include/asm-x86_64/msr.h   2004-12-21 18:38:40.630915536 +0100
2110 +++ linux-2.6.0/include/asm-x86_64/msr.h        2004-12-21 18:39:00.848841944 +0100
2111 @@ -67,7 +67,7 @@
2112                           : "=a" (low), "=d" (high) \
2113                           : "c" (counter))
2114  
2115 -extern inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
2116 +static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
2117  {
2118         __asm__("cpuid"
2119                 : "=a" (*eax),
2120 @@ -80,7 +80,7 @@
2121  /*
2122   * CPUID functions returning a single datum
2123   */
2124 -extern inline unsigned int cpuid_eax(unsigned int op)
2125 +static inline unsigned int cpuid_eax(unsigned int op)
2126  {
2127         unsigned int eax;
2128  
2129 @@ -90,7 +90,7 @@
2130                 : "bx", "cx", "dx");
2131         return eax;
2132  }
2133 -extern inline unsigned int cpuid_ebx(unsigned int op)
2134 +static inline unsigned int cpuid_ebx(unsigned int op)
2135  {
2136         unsigned int eax, ebx;
2137  
2138 @@ -100,7 +100,7 @@
2139                 : "cx", "dx" );
2140         return ebx;
2141  }
2142 -extern inline unsigned int cpuid_ecx(unsigned int op)
2143 +static inline unsigned int cpuid_ecx(unsigned int op)
2144  {
2145         unsigned int eax, ecx;
2146  
2147 @@ -110,7 +110,7 @@
2148                 : "bx", "dx" );
2149         return ecx;
2150  }
2151 -extern inline unsigned int cpuid_edx(unsigned int op)
2152 +static inline unsigned int cpuid_edx(unsigned int op)
2153  {
2154         unsigned int eax, edx;
2155  
2156 diff -urN linux-2.6.0-orig/include/asm-x86_64/node.h linux-2.6.0/include/asm-x86_64/node.h
2157 --- linux-2.6.0-orig/include/asm-x86_64/node.h  1970-01-01 01:00:00.000000000 +0100
2158 +++ linux-2.6.0/include/asm-x86_64/node.h       2004-12-21 18:39:00.848841944 +0100
2159 @@ -0,0 +1 @@
2160 +#include <asm-i386/node.h>
2161 diff -urN linux-2.6.0-orig/include/asm-x86_64/pgalloc.h linux-2.6.0/include/asm-x86_64/pgalloc.h
2162 --- linux-2.6.0-orig/include/asm-x86_64/pgalloc.h       2004-12-21 18:38:40.626916144 +0100
2163 +++ linux-2.6.0/include/asm-x86_64/pgalloc.h    2004-12-21 18:39:00.848841944 +0100
2164 @@ -69,7 +69,7 @@
2165         free_page((unsigned long)pte); 
2166  }
2167  
2168 -extern inline void pte_free(struct page *pte)
2169 +static inline void pte_free(struct page *pte)
2170  {
2171         __free_page(pte);
2172  } 
2173 diff -urN linux-2.6.0-orig/include/asm-x86_64/pgtable.h linux-2.6.0/include/asm-x86_64/pgtable.h
2174 --- linux-2.6.0-orig/include/asm-x86_64/pgtable.h       2004-12-21 18:38:40.628915840 +0100
2175 +++ linux-2.6.0/include/asm-x86_64/pgtable.h    2004-12-21 18:39:00.849841792 +0100
2176 @@ -71,7 +71,7 @@
2177  #define pml4_none(x)   (!pml4_val(x))
2178  #define pgd_none(x)    (!pgd_val(x))
2179  
2180 -extern inline int pgd_present(pgd_t pgd)       { return !pgd_none(pgd); }
2181 +static inline int pgd_present(pgd_t pgd)       { return !pgd_none(pgd); }
2182  
2183  static inline void set_pte(pte_t *dst, pte_t val)
2184  {
2185 @@ -88,7 +88,7 @@
2186         pgd_val(*dst) = pgd_val(val); 
2187  } 
2188  
2189 -extern inline void pgd_clear (pgd_t * pgd)
2190 +static inline void pgd_clear (pgd_t * pgd)
2191  {
2192         set_pgd(pgd, __pgd(0));
2193  }
2194 @@ -180,6 +180,8 @@
2195         (_PAGE_PRESENT | _PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_NX)
2196  #define __PAGE_KERNEL_VSYSCALL \
2197         (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
2198 +#define __PAGE_KERNEL_VSYSCALL_NOCACHE \
2199 +       (_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_PCD)
2200  #define __PAGE_KERNEL_LARGE \
2201         (__PAGE_KERNEL | _PAGE_PSE)
2202  
2203 @@ -191,6 +193,7 @@
2204  #define PAGE_KERNEL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_NOCACHE)
2205  #define PAGE_KERNEL_VSYSCALL MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL)
2206  #define PAGE_KERNEL_LARGE MAKE_GLOBAL(__PAGE_KERNEL_LARGE)
2207 +#define PAGE_KERNEL_VSYSCALL_NOCACHE MAKE_GLOBAL(__PAGE_KERNEL_VSYSCALL_NOCACHE)
2208  
2209  /*         xwr */
2210  #define __P000 PAGE_NONE
2211 @@ -242,23 +245,23 @@
2212   * Undefined behaviour if not..
2213   */
2214  static inline int pte_user(pte_t pte)          { return pte_val(pte) & _PAGE_USER; }
2215 -extern inline int pte_read(pte_t pte)          { return pte_val(pte) & _PAGE_USER; }
2216 -extern inline int pte_exec(pte_t pte)          { return pte_val(pte) & _PAGE_USER; }
2217 -extern inline int pte_dirty(pte_t pte)         { return pte_val(pte) & _PAGE_DIRTY; }
2218 -extern inline int pte_young(pte_t pte)         { return pte_val(pte) & _PAGE_ACCESSED; }
2219 -extern inline int pte_write(pte_t pte)         { return pte_val(pte) & _PAGE_RW; }
2220 +static inline int pte_read(pte_t pte)          { return pte_val(pte) & _PAGE_USER; }
2221 +static inline int pte_exec(pte_t pte)          { return pte_val(pte) & _PAGE_USER; }
2222 +static inline int pte_dirty(pte_t pte)         { return pte_val(pte) & _PAGE_DIRTY; }
2223 +static inline int pte_young(pte_t pte)         { return pte_val(pte) & _PAGE_ACCESSED; }
2224 +static inline int pte_write(pte_t pte)         { return pte_val(pte) & _PAGE_RW; }
2225  static inline int pte_file(pte_t pte)          { return pte_val(pte) & _PAGE_FILE; }
2226  
2227 -extern inline pte_t pte_rdprotect(pte_t pte)   { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
2228 -extern inline pte_t pte_exprotect(pte_t pte)   { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
2229 -extern inline pte_t pte_mkclean(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
2230 -extern inline pte_t pte_mkold(pte_t pte)       { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
2231 -extern inline pte_t pte_wrprotect(pte_t pte)   { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; }
2232 -extern inline pte_t pte_mkread(pte_t pte)      { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
2233 -extern inline pte_t pte_mkexec(pte_t pte)      { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
2234 -extern inline pte_t pte_mkdirty(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
2235 -extern inline pte_t pte_mkyoung(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
2236 -extern inline pte_t pte_mkwrite(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; }
2237 +static inline pte_t pte_rdprotect(pte_t pte)   { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
2238 +static inline pte_t pte_exprotect(pte_t pte)   { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_USER)); return pte; }
2239 +static inline pte_t pte_mkclean(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; }
2240 +static inline pte_t pte_mkold(pte_t pte)       { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; }
2241 +static inline pte_t pte_wrprotect(pte_t pte)   { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; }
2242 +static inline pte_t pte_mkread(pte_t pte)      { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
2243 +static inline pte_t pte_mkexec(pte_t pte)      { set_pte(&pte, __pte(pte_val(pte) | _PAGE_USER)); return pte; }
2244 +static inline pte_t pte_mkdirty(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; }
2245 +static inline pte_t pte_mkyoung(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; }
2246 +static inline pte_t pte_mkwrite(pte_t pte)     { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; }
2247  static inline  int ptep_test_and_clear_dirty(pte_t *ptep)      { return test_and_clear_bit(_PAGE_BIT_DIRTY, ptep); }
2248  static inline  int ptep_test_and_clear_young(pte_t *ptep)      { return test_and_clear_bit(_PAGE_BIT_ACCESSED, ptep); }
2249  static inline void ptep_set_wrprotect(pte_t *ptep)             { clear_bit(_PAGE_BIT_RW, ptep); }
2250 @@ -359,7 +362,7 @@
2251  }
2252   
2253  /* Change flags of a PTE */
2254 -extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
2255 +static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
2256  { 
2257         pte_val(pte) &= _PAGE_CHG_MASK;
2258         pte_val(pte) |= pgprot_val(newprot);
2259 diff -urN linux-2.6.0-orig/include/asm-x86_64/processor.h linux-2.6.0/include/asm-x86_64/processor.h
2260 --- linux-2.6.0-orig/include/asm-x86_64/processor.h     2004-12-21 18:38:40.631915384 +0100
2261 +++ linux-2.6.0/include/asm-x86_64/processor.h  2004-12-21 18:39:00.849841792 +0100
2262 @@ -304,13 +304,13 @@
2263  #define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */
2264  
2265  /* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
2266 -extern inline void rep_nop(void)
2267 +static inline void rep_nop(void)
2268  {
2269         __asm__ __volatile__("rep;nop": : :"memory");
2270  }
2271  
2272  /* Stop speculative execution */
2273 -extern inline void sync_core(void)
2274 +static inline void sync_core(void)
2275  { 
2276         int tmp;
2277         asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory");
2278 diff -urN linux-2.6.0-orig/include/asm-x86_64/smp.h linux-2.6.0/include/asm-x86_64/smp.h
2279 --- linux-2.6.0-orig/include/asm-x86_64/smp.h   2004-12-21 18:38:40.622916752 +0100
2280 +++ linux-2.6.0/include/asm-x86_64/smp.h        2004-12-21 18:39:00.850841640 +0100
2281 @@ -74,7 +74,7 @@
2282         return GET_APIC_ID(*(unsigned int *)(APIC_BASE+APIC_ID));
2283  }
2284  
2285 -#define safe_smp_processor_id() (cpuid_ebx(1) >> 24) 
2286 +#define safe_smp_processor_id() (disable_apic ? 0 : hard_smp_processor_id())
2287  
2288  #define cpu_online(cpu) cpu_isset(cpu, cpu_online_map)
2289  #endif /* !ASSEMBLY */
2290 diff -urN linux-2.6.0-orig/include/asm-x86_64/statfs.h linux-2.6.0/include/asm-x86_64/statfs.h
2291 --- linux-2.6.0-orig/include/asm-x86_64/statfs.h        2004-12-21 18:38:40.628915840 +0100
2292 +++ linux-2.6.0/include/asm-x86_64/statfs.h     2004-12-21 18:39:00.850841640 +0100
2293 @@ -41,4 +41,18 @@
2294         long f_spare[5];
2295  };
2296  
2297 +struct compat_statfs64 {
2298 +       __u32 f_type;
2299 +       __u32 f_bsize;
2300 +       __u64 f_blocks;
2301 +       __u64 f_bfree;
2302 +       __u64 f_bavail;
2303 +       __u64 f_files;
2304 +       __u64 f_ffree;
2305 +       __kernel_fsid_t f_fsid;
2306 +       __u32 f_namelen;
2307 +       __u32 f_frsize;
2308 +       __u32 f_spare[5];
2309 +} __attribute__((packed));
2310 +
2311  #endif
2312 diff -urN linux-2.6.0-orig/include/asm-x86_64/system.h linux-2.6.0/include/asm-x86_64/system.h
2313 --- linux-2.6.0-orig/include/asm-x86_64/system.h        2004-12-21 18:38:40.629915688 +0100
2314 +++ linux-2.6.0/include/asm-x86_64/system.h     2004-12-21 18:39:00.850841640 +0100
2315 @@ -188,7 +188,7 @@
2316  
2317  #define __xg(x) ((volatile long *)(x))
2318  
2319 -extern inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
2320 +static inline void set_64bit(volatile unsigned long *ptr, unsigned long val)
2321  {
2322         *ptr = val;
2323  }
2324 @@ -276,6 +276,13 @@
2325         ((__typeof__(*(ptr)))__cmpxchg((ptr),(unsigned long)(o),\
2326                                         (unsigned long)(n),sizeof(*(ptr))))
2327  
2328 +static inline __u32 cmpxchg4_locked(__u32 *ptr, __u32 old, __u32 new) 
2329 +{
2330 +       asm volatile("lock ; cmpxchgl %k1,%2" :
2331 +                    "=r" (new) : "0" (old), "m" (*(__u32 *)ptr) : "memory");
2332 +       return new; 
2333 +}
2334 +
2335  #ifdef CONFIG_SMP
2336  #define smp_mb()       mb()
2337  #define smp_rmb()      rmb()
2338 @@ -314,7 +321,21 @@
2339  #define local_irq_disable()    __asm__ __volatile__("cli": : :"memory")
2340  #define local_irq_enable()     __asm__ __volatile__("sti": : :"memory")
2341  /* used in the idle loop; sti takes one instruction cycle to complete */
2342 -#define safe_halt()            __asm__ __volatile__("sti; hlt": : :"memory")
2343 +
2344 +/* Work around BIOS that don't have K8 Errata #93 fixed. */
2345 +#define safe_halt()          \
2346 +       asm volatile("   sti\n"                                 \
2347 +                    "1: hlt\n"                                         \
2348 +                    "2:\n"                                                     \
2349 +                    ".section .fixup,\"ax\"\n"         \
2350 +                    "3: call idle_warning\n"           \
2351 +                    "   jmp 2b\n"                                      \
2352 +                    ".previous\n"                                      \
2353 +                    ".section __ex_table,\"a\"\n\t"    \
2354 +                    ".align 8\n\t"                                     \
2355 +                    ".quad 1b,3b\n"                            \
2356 +                    ".previous" ::: "memory")
2357 +
2358  #define irqs_disabled()                        \
2359  ({                                     \
2360         unsigned long flags;            \
2361 diff -urN linux-2.6.0-orig/include/asm-x86_64/timex.h linux-2.6.0/include/asm-x86_64/timex.h
2362 --- linux-2.6.0-orig/include/asm-x86_64/timex.h 2004-12-21 18:38:40.627915992 +0100
2363 +++ linux-2.6.0/include/asm-x86_64/timex.h      2004-12-21 18:39:00.851841488 +0100
2364 @@ -60,4 +60,7 @@
2365  
2366  extern struct vxtime_data vxtime;
2367  
2368 +#define ARCH_HAS_TIMEVARS 1
2369 +
2370 +
2371  #endif
2372 diff -urN linux-2.6.0-orig/include/asm-x86_64/topology.h linux-2.6.0/include/asm-x86_64/topology.h
2373 --- linux-2.6.0-orig/include/asm-x86_64/topology.h      2004-12-21 18:38:40.628915840 +0100
2374 +++ linux-2.6.0/include/asm-x86_64/topology.h   2004-12-21 18:39:00.851841488 +0100
2375 @@ -23,6 +23,7 @@
2376  
2377  static inline unsigned long pcibus_to_cpumask(int bus)
2378  {
2379 +       BUG_ON(bus >= MAX_MP_BUSSES);
2380         return mp_bus_to_cpumask[bus] & cpu_online_map; 
2381  }
2382  
2383 diff -urN linux-2.6.0-orig/include/asm-x86_64/uaccess.h linux-2.6.0/include/asm-x86_64/uaccess.h
2384 --- linux-2.6.0-orig/include/asm-x86_64/uaccess.h       2004-12-21 18:38:40.624916448 +0100
2385 +++ linux-2.6.0/include/asm-x86_64/uaccess.h    2004-12-21 18:39:00.851841488 +0100
2386 @@ -48,7 +48,7 @@
2387  
2388  #define access_ok(type,addr,size) (__range_not_ok(addr,size) == 0)
2389  
2390 -extern inline int verify_area(int type, const void * addr, unsigned long size)
2391 +static inline int verify_area(int type, const void * addr, unsigned long size)
2392  {
2393         return access_ok(type,addr,size) ? 0 : -EFAULT;
2394  }
2395 diff -urN linux-2.6.0-orig/include/asm-x86_64/unistd.h linux-2.6.0/include/asm-x86_64/unistd.h
2396 --- linux-2.6.0-orig/include/asm-x86_64/unistd.h        2004-12-21 18:38:40.627915992 +0100
2397 +++ linux-2.6.0/include/asm-x86_64/unistd.h     2004-12-21 18:39:00.852841336 +0100
2398 @@ -623,11 +623,11 @@
2399  type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \
2400  { \
2401  long __res; \
2402 -__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; movq %7,%%r9" __syscall \
2403 +__asm__ volatile ("movq %5,%%r10 ; movq %6,%%r8 ; movq %7,%%r9 ; " __syscall \
2404         : "=a" (__res) \
2405         : "0" (__NR_##name),"D" ((long)(arg1)),"S" ((long)(arg2)), \
2406 -         "d" ((long)(arg3)),"g" ((long)(arg4)),"g" ((long)(arg5), \
2407 -         "g" ((long)(arg6),) : \
2408 +         "d" ((long)(arg3)), "g" ((long)(arg4)), "g" ((long)(arg5)), \
2409 +         "g" ((long)(arg6)) : \
2410         __syscall_clobber,"r8","r10","r9" ); \
2411  __syscall_return(type,__res); \
2412  }
2413 diff -urN linux-2.6.0-orig/include/asm-x86_64/vsyscall.h linux-2.6.0/include/asm-x86_64/vsyscall.h
2414 --- linux-2.6.0-orig/include/asm-x86_64/vsyscall.h      2004-12-21 18:38:40.631915384 +0100
2415 +++ linux-2.6.0/include/asm-x86_64/vsyscall.h   2004-12-21 18:39:00.852841336 +0100
2416 @@ -15,6 +15,8 @@
2417  
2418  #ifdef __KERNEL__
2419  
2420 +/* FIXME: put all this into a single section */ 
2421 +
2422  #define __section_vxtime __attribute__ ((unused, __section__ (".vxtime"), aligned(16)))
2423  #define __section_wall_jiffies __attribute__ ((unused, __section__ (".wall_jiffies"), aligned(16)))
2424  #define __section_jiffies __attribute__ ((unused, __section__ (".jiffies"), aligned(16)))
2425 @@ -22,6 +24,8 @@
2426  #define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16)))
2427  #define __section_xtime __attribute__ ((unused, __section__ (".xtime"), aligned(16)))
2428  #define __section_xtime_lock __attribute__ ((unused, __section__ (".xtime_lock"), aligned(L1_CACHE_BYTES)))
2429 +#define __section_time_adjust __attribute__ ((unused, __section__ (".time_adjust"), aligned(16)))
2430 +#define __section_tick_usec __attribute__ ((unused, __section__ (".tick_usec"), aligned(16)))
2431  
2432  #define VXTIME_TSC     1
2433  #define VXTIME_HPET    2
2434 @@ -46,6 +50,8 @@
2435  extern unsigned long __wall_jiffies;
2436  extern struct timezone __sys_tz;
2437  extern seqlock_t __xtime_lock;
2438 +extern long __time_adjust;
2439 +extern long __tick_usec;
2440  
2441  /* kernel space (writeable) */
2442  extern struct vxtime_data vxtime;
2443 @@ -53,6 +59,8 @@
2444  extern struct timezone sys_tz;
2445  extern int sysctl_vsyscall;
2446  extern seqlock_t xtime_lock;
2447 +extern long time_adjust;
2448 +extern unsigned long tick_usec;
2449  
2450  #define ARCH_HAVE_XTIME_LOCK 1
2451  
2452 diff -urN linux-2.6.0-orig/include/linux/compat.h linux-2.6.0/include/linux/compat.h
2453 --- linux-2.6.0-orig/include/linux/compat.h     2004-12-21 18:38:40.685907176 +0100
2454 +++ linux-2.6.0/include/linux/compat.h  2004-12-21 18:39:00.852841336 +0100
2455 @@ -76,20 +76,6 @@
2456         compat_long_t   ru_nivcsw;
2457  };
2458  
2459 -struct compat_statfs64 {
2460 -       __u32 f_type;
2461 -       __u32 f_bsize;
2462 -       __u64 f_blocks;
2463 -       __u64 f_bfree;
2464 -       __u64 f_bavail;
2465 -       __u64 f_files;
2466 -       __u64 f_ffree;
2467 -       __kernel_fsid_t f_fsid;
2468 -       __u32 f_namelen;
2469 -       __u32 f_frsize;
2470 -       __u32 f_spare[5];
2471 -};
2472 -
2473  struct compat_dirent {
2474         u32             d_ino;
2475         compat_off_t    d_off;
2476 diff -urN linux-2.6.0-orig/include/linux/compat_ioctl.h linux-2.6.0/include/linux/compat_ioctl.h
2477 --- linux-2.6.0-orig/include/linux/compat_ioctl.h       2004-12-21 18:38:40.720901856 +0100
2478 +++ linux-2.6.0/include/linux/compat_ioctl.h    2004-12-21 18:39:00.853841184 +0100
2479 @@ -260,6 +260,7 @@
2480  COMPATIBLE_IOCTL(SIOCSIFLINK)
2481  COMPATIBLE_IOCTL(SIOCSIFENCAP)
2482  COMPATIBLE_IOCTL(SIOCGIFENCAP)
2483 +COMPATIBLE_IOCTL(SIOCSIFNAME)
2484  COMPATIBLE_IOCTL(SIOCSIFBR)
2485  COMPATIBLE_IOCTL(SIOCGIFBR)
2486  COMPATIBLE_IOCTL(SIOCSARP)
2487 diff -urN linux-2.6.0-orig/include/linux/pci_ids.h linux-2.6.0/include/linux/pci_ids.h
2488 --- linux-2.6.0-orig/include/linux/pci_ids.h    2004-12-21 18:38:40.681907784 +0100
2489 +++ linux-2.6.0/include/linux/pci_ids.h 2004-12-21 18:39:00.854841032 +0100
2490 @@ -1031,6 +1031,8 @@
2491  #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE      0x0085
2492  #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA     0x008e
2493  #define PCI_DEVICE_ID_NVIDIA_ITNT2             0x00A0
2494 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3           0x00d1
2495 +#define PCI_DEVICE_ID_NVIDIA_NFORCE3S                  0x00e1
2496  #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE       0x00d5
2497  #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA     0x00e3
2498  #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE      0x00e5
2499 diff -urN linux-2.6.0-orig/include/linux/timex.h linux-2.6.0/include/linux/timex.h
2500 --- linux-2.6.0-orig/include/linux/timex.h      2004-12-21 18:38:40.660910976 +0100
2501 +++ linux-2.6.0/include/linux/timex.h   2004-12-21 18:39:00.855840880 +0100
2502 @@ -282,7 +282,7 @@
2503   */
2504  extern unsigned long tick_usec;                /* USER_HZ period (usec) */
2505  extern unsigned long tick_nsec;                /* ACTHZ          period (nsec) */
2506 -extern int tickadj;                    /* amount of adjustment per tick */
2507 +#define tickadj ((int)(500/HZ ? : 1))
2508  
2509  /*
2510   * phase-lock loop variables
2511 diff -urN linux-2.6.0-orig/kernel/timer.c linux-2.6.0/kernel/timer.c
2512 --- linux-2.6.0-orig/kernel/timer.c     2004-12-21 18:38:42.155683736 +0100
2513 +++ linux-2.6.0/kernel/timer.c  2004-12-21 18:39:00.856840728 +0100
2514 @@ -436,7 +436,18 @@
2515  /*
2516   * Timekeeping variables
2517   */
2518 +
2519 +/* 
2520 + * Any variables used in low level gettimeofday must be declared
2521 + * inside ARCH_HAS_TIMEVARS. This is requires for x86-64 who
2522 + * can run gettimeofday in user context in a vsyscall. The variables
2523 + * must be mapped in a special way in the low level architecture code
2524 + * then. -AK
2525 + */ 
2526 +
2527 +#ifndef ARCH_HAS_TIMEVARS
2528  unsigned long tick_usec = TICK_USEC;           /* USER_HZ period (usec) */
2529 +#endif
2530  unsigned long tick_nsec = TICK_NSEC;           /* ACTHZ period (nsec) */
2531  
2532  /* 
2533 @@ -452,10 +463,6 @@
2534  
2535  EXPORT_SYMBOL(xtime);
2536  
2537 -/* Don't completely fail for HZ > 500.  */
2538 -int tickadj = 500/HZ ? : 1;            /* microsecs */
2539 -
2540 -
2541  /*
2542   * phase-lock loop variables
2543   */
2544 @@ -473,7 +480,9 @@
2545                                         /* frequency offset (scaled ppm)*/
2546  long time_adj;                         /* tick adjust (scaled 1 / HZ)  */
2547  long time_reftime;                     /* time at last adjustment (s)  */
2548 +#ifndef ARCH_HAS_TIMEVARS
2549  long time_adjust;
2550 +#endif
2551  long time_next_adjust;
2552  
2553  /*
This page took 0.283193 seconds and 3 git commands to generate.