aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-05-20 16:27:44 -0400
committerJames Bottomley <jejb@titanic.(none)>2005-05-20 16:27:44 -0400
commitad34ea2cc3845ef4dcd7d12fb0fa8484734bd672 (patch)
treead434400f5ecaa33b433c8f830e40792d8d6c05c /arch/i386/kernel
parent90356ac3194bf91a441a5f9c3067af386ef62462 (diff)
parent88d7bd8cb9eb8d64bf7997600b0d64f7834047c5 (diff)
merge by hand - fix up rejections in Documentation/DocBook/Makefile
Diffstat (limited to 'arch/i386/kernel')
-rw-r--r--arch/i386/kernel/Makefile1
-rw-r--r--arch/i386/kernel/acpi/boot.c2
-rw-r--r--arch/i386/kernel/apic.c2
-rw-r--r--arch/i386/kernel/cpu/amd.c4
-rw-r--r--arch/i386/kernel/cpu/mtrr/cyrix.c4
-rw-r--r--arch/i386/kernel/cpu/mtrr/generic.c4
-rw-r--r--arch/i386/kernel/cpu/mtrr/main.c14
-rw-r--r--arch/i386/kernel/cpu/proc.c2
-rw-r--r--arch/i386/kernel/entry.S304
-rw-r--r--arch/i386/kernel/head.S2
-rw-r--r--arch/i386/kernel/i386_ksyms.c4
-rw-r--r--arch/i386/kernel/io_apic.c2
-rw-r--r--arch/i386/kernel/kprobes.c7
-rw-r--r--arch/i386/kernel/nmi.c11
-rw-r--r--arch/i386/kernel/process.c17
-rw-r--r--arch/i386/kernel/ptrace.c24
-rw-r--r--arch/i386/kernel/reboot.c2
-rw-r--r--arch/i386/kernel/reboot_fixups.c56
-rw-r--r--arch/i386/kernel/smpboot.c3
-rw-r--r--arch/i386/kernel/syscall_table.S291
-rw-r--r--arch/i386/kernel/time.c2
-rw-r--r--arch/i386/kernel/time_hpet.c48
-rw-r--r--arch/i386/kernel/timers/timer_hpet.c11
-rw-r--r--arch/i386/kernel/timers/timer_tsc.c2
-rw-r--r--arch/i386/kernel/traps.c6
-rw-r--r--arch/i386/kernel/vm86.c21
26 files changed, 459 insertions, 387 deletions
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index aacdae6f372d..0fbcfe00dd8d 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o
23obj-$(CONFIG_X86_MPPARSE) += mpparse.o 23obj-$(CONFIG_X86_MPPARSE) += mpparse.o
24obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o 24obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o
25obj-$(CONFIG_X86_IO_APIC) += io_apic.o 25obj-$(CONFIG_X86_IO_APIC) += io_apic.o
26obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups.o
26obj-$(CONFIG_X86_NUMAQ) += numaq.o 27obj-$(CONFIG_X86_NUMAQ) += numaq.o
27obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o 28obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o
28obj-$(CONFIG_KPROBES) += kprobes.o 29obj-$(CONFIG_KPROBES) += kprobes.o
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 53eb5cfd5b63..848bb97af7ca 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -650,7 +650,7 @@ acpi_find_rsdp (void)
650 */ 650 */
651 rsdp_phys = acpi_scan_rsdp (0, 0x400); 651 rsdp_phys = acpi_scan_rsdp (0, 0x400);
652 if (!rsdp_phys) 652 if (!rsdp_phys)
653 rsdp_phys = acpi_scan_rsdp (0xE0000, 0xFFFFF); 653 rsdp_phys = acpi_scan_rsdp (0xE0000, 0x20000);
654 654
655 return rsdp_phys; 655 return rsdp_phys;
656} 656}
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c
index e3879f7625c2..d509836b70c3 100644
--- a/arch/i386/kernel/apic.c
+++ b/arch/i386/kernel/apic.c
@@ -1265,8 +1265,6 @@ int __init APIC_init_uniprocessor (void)
1265 1265
1266 setup_local_APIC(); 1266 setup_local_APIC();
1267 1267
1268 if (nmi_watchdog == NMI_LOCAL_APIC)
1269 check_nmi_watchdog();
1270#ifdef CONFIG_X86_IO_APIC 1268#ifdef CONFIG_X86_IO_APIC
1271 if (smp_found_config) 1269 if (smp_found_config)
1272 if (!skip_ioapic_setup && nr_ioapics) 1270 if (!skip_ioapic_setup && nr_ioapics)
diff --git a/arch/i386/kernel/cpu/amd.c b/arch/i386/kernel/cpu/amd.c
index 8d182e875cd7..16dbc4151be4 100644
--- a/arch/i386/kernel/cpu/amd.c
+++ b/arch/i386/kernel/cpu/amd.c
@@ -24,7 +24,7 @@ __asm__(".align 4\nvide: ret");
24 24
25static void __init init_amd(struct cpuinfo_x86 *c) 25static void __init init_amd(struct cpuinfo_x86 *c)
26{ 26{
27#ifdef CONFIG_SMP 27#ifdef CONFIG_X86_SMP
28 int cpu = c == &boot_cpu_data ? 0 : c - cpu_data; 28 int cpu = c == &boot_cpu_data ? 0 : c - cpu_data;
29#endif 29#endif
30 u32 l, h; 30 u32 l, h;
@@ -198,7 +198,7 @@ static void __init init_amd(struct cpuinfo_x86 *c)
198 c->x86_num_cores = 1; 198 c->x86_num_cores = 1;
199 } 199 }
200 200
201#ifdef CONFIG_SMP 201#ifdef CONFIG_X86_SMP
202 /* 202 /*
203 * On a AMD dual core setup the lower bits of the APIC id 203 * On a AMD dual core setup the lower bits of the APIC id
204 * distingush the cores. Assumes number of cores is a power 204 * distingush the cores. Assumes number of cores is a power
diff --git a/arch/i386/kernel/cpu/mtrr/cyrix.c b/arch/i386/kernel/cpu/mtrr/cyrix.c
index 933b0dd62f48..9027a987006b 100644
--- a/arch/i386/kernel/cpu/mtrr/cyrix.c
+++ b/arch/i386/kernel/cpu/mtrr/cyrix.c
@@ -218,12 +218,12 @@ typedef struct {
218 mtrr_type type; 218 mtrr_type type;
219} arr_state_t; 219} arr_state_t;
220 220
221static arr_state_t arr_state[8] __initdata = { 221static arr_state_t arr_state[8] __devinitdata = {
222 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, 222 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL},
223 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL} 223 {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}, {0UL, 0UL, 0UL}
224}; 224};
225 225
226static unsigned char ccr_state[7] __initdata = { 0, 0, 0, 0, 0, 0, 0 }; 226static unsigned char ccr_state[7] __devinitdata = { 0, 0, 0, 0, 0, 0, 0 };
227 227
228static void cyrix_set_all(void) 228static void cyrix_set_all(void)
229{ 229{
diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/i386/kernel/cpu/mtrr/generic.c
index 9f7a7ea6388d..f468a979e9aa 100644
--- a/arch/i386/kernel/cpu/mtrr/generic.c
+++ b/arch/i386/kernel/cpu/mtrr/generic.c
@@ -124,8 +124,8 @@ int generic_get_free_region(unsigned long base, unsigned long size)
124 return -ENOSPC; 124 return -ENOSPC;
125} 125}
126 126
127void generic_get_mtrr(unsigned int reg, unsigned long *base, 127static void generic_get_mtrr(unsigned int reg, unsigned long *base,
128 unsigned int *size, mtrr_type * type) 128 unsigned int *size, mtrr_type * type)
129{ 129{
130 unsigned int mask_lo, mask_hi, base_lo, base_hi; 130 unsigned int mask_lo, mask_hi, base_lo, base_hi;
131 131
diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/i386/kernel/cpu/mtrr/main.c
index 54999e4c55fd..e1c2042b9b7e 100644
--- a/arch/i386/kernel/cpu/mtrr/main.c
+++ b/arch/i386/kernel/cpu/mtrr/main.c
@@ -72,17 +72,21 @@ void set_mtrr_ops(struct mtrr_ops * ops)
72static int have_wrcomb(void) 72static int have_wrcomb(void)
73{ 73{
74 struct pci_dev *dev; 74 struct pci_dev *dev;
75 u8 rev;
75 76
76 if ((dev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) != NULL) { 77 if ((dev = pci_get_class(PCI_CLASS_BRIDGE_HOST << 8, NULL)) != NULL) {
77 /* ServerWorks LE chipsets have problems with write-combining 78 /* ServerWorks LE chipsets < rev 6 have problems with write-combining
78 Don't allow it and leave room for other chipsets to be tagged */ 79 Don't allow it and leave room for other chipsets to be tagged */
79 if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS && 80 if (dev->vendor == PCI_VENDOR_ID_SERVERWORKS &&
80 dev->device == PCI_DEVICE_ID_SERVERWORKS_LE) { 81 dev->device == PCI_DEVICE_ID_SERVERWORKS_LE) {
81 printk(KERN_INFO "mtrr: Serverworks LE detected. Write-combining disabled.\n"); 82 pci_read_config_byte(dev, PCI_CLASS_REVISION, &rev);
82 pci_dev_put(dev); 83 if (rev <= 5) {
83 return 0; 84 printk(KERN_INFO "mtrr: Serverworks LE rev < 6 detected. Write-combining disabled.\n");
85 pci_dev_put(dev);
86 return 0;
87 }
84 } 88 }
85 /* Intel 450NX errata # 23. Non ascending cachline evictions to 89 /* Intel 450NX errata # 23. Non ascending cacheline evictions to
86 write combining memory may resulting in data corruption */ 90 write combining memory may resulting in data corruption */
87 if (dev->vendor == PCI_VENDOR_ID_INTEL && 91 if (dev->vendor == PCI_VENDOR_ID_INTEL &&
88 dev->device == PCI_DEVICE_ID_INTEL_82451NX) { 92 dev->device == PCI_DEVICE_ID_INTEL_82451NX) {
diff --git a/arch/i386/kernel/cpu/proc.c b/arch/i386/kernel/cpu/proc.c
index 4f28eba7fb8a..7323c19f354e 100644
--- a/arch/i386/kernel/cpu/proc.c
+++ b/arch/i386/kernel/cpu/proc.c
@@ -25,7 +25,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
25 "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe", 25 "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe",
26 26
27 /* AMD-defined */ 27 /* AMD-defined */
28 "pni", NULL, NULL, NULL, NULL, NULL, NULL, NULL, 28 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
29 NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, 29 NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL,
30 NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL, 30 NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL,
31 NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow", 31 NULL, "fxsr_opt", NULL, NULL, NULL, "lm", "3dnowext", "3dnow",
diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S
index 3c73dc865ead..a991d4e5edd2 100644
--- a/arch/i386/kernel/entry.S
+++ b/arch/i386/kernel/entry.S
@@ -260,11 +260,9 @@ restore_nocheck:
260.section .fixup,"ax" 260.section .fixup,"ax"
261iret_exc: 261iret_exc:
262 sti 262 sti
263 movl $__USER_DS, %edx 263 pushl $0 # no error code
264 movl %edx, %ds 264 pushl $do_iret_error
265 movl %edx, %es 265 jmp error_code
266 movl $11,%eax
267 call do_exit
268.previous 266.previous
269.section __ex_table,"a" 267.section __ex_table,"a"
270 .align 4 268 .align 4
@@ -516,8 +514,6 @@ debug_stack_correct:
516 xorl %edx,%edx # error code 0 514 xorl %edx,%edx # error code 0
517 movl %esp,%eax # pt_regs pointer 515 movl %esp,%eax # pt_regs pointer
518 call do_debug 516 call do_debug
519 testl %eax,%eax
520 jnz restore_all
521 jmp ret_from_exception 517 jmp ret_from_exception
522 518
523/* 519/*
@@ -598,8 +594,6 @@ ENTRY(int3)
598 xorl %edx,%edx # zero error code 594 xorl %edx,%edx # zero error code
599 movl %esp,%eax # pt_regs pointer 595 movl %esp,%eax # pt_regs pointer
600 call do_int3 596 call do_int3
601 testl %eax,%eax
602 jnz restore_all
603 jmp ret_from_exception 597 jmp ret_from_exception
604 598
605ENTRY(overflow) 599ENTRY(overflow)
@@ -658,296 +652,6 @@ ENTRY(spurious_interrupt_bug)
658 pushl $do_spurious_interrupt_bug 652 pushl $do_spurious_interrupt_bug
659 jmp error_code 653 jmp error_code
660 654
661.data 655#include "syscall_table.S"
662ENTRY(sys_call_table)
663 .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
664 .long sys_exit
665 .long sys_fork
666 .long sys_read
667 .long sys_write
668 .long sys_open /* 5 */
669 .long sys_close
670 .long sys_waitpid
671 .long sys_creat
672 .long sys_link
673 .long sys_unlink /* 10 */
674 .long sys_execve
675 .long sys_chdir
676 .long sys_time
677 .long sys_mknod
678 .long sys_chmod /* 15 */
679 .long sys_lchown16
680 .long sys_ni_syscall /* old break syscall holder */
681 .long sys_stat
682 .long sys_lseek
683 .long sys_getpid /* 20 */
684 .long sys_mount
685 .long sys_oldumount
686 .long sys_setuid16
687 .long sys_getuid16
688 .long sys_stime /* 25 */
689 .long sys_ptrace
690 .long sys_alarm
691 .long sys_fstat
692 .long sys_pause
693 .long sys_utime /* 30 */
694 .long sys_ni_syscall /* old stty syscall holder */
695 .long sys_ni_syscall /* old gtty syscall holder */
696 .long sys_access
697 .long sys_nice
698 .long sys_ni_syscall /* 35 - old ftime syscall holder */
699 .long sys_sync
700 .long sys_kill
701 .long sys_rename
702 .long sys_mkdir
703 .long sys_rmdir /* 40 */
704 .long sys_dup
705 .long sys_pipe
706 .long sys_times
707 .long sys_ni_syscall /* old prof syscall holder */
708 .long sys_brk /* 45 */
709 .long sys_setgid16
710 .long sys_getgid16
711 .long sys_signal
712 .long sys_geteuid16
713 .long sys_getegid16 /* 50 */
714 .long sys_acct
715 .long sys_umount /* recycled never used phys() */
716 .long sys_ni_syscall /* old lock syscall holder */
717 .long sys_ioctl
718 .long sys_fcntl /* 55 */
719 .long sys_ni_syscall /* old mpx syscall holder */
720 .long sys_setpgid
721 .long sys_ni_syscall /* old ulimit syscall holder */
722 .long sys_olduname
723 .long sys_umask /* 60 */
724 .long sys_chroot
725 .long sys_ustat
726 .long sys_dup2
727 .long sys_getppid
728 .long sys_getpgrp /* 65 */
729 .long sys_setsid
730 .long sys_sigaction
731 .long sys_sgetmask
732 .long sys_ssetmask
733 .long sys_setreuid16 /* 70 */
734 .long sys_setregid16
735 .long sys_sigsuspend
736 .long sys_sigpending
737 .long sys_sethostname
738 .long sys_setrlimit /* 75 */
739 .long sys_old_getrlimit
740 .long sys_getrusage
741 .long sys_gettimeofday
742 .long sys_settimeofday
743 .long sys_getgroups16 /* 80 */
744 .long sys_setgroups16
745 .long old_select
746 .long sys_symlink
747 .long sys_lstat
748 .long sys_readlink /* 85 */
749 .long sys_uselib
750 .long sys_swapon
751 .long sys_reboot
752 .long old_readdir
753 .long old_mmap /* 90 */
754 .long sys_munmap
755 .long sys_truncate
756 .long sys_ftruncate
757 .long sys_fchmod
758 .long sys_fchown16 /* 95 */
759 .long sys_getpriority
760 .long sys_setpriority
761 .long sys_ni_syscall /* old profil syscall holder */
762 .long sys_statfs
763 .long sys_fstatfs /* 100 */
764 .long sys_ioperm
765 .long sys_socketcall
766 .long sys_syslog
767 .long sys_setitimer
768 .long sys_getitimer /* 105 */
769 .long sys_newstat
770 .long sys_newlstat
771 .long sys_newfstat
772 .long sys_uname
773 .long sys_iopl /* 110 */
774 .long sys_vhangup
775 .long sys_ni_syscall /* old "idle" system call */
776 .long sys_vm86old
777 .long sys_wait4
778 .long sys_swapoff /* 115 */
779 .long sys_sysinfo
780 .long sys_ipc
781 .long sys_fsync
782 .long sys_sigreturn
783 .long sys_clone /* 120 */
784 .long sys_setdomainname
785 .long sys_newuname
786 .long sys_modify_ldt
787 .long sys_adjtimex
788 .long sys_mprotect /* 125 */
789 .long sys_sigprocmask
790 .long sys_ni_syscall /* old "create_module" */
791 .long sys_init_module
792 .long sys_delete_module
793 .long sys_ni_syscall /* 130: old "get_kernel_syms" */
794 .long sys_quotactl
795 .long sys_getpgid
796 .long sys_fchdir
797 .long sys_bdflush
798 .long sys_sysfs /* 135 */
799 .long sys_personality
800 .long sys_ni_syscall /* reserved for afs_syscall */
801 .long sys_setfsuid16
802 .long sys_setfsgid16
803 .long sys_llseek /* 140 */
804 .long sys_getdents
805 .long sys_select
806 .long sys_flock
807 .long sys_msync
808 .long sys_readv /* 145 */
809 .long sys_writev
810 .long sys_getsid
811 .long sys_fdatasync
812 .long sys_sysctl
813 .long sys_mlock /* 150 */
814 .long sys_munlock
815 .long sys_mlockall
816 .long sys_munlockall
817 .long sys_sched_setparam
818 .long sys_sched_getparam /* 155 */
819 .long sys_sched_setscheduler
820 .long sys_sched_getscheduler
821 .long sys_sched_yield
822 .long sys_sched_get_priority_max
823 .long sys_sched_get_priority_min /* 160 */
824 .long sys_sched_rr_get_interval
825 .long sys_nanosleep
826 .long sys_mremap
827 .long sys_setresuid16
828 .long sys_getresuid16 /* 165 */
829 .long sys_vm86
830 .long sys_ni_syscall /* Old sys_query_module */
831 .long sys_poll
832 .long sys_nfsservctl
833 .long sys_setresgid16 /* 170 */
834 .long sys_getresgid16
835 .long sys_prctl
836 .long sys_rt_sigreturn
837 .long sys_rt_sigaction
838 .long sys_rt_sigprocmask /* 175 */
839 .long sys_rt_sigpending
840 .long sys_rt_sigtimedwait
841 .long sys_rt_sigqueueinfo
842 .long sys_rt_sigsuspend
843 .long sys_pread64 /* 180 */
844 .long sys_pwrite64
845 .long sys_chown16
846 .long sys_getcwd
847 .long sys_capget
848 .long sys_capset /* 185 */
849 .long sys_sigaltstack
850 .long sys_sendfile
851 .long sys_ni_syscall /* reserved for streams1 */
852 .long sys_ni_syscall /* reserved for streams2 */
853 .long sys_vfork /* 190 */
854 .long sys_getrlimit
855 .long sys_mmap2
856 .long sys_truncate64
857 .long sys_ftruncate64
858 .long sys_stat64 /* 195 */
859 .long sys_lstat64
860 .long sys_fstat64
861 .long sys_lchown
862 .long sys_getuid
863 .long sys_getgid /* 200 */
864 .long sys_geteuid
865 .long sys_getegid
866 .long sys_setreuid
867 .long sys_setregid
868 .long sys_getgroups /* 205 */
869 .long sys_setgroups
870 .long sys_fchown
871 .long sys_setresuid
872 .long sys_getresuid
873 .long sys_setresgid /* 210 */
874 .long sys_getresgid
875 .long sys_chown
876 .long sys_setuid
877 .long sys_setgid
878 .long sys_setfsuid /* 215 */
879 .long sys_setfsgid
880 .long sys_pivot_root
881 .long sys_mincore
882 .long sys_madvise
883 .long sys_getdents64 /* 220 */
884 .long sys_fcntl64
885 .long sys_ni_syscall /* reserved for TUX */
886 .long sys_ni_syscall
887 .long sys_gettid
888 .long sys_readahead /* 225 */
889 .long sys_setxattr
890 .long sys_lsetxattr
891 .long sys_fsetxattr
892 .long sys_getxattr
893 .long sys_lgetxattr /* 230 */
894 .long sys_fgetxattr
895 .long sys_listxattr
896 .long sys_llistxattr
897 .long sys_flistxattr
898 .long sys_removexattr /* 235 */
899 .long sys_lremovexattr
900 .long sys_fremovexattr
901 .long sys_tkill
902 .long sys_sendfile64
903 .long sys_futex /* 240 */
904 .long sys_sched_setaffinity
905 .long sys_sched_getaffinity
906 .long sys_set_thread_area
907 .long sys_get_thread_area
908 .long sys_io_setup /* 245 */
909 .long sys_io_destroy
910 .long sys_io_getevents
911 .long sys_io_submit
912 .long sys_io_cancel
913 .long sys_fadvise64 /* 250 */
914 .long sys_ni_syscall
915 .long sys_exit_group
916 .long sys_lookup_dcookie
917 .long sys_epoll_create
918 .long sys_epoll_ctl /* 255 */
919 .long sys_epoll_wait
920 .long sys_remap_file_pages
921 .long sys_set_tid_address
922 .long sys_timer_create
923 .long sys_timer_settime /* 260 */
924 .long sys_timer_gettime
925 .long sys_timer_getoverrun
926 .long sys_timer_delete
927 .long sys_clock_settime
928 .long sys_clock_gettime /* 265 */
929 .long sys_clock_getres
930 .long sys_clock_nanosleep
931 .long sys_statfs64
932 .long sys_fstatfs64
933 .long sys_tgkill /* 270 */
934 .long sys_utimes
935 .long sys_fadvise64_64
936 .long sys_ni_syscall /* sys_vserver */
937 .long sys_mbind
938 .long sys_get_mempolicy
939 .long sys_set_mempolicy
940 .long sys_mq_open
941 .long sys_mq_unlink
942 .long sys_mq_timedsend
943 .long sys_mq_timedreceive /* 280 */
944 .long sys_mq_notify
945 .long sys_mq_getsetattr
946 .long sys_ni_syscall /* reserved for kexec */
947 .long sys_waitid
948 .long sys_ni_syscall /* 285 */ /* available */
949 .long sys_add_key
950 .long sys_request_key
951 .long sys_keyctl
952 656
953syscall_table_size=(.-sys_call_table) 657syscall_table_size=(.-sys_call_table)
diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S
index d273fd746192..e966fc8c44c4 100644
--- a/arch/i386/kernel/head.S
+++ b/arch/i386/kernel/head.S
@@ -380,6 +380,7 @@ rp_sidt:
380 ALIGN 380 ALIGN
381ignore_int: 381ignore_int:
382 cld 382 cld
383#ifdef CONFIG_PRINTK
383 pushl %eax 384 pushl %eax
384 pushl %ecx 385 pushl %ecx
385 pushl %edx 386 pushl %edx
@@ -400,6 +401,7 @@ ignore_int:
400 popl %edx 401 popl %edx
401 popl %ecx 402 popl %ecx
402 popl %eax 403 popl %eax
404#endif
403 iret 405 iret
404 406
405/* 407/*
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c
index 14ec354bec92..903190a4b3ff 100644
--- a/arch/i386/kernel/i386_ksyms.c
+++ b/arch/i386/kernel/i386_ksyms.c
@@ -169,10 +169,6 @@ EXPORT_SYMBOL(rtc_lock);
169EXPORT_SYMBOL_GPL(set_nmi_callback); 169EXPORT_SYMBOL_GPL(set_nmi_callback);
170EXPORT_SYMBOL_GPL(unset_nmi_callback); 170EXPORT_SYMBOL_GPL(unset_nmi_callback);
171 171
172#undef memcmp
173extern int memcmp(const void *,const void *,__kernel_size_t);
174EXPORT_SYMBOL(memcmp);
175
176EXPORT_SYMBOL(register_die_notifier); 172EXPORT_SYMBOL(register_die_notifier);
177#ifdef CONFIG_HAVE_DEC_LOCK 173#ifdef CONFIG_HAVE_DEC_LOCK
178EXPORT_SYMBOL(_atomic_dec_and_lock); 174EXPORT_SYMBOL(_atomic_dec_and_lock);
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 5e0d55be5435..7a324e8b86f9 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -2175,7 +2175,6 @@ static inline void check_timer(void)
2175 disable_8259A_irq(0); 2175 disable_8259A_irq(0);
2176 setup_nmi(); 2176 setup_nmi();
2177 enable_8259A_irq(0); 2177 enable_8259A_irq(0);
2178 check_nmi_watchdog();
2179 } 2178 }
2180 return; 2179 return;
2181 } 2180 }
@@ -2198,7 +2197,6 @@ static inline void check_timer(void)
2198 add_pin_to_irq(0, 0, pin2); 2197 add_pin_to_irq(0, 0, pin2);
2199 if (nmi_watchdog == NMI_IO_APIC) { 2198 if (nmi_watchdog == NMI_IO_APIC) {
2200 setup_nmi(); 2199 setup_nmi();
2201 check_nmi_watchdog();
2202 } 2200 }
2203 return; 2201 return;
2204 } 2202 }
diff --git a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
index 671681659243..59ff9b455069 100644
--- a/arch/i386/kernel/kprobes.c
+++ b/arch/i386/kernel/kprobes.c
@@ -217,6 +217,13 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs)
217 *tos &= ~(TF_MASK | IF_MASK); 217 *tos &= ~(TF_MASK | IF_MASK);
218 *tos |= kprobe_old_eflags; 218 *tos |= kprobe_old_eflags;
219 break; 219 break;
220 case 0xc3: /* ret/lret */
221 case 0xcb:
222 case 0xc2:
223 case 0xca:
224 regs->eflags &= ~TF_MASK;
225 /* eip is already adjusted, no more changes required*/
226 return;
220 case 0xe8: /* call relative - Fix return addr */ 227 case 0xe8: /* call relative - Fix return addr */
221 *tos = orig_eip + (*tos - copy_eip); 228 *tos = orig_eip + (*tos - copy_eip);
222 break; 229 break;
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c
index 2f89d000f954..2c0ee9c2d020 100644
--- a/arch/i386/kernel/nmi.c
+++ b/arch/i386/kernel/nmi.c
@@ -102,20 +102,21 @@ int nmi_active;
102 (P4_CCCR_OVF_PMI0|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT| \ 102 (P4_CCCR_OVF_PMI0|P4_CCCR_THRESHOLD(15)|P4_CCCR_COMPLEMENT| \
103 P4_CCCR_COMPARE|P4_CCCR_REQUIRED|P4_CCCR_ESCR_SELECT(4)|P4_CCCR_ENABLE) 103 P4_CCCR_COMPARE|P4_CCCR_REQUIRED|P4_CCCR_ESCR_SELECT(4)|P4_CCCR_ENABLE)
104 104
105int __init check_nmi_watchdog (void) 105static int __init check_nmi_watchdog(void)
106{ 106{
107 unsigned int prev_nmi_count[NR_CPUS]; 107 unsigned int prev_nmi_count[NR_CPUS];
108 int cpu; 108 int cpu;
109 109
110 printk(KERN_INFO "testing NMI watchdog ... "); 110 if (nmi_watchdog == NMI_NONE)
111 return 0;
112
113 printk(KERN_INFO "Testing NMI watchdog ... ");
111 114
112 for (cpu = 0; cpu < NR_CPUS; cpu++) 115 for (cpu = 0; cpu < NR_CPUS; cpu++)
113 prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count; 116 prev_nmi_count[cpu] = per_cpu(irq_stat, cpu).__nmi_count;
114 local_irq_enable(); 117 local_irq_enable();
115 mdelay((10*1000)/nmi_hz); // wait 10 ticks 118 mdelay((10*1000)/nmi_hz); // wait 10 ticks
116 119
117 /* FIXME: Only boot CPU is online at this stage. Check CPUs
118 as they come up. */
119 for (cpu = 0; cpu < NR_CPUS; cpu++) { 120 for (cpu = 0; cpu < NR_CPUS; cpu++) {
120#ifdef CONFIG_SMP 121#ifdef CONFIG_SMP
121 /* Check cpu_callin_map here because that is set 122 /* Check cpu_callin_map here because that is set
@@ -139,6 +140,8 @@ int __init check_nmi_watchdog (void)
139 140
140 return 0; 141 return 0;
141} 142}
143/* This needs to happen later in boot so counters are working */
144late_initcall(check_nmi_watchdog);
142 145
143static int __init setup_nmi_watchdog(char *str) 146static int __init setup_nmi_watchdog(char *str)
144{ 147{
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c
index b2203e21acb3..96e3ea6b17c7 100644
--- a/arch/i386/kernel/process.c
+++ b/arch/i386/kernel/process.c
@@ -400,11 +400,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
400 int err; 400 int err;
401 401
402 childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; 402 childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p->thread_info)) - 1;
403 *childregs = *regs;
404 childregs->eax = 0;
405 childregs->esp = esp;
406
407 p->thread.esp = (unsigned long) childregs;
408 /* 403 /*
409 * The below -8 is to reserve 8 bytes on top of the ring0 stack. 404 * The below -8 is to reserve 8 bytes on top of the ring0 stack.
410 * This is necessary to guarantee that the entire "struct pt_regs" 405 * This is necessary to guarantee that the entire "struct pt_regs"
@@ -415,7 +410,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long esp,
415 * "struct pt_regs" is possible, but they may contain the 410 * "struct pt_regs" is possible, but they may contain the
416 * completely wrong values. 411 * completely wrong values.
417 */ 412 */
418 p->thread.esp0 = (unsigned long) (childregs+1) - 8; 413 childregs = (struct pt_regs *) ((unsigned long) childregs - 8);
414 *childregs = *regs;
415 childregs->eax = 0;
416 childregs->esp = esp;
417
418 p->thread.esp = (unsigned long) childregs;
419 p->thread.esp0 = (unsigned long) (childregs+1);
419 420
420 p->thread.eip = (unsigned long) ret_from_fork; 421 p->thread.eip = (unsigned long) ret_from_fork;
421 422
@@ -611,8 +612,8 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
611 * Save away %fs and %gs. No need to save %es and %ds, as 612 * Save away %fs and %gs. No need to save %es and %ds, as
612 * those are always kernel segments while inside the kernel. 613 * those are always kernel segments while inside the kernel.
613 */ 614 */
614 asm volatile("movl %%fs,%0":"=m" (*(int *)&prev->fs)); 615 asm volatile("mov %%fs,%0":"=m" (prev->fs));
615 asm volatile("movl %%gs,%0":"=m" (*(int *)&prev->gs)); 616 asm volatile("mov %%gs,%0":"=m" (prev->gs));
616 617
617 /* 618 /*
618 * Restore %fs and %gs if needed. 619 * Restore %fs and %gs if needed.
diff --git a/arch/i386/kernel/ptrace.c b/arch/i386/kernel/ptrace.c
index b2f17640ceff..e34f651fa13c 100644
--- a/arch/i386/kernel/ptrace.c
+++ b/arch/i386/kernel/ptrace.c
@@ -16,6 +16,7 @@
16#include <linux/security.h> 16#include <linux/security.h>
17#include <linux/audit.h> 17#include <linux/audit.h>
18#include <linux/seccomp.h> 18#include <linux/seccomp.h>
19#include <linux/signal.h>
19 20
20#include <asm/uaccess.h> 21#include <asm/uaccess.h>
21#include <asm/pgtable.h> 22#include <asm/pgtable.h>
@@ -511,7 +512,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
511 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ 512 case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */
512 case PTRACE_CONT: /* restart after signal. */ 513 case PTRACE_CONT: /* restart after signal. */
513 ret = -EIO; 514 ret = -EIO;
514 if ((unsigned long) data > _NSIG) 515 if (!valid_signal(data))
515 break; 516 break;
516 if (request == PTRACE_SYSCALL) { 517 if (request == PTRACE_SYSCALL) {
517 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 518 set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
@@ -543,7 +544,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
543 544
544 case PTRACE_SINGLESTEP: /* set the trap flag. */ 545 case PTRACE_SINGLESTEP: /* set the trap flag. */
545 ret = -EIO; 546 ret = -EIO;
546 if ((unsigned long) data > _NSIG) 547 if (!valid_signal(data))
547 break; 548 break;
548 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); 549 clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
549 set_singlestep(child); 550 set_singlestep(child);
@@ -682,24 +683,18 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit)
682 /* do the secure computing check first */ 683 /* do the secure computing check first */
683 secure_computing(regs->orig_eax); 684 secure_computing(regs->orig_eax);
684 685
685 if (unlikely(current->audit_context)) { 686 if (unlikely(current->audit_context) && entryexit)
686 if (!entryexit) 687 audit_syscall_exit(current, AUDITSC_RESULT(regs->eax), regs->eax);
687 audit_syscall_entry(current, regs->orig_eax,
688 regs->ebx, regs->ecx,
689 regs->edx, regs->esi);
690 else
691 audit_syscall_exit(current, regs->eax);
692 }
693 688
694 if (!(current->ptrace & PT_PTRACED)) 689 if (!(current->ptrace & PT_PTRACED))
695 return; 690 goto out;
696 691
697 /* Fake a debug trap */ 692 /* Fake a debug trap */
698 if (test_thread_flag(TIF_SINGLESTEP)) 693 if (test_thread_flag(TIF_SINGLESTEP))
699 send_sigtrap(current, regs, 0); 694 send_sigtrap(current, regs, 0);
700 695
701 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 696 if (!test_thread_flag(TIF_SYSCALL_TRACE))
702 return; 697 goto out;
703 698
704 /* the 0x80 provides a way for the tracing parent to distinguish 699 /* the 0x80 provides a way for the tracing parent to distinguish
705 between a syscall stop and SIGTRAP delivery */ 700 between a syscall stop and SIGTRAP delivery */
@@ -714,4 +709,9 @@ void do_syscall_trace(struct pt_regs *regs, int entryexit)
714 send_sig(current->exit_code, current, 1); 709 send_sig(current->exit_code, current, 1);
715 current->exit_code = 0; 710 current->exit_code = 0;
716 } 711 }
712 out:
713 if (unlikely(current->audit_context) && !entryexit)
714 audit_syscall_entry(current, AUDIT_ARCH_I386, regs->orig_eax,
715 regs->ebx, regs->ecx, regs->edx, regs->esi);
716
717} 717}
diff --git a/arch/i386/kernel/reboot.c b/arch/i386/kernel/reboot.c
index 3d7e994563df..6dc27eb70ee7 100644
--- a/arch/i386/kernel/reboot.c
+++ b/arch/i386/kernel/reboot.c
@@ -13,6 +13,7 @@
13#include <asm/uaccess.h> 13#include <asm/uaccess.h>
14#include <asm/apic.h> 14#include <asm/apic.h>
15#include "mach_reboot.h" 15#include "mach_reboot.h"
16#include <linux/reboot_fixups.h>
16 17
17/* 18/*
18 * Power off function, if any 19 * Power off function, if any
@@ -348,6 +349,7 @@ void machine_restart(char * __unused)
348 /* rebooting needs to touch the page at absolute addr 0 */ 349 /* rebooting needs to touch the page at absolute addr 0 */
349 *((unsigned short *)__va(0x472)) = reboot_mode; 350 *((unsigned short *)__va(0x472)) = reboot_mode;
350 for (;;) { 351 for (;;) {
352 mach_reboot_fixups(); /* for board specific fixups */
351 mach_reboot(); 353 mach_reboot();
352 /* That didn't work - force a triple fault.. */ 354 /* That didn't work - force a triple fault.. */
353 __asm__ __volatile__("lidt %0": :"m" (no_idt)); 355 __asm__ __volatile__("lidt %0": :"m" (no_idt));
diff --git a/arch/i386/kernel/reboot_fixups.c b/arch/i386/kernel/reboot_fixups.c
new file mode 100644
index 000000000000..1b183b378c2c
--- /dev/null
+++ b/arch/i386/kernel/reboot_fixups.c
@@ -0,0 +1,56 @@
1/*
2 * linux/arch/i386/kernel/reboot_fixups.c
3 *
4 * This is a good place to put board specific reboot fixups.
5 *
6 * List of supported fixups:
7 * geode-gx1/cs5530a - Jaya Kumar <jayalk@intworks.biz>
8 *
9 */
10
11#include <asm/delay.h>
12#include <linux/pci.h>
13
14static void cs5530a_warm_reset(struct pci_dev *dev)
15{
16 /* writing 1 to the reset control register, 0x44 causes the
17 cs5530a to perform a system warm reset */
18 pci_write_config_byte(dev, 0x44, 0x1);
19 udelay(50); /* shouldn't get here but be safe and spin-a-while */
20 return;
21}
22
23struct device_fixup {
24 unsigned int vendor;
25 unsigned int device;
26 void (*reboot_fixup)(struct pci_dev *);
27};
28
29static struct device_fixup fixups_table[] = {
30{ PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_LEGACY, cs5530a_warm_reset },
31};
32
33/*
34 * we see if any fixup is available for our current hardware. if there
35 * is a fixup, we call it and we expect to never return from it. if we
36 * do return, we keep looking and then eventually fall back to the
37 * standard mach_reboot on return.
38 */
39void mach_reboot_fixups(void)
40{
41 struct device_fixup *cur;
42 struct pci_dev *dev;
43 int i;
44
45 for (i=0; i < (sizeof(fixups_table)/sizeof(fixups_table[0])); i++) {
46 cur = &(fixups_table[i]);
47 dev = pci_get_device(cur->vendor, cur->device, 0);
48 if (!dev)
49 continue;
50
51 cur->reboot_fixup(dev);
52 }
53
54 printk(KERN_WARNING "No reboot fixup found for your hardware\n");
55}
56
diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c
index fd36d2f65f88..cbea7ac582e5 100644
--- a/arch/i386/kernel/smpboot.c
+++ b/arch/i386/kernel/smpboot.c
@@ -1089,9 +1089,6 @@ static void __init smp_boot_cpus(unsigned int max_cpus)
1089 } 1089 }
1090 } 1090 }
1091 1091
1092 if (nmi_watchdog == NMI_LOCAL_APIC)
1093 check_nmi_watchdog();
1094
1095 smpboot_setup_io_apic(); 1092 smpboot_setup_io_apic();
1096 1093
1097 setup_boot_APIC_clock(); 1094 setup_boot_APIC_clock();
diff --git a/arch/i386/kernel/syscall_table.S b/arch/i386/kernel/syscall_table.S
new file mode 100644
index 000000000000..6cd1ed311f02
--- /dev/null
+++ b/arch/i386/kernel/syscall_table.S
@@ -0,0 +1,291 @@
1.data
2ENTRY(sys_call_table)
3 .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
4 .long sys_exit
5 .long sys_fork
6 .long sys_read
7 .long sys_write
8 .long sys_open /* 5 */
9 .long sys_close
10 .long sys_waitpid
11 .long sys_creat
12 .long sys_link
13 .long sys_unlink /* 10 */
14 .long sys_execve
15 .long sys_chdir
16 .long sys_time
17 .long sys_mknod
18 .long sys_chmod /* 15 */
19 .long sys_lchown16
20 .long sys_ni_syscall /* old break syscall holder */
21 .long sys_stat
22 .long sys_lseek
23 .long sys_getpid /* 20 */
24 .long sys_mount
25 .long sys_oldumount
26 .long sys_setuid16
27 .long sys_getuid16
28 .long sys_stime /* 25 */
29 .long sys_ptrace
30 .long sys_alarm
31 .long sys_fstat
32 .long sys_pause
33 .long sys_utime /* 30 */
34 .long sys_ni_syscall /* old stty syscall holder */
35 .long sys_ni_syscall /* old gtty syscall holder */
36 .long sys_access
37 .long sys_nice
38 .long sys_ni_syscall /* 35 - old ftime syscall holder */
39 .long sys_sync
40 .long sys_kill
41 .long sys_rename
42 .long sys_mkdir
43 .long sys_rmdir /* 40 */
44 .long sys_dup
45 .long sys_pipe
46 .long sys_times
47 .long sys_ni_syscall /* old prof syscall holder */
48 .long sys_brk /* 45 */
49 .long sys_setgid16
50 .long sys_getgid16
51 .long sys_signal
52 .long sys_geteuid16
53 .long sys_getegid16 /* 50 */
54 .long sys_acct
55 .long sys_umount /* recycled never used phys() */
56 .long sys_ni_syscall /* old lock syscall holder */
57 .long sys_ioctl
58 .long sys_fcntl /* 55 */
59 .long sys_ni_syscall /* old mpx syscall holder */
60 .long sys_setpgid
61 .long sys_ni_syscall /* old ulimit syscall holder */
62 .long sys_olduname
63 .long sys_umask /* 60 */
64 .long sys_chroot
65 .long sys_ustat
66 .long sys_dup2
67 .long sys_getppid
68 .long sys_getpgrp /* 65 */
69 .long sys_setsid
70 .long sys_sigaction
71 .long sys_sgetmask
72 .long sys_ssetmask
73 .long sys_setreuid16 /* 70 */
74 .long sys_setregid16
75 .long sys_sigsuspend
76 .long sys_sigpending
77 .long sys_sethostname
78 .long sys_setrlimit /* 75 */
79 .long sys_old_getrlimit
80 .long sys_getrusage
81 .long sys_gettimeofday
82 .long sys_settimeofday
83 .long sys_getgroups16 /* 80 */
84 .long sys_setgroups16
85 .long old_select
86 .long sys_symlink
87 .long sys_lstat
88 .long sys_readlink /* 85 */
89 .long sys_uselib
90 .long sys_swapon
91 .long sys_reboot
92 .long old_readdir
93 .long old_mmap /* 90 */
94 .long sys_munmap
95 .long sys_truncate
96 .long sys_ftruncate
97 .long sys_fchmod
98 .long sys_fchown16 /* 95 */
99 .long sys_getpriority
100 .long sys_setpriority
101 .long sys_ni_syscall /* old profil syscall holder */
102 .long sys_statfs
103 .long sys_fstatfs /* 100 */
104 .long sys_ioperm
105 .long sys_socketcall
106 .long sys_syslog
107 .long sys_setitimer
108 .long sys_getitimer /* 105 */
109 .long sys_newstat
110 .long sys_newlstat
111 .long sys_newfstat
112 .long sys_uname
113 .long sys_iopl /* 110 */
114 .long sys_vhangup
115 .long sys_ni_syscall /* old "idle" system call */
116 .long sys_vm86old
117 .long sys_wait4
118 .long sys_swapoff /* 115 */
119 .long sys_sysinfo
120 .long sys_ipc
121 .long sys_fsync
122 .long sys_sigreturn
123 .long sys_clone /* 120 */
124 .long sys_setdomainname
125 .long sys_newuname
126 .long sys_modify_ldt
127 .long sys_adjtimex
128 .long sys_mprotect /* 125 */
129 .long sys_sigprocmask
130 .long sys_ni_syscall /* old "create_module" */
131 .long sys_init_module
132 .long sys_delete_module
133 .long sys_ni_syscall /* 130: old "get_kernel_syms" */
134 .long sys_quotactl
135 .long sys_getpgid
136 .long sys_fchdir
137 .long sys_bdflush
138 .long sys_sysfs /* 135 */
139 .long sys_personality
140 .long sys_ni_syscall /* reserved for afs_syscall */
141 .long sys_setfsuid16
142 .long sys_setfsgid16
143 .long sys_llseek /* 140 */
144 .long sys_getdents
145 .long sys_select
146 .long sys_flock
147 .long sys_msync
148 .long sys_readv /* 145 */
149 .long sys_writev
150 .long sys_getsid
151 .long sys_fdatasync
152 .long sys_sysctl
153 .long sys_mlock /* 150 */
154 .long sys_munlock
155 .long sys_mlockall
156 .long sys_munlockall
157 .long sys_sched_setparam
158 .long sys_sched_getparam /* 155 */
159 .long sys_sched_setscheduler
160 .long sys_sched_getscheduler
161 .long sys_sched_yield
162 .long sys_sched_get_priority_max
163 .long sys_sched_get_priority_min /* 160 */
164 .long sys_sched_rr_get_interval
165 .long sys_nanosleep
166 .long sys_mremap
167 .long sys_setresuid16
168 .long sys_getresuid16 /* 165 */
169 .long sys_vm86
170 .long sys_ni_syscall /* Old sys_query_module */
171 .long sys_poll
172 .long sys_nfsservctl
173 .long sys_setresgid16 /* 170 */
174 .long sys_getresgid16
175 .long sys_prctl
176 .long sys_rt_sigreturn
177 .long sys_rt_sigaction
178 .long sys_rt_sigprocmask /* 175 */
179 .long sys_rt_sigpending
180 .long sys_rt_sigtimedwait
181 .long sys_rt_sigqueueinfo
182 .long sys_rt_sigsuspend
183 .long sys_pread64 /* 180 */
184 .long sys_pwrite64
185 .long sys_chown16
186 .long sys_getcwd
187 .long sys_capget
188 .long sys_capset /* 185 */
189 .long sys_sigaltstack
190 .long sys_sendfile
191 .long sys_ni_syscall /* reserved for streams1 */
192 .long sys_ni_syscall /* reserved for streams2 */
193 .long sys_vfork /* 190 */
194 .long sys_getrlimit
195 .long sys_mmap2
196 .long sys_truncate64
197 .long sys_ftruncate64
198 .long sys_stat64 /* 195 */
199 .long sys_lstat64
200 .long sys_fstat64
201 .long sys_lchown
202 .long sys_getuid
203 .long sys_getgid /* 200 */
204 .long sys_geteuid
205 .long sys_getegid
206 .long sys_setreuid
207 .long sys_setregid
208 .long sys_getgroups /* 205 */
209 .long sys_setgroups
210 .long sys_fchown
211 .long sys_setresuid
212 .long sys_getresuid
213 .long sys_setresgid /* 210 */
214 .long sys_getresgid
215 .long sys_chown
216 .long sys_setuid
217 .long sys_setgid
218 .long sys_setfsuid /* 215 */
219 .long sys_setfsgid
220 .long sys_pivot_root
221 .long sys_mincore
222 .long sys_madvise
223 .long sys_getdents64 /* 220 */
224 .long sys_fcntl64
225 .long sys_ni_syscall /* reserved for TUX */
226 .long sys_ni_syscall
227 .long sys_gettid
228 .long sys_readahead /* 225 */
229 .long sys_setxattr
230 .long sys_lsetxattr
231 .long sys_fsetxattr
232 .long sys_getxattr
233 .long sys_lgetxattr /* 230 */
234 .long sys_fgetxattr
235 .long sys_listxattr
236 .long sys_llistxattr
237 .long sys_flistxattr
238 .long sys_removexattr /* 235 */
239 .long sys_lremovexattr
240 .long sys_fremovexattr
241 .long sys_tkill
242 .long sys_sendfile64
243 .long sys_futex /* 240 */
244 .long sys_sched_setaffinity
245 .long sys_sched_getaffinity
246 .long sys_set_thread_area
247 .long sys_get_thread_area
248 .long sys_io_setup /* 245 */
249 .long sys_io_destroy
250 .long sys_io_getevents
251 .long sys_io_submit
252 .long sys_io_cancel
253 .long sys_fadvise64 /* 250 */
254 .long sys_ni_syscall
255 .long sys_exit_group
256 .long sys_lookup_dcookie
257 .long sys_epoll_create
258 .long sys_epoll_ctl /* 255 */
259 .long sys_epoll_wait
260 .long sys_remap_file_pages
261 .long sys_set_tid_address
262 .long sys_timer_create
263 .long sys_timer_settime /* 260 */
264 .long sys_timer_gettime
265 .long sys_timer_getoverrun
266 .long sys_timer_delete
267 .long sys_clock_settime
268 .long sys_clock_gettime /* 265 */
269 .long sys_clock_getres
270 .long sys_clock_nanosleep
271 .long sys_statfs64
272 .long sys_fstatfs64
273 .long sys_tgkill /* 270 */
274 .long sys_utimes
275 .long sys_fadvise64_64
276 .long sys_ni_syscall /* sys_vserver */
277 .long sys_mbind
278 .long sys_get_mempolicy
279 .long sys_set_mempolicy
280 .long sys_mq_open
281 .long sys_mq_unlink
282 .long sys_mq_timedsend
283 .long sys_mq_timedreceive /* 280 */
284 .long sys_mq_notify
285 .long sys_mq_getsetattr
286 .long sys_ni_syscall /* reserved for kexec */
287 .long sys_waitid
288 .long sys_ni_syscall /* 285 */ /* available */
289 .long sys_add_key
290 .long sys_request_key
291 .long sys_keyctl
diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c
index 4d75b373f90e..a0dcb7c87c30 100644
--- a/arch/i386/kernel/time.c
+++ b/arch/i386/kernel/time.c
@@ -441,7 +441,7 @@ static void __init hpet_time_init(void)
441 set_normalized_timespec(&wall_to_monotonic, 441 set_normalized_timespec(&wall_to_monotonic,
442 -xtime.tv_sec, -xtime.tv_nsec); 442 -xtime.tv_sec, -xtime.tv_nsec);
443 443
444 if (hpet_enable() >= 0) { 444 if ((hpet_enable() >= 0) && hpet_use_timer) {
445 printk("Using HPET for base-timer\n"); 445 printk("Using HPET for base-timer\n");
446 } 446 }
447 447
diff --git a/arch/i386/kernel/time_hpet.c b/arch/i386/kernel/time_hpet.c
index 244a31b04be7..10a0cbb88e75 100644
--- a/arch/i386/kernel/time_hpet.c
+++ b/arch/i386/kernel/time_hpet.c
@@ -26,6 +26,7 @@
26static unsigned long hpet_period; /* fsecs / HPET clock */ 26static unsigned long hpet_period; /* fsecs / HPET clock */
27unsigned long hpet_tick; /* hpet clks count per tick */ 27unsigned long hpet_tick; /* hpet clks count per tick */
28unsigned long hpet_address; /* hpet memory map physical address */ 28unsigned long hpet_address; /* hpet memory map physical address */
29int hpet_use_timer;
29 30
30static int use_hpet; /* can be used for runtime check of hpet */ 31static int use_hpet; /* can be used for runtime check of hpet */
31static int boot_hpet_disable; /* boottime override for HPET timer */ 32static int boot_hpet_disable; /* boottime override for HPET timer */
@@ -73,27 +74,30 @@ static int hpet_timer_stop_set_go(unsigned long tick)
73 hpet_writel(0, HPET_COUNTER); 74 hpet_writel(0, HPET_COUNTER);
74 hpet_writel(0, HPET_COUNTER + 4); 75 hpet_writel(0, HPET_COUNTER + 4);
75 76
76 /* 77 if (hpet_use_timer) {
77 * Set up timer 0, as periodic with first interrupt to happen at 78 /*
78 * hpet_tick, and period also hpet_tick. 79 * Set up timer 0, as periodic with first interrupt to happen at
79 */ 80 * hpet_tick, and period also hpet_tick.
80 cfg = hpet_readl(HPET_T0_CFG); 81 */
81 cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC | 82 cfg = hpet_readl(HPET_T0_CFG);
82 HPET_TN_SETVAL | HPET_TN_32BIT; 83 cfg |= HPET_TN_ENABLE | HPET_TN_PERIODIC |
83 hpet_writel(cfg, HPET_T0_CFG); 84 HPET_TN_SETVAL | HPET_TN_32BIT;
84 85 hpet_writel(cfg, HPET_T0_CFG);
85 /*
86 * The first write after writing TN_SETVAL to the config register sets
87 * the counter value, the second write sets the threshold.
88 */
89 hpet_writel(tick, HPET_T0_CMP);
90 hpet_writel(tick, HPET_T0_CMP);
91 86
87 /*
88 * The first write after writing TN_SETVAL to the config register sets
89 * the counter value, the second write sets the threshold.
90 */
91 hpet_writel(tick, HPET_T0_CMP);
92 hpet_writel(tick, HPET_T0_CMP);
93 }
92 /* 94 /*
93 * Go! 95 * Go!
94 */ 96 */
95 cfg = hpet_readl(HPET_CFG); 97 cfg = hpet_readl(HPET_CFG);
96 cfg |= HPET_CFG_ENABLE | HPET_CFG_LEGACY; 98 if (hpet_use_timer)
99 cfg |= HPET_CFG_LEGACY;
100 cfg |= HPET_CFG_ENABLE;
97 hpet_writel(cfg, HPET_CFG); 101 hpet_writel(cfg, HPET_CFG);
98 102
99 return 0; 103 return 0;
@@ -128,12 +132,11 @@ int __init hpet_enable(void)
128 * However, we can do with one timer otherwise using the 132 * However, we can do with one timer otherwise using the
129 * the single HPET timer for system time. 133 * the single HPET timer for system time.
130 */ 134 */
131 if (
132#ifdef CONFIG_HPET_EMULATE_RTC 135#ifdef CONFIG_HPET_EMULATE_RTC
133 !(id & HPET_ID_NUMBER) || 136 if (!(id & HPET_ID_NUMBER))
134#endif
135 !(id & HPET_ID_LEGSUP))
136 return -1; 137 return -1;
138#endif
139
137 140
138 hpet_period = hpet_readl(HPET_PERIOD); 141 hpet_period = hpet_readl(HPET_PERIOD);
139 if ((hpet_period < HPET_MIN_PERIOD) || (hpet_period > HPET_MAX_PERIOD)) 142 if ((hpet_period < HPET_MIN_PERIOD) || (hpet_period > HPET_MAX_PERIOD))
@@ -152,6 +155,8 @@ int __init hpet_enable(void)
152 if (hpet_tick_rem > (hpet_period >> 1)) 155 if (hpet_tick_rem > (hpet_period >> 1))
153 hpet_tick++; /* rounding the result */ 156 hpet_tick++; /* rounding the result */
154 157
158 hpet_use_timer = id & HPET_ID_LEGSUP;
159
155 if (hpet_timer_stop_set_go(hpet_tick)) 160 if (hpet_timer_stop_set_go(hpet_tick))
156 return -1; 161 return -1;
157 162
@@ -202,7 +207,8 @@ int __init hpet_enable(void)
202#endif 207#endif
203 208
204#ifdef CONFIG_X86_LOCAL_APIC 209#ifdef CONFIG_X86_LOCAL_APIC
205 wait_timer_tick = wait_hpet_tick; 210 if (hpet_use_timer)
211 wait_timer_tick = wait_hpet_tick;
206#endif 212#endif
207 return 0; 213 return 0;
208} 214}
diff --git a/arch/i386/kernel/timers/timer_hpet.c b/arch/i386/kernel/timers/timer_hpet.c
index 713134e71844..f778f471a09a 100644
--- a/arch/i386/kernel/timers/timer_hpet.c
+++ b/arch/i386/kernel/timers/timer_hpet.c
@@ -79,7 +79,7 @@ static unsigned long get_offset_hpet(void)
79 79
80 eax = hpet_readl(HPET_COUNTER); 80 eax = hpet_readl(HPET_COUNTER);
81 eax -= hpet_last; /* hpet delta */ 81 eax -= hpet_last; /* hpet delta */
82 82 eax = min(hpet_tick, eax);
83 /* 83 /*
84 * Time offset = (hpet delta) * ( usecs per HPET clock ) 84 * Time offset = (hpet delta) * ( usecs per HPET clock )
85 * = (hpet delta) * ( usecs per tick / HPET clocks per tick) 85 * = (hpet delta) * ( usecs per tick / HPET clocks per tick)
@@ -105,9 +105,12 @@ static void mark_offset_hpet(void)
105 last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; 105 last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low;
106 rdtsc(last_tsc_low, last_tsc_high); 106 rdtsc(last_tsc_low, last_tsc_high);
107 107
108 offset = hpet_readl(HPET_T0_CMP) - hpet_tick; 108 if (hpet_use_timer)
109 if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) { 109 offset = hpet_readl(HPET_T0_CMP) - hpet_tick;
110 int lost_ticks = (offset - hpet_last) / hpet_tick; 110 else
111 offset = hpet_readl(HPET_COUNTER);
112 if (unlikely(((offset - hpet_last) >= (2*hpet_tick)) && (hpet_last != 0))) {
113 int lost_ticks = ((offset - hpet_last) / hpet_tick) - 1;
111 jiffies_64 += lost_ticks; 114 jiffies_64 += lost_ticks;
112 } 115 }
113 hpet_last = offset; 116 hpet_last = offset;
diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
index a685994e5c8e..7926d967be00 100644
--- a/arch/i386/kernel/timers/timer_tsc.c
+++ b/arch/i386/kernel/timers/timer_tsc.c
@@ -477,7 +477,7 @@ static int __init init_tsc(char* override)
477 if (cpu_has_tsc) { 477 if (cpu_has_tsc) {
478 unsigned long tsc_quotient; 478 unsigned long tsc_quotient;
479#ifdef CONFIG_HPET_TIMER 479#ifdef CONFIG_HPET_TIMER
480 if (is_hpet_enabled()){ 480 if (is_hpet_enabled() && hpet_use_timer) {
481 unsigned long result, remain; 481 unsigned long result, remain;
482 printk("Using TSC for gettimeofday\n"); 482 printk("Using TSC for gettimeofday\n");
483 tsc_quotient = calibrate_tsc_hpet(NULL); 483 tsc_quotient = calibrate_tsc_hpet(NULL);
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c
index 6c0e383915b6..00c63419c06f 100644
--- a/arch/i386/kernel/traps.c
+++ b/arch/i386/kernel/traps.c
@@ -451,6 +451,7 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS)
451DO_ERROR(11, SIGBUS, "segment not present", segment_not_present) 451DO_ERROR(11, SIGBUS, "segment not present", segment_not_present)
452DO_ERROR(12, SIGBUS, "stack segment", stack_segment) 452DO_ERROR(12, SIGBUS, "stack segment", stack_segment)
453DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) 453DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0)
454DO_ERROR_INFO(32, SIGSEGV, "iret exception", iret_error, ILL_BADSTK, 0)
454 455
455fastcall void do_general_protection(struct pt_regs * regs, long error_code) 456fastcall void do_general_protection(struct pt_regs * regs, long error_code)
456{ 457{
@@ -642,16 +643,15 @@ void unset_nmi_callback(void)
642} 643}
643 644
644#ifdef CONFIG_KPROBES 645#ifdef CONFIG_KPROBES
645fastcall int do_int3(struct pt_regs *regs, long error_code) 646fastcall void do_int3(struct pt_regs *regs, long error_code)
646{ 647{
647 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) 648 if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP)
648 == NOTIFY_STOP) 649 == NOTIFY_STOP)
649 return 1; 650 return;
650 /* This is an interrupt gate, because kprobes wants interrupts 651 /* This is an interrupt gate, because kprobes wants interrupts
651 disabled. Normal trap handlers don't. */ 652 disabled. Normal trap handlers don't. */
652 restore_interrupts(regs); 653 restore_interrupts(regs);
653 do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL); 654 do_trap(3, SIGTRAP, "int3", 1, regs, error_code, NULL);
654 return 0;
655} 655}
656#endif 656#endif
657 657
diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c
index 2f3d52dacff7..ec0f68ce6886 100644
--- a/arch/i386/kernel/vm86.c
+++ b/arch/i386/kernel/vm86.c
@@ -222,7 +222,7 @@ asmlinkage int sys_vm86(struct pt_regs regs)
222 goto out; 222 goto out;
223 case VM86_PLUS_INSTALL_CHECK: 223 case VM86_PLUS_INSTALL_CHECK:
224 /* NOTE: on old vm86 stuff this will return the error 224 /* NOTE: on old vm86 stuff this will return the error
225 from verify_area(), because the subfunction is 225 from access_ok(), because the subfunction is
226 interpreted as (invalid) address to vm86_struct. 226 interpreted as (invalid) address to vm86_struct.
227 So the installation check works. 227 So the installation check works.
228 */ 228 */
@@ -294,8 +294,8 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk
294 */ 294 */
295 info->regs32->eax = 0; 295 info->regs32->eax = 0;
296 tsk->thread.saved_esp0 = tsk->thread.esp0; 296 tsk->thread.saved_esp0 = tsk->thread.esp0;
297 asm volatile("movl %%fs,%0":"=m" (tsk->thread.saved_fs)); 297 asm volatile("mov %%fs,%0":"=m" (tsk->thread.saved_fs));
298 asm volatile("movl %%gs,%0":"=m" (tsk->thread.saved_gs)); 298 asm volatile("mov %%gs,%0":"=m" (tsk->thread.saved_gs));
299 299
300 tss = &per_cpu(init_tss, get_cpu()); 300 tss = &per_cpu(init_tss, get_cpu());
301 tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0; 301 tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0;
@@ -717,12 +717,12 @@ static irqreturn_t irq_handler(int intno, void *dev_id, struct pt_regs * regs)
717 irqbits |= irq_bit; 717 irqbits |= irq_bit;
718 if (vm86_irqs[intno].sig) 718 if (vm86_irqs[intno].sig)
719 send_sig(vm86_irqs[intno].sig, vm86_irqs[intno].tsk, 1); 719 send_sig(vm86_irqs[intno].sig, vm86_irqs[intno].tsk, 1);
720 spin_unlock_irqrestore(&irqbits_lock, flags);
721 /* 720 /*
722 * IRQ will be re-enabled when user asks for the irq (whether 721 * IRQ will be re-enabled when user asks for the irq (whether
723 * polling or as a result of the signal) 722 * polling or as a result of the signal)
724 */ 723 */
725 disable_irq(intno); 724 disable_irq_nosync(intno);
725 spin_unlock_irqrestore(&irqbits_lock, flags);
726 return IRQ_HANDLED; 726 return IRQ_HANDLED;
727 727
728out: 728out:
@@ -754,17 +754,20 @@ static inline int get_and_reset_irq(int irqnumber)
754{ 754{
755 int bit; 755 int bit;
756 unsigned long flags; 756 unsigned long flags;
757 int ret = 0;
757 758
758 if (invalid_vm86_irq(irqnumber)) return 0; 759 if (invalid_vm86_irq(irqnumber)) return 0;
759 if (vm86_irqs[irqnumber].tsk != current) return 0; 760 if (vm86_irqs[irqnumber].tsk != current) return 0;
760 spin_lock_irqsave(&irqbits_lock, flags); 761 spin_lock_irqsave(&irqbits_lock, flags);
761 bit = irqbits & (1 << irqnumber); 762 bit = irqbits & (1 << irqnumber);
762 irqbits &= ~bit; 763 irqbits &= ~bit;
764 if (bit) {
765 enable_irq(irqnumber);
766 ret = 1;
767 }
768
763 spin_unlock_irqrestore(&irqbits_lock, flags); 769 spin_unlock_irqrestore(&irqbits_lock, flags);
764 if (!bit) 770 return ret;
765 return 0;
766 enable_irq(irqnumber);
767 return 1;
768} 771}
769 772
770 773