diff -Nru --exclude-from exclude Linux/CREDITS linux-a386/CREDITS --- Linux/CREDITS Tue Jan 18 07:19:08 2000 +++ linux-a386/CREDITS Tue Jan 25 17:04:36 2000 @@ -324,6 +324,15 @@ S: Lancaster, LA1 4DN S: UK, England +N: Lars Brinkhoff +E: lars@nocrew.org +W: http://lars.nocrew.org/ +D: dsp56k device driver +D: Linux/a386 port +S: Kopmansg 2 +S: 411 13 Goteborg +S: Sweden + N: Andries Brouwer E: aeb@cwi.nl D: random Linux hacker diff -Nru --exclude-from exclude Linux/Makefile linux-a386/Makefile --- Linux/Makefile Tue Jan 18 07:22:52 2000 +++ linux-a386/Makefile Tue Jan 25 17:04:36 2000 @@ -92,7 +92,8 @@ CPPFLAGS += -D__SMP__ endif -CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +#CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer +CFLAGS = $(CPPFLAGS) -g -Wall -Wstrict-prototypes -O2 AFLAGS := $(CPPFLAGS) # use '-fno-strict-aliasing', but only if the compiler can take it diff -Nru --exclude-from exclude Linux/arch/i386/Makefile linux-a386/arch/i386/Makefile --- Linux/arch/i386/Makefile Sun Oct 17 06:00:11 1999 +++ linux-a386/arch/i386/Makefile Wed Jan 26 09:24:23 2000 @@ -1,5 +1,5 @@ # -# i386/Makefile +# arch/a386/Makefile # # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. Remember to do have actions @@ -16,10 +16,12 @@ # Added '-march' and '-mpreferred-stack-boundary' support # +A386_LIB = /usr/local/lib/a386.a + LD=$(CROSS_COMPILE)ld -m elf_i386 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S LDFLAGS=-e stext -LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS) +LINKFLAGS =-T $(TOPDIR)/arch/a386/vmlinux.lds $(LDFLAGS) CFLAGS_PIPE := -pipe CFLAGS_NSR := -fno-strength-reduce @@ -63,26 +65,27 @@ AFLAGS := $(AFLAGS) -DCPU=686 endif -HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o +HEAD := arch/a386/kernel/head.o arch/a386/kernel/init_task.o -SUBDIRS := $(SUBDIRS) arch/i386/kernel arch/i386/mm arch/i386/lib -CORE_FILES := arch/i386/kernel/kernel.o arch/i386/mm/mm.o $(CORE_FILES) -LIBS := $(TOPDIR)/arch/i386/lib/lib.a $(LIBS) $(TOPDIR)/arch/i386/lib/lib.a +SUBDIRS := $(SUBDIRS) arch/a386/kernel arch/a386/mm arch/a386/lib +CORE_FILES := arch/a386/kernel/kernel.o arch/a386/mm/mm.o $(CORE_FILES) +LIBS := $(TOPDIR)/arch/a386/lib/lib.a $(LIBS) $(TOPDIR)/arch/a386/lib/lib.a \ + $(A386_LIB) ifdef CONFIG_MATH_EMULATION -SUBDIRS := $(SUBDIRS) arch/i386/math-emu -DRIVERS := $(DRIVERS) arch/i386/math-emu/math.a +SUBDIRS := $(SUBDIRS) arch/a386/math-emu +DRIVERS := $(DRIVERS) arch/a386/math-emu/math.a endif -arch/i386/kernel: dummy - $(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel +arch/a386/kernel: dummy + $(MAKE) linuxsubdirs SUBDIRS=arch/a386/kernel -arch/i386/mm: dummy - $(MAKE) linuxsubdirs SUBDIRS=arch/i386/mm +arch/a386/mm: dummy + $(MAKE) linuxsubdirs SUBDIRS=arch/a386/mm MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot -vmlinux: arch/i386/vmlinux.lds +vmlinux: arch/a386/vmlinux.lds FORCE: ; diff -Nru --exclude-from exclude Linux/arch/i386/kernel/Makefile linux-a386/arch/i386/kernel/Makefile --- Linux/arch/i386/kernel/Makefile Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/kernel/Makefile Tue Jan 25 17:04:36 2000 @@ -1,4 +1,6 @@ # +# arch/a386/kernel/Makefile +# # Makefile for the linux kernel. # # Note! Dependencies are done automagically by 'make dep', which also diff -Nru --exclude-from exclude Linux/arch/i386/kernel/acpi.c linux-a386/arch/i386/kernel/acpi.c --- Linux/arch/i386/kernel/acpi.c Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/kernel/acpi.c Tue Jan 25 17:04:36 2000 @@ -812,7 +812,8 @@ if (current->need_resched) goto out; time = TIME_BEGIN(pm_tmr); - __asm__ __volatile__("sti ; hlt": : :"memory"); + a386_interrupts_enable (); + a386_interrupt_wait (); time = TIME_END(pm_tmr, time); if (time > acpi_enter_lvl2_lat) goto sleep2; @@ -823,7 +824,8 @@ __cli(); if (current->need_resched) goto out; - __asm__ __volatile__("sti ; hlt": : :"memory"); + a386_enable_interrupts (); + a386_interrupt_wait (); } out: diff -Nru --exclude-from exclude Linux/arch/i386/kernel/entry.S linux-a386/arch/i386/kernel/entry.S --- Linux/arch/i386/kernel/entry.S Tue Jan 11 03:15:58 2000 +++ linux-a386/arch/i386/kernel/entry.S Thu Jan 1 01:00:00 1970 @@ -1,630 +0,0 @@ -/* - * linux/arch/i386/entry.S - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -/* - * entry.S contains the system-call and fault low-level handling routines. - * This also contains the timer-interrupt handler, as well as all interrupts - * and faults that can result in a task-switch. - * - * NOTE: This code handles signal-recognition, which happens every time - * after a timer-interrupt and after each system call. - * - * I changed all the .align's to 4 (16 byte alignment), as that's faster - * on a 486. - * - * Stack layout in 'ret_from_system_call': - * ptrace needs to have all regs on the stack. - * if the order here is changed, it needs to be - * updated in fork.c:copy_process, signal.c:do_signal, - * ptrace.c and ptrace.h - * - * 0(%esp) - %ebx - * 4(%esp) - %ecx - * 8(%esp) - %edx - * C(%esp) - %esi - * 10(%esp) - %edi - * 14(%esp) - %ebp - * 18(%esp) - %eax - * 1C(%esp) - %ds - * 20(%esp) - %es - * 24(%esp) - orig_eax - * 28(%esp) - %eip - * 2C(%esp) - %cs - * 30(%esp) - %eflags - * 34(%esp) - %oldesp - * 38(%esp) - %oldss - * - * "current" is in register %ebx during any slow entries. - */ - -#include -#include -#include -#define ASSEMBLY -#include - -EBX = 0x00 -ECX = 0x04 -EDX = 0x08 -ESI = 0x0C -EDI = 0x10 -EBP = 0x14 -EAX = 0x18 -DS = 0x1C -ES = 0x20 -ORIG_EAX = 0x24 -EIP = 0x28 -CS = 0x2C -EFLAGS = 0x30 -OLDESP = 0x34 -OLDSS = 0x38 - -CF_MASK = 0x00000001 -IF_MASK = 0x00000200 -NT_MASK = 0x00004000 -VM_MASK = 0x00020000 - -/* - * these are offsets into the task-struct. - */ -state = 0 -flags = 4 -sigpending = 8 -addr_limit = 12 -exec_domain = 16 -need_resched = 20 - -ENOSYS = 38 - - -#define SAVE_ALL \ - cld; \ - pushl %es; \ - pushl %ds; \ - pushl %eax; \ - pushl %ebp; \ - pushl %edi; \ - pushl %esi; \ - pushl %edx; \ - pushl %ecx; \ - pushl %ebx; \ - movl $(__KERNEL_DS),%edx; \ - movl %edx,%ds; \ - movl %edx,%es; - -#define RESTORE_ALL \ - popl %ebx; \ - popl %ecx; \ - popl %edx; \ - popl %esi; \ - popl %edi; \ - popl %ebp; \ - popl %eax; \ -1: popl %ds; \ -2: popl %es; \ - addl $4,%esp; \ -3: iret; \ -.section .fixup,"ax"; \ -4: movl $0,(%esp); \ - jmp 1b; \ -5: movl $0,(%esp); \ - jmp 2b; \ -6: pushl %ss; \ - popl %ds; \ - pushl %ss; \ - popl %es; \ - pushl $11; \ - call do_exit; \ -.previous; \ -.section __ex_table,"a";\ - .align 4; \ - .long 1b,4b; \ - .long 2b,5b; \ - .long 3b,6b; \ -.previous - -#define GET_CURRENT(reg) \ - movl %esp, reg; \ - andl $-8192, reg; - -ENTRY(lcall7) - pushfl # We get a different stack layout with call gates, - pushl %eax # which has to be cleaned up later.. - SAVE_ALL - movl EIP(%esp),%eax # due to call gates, this is eflags, not eip.. - movl CS(%esp),%edx # this is eip.. - movl EFLAGS(%esp),%ecx # and this is cs.. - movl %eax,EFLAGS(%esp) # - movl %edx,EIP(%esp) # Now we move them to their "normal" places - movl %ecx,CS(%esp) # - movl %esp,%ebx - pushl %ebx - andl $-8192,%ebx # GET_CURRENT - movl exec_domain(%ebx),%edx # Get the execution domain - movl 4(%edx),%edx # Get the lcall7 handler for the domain - pushl $0x7 - call *%edx - addl $4, %esp - popl %eax - jmp ret_from_sys_call - -ENTRY(lcall27) - pushfl # We get a different stack layout with call gates, - pushl %eax # which has to be cleaned up later.. - SAVE_ALL - movl EIP(%esp),%eax # due to call gates, this is eflags, not eip.. - movl CS(%esp),%edx # this is eip.. - movl EFLAGS(%esp),%ecx # and this is cs.. - movl %eax,EFLAGS(%esp) # - movl %edx,EIP(%esp) # Now we move them to their "normal" places - movl %ecx,CS(%esp) # - movl %esp,%ebx - pushl %ebx - andl $-8192,%ebx # GET_CURRENT - movl exec_domain(%ebx),%edx # Get the execution domain - movl 4(%edx),%edx # Get the lcall7 handler for the domain - pushl $0x27 - call *%edx - addl $4, %esp - popl %eax - jmp ret_from_sys_call - - - ALIGN - .globl ret_from_fork -ret_from_fork: - pushl %ebx - call SYMBOL_NAME(schedule_tail) - addl $4, %esp - GET_CURRENT(%ebx) - jmp ret_from_sys_call - -/* - * Return to user mode is not as complex as all this looks, - * but we want the default path for a system call return to - * go as quickly as possible which is why some of this is - * less clear than it otherwise should be. - */ - -ENTRY(system_call) - pushl %eax # save orig_eax - SAVE_ALL - GET_CURRENT(%ebx) - cmpl $(NR_syscalls),%eax - jae badsys - testb $0x20,flags(%ebx) # PF_TRACESYS - jne tracesys - call *SYMBOL_NAME(sys_call_table)(,%eax,4) - movl %eax,EAX(%esp) # save the return value - ALIGN - .globl ret_from_sys_call - .globl ret_from_intr -ret_from_sys_call: - movl SYMBOL_NAME(bh_mask),%eax - andl SYMBOL_NAME(bh_active),%eax - jne handle_bottom_half -ret_with_reschedule: - cmpl $0,need_resched(%ebx) - jne reschedule - cmpl $0,sigpending(%ebx) - jne signal_return -restore_all: - RESTORE_ALL - - ALIGN -signal_return: - sti # we can get here from an interrupt handler - testl $(VM_MASK),EFLAGS(%esp) - movl %esp,%eax - jne v86_signal_return - xorl %edx,%edx - call SYMBOL_NAME(do_signal) - jmp restore_all - - ALIGN -v86_signal_return: - call SYMBOL_NAME(save_v86_state) - movl %eax,%esp - xorl %edx,%edx - call SYMBOL_NAME(do_signal) - jmp restore_all - - ALIGN -tracesys: - movl $-ENOSYS,EAX(%esp) - call SYMBOL_NAME(syscall_trace) - movl ORIG_EAX(%esp),%eax - cmpl $(NR_syscalls),%eax - jae tracesys_exit - call *SYMBOL_NAME(sys_call_table)(,%eax,4) - movl %eax,EAX(%esp) # save the return value -tracesys_exit: - call SYMBOL_NAME(syscall_trace) - jmp ret_from_sys_call -badsys: - movl $-ENOSYS,EAX(%esp) - jmp ret_from_sys_call - - ALIGN -ret_from_exception: - movl SYMBOL_NAME(bh_mask),%eax - andl SYMBOL_NAME(bh_active),%eax - jne handle_bottom_half - ALIGN -ret_from_intr: - GET_CURRENT(%ebx) - movl EFLAGS(%esp),%eax # mix EFLAGS and CS - movb CS(%esp),%al - testl $(VM_MASK | 3),%eax # return to VM86 mode or non-supervisor? - jne ret_with_reschedule - jmp restore_all - - ALIGN -handle_bottom_half: - call SYMBOL_NAME(do_bottom_half) - jmp ret_from_intr - - ALIGN -reschedule: - call SYMBOL_NAME(schedule) # test - jmp ret_from_sys_call - -ENTRY(divide_error) - pushl $0 # no error code - pushl $ SYMBOL_NAME(do_divide_error) - ALIGN -error_code: - pushl %ds - pushl %eax - xorl %eax,%eax - pushl %ebp - pushl %edi - pushl %esi - pushl %edx - decl %eax # eax = -1 - pushl %ecx - pushl %ebx - cld - movl %es,%ecx - xchgl %eax, ORIG_EAX(%esp) # orig_eax (get the error code. ) - movl %esp,%edx - xchgl %ecx, ES(%esp) # get the address and save es. - pushl %eax # push the error code - pushl %edx - movl $(__KERNEL_DS),%edx - movl %edx,%ds - movl %edx,%es - GET_CURRENT(%ebx) - call *%ecx - addl $8,%esp - jmp ret_from_exception - -ENTRY(coprocessor_error) - pushl $0 - pushl $ SYMBOL_NAME(do_coprocessor_error) - jmp error_code - -ENTRY(device_not_available) - pushl $-1 # mark this as an int - SAVE_ALL - GET_CURRENT(%ebx) - pushl $ret_from_exception - movl %cr0,%eax - testl $0x4,%eax # EM (math emulation bit) - je SYMBOL_NAME(math_state_restore) - pushl $0 # temporary storage for ORIG_EIP - call SYMBOL_NAME(math_emulate) - addl $4,%esp - ret - -ENTRY(debug) - pushl $0 - pushl $ SYMBOL_NAME(do_debug) - jmp error_code - -ENTRY(nmi) - pushl %eax - SAVE_ALL - movl %esp,%edx - pushl $0 - pushl %edx - call SYMBOL_NAME(do_nmi) - addl $8,%esp - RESTORE_ALL - -ENTRY(int3) - pushl $0 - pushl $ SYMBOL_NAME(do_int3) - jmp error_code - -ENTRY(overflow) - pushl $0 - pushl $ SYMBOL_NAME(do_overflow) - jmp error_code - -ENTRY(bounds) - pushl $0 - pushl $ SYMBOL_NAME(do_bounds) - jmp error_code - -ENTRY(invalid_op) - pushl $0 - pushl $ SYMBOL_NAME(do_invalid_op) - jmp error_code - -ENTRY(coprocessor_segment_overrun) - pushl $0 - pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun) - jmp error_code - -ENTRY(reserved) - pushl $0 - pushl $ SYMBOL_NAME(do_reserved) - jmp error_code - -ENTRY(double_fault) - pushl $ SYMBOL_NAME(do_double_fault) - jmp error_code - -ENTRY(invalid_TSS) - pushl $ SYMBOL_NAME(do_invalid_TSS) - jmp error_code - -ENTRY(segment_not_present) - pushl $ SYMBOL_NAME(do_segment_not_present) - jmp error_code - -ENTRY(stack_segment) - pushl $ SYMBOL_NAME(do_stack_segment) - jmp error_code - -ENTRY(general_protection) - pushl $ SYMBOL_NAME(do_general_protection) - jmp error_code - -ENTRY(alignment_check) - pushl $ SYMBOL_NAME(do_alignment_check) - jmp error_code - -ENTRY(page_fault) - pushl $ SYMBOL_NAME(do_page_fault) - jmp error_code - -ENTRY(spurious_interrupt_bug) - pushl $0 - pushl $ SYMBOL_NAME(do_spurious_interrupt_bug) - jmp error_code - -.data -ENTRY(sys_call_table) - .long SYMBOL_NAME(sys_ni_syscall) /* 0 - old "setup()" system call*/ - .long SYMBOL_NAME(sys_exit) - .long SYMBOL_NAME(sys_fork) - .long SYMBOL_NAME(sys_read) - .long SYMBOL_NAME(sys_write) - .long SYMBOL_NAME(sys_open) /* 5 */ - .long SYMBOL_NAME(sys_close) - .long SYMBOL_NAME(sys_waitpid) - .long SYMBOL_NAME(sys_creat) - .long SYMBOL_NAME(sys_link) - .long SYMBOL_NAME(sys_unlink) /* 10 */ - .long SYMBOL_NAME(sys_execve) - .long SYMBOL_NAME(sys_chdir) - .long SYMBOL_NAME(sys_time) - .long SYMBOL_NAME(sys_mknod) - .long SYMBOL_NAME(sys_chmod) /* 15 */ - .long SYMBOL_NAME(sys_lchown16) - .long SYMBOL_NAME(sys_ni_syscall) /* old break syscall holder */ - .long SYMBOL_NAME(sys_stat) - .long SYMBOL_NAME(sys_lseek) - .long SYMBOL_NAME(sys_getpid) /* 20 */ - .long SYMBOL_NAME(sys_mount) - .long SYMBOL_NAME(sys_oldumount) - .long SYMBOL_NAME(sys_setuid16) - .long SYMBOL_NAME(sys_getuid16) - .long SYMBOL_NAME(sys_stime) /* 25 */ - .long SYMBOL_NAME(sys_ptrace) - .long SYMBOL_NAME(sys_alarm) - .long SYMBOL_NAME(sys_fstat) - .long SYMBOL_NAME(sys_pause) - .long SYMBOL_NAME(sys_utime) /* 30 */ - .long SYMBOL_NAME(sys_ni_syscall) /* old stty syscall holder */ - .long SYMBOL_NAME(sys_ni_syscall) /* old gtty syscall holder */ - .long SYMBOL_NAME(sys_access) - .long SYMBOL_NAME(sys_nice) - .long SYMBOL_NAME(sys_ni_syscall) /* 35 */ /* old ftime syscall holder */ - .long SYMBOL_NAME(sys_sync) - .long SYMBOL_NAME(sys_kill) - .long SYMBOL_NAME(sys_rename) - .long SYMBOL_NAME(sys_mkdir) - .long SYMBOL_NAME(sys_rmdir) /* 40 */ - .long SYMBOL_NAME(sys_dup) - .long SYMBOL_NAME(sys_pipe) - .long SYMBOL_NAME(sys_times) - .long SYMBOL_NAME(sys_ni_syscall) /* old prof syscall holder */ - .long SYMBOL_NAME(sys_brk) /* 45 */ - .long SYMBOL_NAME(sys_setgid16) - .long SYMBOL_NAME(sys_getgid16) - .long SYMBOL_NAME(sys_signal) - .long SYMBOL_NAME(sys_geteuid16) - .long SYMBOL_NAME(sys_getegid16) /* 50 */ - .long SYMBOL_NAME(sys_acct) - .long SYMBOL_NAME(sys_umount) /* recycled never used phys() */ - .long SYMBOL_NAME(sys_ni_syscall) /* old lock syscall holder */ - .long SYMBOL_NAME(sys_ioctl) - .long SYMBOL_NAME(sys_fcntl) /* 55 */ - .long SYMBOL_NAME(sys_ni_syscall) /* old mpx syscall holder */ - .long SYMBOL_NAME(sys_setpgid) - .long SYMBOL_NAME(sys_ni_syscall) /* old ulimit syscall holder */ - .long SYMBOL_NAME(sys_olduname) - .long SYMBOL_NAME(sys_umask) /* 60 */ - .long SYMBOL_NAME(sys_chroot) - .long SYMBOL_NAME(sys_ustat) - .long SYMBOL_NAME(sys_dup2) - .long SYMBOL_NAME(sys_getppid) - .long SYMBOL_NAME(sys_getpgrp) /* 65 */ - .long SYMBOL_NAME(sys_setsid) - .long SYMBOL_NAME(sys_sigaction) - .long SYMBOL_NAME(sys_sgetmask) - .long SYMBOL_NAME(sys_ssetmask) - .long SYMBOL_NAME(sys_setreuid16) /* 70 */ - .long SYMBOL_NAME(sys_setregid16) - .long SYMBOL_NAME(sys_sigsuspend) - .long SYMBOL_NAME(sys_sigpending) - .long SYMBOL_NAME(sys_sethostname) - .long SYMBOL_NAME(sys_setrlimit) /* 75 */ - .long SYMBOL_NAME(sys_old_getrlimit) - .long SYMBOL_NAME(sys_getrusage) - .long SYMBOL_NAME(sys_gettimeofday) - .long SYMBOL_NAME(sys_settimeofday) - .long SYMBOL_NAME(sys_getgroups16) /* 80 */ - .long SYMBOL_NAME(sys_setgroups16) - .long SYMBOL_NAME(old_select) - .long SYMBOL_NAME(sys_symlink) - .long SYMBOL_NAME(sys_lstat) - .long SYMBOL_NAME(sys_readlink) /* 85 */ - .long SYMBOL_NAME(sys_uselib) - .long SYMBOL_NAME(sys_swapon) - .long SYMBOL_NAME(sys_reboot) - .long SYMBOL_NAME(old_readdir) - .long SYMBOL_NAME(old_mmap) /* 90 */ - .long SYMBOL_NAME(sys_munmap) - .long SYMBOL_NAME(sys_truncate) - .long SYMBOL_NAME(sys_ftruncate) - .long SYMBOL_NAME(sys_fchmod) - .long SYMBOL_NAME(sys_fchown16) /* 95 */ - .long SYMBOL_NAME(sys_getpriority) - .long SYMBOL_NAME(sys_setpriority) - .long SYMBOL_NAME(sys_ni_syscall) /* old profil syscall holder */ - .long SYMBOL_NAME(sys_statfs) - .long SYMBOL_NAME(sys_fstatfs) /* 100 */ - .long SYMBOL_NAME(sys_ioperm) - .long SYMBOL_NAME(sys_socketcall) - .long SYMBOL_NAME(sys_syslog) - .long SYMBOL_NAME(sys_setitimer) - .long SYMBOL_NAME(sys_getitimer) /* 105 */ - .long SYMBOL_NAME(sys_newstat) - .long SYMBOL_NAME(sys_newlstat) - .long SYMBOL_NAME(sys_newfstat) - .long SYMBOL_NAME(sys_uname) - .long SYMBOL_NAME(sys_iopl) /* 110 */ - .long SYMBOL_NAME(sys_vhangup) - .long SYMBOL_NAME(sys_ni_syscall) /* old "idle" system call */ - .long SYMBOL_NAME(sys_vm86old) - .long SYMBOL_NAME(sys_wait4) - .long SYMBOL_NAME(sys_swapoff) /* 115 */ - .long SYMBOL_NAME(sys_sysinfo) - .long SYMBOL_NAME(sys_ipc) - .long SYMBOL_NAME(sys_fsync) - .long SYMBOL_NAME(sys_sigreturn) - .long SYMBOL_NAME(sys_clone) /* 120 */ - .long SYMBOL_NAME(sys_setdomainname) - .long SYMBOL_NAME(sys_newuname) - .long SYMBOL_NAME(sys_modify_ldt) - .long SYMBOL_NAME(sys_adjtimex) - .long SYMBOL_NAME(sys_mprotect) /* 125 */ - .long SYMBOL_NAME(sys_sigprocmask) - .long SYMBOL_NAME(sys_create_module) - .long SYMBOL_NAME(sys_init_module) - .long SYMBOL_NAME(sys_delete_module) - .long SYMBOL_NAME(sys_get_kernel_syms) /* 130 */ - .long SYMBOL_NAME(sys_quotactl) - .long SYMBOL_NAME(sys_getpgid) - .long SYMBOL_NAME(sys_fchdir) - .long SYMBOL_NAME(sys_bdflush) - .long SYMBOL_NAME(sys_sysfs) /* 135 */ - .long SYMBOL_NAME(sys_personality) - .long SYMBOL_NAME(sys_ni_syscall) /* for afs_syscall */ - .long SYMBOL_NAME(sys_setfsuid16) - .long SYMBOL_NAME(sys_setfsgid16) - .long SYMBOL_NAME(sys_llseek) /* 140 */ - .long SYMBOL_NAME(sys_getdents) - .long SYMBOL_NAME(sys_select) - .long SYMBOL_NAME(sys_flock) - .long SYMBOL_NAME(sys_msync) - .long SYMBOL_NAME(sys_readv) /* 145 */ - .long SYMBOL_NAME(sys_writev) - .long SYMBOL_NAME(sys_getsid) - .long SYMBOL_NAME(sys_fdatasync) - .long SYMBOL_NAME(sys_sysctl) - .long SYMBOL_NAME(sys_mlock) /* 150 */ - .long SYMBOL_NAME(sys_munlock) - .long SYMBOL_NAME(sys_mlockall) - .long SYMBOL_NAME(sys_munlockall) - .long SYMBOL_NAME(sys_sched_setparam) - .long SYMBOL_NAME(sys_sched_getparam) /* 155 */ - .long SYMBOL_NAME(sys_sched_setscheduler) - .long SYMBOL_NAME(sys_sched_getscheduler) - .long SYMBOL_NAME(sys_sched_yield) - .long SYMBOL_NAME(sys_sched_get_priority_max) - .long SYMBOL_NAME(sys_sched_get_priority_min) /* 160 */ - .long SYMBOL_NAME(sys_sched_rr_get_interval) - .long SYMBOL_NAME(sys_nanosleep) - .long SYMBOL_NAME(sys_mremap) - .long SYMBOL_NAME(sys_setresuid16) - .long SYMBOL_NAME(sys_getresuid16) /* 165 */ - .long SYMBOL_NAME(sys_vm86) - .long SYMBOL_NAME(sys_query_module) - .long SYMBOL_NAME(sys_poll) - .long SYMBOL_NAME(sys_nfsservctl) - .long SYMBOL_NAME(sys_setresgid16) /* 170 */ - .long SYMBOL_NAME(sys_getresgid16) - .long SYMBOL_NAME(sys_prctl) - .long SYMBOL_NAME(sys_rt_sigreturn) - .long SYMBOL_NAME(sys_rt_sigaction) - .long SYMBOL_NAME(sys_rt_sigprocmask) /* 175 */ - .long SYMBOL_NAME(sys_rt_sigpending) - .long SYMBOL_NAME(sys_rt_sigtimedwait) - .long SYMBOL_NAME(sys_rt_sigqueueinfo) - .long SYMBOL_NAME(sys_rt_sigsuspend) - .long SYMBOL_NAME(sys_pread) /* 180 */ - .long SYMBOL_NAME(sys_pwrite) - .long SYMBOL_NAME(sys_chown16) - .long SYMBOL_NAME(sys_getcwd) - .long SYMBOL_NAME(sys_capget) - .long SYMBOL_NAME(sys_capset) /* 185 */ - .long SYMBOL_NAME(sys_sigaltstack) - .long SYMBOL_NAME(sys_sendfile) - .long SYMBOL_NAME(sys_ni_syscall) /* streams1 */ - .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */ - .long SYMBOL_NAME(sys_vfork) /* 190 */ - .long SYMBOL_NAME(sys_getrlimit) - .long SYMBOL_NAME(sys_mmap2) - .long SYMBOL_NAME(sys_truncate64) - .long SYMBOL_NAME(sys_ftruncate64) - .long SYMBOL_NAME(sys_stat64) /* 195 */ - .long SYMBOL_NAME(sys_lstat64) - .long SYMBOL_NAME(sys_fstat64) - .long SYMBOL_NAME(sys_lchown) - .long SYMBOL_NAME(sys_getuid) - .long SYMBOL_NAME(sys_getgid) /* 200 */ - .long SYMBOL_NAME(sys_geteuid) - .long SYMBOL_NAME(sys_getegid) - .long SYMBOL_NAME(sys_setreuid) - .long SYMBOL_NAME(sys_setregid) - .long SYMBOL_NAME(sys_getgroups) /* 205 */ - .long SYMBOL_NAME(sys_setgroups) - .long SYMBOL_NAME(sys_fchown) - .long SYMBOL_NAME(sys_setresuid) - .long SYMBOL_NAME(sys_getresuid) - .long SYMBOL_NAME(sys_setresgid) /* 210 */ - .long SYMBOL_NAME(sys_getresgid) - .long SYMBOL_NAME(sys_chown) - .long SYMBOL_NAME(sys_setuid) - .long SYMBOL_NAME(sys_setgid) - .long SYMBOL_NAME(sys_setfsuid) /* 215 */ - .long SYMBOL_NAME(sys_setfsgid) - - - /* - * NOTE!! This doesn't have to be exact - we just have - * to make sure we have _enough_ of the "sys_ni_syscall" - * entries. Don't panic if you notice that this hasn't - * been shrunk every time we add a new system call. - */ - .rept NR_syscalls-216 - .long SYMBOL_NAME(sys_ni_syscall) - .endr diff -Nru --exclude-from exclude Linux/arch/i386/kernel/entry.c linux-a386/arch/i386/kernel/entry.c --- Linux/arch/i386/kernel/entry.c Thu Jan 1 01:00:00 1970 +++ linux-a386/arch/i386/kernel/entry.c Wed Jan 26 12:39:09 2000 @@ -0,0 +1,1021 @@ +/* + * linux/arch/a386/entry.c + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +/* + * entry.c contains the system-call and fault low-level handling routines. + * This also contains the timer-interrupt handler, as well as all interrupts + * and faults that can result in a task-switch. + * + * NOTE: This code handles signal-recognition, which happens every time + * after a timer-interrupt and after each system call. + * + * I changed all the .align's to 4 (16 byte alignment), as that's faster + * on a 486. + * + * Stack layout in 'ret_from_system_call': + * ptrace needs to have all regs on the stack. + * if the order here is changed, it needs to be + * updated in fork.c:copy_process, signal.c:do_signal, + * ptrace.c and ptrace.h + * + * 0(%esp) - %ebx + * 4(%esp) - %ecx + * 8(%esp) - %edx + * C(%esp) - %esi + * 10(%esp) - %edi + * 14(%esp) - %ebp + * 18(%esp) - %eax + * 1C(%esp) - %ds + * 20(%esp) - %es + * 24(%esp) - orig_eax + * 28(%esp) - %eip + * 2C(%esp) - %cs + * 30(%esp) - %eflags + * 34(%esp) - %oldesp + * 38(%esp) - %oldss + * + * "current" is in register %ebx during any slow entries. + */ + +#include +#include +#include +#include +#include +#include +#define ASSEMBLY +#include + +#include + +#define ENOSYS 38 + +void +lcall7 (void) +{ + a386_panic ("lcall7"); +} + +void +lcall27 (void) +{ + a386_panic ("lcall7"); +} + +typedef a386_result_t (*syscallfun) (); +syscallfun sys_call_table[]; + +void +ret_from_fork (int unused) +{ + struct a386_context *context = (void *)(&unused - 1); + extern void schedule_tail (struct task_struct *); /* FIXMEa386 */ + extern void do_signal (void); /* FIXMEa386 */ + + schedule_tail (current); + /*goto ret_from_sys_call;*/ + + ret_from_sys_call: + if (bh_mask & bh_active) + goto handle_bottom_half; + ret_with_reschedule: + if (current->need_resched) + goto reschedule; + if (current->sigpending) + goto signal_return; + restore_all: + a386_printf ("\nret_from_fork: returning to task %p, pid %d", (int)a386_get_sp () & -8192, ((struct task_struct *)((int)a386_get_sp () & -8192))->pid); + +#if 0 + { + int i; + extern long _a386_regs[]; + long *r = (long *)_a386_regs; + static char *regname[] = + { "ebx", "ecx", "edx", "esi", "edi", "ebp", "eax", "xds", + "xes", "orig_eax", "eip", "xcs", "eflags", "esp", "xss", + "kernel_mode", "interrupts_enabled" }; + for (i = 0; i < 17; i++) + a386_printf ("\n%s = %08lx", regname[i], r[i]); + } +#endif + + if (a386_context_get_kernel_mode (context)) + a386_context_set_sp (context, (a386_address_t)&unused); + else + _a386_ksp = (a386_address_t)&unused; + a386_context_set (context); + + signal_return: + a386_interrupts_enable (); + do_signal (); + goto restore_all; + + ret_from_intr: + if (!a386_context_get_kernel_mode (context)) + goto ret_with_reschedule; + goto restore_all; + + handle_bottom_half: + do_bottom_half (); + goto ret_from_intr; + + reschedule: + schedule (); + goto ret_from_sys_call; +} + +/* + * Return to user mode is not as complex as all this looks, + * but we want the default path for a system call return to + * go as quickly as possible which is why some of this is + * less clear than it otherwise should be. + */ + +void +system_call (int unused) +{ + int syscall = a386_syscall_number; + extern void do_signal (void); /* FIXMEa386 */ + extern void syscall_trace (void); /* FIXMEa386 */ + struct pt_regs * volatile regs; + + /* SAVE_ALL */ + extern a386_word_t _a386_regs[17]; + + asm volatile ( + "pushl %9;" /* interrupts_enabled */ + "pushl %8;" /* kernel_mode */ + "pushl %7;" /* xss */ + "pushl %6;" /* esp */ + "pushl %5;" /* eflags */ + "pushl %4;" /* xcs */ + "pushl %3;" /* eip */ + "pushl %2;" /* orig_eax */ + "pushl %1;" /* xes */ + "pushl %0;" /* xds */ + : /* no outputs */ + : "m" (_a386_regs[7]), "m" (_a386_regs[8]), "m" (_a386_regs[9]), + "m" (_a386_regs[10]), "m" (_a386_regs[11]), "m" (_a386_regs[12]), + "m" (_a386_regs[13]), "m" (_a386_regs[14]), "m" (_a386_regs[15]), + "m" (_a386_regs[16]) + : "memory"); + asm volatile ( + "pushl %6;" /* eax */ + "pushl %5;" /* ebp */ + "pushl %4;" /* edi */ + "pushl %3;" /* esi */ + "pushl %2;" /* edx */ + "pushl %1;" /* ecx */ + "pushl %0;" /* ebx */ + : /* no outputs */ + : "m" (_a386_regs[0]), "m" (_a386_regs[1]), "m" (_a386_regs[2]), + "m" (_a386_regs[3]), "m" (_a386_regs[4]), "m" (_a386_regs[5]), + "m" (_a386_regs[6]) + : "memory"); + regs = (struct pt_regs *)a386_get_sp (); + +#if 0 + a386_printf ("\npid %d @ %x: ", + ((struct task_struct *)((int)a386_get_sp () & -8192))->pid, + a386_context_get_ip (®s->context)); + switch (syscall) + { + case 1: + a386_printf ("exit (%d)", a386_get_arg (0)); + break; + case 2: + { + int i; + int *sp = (void *)a386_context_get_sp (®s->context); + unsigned char *ip = (void *)a386_context_get_ip (®s->context); + + a386_printf ("fork ()"); + +#if 0 + a386_printf ("\n stack @ %p: ", sp); + for (i = 0; i < 5; i++) + a386_printf ("%p ", sp[i]); + + a386_printf ("\n code @ %p: ", ip); + for (i = 0; i < 15; i++) + a386_printf ("%02x ", ip[i]); + + ip = *(int *)a386_context_get_sp (®s->context); + if (ip != 0) + { + a386_printf ("\n code @ %p: ", ip); + for (i = 0; i < 15; i++) + a386_printf ("%02x ", ip[i]); + } +#endif + } + break; + case 3: +#if 1 + a386_printf ("read (%d, %p, %d)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); +#endif + break; + case 4: +#if 1 + { +#if 0 + char *c; + + for (c = (char *)a386_get_arg (1); + c < (char *)(a386_get_arg (1) + a386_get_arg (2)); + c ++) + { + a386_putchar ('.'); + a386_putchar ('\b'); + } +#elif 0 + a386_printf ("write ()"); +#else + char *c; + + a386_printf ("write (%d, \"", a386_get_arg (0)); + for (c = (char *)a386_get_arg (1); + c < (char *)(a386_get_arg (1) + a386_get_arg (2)); + c ++) + a386_putchar (*c); + a386_printf ("\", %d)", a386_get_arg (2)); +#endif + } +#endif + break; +#if 1 + case 5: + a386_printf ("open (\"%s\", %x, %x)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 6: + a386_printf ("close (%d)", a386_get_arg (0)); + break; + case 11: + a386_printf ("execve (\"%s\", %p, %p)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; +#endif + case 12: + a386_printf ("chdir (\"%s\")", a386_get_arg (0)); + break; + case 13: +#if 1 + a386_printf ("time (%p)", a386_get_arg (0)); +#endif + break; +#if 1 + case 19: + a386_printf ("lseek (%d, %d, %d)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 20: + a386_printf ("getpid ()"); + break; + case 24: + a386_printf ("getuid ()"); + break; + case 36: + a386_printf ("sync ()"); + break; + case 37: + a386_printf ("kill (%d, %d)", a386_get_arg (0), a386_get_arg (1)); + break; + case 41: + a386_printf ("dup (%d)", a386_get_arg (0)); + break; +#endif + case 45: +#if 1 + a386_printf ("brk (%p)", a386_get_arg (0)); +#endif + break; +#if 1 + case 47: + a386_printf ("getgid ()"); + break; + case 49: + a386_printf ("geteuid ()"); + break; + case 50: + a386_printf ("getgid ()"); + break; + case 54: + a386_printf ("ioctl (%d, %x, %p)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 55: + a386_printf ("fcntl (%d, %x, %p)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 57: + a386_printf ("getpgid ()"); + break; + case 63: + a386_printf ("dup2 (%d, %d)", a386_get_arg (0), a386_get_arg (1)); + break; + case 65: + a386_printf ("getpgrp ()"); + break; + case 67: + a386_printf ("sigaction (%d, %p, %p)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 76: + a386_printf ("getrlimit (%d, %p)", a386_get_arg (0), a386_get_arg (1)); + break; + case 85: + a386_printf ("readlink (\"%s\", %p, %d)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 88: + a386_printf ("reboot (...)"); + break; + case 90: + { + struct + { + void *start; + int length; + int prot; + int flags; + int fd; + int offset; + } *arg; + + arg = (void *)a386_get_arg (0); + a386_printf ("mmap (%p, %d, %x, %x, %d, %d)", + arg->start, arg->length, arg->prot, + arg->flags, arg->fd, arg->offset); + } + break; + case 91: + a386_printf ("munmap (%p, %d)", a386_get_arg (0), a386_get_arg (1)); + break; + case 102: + a386_printf ("socketcall (%d, %p)", a386_get_arg (0), a386_get_arg (1)); + break; + case 106: + a386_printf ("stat (\"%s\", %p)", + a386_get_arg (0), a386_get_arg (1)); + break; +#endif + case 107: +#if 1 + a386_printf ("lstat (\"%s\", %p)", + a386_get_arg (0), a386_get_arg (1)); +#endif + break; +#if 1 + case 108: + a386_printf ("fstat (%d, %p)", + a386_get_arg (0), a386_get_arg (1)); + break; +#endif + case 114: +#if 1 + a386_printf ("wait4 (%d, %p, %x, %p)", + a386_get_arg (0), a386_get_arg (1), + a386_get_arg (2), a386_get_arg (3)); +#endif + break; +#if 1 + case 120: + a386_printf ("clone (%x, %p)", + a386_get_arg (0), a386_get_arg (1)); + break; + case 122: + a386_printf ("uname (%p)", a386_get_arg (0)); + break; + case 125: + a386_printf ("mprotect (%p, %d, %x)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 136: + a386_printf ("personality (%d)", a386_get_arg (0)); + break; +#endif + case 141: +#if 1 + a386_printf ("getdents (%d, %p, %d)", a386_get_arg (0), + a386_get_arg (1), a386_get_arg (2)); +#endif + break; +#if 1 + case 162: + a386_printf ("nanosleep (%p, %p)", a386_get_arg (0), a386_get_arg (1)); + break; + case 174: + a386_printf ("rt_sigaction (%d, %p, %p)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 175: + a386_printf ("rt_sigprocmask (%d, %p, %p)", + a386_get_arg (0), a386_get_arg (1), a386_get_arg (2)); + break; + case 183: + a386_printf ("getcwd (%p, %d)", a386_get_arg (1), a386_get_arg (2)); + break; + default: + a386_printf (" (%x, %x, %x, %x, %x)", + syscall, a386_get_arg (0), a386_get_arg (1), + a386_get_arg (2), a386_get_arg (3), a386_get_arg (4)); + break; +#endif + } +#endif + + a386_context_set_syscall (®s->context, syscall); + a386_context_set_arg (®s->context, 0, a386_get_arg (0)); + a386_context_set_arg (®s->context, 1, a386_get_arg (1)); + a386_context_set_arg (®s->context, 2, a386_get_arg (2)); + a386_context_set_arg (®s->context, 3, a386_get_arg (3)); + a386_context_set_arg (®s->context, 4, a386_get_arg (4)); + +#if 0 + { + int i; + long *r = (long *)regs; + static char *regname[] = + { "ebx", "ecx", "edx", "esi", "edi", "ebp", "eax", "xds", + "xes", "orig_eax", "eip", "xcs", "eflags", "esp", "xss", + "kernel_mode", "interrupts_enabled" }; + for (i = 0; i < 17; i++) + a386_printf ("\n%s = %08lx", regname[i], r[i]); + } +#endif + +#if 0 + a386_printf ("system_call: current = %p\n", current); + a386_printf ("system_call: previous ip = %p\n", a386_context_get_ip (®s->context)); + a386_printf ("system_call: previous sp = %p\n", a386_context_get_sp (®s->context)); + a386_printf ("system_call: previous kernel_mode = %d\n", a386_context_get_kernel_mode (®s->context)); +#endif + if (syscall >= NR_syscalls) + goto badsys; + if (current->flags & PF_TRACESYS) + goto tracesys; + //a386_printf ("system_call: syscall = %d\n", syscall); + a386_set_sp ((a386_address_t)regs); + a386_context_set_result (®s->context, + sys_call_table[syscall] ()); + asm volatile ("" : : : "eax", "ebx", "ecx", "edx", "esi", "edi"); +#if 0 + if (syscall != 11) + a386_printf ("\npid %d @ %p: syscall returns %d = %p", current->pid, a386_context_get_ip (®s->context), a386_context_get_result (®s->context), a386_context_get_result (®s->context)); +#endif + + ret_from_sys_call: + if (bh_mask & bh_active) + goto handle_bottom_half; + ret_with_reschedule: + if (current->need_resched) + goto reschedule; + if (current->sigpending) + goto signal_return; + restore_all: + + if (a386_context_get_kernel_mode (®s->context)) + a386_context_set_sp (®s->context, (a386_get_sp() & -8192) + 8192); + else + _a386_ksp = (a386_address_t)(regs + 1); + a386_context_set (®s->context); + + signal_return: + a386_interrupts_enable (); + do_signal (); + goto restore_all; + + tracesys: + a386_context_set_result (®s->context, -ENOSYS); + syscall_trace (); + syscall = a386_context_get_syscall (®s->context); + if (syscall >= NR_syscalls) + goto tracesys_exit; + a386_context_set_result (®s->context, + sys_call_table[syscall] ()); + tracesys_exit: + syscall_trace (); + goto ret_from_sys_call; + + badsys: + a386_context_set_result (®s->context, -ENOSYS); + goto ret_from_sys_call; + + ret_from_intr: + if (!a386_context_get_kernel_mode (®s->context)) + goto ret_with_reschedule; + goto restore_all; + + handle_bottom_half: + do_bottom_half (); + goto ret_from_intr; + + reschedule: + schedule (); + goto ret_from_sys_call; +} + +void +ret_from_sys_call (void) +{ + a386_panic ("ret_from_sys_call (the function)"); +} + +void +ret_from_intr (void) +{ + a386_panic ("ret_from_intr (the function)"); +} + +a386_result_t +ret_from_exception (void) +{ + struct a386_context *context = (void *)(a386_get_sp () + 4); + extern void do_signal (void); /* FIXMEa386 */ + a386_result_t result = 0; + + if (bh_mask & bh_active) + goto handle_bottom_half; + + ret_from_sys_call: + if (bh_mask & bh_active) + goto handle_bottom_half; + ret_with_reschedule: + if (current->need_resched) + goto reschedule; + if (current->sigpending) + goto signal_return; + restore_all: + return result; /* RESTORE_ALL */ + + signal_return: + a386_interrupts_enable (); + do_signal (); + goto restore_all; + + ret_from_intr: + if (!a386_context_get_kernel_mode (context)) + goto ret_with_reschedule; + goto restore_all; + + handle_bottom_half: + do_bottom_half (); + goto ret_from_intr; + + reschedule: + schedule (); + goto ret_from_sys_call; +} + +void +divide_error (void) +{ + a386_panic ("divide_error"); +} + +void +coprocessor_error (void) +{ + a386_panic ("coprocessor_error"); +} + +void +device_not_available (void) +{ + a386_panic ("device_not_available"); +} + +void +debug (void) +{ + a386_panic ("debug"); +} + +void +nmi (void) +{ + a386_panic ("nmi"); +} + +void +int3 (void) +{ + a386_panic ("int3"); +} + +void +overflow (void) +{ + a386_panic ("overflow"); +} + +void +bounds (void) +{ + a386_panic ("bounds"); +} + +void +invalid_op (void) +{ + a386_panic ("invalid_op"); +} + +void +coprocessor_segment_overrun (void) +{ + a386_panic ("coprocessor_segment_overrun"); +} + +void +reserved (void) +{ + a386_panic ("reserved"); +} + +void +double_fault (void) +{ + a386_panic ("double_fault"); +} + +void +invalid_TSS (void) +{ + a386_panic ("invalid_TSS"); +} + +void +segment_not_present (void) +{ + a386_panic ("segment_not_present"); +} + +void +stack_segment (void) +{ + a386_panic ("stack_segment"); +} + +void +general_protection (void) +{ + extern void do_general_protection (void); /* FIXMEa386 */ + a386_puts ("\ngeneral_protection"); + do_general_protection (); +} + +void +alignment_check (void) +{ + a386_panic ("alignment_check"); +} + +void +page_fault (int unused) +{ + struct pt_regs *regs; + unsigned long error_code = 0; + extern int _a386_page_fault_reason; /* FIXMEa386 */ + extern void do_page_fault (struct pt_regs *, int); /* FIXMEa386 */ + + /* SAVE_ALL */ + extern a386_word_t _a386_regs[17]; + + asm volatile ( + "pushl %0+4*16;" /* interrupts_enabled */ + "pushl %0+4*15;" /* kernel_mode */ + "pushl %0+4*14;" /* xss */ + "pushl %0+4*13;" /* esp */ + "pushl %0+4*12;" /* eflags */ + "pushl %0+4*11;" /* xcs */ + "pushl %0+4*10;" /* eip */ + "pushl %0+4*9;" /* orig_eax */ + "pushl %0+4*8;" /* xes */ + "pushl %0+4*7;" /* xds */ + "pushl %0+4*6;" /* eax */ + "pushl %0+4*5;" /* ebp */ + "pushl %0+4*4;" /* edi */ + "pushl %0+4*3;" /* esi */ + "pushl %0+4*2;" /* edx */ + "pushl %0+4*1;" /* ecx */ + "pushl %0+4*0;" /* ebx */ + : /* no outputs */ + : "m" (_a386_regs[0])); + regs = (struct pt_regs *)a386_get_sp (); + + if (_a386_page_fault_reason & A386_REASON_PROT) + error_code |= 1; + if (_a386_page_fault_reason & A386_REASON_WRITE) + error_code |= 2; + if (_a386_page_fault_reason & A386_REASON_USER) + error_code |= 4; + + do_page_fault (regs, error_code); + + if (a386_context_get_kernel_mode (®s->context)) + a386_context_set_sp (®s->context, (a386_address_t)(&unused - 1)); + else + _a386_ksp = (a386_address_t)(&unused - 1); + a386_context_set (®s->context); +} + +void +spurious_interrupt_bug (void) +{ + a386_panic ("spurious_interrupt_bug"); +} + +extern a386_result_t +sys_ni_syscall(), sys_exit(), sys_fork(), sys_read(), sys_write(), sys_open(), +sys_close(), sys_waitpid(), sys_creat(), sys_link(), sys_unlink(), +sys_execve(), sys_chdir(), sys_time(), sys_mknod(), sys_chmod(), sys_lchown(), +sys_stat(), sys_lseek(), sys_getpid(), sys_mount(), sys_oldumount(), +sys_setuid(), sys_getuid(), sys_stime(), sys_ptrace(), sys_alarm(), +sys_fstat(), sys_pause(), sys_utime(), sys_access(), sys_nice(), sys_sync(), +sys_kill(), sys_rename(), sys_mkdir(), sys_rmdir(), sys_dup(), sys_pipe(), +sys_times(), sys_brk(), sys_setgid(), sys_getgid(), sys_signal(), +sys_geteuid(), sys_getegid(), sys_acct(), sys_umount(), sys_ioctl(), +sys_fcntl(), sys_setpgid(), sys_olduname(), sys_umask(), sys_chroot(), +sys_ustat(), sys_dup2(), sys_getppid(), sys_getpgrp(), sys_setsid(), +sys_sigaction(), sys_sgetmask(), sys_ssetmask(), sys_setreuid(), +sys_setregid(), sys_sigsuspend(), sys_sigpending(), sys_sethostname(), +sys_setrlimit(), sys_getrlimit(), sys_getrusage(), sys_gettimeofday(), +sys_settimeofday(), sys_getgroups(), sys_setgroups(), old_select(), +sys_symlink(), sys_lstat(), sys_readlink(), sys_uselib(), sys_swapon(), +sys_reboot(), old_readdir(), old_mmap(), sys_munmap(), sys_truncate(), +sys_ftruncate(), sys_fchmod(), sys_fchown(), sys_getpriority(), +sys_setpriority(), sys_statfs(), sys_fstatfs(), sys_ioperm(), sys_socketcall(), +sys_syslog(), sys_setitimer(), sys_getitimer(), sys_newstat(), sys_newlstat(), +sys_newfstat(), sys_uname(), sys_iopl(), sys_vhangup(), sys_vm86old(), +sys_wait4(), sys_swapoff(), sys_sysinfo(), sys_ipc(), sys_fsync(), +sys_sigreturn(), sys_clone(), sys_setdomainname(), sys_newuname(), +sys_modify_ldt(), sys_adjtimex(), sys_mprotect(), sys_sigprocmask(), +sys_create_module(), sys_init_module(), sys_delete_module(), +sys_get_kernel_syms(), sys_quotactl(), sys_getpgid(), sys_fchdir(), +sys_bdflush(), sys_sysfs(), sys_personality(), sys_setfsuid(), sys_setfsgid(), +sys_llseek(), sys_getdents(), sys_select(), sys_flock(), sys_msync(), +sys_readv(), sys_writev(), sys_getsid(), sys_fdatasync(), sys_sysctl(), +sys_mlock(), sys_munlock(), sys_mlockall(), sys_munlockall(), +sys_sched_setparam(), sys_sched_getparam(), sys_sched_setscheduler(), +sys_sched_getscheduler(), sys_sched_yield(), sys_sched_get_priority_max(), +sys_sched_get_priority_min(), sys_sched_rr_get_interval(), sys_nanosleep(), +sys_mremap(), sys_setresuid(), sys_getresuid(), sys_vm86(), sys_query_module(), +sys_poll(), sys_nfsservctl(), sys_setresgid(), sys_getresgid(), sys_prctl(), +sys_rt_sigreturn(), sys_rt_sigaction(), sys_rt_sigprocmask(), +sys_rt_sigpending(), sys_rt_sigtimedwait(), sys_rt_sigqueueinfo(), +sys_rt_sigsuspend(), sys_pread(), sys_pwrite(), sys_chown(), sys_getcwd(), +sys_capget(), sys_capset(), sys_sigaltstack(), sys_sendfile(), sys_vfork(), +sys_lchown16(), sys_setuid16(), sys_getuid16(), sys_setgid16(), sys_getgid16(), +sys_geteuid16(), sys_getegid16(), sys_setreuid16(), sys_setregid16(), +sys_old_getrlimit(), sys_getgroups16(), sys_setgroups16(), sys_fchown16(), +sys_setfsuid16(), sys_setfsgid16(), sys_setresuid16(), sys_getresuid16(), +sys_setresgid16(), sys_getresgid16(), sys_chown16(), sys_mmap2(), +sys_truncate64(), sys_ftruncate64(), sys_stat64(), sys_lstat64(), +sys_fstat64(); + +syscallfun sys_call_table[] = +{ + sys_ni_syscall, /* 0 - old "setup()" system call*/ + sys_exit, + sys_fork, + sys_read, + sys_write, + sys_open, /* 5 */ + sys_close, + sys_waitpid, + sys_creat, + sys_link, + sys_unlink, /* 10 */ + sys_execve, + sys_chdir, + sys_time, + sys_mknod, + sys_chmod, /* 15 */ + sys_lchown16, + sys_ni_syscall, /* old break syscall holder */ + sys_stat, + sys_lseek, + sys_getpid, /* 20 */ + sys_mount, + sys_oldumount, + sys_setuid16, + sys_getuid16, + sys_stime, /* 25 */ + sys_ptrace, + sys_alarm, + sys_fstat, + sys_pause, + sys_utime, /* 30 */ + sys_ni_syscall, /* old stty syscall holder */ + sys_ni_syscall, /* old gtty syscall holder */ + sys_access, + sys_nice, + sys_ni_syscall, /* 35 */ /* old ftime syscall holder */ + sys_sync, + sys_kill, + sys_rename, + sys_mkdir, + sys_rmdir, /* 40 */ + sys_dup, + sys_pipe, + sys_times, + sys_ni_syscall, /* old prof syscall holder */ + sys_brk, /* 45 */ + sys_setgid16, + sys_getgid16, + sys_signal, + sys_geteuid16, + sys_getegid16, /* 50 */ + sys_acct, + sys_umount, /* recycled never used phys() */ + sys_ni_syscall, /* old lock syscall holder */ + sys_ioctl, + sys_fcntl, /* 55 */ + sys_ni_syscall, /* old mpx syscall holder */ + sys_setpgid, + sys_ni_syscall, /* old ulimit syscall holder */ + sys_olduname, + sys_umask, /* 60 */ + sys_chroot, + sys_ustat, + sys_dup2, + sys_getppid, + sys_getpgrp, /* 65 */ + sys_setsid, + sys_sigaction, + sys_sgetmask, + sys_ssetmask, + sys_setreuid16, /* 70 */ + sys_setregid16, + sys_sigsuspend, + sys_sigpending, + sys_sethostname, + sys_setrlimit, /* 75 */ + sys_old_getrlimit, + sys_getrusage, + sys_gettimeofday, + sys_settimeofday, + sys_getgroups16, /* 80 */ + sys_setgroups16, + old_select, + sys_symlink, + sys_lstat, + sys_readlink, /* 85 */ + sys_uselib, + sys_swapon, + sys_reboot, + old_readdir, + old_mmap, /* 90 */ + sys_munmap, + sys_truncate, + sys_ftruncate, + sys_fchmod, + sys_fchown16, /* 95 */ + sys_getpriority, + sys_setpriority, + sys_ni_syscall, /* old profil syscall holder */ + sys_statfs, + sys_fstatfs, /* 100 */ + sys_ioperm, + sys_socketcall, + sys_syslog, + sys_setitimer, + sys_getitimer, /* 105 */ + sys_newstat, + sys_newlstat, + sys_newfstat, + sys_uname, + sys_iopl, /* 110 */ + sys_vhangup, + sys_ni_syscall, /* old "idle" system call */ + sys_vm86old, + sys_wait4, + sys_swapoff, /* 115 */ + sys_sysinfo, + sys_ipc, + sys_fsync, + sys_sigreturn, + sys_clone, /* 120 */ + sys_setdomainname, + sys_newuname, + sys_modify_ldt, + sys_adjtimex, + sys_mprotect, /* 125 */ + sys_sigprocmask, + sys_create_module, + sys_init_module, + sys_delete_module, + sys_get_kernel_syms, /* 130 */ + sys_quotactl, + sys_getpgid, + sys_fchdir, + sys_bdflush, + sys_sysfs, /* 135 */ + sys_personality, + sys_ni_syscall, /* for afs_syscall */ + sys_setfsuid16, + sys_setfsgid16, + sys_llseek, /* 140 */ + sys_getdents, + sys_select, + sys_flock, + sys_msync, + sys_readv, /* 145 */ + sys_writev, + sys_getsid, + sys_fdatasync, + sys_sysctl, + sys_mlock, /* 150 */ + sys_munlock, + sys_mlockall, + sys_munlockall, + sys_sched_setparam, + sys_sched_getparam, /* 155 */ + sys_sched_setscheduler, + sys_sched_getscheduler, + sys_sched_yield, + sys_sched_get_priority_max, + sys_sched_get_priority_min, /* 160 */ + sys_sched_rr_get_interval, + sys_nanosleep, + sys_mremap, + sys_setresuid16, + sys_getresuid16, /* 165 */ + sys_vm86, + sys_query_module, + sys_poll, + sys_nfsservctl, + sys_setresgid16, /* 170 */ + sys_getresgid16, + sys_prctl, + sys_rt_sigreturn, + sys_rt_sigaction, + sys_rt_sigprocmask, /* 175 */ + sys_rt_sigpending, + sys_rt_sigtimedwait, + sys_rt_sigqueueinfo, + sys_rt_sigsuspend, + sys_pread, /* 180 */ + sys_pwrite, + sys_chown16, + sys_getcwd, + sys_capget, + sys_capset, /* 185 */ + sys_sigaltstack, + sys_sendfile, + sys_ni_syscall, /* streams1 */ + sys_ni_syscall, /* streams2 */ + sys_vfork, /* 190 */ + sys_getrlimit, + sys_mmap2, + sys_truncate64, + sys_ftruncate64, + sys_stat64, /* 195 */ + sys_lstat64, + sys_fstat64, + sys_lchown, + sys_getuid, + sys_getgid, /* 200 */ + sys_geteuid, + sys_getegid, + sys_setreuid, + sys_setregid, + sys_getgroups, /* 205 */ + sys_setgroups, + sys_fchown, + sys_setresuid, + sys_getresuid, + sys_setresgid, /* 210 */ + sys_getresgid, + sys_chown, + sys_setuid, + sys_setgid, + sys_setfsuid, /* 215 */ + sys_setfsgid, + + /* + * NOTE!! This doesn't have to be exact - we just have + * to make sure we have _enough_ of the "sys_ni_syscall" + * entries. Don't panic if you notice that this hasn't + * been shrunk every time we add a new system call. + */ + + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, + sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, sys_ni_syscall, +}; diff -Nru --exclude-from exclude Linux/arch/i386/kernel/head.S linux-a386/arch/i386/kernel/head.S --- Linux/arch/i386/kernel/head.S Fri Jan 7 20:32:27 2000 +++ linux-a386/arch/i386/kernel/head.S Thu Jan 1 01:00:00 1970 @@ -1,706 +0,0 @@ -/* - * linux/arch/i386/head.S -- the 32-bit startup code. - * - * Copyright (C) 1991, 1992 Linus Torvalds - * - * Enhanced CPU detection and feature setting code by Mike Jagdis - * and Martin Mares, November 1997. - */ - -.text -#include -#include -#include -#include -#include -#include -#include - - -#define CL_MAGIC_ADDR 0x90020 -#define CL_MAGIC 0xA33F -#define CL_BASE_ADDR 0x90000 -#define CL_OFFSET 0x90022 - -/* - * References to members of the boot_cpu_data structure. - */ - -#define CPU_PARAMS SYMBOL_NAME(boot_cpu_data) -#define X86 CPU_PARAMS+0 -#define X86_VENDOR CPU_PARAMS+1 -#define X86_MODEL CPU_PARAMS+2 -#define X86_MASK CPU_PARAMS+3 -#define X86_HARD_MATH CPU_PARAMS+6 -#define X86_CPUID CPU_PARAMS+8 -#define X86_CAPABILITY CPU_PARAMS+12 -#define X86_VENDOR_ID CPU_PARAMS+16 - -/* - * swapper_pg_dir is the main page directory, address 0x00101000 - */ -ENTRY(stext) -ENTRY(_stext) -startup_32: -/* - * Set segments to known values - */ - cld - movl $(__KERNEL_DS),%eax - movl %eax,%ds - movl %eax,%es - movl %eax,%fs - movl %eax,%gs -#ifdef __SMP__ - orw %bx,%bx - jz 1f -/* - * New page tables may be in 4Mbyte page mode and may - * be using the global pages. - * - * NOTE! We have to correct for the fact that we're - * not yet offset PAGE_OFFSET.. - */ -#define cr4_bits mmu_cr4_features-__PAGE_OFFSET - movl %cr4,%eax # Turn on 4Mb pages - orl cr4_bits,%eax - movl %eax,%cr4 -#endif -/* - * Setup paging (the tables are already set up, just switch them on) - */ -1: - movl $0x101000,%eax - movl %eax,%cr3 /* set the page table pointer.. */ - movl %cr0,%eax - orl $0x80000000,%eax - movl %eax,%cr0 /* ..and set paging (PG) bit */ - jmp 1f /* flush the prefetch-queue */ -1: - movl $1f,%eax - jmp *%eax /* make sure eip is relocated */ -1: - /* Set up the stack pointer */ - lss stack_start,%esp - -#ifdef __SMP__ - orw %bx,%bx - jz 1f /* Initial CPU cleans BSS */ - pushl $0 - popfl - jmp checkCPUtype -1: -#endif __SMP__ -/* - * Clear BSS first so that there are no surprises... - */ - xorl %eax,%eax - movl $ SYMBOL_NAME(__bss_start),%edi - movl $ SYMBOL_NAME(_end),%ecx - subl %edi,%ecx - cld - rep - stosb -/* - * start system 32-bit setup. We need to re-do some of the things done - * in 16-bit mode for the "real" operations. - */ - call setup_idt -/* - * Initialize eflags. Some BIOS's leave bits like NT set. This would - * confuse the debugger if this code is traced. - * XXX - best to initialize before switching to protected mode. - */ - pushl $0 - popfl -/* - * Copy bootup parameters out of the way. First 2kB of - * _empty_zero_page is for boot parameters, second 2kB - * is for the command line. - */ - movl $0x90000,%esi - movl $ SYMBOL_NAME(empty_zero_page),%edi - movl $512,%ecx - cld - rep - movsl - xorl %eax,%eax - movl $512,%ecx - rep - stosl - cmpw $(CL_MAGIC),CL_MAGIC_ADDR - jne 1f - movl $ SYMBOL_NAME(empty_zero_page)+2048,%edi - movzwl CL_OFFSET,%esi - addl $(CL_BASE_ADDR),%esi - movl $512,%ecx - rep - movsl -1: -#ifdef __SMP__ -checkCPUtype: -#endif - - movl $-1,X86_CPUID # -1 for no CPUID initially - -/* check if it is 486 or 386. */ -/* - * XXX - this does a lot of unnecessary setup. Alignment checks don't - * apply at our cpl of 0 and the stack ought to be aligned already, and - * we don't need to preserve eflags. - */ - - movl $3,X86 # at least 386 - pushfl # push EFLAGS - popl %eax # get EFLAGS - movl %eax,%ecx # save original EFLAGS - xorl $0x40000,%eax # flip AC bit in EFLAGS - pushl %eax # copy to EFLAGS - popfl # set EFLAGS - pushfl # get new EFLAGS - popl %eax # put it in eax - xorl %ecx,%eax # change in flags - andl $0x40000,%eax # check if AC bit changed - je is386 - - movl $4,X86 # at least 486 - movl %ecx,%eax - xorl $0x200000,%eax # check ID flag - pushl %eax - popfl # if we are on a straight 486DX, SX, or - pushfl # 487SX we can't change it - popl %eax - xorl %ecx,%eax - pushl %ecx # restore original EFLAGS - popfl - andl $0x200000,%eax - je is486 - - /* get vendor info */ - xorl %eax,%eax # call CPUID with 0 -> return vendor ID - cpuid - movl %eax,X86_CPUID # save CPUID level - movl %ebx,X86_VENDOR_ID # lo 4 chars - movl %edx,X86_VENDOR_ID+4 # next 4 chars - movl %ecx,X86_VENDOR_ID+8 # last 4 chars - - orl %eax,%eax # do we have processor info as well? - je is486 - - movl $1,%eax # Use the CPUID instruction to get CPU type - cpuid - movb %al,%cl # save reg for future use - andb $0x0f,%ah # mask processor family - movb %ah,X86 - andb $0xf0,%al # mask model - shrb $4,%al - movb %al,X86_MODEL - andb $0x0f,%cl # mask mask revision - movb %cl,X86_MASK - movl %edx,X86_CAPABILITY - -is486: - movl %cr0,%eax # 486 or better - andl $0x80000011,%eax # Save PG,PE,ET - orl $0x50022,%eax # set AM, WP, NE and MP - jmp 2f - -is386: pushl %ecx # restore original EFLAGS - popfl - movl %cr0,%eax # 386 - andl $0x80000011,%eax # Save PG,PE,ET - orl $2,%eax # set MP -2: movl %eax,%cr0 - call check_x87 -#ifdef __SMP__ - movb ready,%al # First CPU if 0 - orb %al,%al - jz 4f # First CPU skip this stuff - movl %cr4,%eax # Turn on 4Mb pages - orl $16,%eax - movl %eax,%cr4 - movl %cr3,%eax # Intel specification clarification says - movl %eax,%cr3 # to do this. Maybe it makes a difference. - # Who knows ? -#endif -4: -#ifdef __SMP__ - incb ready -#endif - lgdt gdt_descr - lidt idt_descr - ljmp $(__KERNEL_CS),$1f -1: movl $(__KERNEL_DS),%eax # reload all the segment registers - movl %eax,%ds # after changing gdt. - movl %eax,%es - movl %eax,%fs - movl %eax,%gs -#ifdef __SMP__ - movl $(__KERNEL_DS), %eax - movl %eax,%ss # Reload the stack pointer (segment only) -#else - lss stack_start,%esp # Load processor stack -#endif - xorl %eax,%eax - lldt %ax - cld # gcc2 wants the direction flag cleared at all times -#ifdef __SMP__ - movb ready, %cl - cmpb $1,%cl - je 1f # the first CPU calls start_kernel - # all other CPUs call initialize_secondary - call SYMBOL_NAME(initialize_secondary) - jmp L6 -1: -#endif - call SYMBOL_NAME(start_kernel) -L6: - jmp L6 # main should never return here, but - # just in case, we know what happens. - -#ifdef __SMP__ -ready: .byte 0 -#endif - -/* - * We depend on ET to be correct. This checks for 287/387. - */ -check_x87: - movb $0,X86_HARD_MATH - clts - fninit - fstsw %ax - cmpb $0,%al - je 1f - movl %cr0,%eax /* no coprocessor: have to set bits */ - xorl $4,%eax /* set EM */ - movl %eax,%cr0 - ret - ALIGN -1: movb $1,X86_HARD_MATH - .byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */ - ret - -/* - * setup_idt - * - * sets up a idt with 256 entries pointing to - * ignore_int, interrupt gates. It doesn't actually load - * idt - that can be done only after paging has been enabled - * and the kernel moved to PAGE_OFFSET. Interrupts - * are enabled elsewhere, when we can be relatively - * sure everything is ok. - */ -setup_idt: - lea ignore_int,%edx - movl $(__KERNEL_CS << 16),%eax - movw %dx,%ax /* selector = 0x0010 = cs */ - movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ - - lea SYMBOL_NAME(idt_table),%edi - mov $256,%ecx -rp_sidt: - movl %eax,(%edi) - movl %edx,4(%edi) - addl $8,%edi - dec %ecx - jne rp_sidt - ret - -ENTRY(stack_start) - .long SYMBOL_NAME(init_task_union)+8192 - .long __KERNEL_DS - -/* This is the default interrupt "handler" :-) */ -int_msg: - .asciz "Unknown interrupt\n" - ALIGN -ignore_int: - cld - pushl %eax - pushl %ecx - pushl %edx - pushl %es - pushl %ds - movl $(__KERNEL_DS),%eax - movl %eax,%ds - movl %eax,%es - pushl $int_msg - call SYMBOL_NAME(printk) - popl %eax - popl %ds - popl %es - popl %edx - popl %ecx - popl %eax - iret - -/* - * The interrupt descriptor table has room for 256 idt's, - * the global descriptor table is dependent on the number - * of tasks we can have.. - */ -#define IDT_ENTRIES 256 -#define GDT_ENTRIES (__TSS(NR_CPUS)) - - -.globl SYMBOL_NAME(idt) -.globl SYMBOL_NAME(gdt) - - ALIGN - .word 0 -idt_descr: - .word IDT_ENTRIES*8-1 # idt contains 256 entries -SYMBOL_NAME(idt): - .long SYMBOL_NAME(idt_table) - - .word 0 -gdt_descr: - .word GDT_ENTRIES*8-1 -SYMBOL_NAME(gdt): - .long SYMBOL_NAME(gdt_table) - -/* - * This is initialized to create a identity-mapping at 0-4M (for bootup - * purposes) and another mapping of the 0-4M area at virtual address - * PAGE_OFFSET. - */ -.org 0x1000 -ENTRY(swapper_pg_dir) - .long 0x00102007 - .long 0x00103007 - .fill BOOT_USER_PGD_PTRS-2,4,0 - /* default: 766 entries */ - .long 0x00102007 - .long 0x00103007 - /* default: 254 entries */ - .fill BOOT_KERNEL_PGD_PTRS-2,4,0 - -/* - * The page tables are initialized to only 4MB here - the final page - * tables are set up later depending on memory size. The "007" at the - * end doesn't mean with right to kill, but PRESENT+RW+USER - */ -.org 0x2000 -ENTRY(pg0) - .long 0x000007,0x001007,0x002007,0x003007,0x004007,0x005007,0x006007,0x007007 - .long 0x008007,0x009007,0x00a007,0x00b007,0x00c007,0x00d007,0x00e007,0x00f007 - .long 0x010007,0x011007,0x012007,0x013007,0x014007,0x015007,0x016007,0x017007 - .long 0x018007,0x019007,0x01a007,0x01b007,0x01c007,0x01d007,0x01e007,0x01f007 - .long 0x020007,0x021007,0x022007,0x023007,0x024007,0x025007,0x026007,0x027007 - .long 0x028007,0x029007,0x02a007,0x02b007,0x02c007,0x02d007,0x02e007,0x02f007 - .long 0x030007,0x031007,0x032007,0x033007,0x034007,0x035007,0x036007,0x037007 - .long 0x038007,0x039007,0x03a007,0x03b007,0x03c007,0x03d007,0x03e007,0x03f007 - .long 0x040007,0x041007,0x042007,0x043007,0x044007,0x045007,0x046007,0x047007 - .long 0x048007,0x049007,0x04a007,0x04b007,0x04c007,0x04d007,0x04e007,0x04f007 - .long 0x050007,0x051007,0x052007,0x053007,0x054007,0x055007,0x056007,0x057007 - .long 0x058007,0x059007,0x05a007,0x05b007,0x05c007,0x05d007,0x05e007,0x05f007 - .long 0x060007,0x061007,0x062007,0x063007,0x064007,0x065007,0x066007,0x067007 - .long 0x068007,0x069007,0x06a007,0x06b007,0x06c007,0x06d007,0x06e007,0x06f007 - .long 0x070007,0x071007,0x072007,0x073007,0x074007,0x075007,0x076007,0x077007 - .long 0x078007,0x079007,0x07a007,0x07b007,0x07c007,0x07d007,0x07e007,0x07f007 - .long 0x080007,0x081007,0x082007,0x083007,0x084007,0x085007,0x086007,0x087007 - .long 0x088007,0x089007,0x08a007,0x08b007,0x08c007,0x08d007,0x08e007,0x08f007 - .long 0x090007,0x091007,0x092007,0x093007,0x094007,0x095007,0x096007,0x097007 - .long 0x098007,0x099007,0x09a007,0x09b007,0x09c007,0x09d007,0x09e007,0x09f007 - .long 0x0a0007,0x0a1007,0x0a2007,0x0a3007,0x0a4007,0x0a5007,0x0a6007,0x0a7007 - .long 0x0a8007,0x0a9007,0x0aa007,0x0ab007,0x0ac007,0x0ad007,0x0ae007,0x0af007 - .long 0x0b0007,0x0b1007,0x0b2007,0x0b3007,0x0b4007,0x0b5007,0x0b6007,0x0b7007 - .long 0x0b8007,0x0b9007,0x0ba007,0x0bb007,0x0bc007,0x0bd007,0x0be007,0x0bf007 - .long 0x0c0007,0x0c1007,0x0c2007,0x0c3007,0x0c4007,0x0c5007,0x0c6007,0x0c7007 - .long 0x0c8007,0x0c9007,0x0ca007,0x0cb007,0x0cc007,0x0cd007,0x0ce007,0x0cf007 - .long 0x0d0007,0x0d1007,0x0d2007,0x0d3007,0x0d4007,0x0d5007,0x0d6007,0x0d7007 - .long 0x0d8007,0x0d9007,0x0da007,0x0db007,0x0dc007,0x0dd007,0x0de007,0x0df007 - .long 0x0e0007,0x0e1007,0x0e2007,0x0e3007,0x0e4007,0x0e5007,0x0e6007,0x0e7007 - .long 0x0e8007,0x0e9007,0x0ea007,0x0eb007,0x0ec007,0x0ed007,0x0ee007,0x0ef007 - .long 0x0f0007,0x0f1007,0x0f2007,0x0f3007,0x0f4007,0x0f5007,0x0f6007,0x0f7007 - .long 0x0f8007,0x0f9007,0x0fa007,0x0fb007,0x0fc007,0x0fd007,0x0fe007,0x0ff007 - .long 0x100007,0x101007,0x102007,0x103007,0x104007,0x105007,0x106007,0x107007 - .long 0x108007,0x109007,0x10a007,0x10b007,0x10c007,0x10d007,0x10e007,0x10f007 - .long 0x110007,0x111007,0x112007,0x113007,0x114007,0x115007,0x116007,0x117007 - .long 0x118007,0x119007,0x11a007,0x11b007,0x11c007,0x11d007,0x11e007,0x11f007 - .long 0x120007,0x121007,0x122007,0x123007,0x124007,0x125007,0x126007,0x127007 - .long 0x128007,0x129007,0x12a007,0x12b007,0x12c007,0x12d007,0x12e007,0x12f007 - .long 0x130007,0x131007,0x132007,0x133007,0x134007,0x135007,0x136007,0x137007 - .long 0x138007,0x139007,0x13a007,0x13b007,0x13c007,0x13d007,0x13e007,0x13f007 - .long 0x140007,0x141007,0x142007,0x143007,0x144007,0x145007,0x146007,0x147007 - .long 0x148007,0x149007,0x14a007,0x14b007,0x14c007,0x14d007,0x14e007,0x14f007 - .long 0x150007,0x151007,0x152007,0x153007,0x154007,0x155007,0x156007,0x157007 - .long 0x158007,0x159007,0x15a007,0x15b007,0x15c007,0x15d007,0x15e007,0x15f007 - .long 0x160007,0x161007,0x162007,0x163007,0x164007,0x165007,0x166007,0x167007 - .long 0x168007,0x169007,0x16a007,0x16b007,0x16c007,0x16d007,0x16e007,0x16f007 - .long 0x170007,0x171007,0x172007,0x173007,0x174007,0x175007,0x176007,0x177007 - .long 0x178007,0x179007,0x17a007,0x17b007,0x17c007,0x17d007,0x17e007,0x17f007 - .long 0x180007,0x181007,0x182007,0x183007,0x184007,0x185007,0x186007,0x187007 - .long 0x188007,0x189007,0x18a007,0x18b007,0x18c007,0x18d007,0x18e007,0x18f007 - .long 0x190007,0x191007,0x192007,0x193007,0x194007,0x195007,0x196007,0x197007 - .long 0x198007,0x199007,0x19a007,0x19b007,0x19c007,0x19d007,0x19e007,0x19f007 - .long 0x1a0007,0x1a1007,0x1a2007,0x1a3007,0x1a4007,0x1a5007,0x1a6007,0x1a7007 - .long 0x1a8007,0x1a9007,0x1aa007,0x1ab007,0x1ac007,0x1ad007,0x1ae007,0x1af007 - .long 0x1b0007,0x1b1007,0x1b2007,0x1b3007,0x1b4007,0x1b5007,0x1b6007,0x1b7007 - .long 0x1b8007,0x1b9007,0x1ba007,0x1bb007,0x1bc007,0x1bd007,0x1be007,0x1bf007 - .long 0x1c0007,0x1c1007,0x1c2007,0x1c3007,0x1c4007,0x1c5007,0x1c6007,0x1c7007 - .long 0x1c8007,0x1c9007,0x1ca007,0x1cb007,0x1cc007,0x1cd007,0x1ce007,0x1cf007 - .long 0x1d0007,0x1d1007,0x1d2007,0x1d3007,0x1d4007,0x1d5007,0x1d6007,0x1d7007 - .long 0x1d8007,0x1d9007,0x1da007,0x1db007,0x1dc007,0x1dd007,0x1de007,0x1df007 - .long 0x1e0007,0x1e1007,0x1e2007,0x1e3007,0x1e4007,0x1e5007,0x1e6007,0x1e7007 - .long 0x1e8007,0x1e9007,0x1ea007,0x1eb007,0x1ec007,0x1ed007,0x1ee007,0x1ef007 - .long 0x1f0007,0x1f1007,0x1f2007,0x1f3007,0x1f4007,0x1f5007,0x1f6007,0x1f7007 - .long 0x1f8007,0x1f9007,0x1fa007,0x1fb007,0x1fc007,0x1fd007,0x1fe007,0x1ff007 - .long 0x200007,0x201007,0x202007,0x203007,0x204007,0x205007,0x206007,0x207007 - .long 0x208007,0x209007,0x20a007,0x20b007,0x20c007,0x20d007,0x20e007,0x20f007 - .long 0x210007,0x211007,0x212007,0x213007,0x214007,0x215007,0x216007,0x217007 - .long 0x218007,0x219007,0x21a007,0x21b007,0x21c007,0x21d007,0x21e007,0x21f007 - .long 0x220007,0x221007,0x222007,0x223007,0x224007,0x225007,0x226007,0x227007 - .long 0x228007,0x229007,0x22a007,0x22b007,0x22c007,0x22d007,0x22e007,0x22f007 - .long 0x230007,0x231007,0x232007,0x233007,0x234007,0x235007,0x236007,0x237007 - .long 0x238007,0x239007,0x23a007,0x23b007,0x23c007,0x23d007,0x23e007,0x23f007 - .long 0x240007,0x241007,0x242007,0x243007,0x244007,0x245007,0x246007,0x247007 - .long 0x248007,0x249007,0x24a007,0x24b007,0x24c007,0x24d007,0x24e007,0x24f007 - .long 0x250007,0x251007,0x252007,0x253007,0x254007,0x255007,0x256007,0x257007 - .long 0x258007,0x259007,0x25a007,0x25b007,0x25c007,0x25d007,0x25e007,0x25f007 - .long 0x260007,0x261007,0x262007,0x263007,0x264007,0x265007,0x266007,0x267007 - .long 0x268007,0x269007,0x26a007,0x26b007,0x26c007,0x26d007,0x26e007,0x26f007 - .long 0x270007,0x271007,0x272007,0x273007,0x274007,0x275007,0x276007,0x277007 - .long 0x278007,0x279007,0x27a007,0x27b007,0x27c007,0x27d007,0x27e007,0x27f007 - .long 0x280007,0x281007,0x282007,0x283007,0x284007,0x285007,0x286007,0x287007 - .long 0x288007,0x289007,0x28a007,0x28b007,0x28c007,0x28d007,0x28e007,0x28f007 - .long 0x290007,0x291007,0x292007,0x293007,0x294007,0x295007,0x296007,0x297007 - .long 0x298007,0x299007,0x29a007,0x29b007,0x29c007,0x29d007,0x29e007,0x29f007 - .long 0x2a0007,0x2a1007,0x2a2007,0x2a3007,0x2a4007,0x2a5007,0x2a6007,0x2a7007 - .long 0x2a8007,0x2a9007,0x2aa007,0x2ab007,0x2ac007,0x2ad007,0x2ae007,0x2af007 - .long 0x2b0007,0x2b1007,0x2b2007,0x2b3007,0x2b4007,0x2b5007,0x2b6007,0x2b7007 - .long 0x2b8007,0x2b9007,0x2ba007,0x2bb007,0x2bc007,0x2bd007,0x2be007,0x2bf007 - .long 0x2c0007,0x2c1007,0x2c2007,0x2c3007,0x2c4007,0x2c5007,0x2c6007,0x2c7007 - .long 0x2c8007,0x2c9007,0x2ca007,0x2cb007,0x2cc007,0x2cd007,0x2ce007,0x2cf007 - .long 0x2d0007,0x2d1007,0x2d2007,0x2d3007,0x2d4007,0x2d5007,0x2d6007,0x2d7007 - .long 0x2d8007,0x2d9007,0x2da007,0x2db007,0x2dc007,0x2dd007,0x2de007,0x2df007 - .long 0x2e0007,0x2e1007,0x2e2007,0x2e3007,0x2e4007,0x2e5007,0x2e6007,0x2e7007 - .long 0x2e8007,0x2e9007,0x2ea007,0x2eb007,0x2ec007,0x2ed007,0x2ee007,0x2ef007 - .long 0x2f0007,0x2f1007,0x2f2007,0x2f3007,0x2f4007,0x2f5007,0x2f6007,0x2f7007 - .long 0x2f8007,0x2f9007,0x2fa007,0x2fb007,0x2fc007,0x2fd007,0x2fe007,0x2ff007 - .long 0x300007,0x301007,0x302007,0x303007,0x304007,0x305007,0x306007,0x307007 - .long 0x308007,0x309007,0x30a007,0x30b007,0x30c007,0x30d007,0x30e007,0x30f007 - .long 0x310007,0x311007,0x312007,0x313007,0x314007,0x315007,0x316007,0x317007 - .long 0x318007,0x319007,0x31a007,0x31b007,0x31c007,0x31d007,0x31e007,0x31f007 - .long 0x320007,0x321007,0x322007,0x323007,0x324007,0x325007,0x326007,0x327007 - .long 0x328007,0x329007,0x32a007,0x32b007,0x32c007,0x32d007,0x32e007,0x32f007 - .long 0x330007,0x331007,0x332007,0x333007,0x334007,0x335007,0x336007,0x337007 - .long 0x338007,0x339007,0x33a007,0x33b007,0x33c007,0x33d007,0x33e007,0x33f007 - .long 0x340007,0x341007,0x342007,0x343007,0x344007,0x345007,0x346007,0x347007 - .long 0x348007,0x349007,0x34a007,0x34b007,0x34c007,0x34d007,0x34e007,0x34f007 - .long 0x350007,0x351007,0x352007,0x353007,0x354007,0x355007,0x356007,0x357007 - .long 0x358007,0x359007,0x35a007,0x35b007,0x35c007,0x35d007,0x35e007,0x35f007 - .long 0x360007,0x361007,0x362007,0x363007,0x364007,0x365007,0x366007,0x367007 - .long 0x368007,0x369007,0x36a007,0x36b007,0x36c007,0x36d007,0x36e007,0x36f007 - .long 0x370007,0x371007,0x372007,0x373007,0x374007,0x375007,0x376007,0x377007 - .long 0x378007,0x379007,0x37a007,0x37b007,0x37c007,0x37d007,0x37e007,0x37f007 - .long 0x380007,0x381007,0x382007,0x383007,0x384007,0x385007,0x386007,0x387007 - .long 0x388007,0x389007,0x38a007,0x38b007,0x38c007,0x38d007,0x38e007,0x38f007 - .long 0x390007,0x391007,0x392007,0x393007,0x394007,0x395007,0x396007,0x397007 - .long 0x398007,0x399007,0x39a007,0x39b007,0x39c007,0x39d007,0x39e007,0x39f007 - .long 0x3a0007,0x3a1007,0x3a2007,0x3a3007,0x3a4007,0x3a5007,0x3a6007,0x3a7007 - .long 0x3a8007,0x3a9007,0x3aa007,0x3ab007,0x3ac007,0x3ad007,0x3ae007,0x3af007 - .long 0x3b0007,0x3b1007,0x3b2007,0x3b3007,0x3b4007,0x3b5007,0x3b6007,0x3b7007 - .long 0x3b8007,0x3b9007,0x3ba007,0x3bb007,0x3bc007,0x3bd007,0x3be007,0x3bf007 - .long 0x3c0007,0x3c1007,0x3c2007,0x3c3007,0x3c4007,0x3c5007,0x3c6007,0x3c7007 - .long 0x3c8007,0x3c9007,0x3ca007,0x3cb007,0x3cc007,0x3cd007,0x3ce007,0x3cf007 - .long 0x3d0007,0x3d1007,0x3d2007,0x3d3007,0x3d4007,0x3d5007,0x3d6007,0x3d7007 - .long 0x3d8007,0x3d9007,0x3da007,0x3db007,0x3dc007,0x3dd007,0x3de007,0x3df007 - .long 0x3e0007,0x3e1007,0x3e2007,0x3e3007,0x3e4007,0x3e5007,0x3e6007,0x3e7007 - .long 0x3e8007,0x3e9007,0x3ea007,0x3eb007,0x3ec007,0x3ed007,0x3ee007,0x3ef007 - .long 0x3f0007,0x3f1007,0x3f2007,0x3f3007,0x3f4007,0x3f5007,0x3f6007,0x3f7007 - .long 0x3f8007,0x3f9007,0x3fa007,0x3fb007,0x3fc007,0x3fd007,0x3fe007,0x3ff007 - -ENTRY(pg1) - .long 0x400007,0x001007,0x002007,0x003007,0x004007,0x005007,0x006007,0x007007 - .long 0x408007,0x009007,0x00a007,0x00b007,0x00c007,0x00d007,0x00e007,0x00f007 - .long 0x410007,0x011007,0x012007,0x013007,0x014007,0x015007,0x016007,0x017007 - .long 0x418007,0x019007,0x01a007,0x01b007,0x01c007,0x01d007,0x01e007,0x01f007 - .long 0x420007,0x021007,0x022007,0x023007,0x024007,0x025007,0x026007,0x027007 - .long 0x428007,0x029007,0x02a007,0x02b007,0x02c007,0x02d007,0x02e007,0x02f007 - .long 0x430007,0x031007,0x032007,0x033007,0x034007,0x035007,0x036007,0x037007 - .long 0x438007,0x039007,0x03a007,0x03b007,0x03c007,0x03d007,0x03e007,0x03f007 - .long 0x440007,0x041007,0x042007,0x043007,0x044007,0x045007,0x046007,0x047007 - .long 0x448007,0x049007,0x04a007,0x04b007,0x04c007,0x04d007,0x04e007,0x04f007 - .long 0x450007,0x051007,0x052007,0x053007,0x054007,0x055007,0x056007,0x057007 - .long 0x458007,0x059007,0x05a007,0x05b007,0x05c007,0x05d007,0x05e007,0x05f007 - .long 0x460007,0x061007,0x062007,0x063007,0x064007,0x065007,0x066007,0x067007 - .long 0x468007,0x069007,0x06a007,0x06b007,0x06c007,0x06d007,0x06e007,0x06f007 - .long 0x470007,0x071007,0x072007,0x073007,0x074007,0x075007,0x076007,0x077007 - .long 0x478007,0x079007,0x07a007,0x07b007,0x07c007,0x07d007,0x07e007,0x07f007 - .long 0x480007,0x081007,0x082007,0x083007,0x084007,0x085007,0x086007,0x087007 - .long 0x488007,0x089007,0x08a007,0x08b007,0x08c007,0x08d007,0x08e007,0x08f007 - .long 0x490007,0x091007,0x092007,0x093007,0x094007,0x095007,0x096007,0x097007 - .long 0x498007,0x099007,0x09a007,0x09b007,0x09c007,0x09d007,0x09e007,0x09f007 - .long 0x4a0007,0x0a1007,0x0a2007,0x0a3007,0x0a4007,0x0a5007,0x0a6007,0x0a7007 - .long 0x4a8007,0x0a9007,0x0aa007,0x0ab007,0x0ac007,0x0ad007,0x0ae007,0x0af007 - .long 0x4b0007,0x0b1007,0x0b2007,0x0b3007,0x0b4007,0x0b5007,0x0b6007,0x0b7007 - .long 0x4b8007,0x0b9007,0x0ba007,0x0bb007,0x0bc007,0x0bd007,0x0be007,0x0bf007 - .long 0x4c0007,0x0c1007,0x0c2007,0x0c3007,0x0c4007,0x0c5007,0x0c6007,0x0c7007 - .long 0x4c8007,0x0c9007,0x0ca007,0x0cb007,0x0cc007,0x0cd007,0x0ce007,0x0cf007 - .long 0x4d0007,0x0d1007,0x0d2007,0x0d3007,0x0d4007,0x0d5007,0x0d6007,0x0d7007 - .long 0x4d8007,0x0d9007,0x0da007,0x0db007,0x0dc007,0x0dd007,0x0de007,0x0df007 - .long 0x4e0007,0x0e1007,0x0e2007,0x0e3007,0x0e4007,0x0e5007,0x0e6007,0x0e7007 - .long 0x4e8007,0x0e9007,0x0ea007,0x0eb007,0x0ec007,0x0ed007,0x0ee007,0x0ef007 - .long 0x4f0007,0x0f1007,0x0f2007,0x0f3007,0x0f4007,0x0f5007,0x0f6007,0x0f7007 - .long 0x4f8007,0x0f9007,0x0fa007,0x0fb007,0x0fc007,0x0fd007,0x0fe007,0x0ff007 - .long 0x500007,0x001007,0x002007,0x003007,0x004007,0x005007,0x006007,0x007007 - .long 0x508007,0x009007,0x00a007,0x00b007,0x00c007,0x00d007,0x00e007,0x00f007 - .long 0x510007,0x011007,0x012007,0x013007,0x014007,0x015007,0x016007,0x017007 - .long 0x518007,0x019007,0x01a007,0x01b007,0x01c007,0x01d007,0x01e007,0x01f007 - .long 0x520007,0x021007,0x022007,0x023007,0x024007,0x025007,0x026007,0x027007 - .long 0x528007,0x029007,0x02a007,0x02b007,0x02c007,0x02d007,0x02e007,0x02f007 - .long 0x530007,0x031007,0x032007,0x033007,0x034007,0x035007,0x036007,0x037007 - .long 0x538007,0x039007,0x03a007,0x03b007,0x03c007,0x03d007,0x03e007,0x03f007 - .long 0x540007,0x041007,0x042007,0x043007,0x044007,0x045007,0x046007,0x047007 - .long 0x548007,0x049007,0x04a007,0x04b007,0x04c007,0x04d007,0x04e007,0x04f007 - .long 0x550007,0x051007,0x052007,0x053007,0x054007,0x055007,0x056007,0x057007 - .long 0x558007,0x059007,0x05a007,0x05b007,0x05c007,0x05d007,0x05e007,0x05f007 - .long 0x560007,0x061007,0x062007,0x063007,0x064007,0x065007,0x066007,0x067007 - .long 0x568007,0x069007,0x06a007,0x06b007,0x06c007,0x06d007,0x06e007,0x06f007 - .long 0x570007,0x071007,0x072007,0x073007,0x074007,0x075007,0x076007,0x077007 - .long 0x578007,0x079007,0x07a007,0x07b007,0x07c007,0x07d007,0x07e007,0x07f007 - .long 0x580007,0x081007,0x082007,0x083007,0x084007,0x085007,0x086007,0x087007 - .long 0x588007,0x089007,0x08a007,0x08b007,0x08c007,0x08d007,0x08e007,0x08f007 - .long 0x590007,0x091007,0x092007,0x093007,0x094007,0x095007,0x096007,0x097007 - .long 0x598007,0x099007,0x09a007,0x09b007,0x09c007,0x09d007,0x09e007,0x09f007 - .long 0x5a0007,0x0a1007,0x0a2007,0x0a3007,0x0a4007,0x0a5007,0x0a6007,0x0a7007 - .long 0x5a8007,0x0a9007,0x0aa007,0x0ab007,0x0ac007,0x0ad007,0x0ae007,0x0af007 - .long 0x5b0007,0x0b1007,0x0b2007,0x0b3007,0x0b4007,0x0b5007,0x0b6007,0x0b7007 - .long 0x5b8007,0x0b9007,0x0ba007,0x0bb007,0x0bc007,0x0bd007,0x0be007,0x0bf007 - .long 0x5c0007,0x0c1007,0x0c2007,0x0c3007,0x0c4007,0x0c5007,0x0c6007,0x0c7007 - .long 0x5c8007,0x0c9007,0x0ca007,0x0cb007,0x0cc007,0x0cd007,0x0ce007,0x0cf007 - .long 0x5d0007,0x0d1007,0x0d2007,0x0d3007,0x0d4007,0x0d5007,0x0d6007,0x0d7007 - .long 0x5d8007,0x0d9007,0x0da007,0x0db007,0x0dc007,0x0dd007,0x0de007,0x0df007 - .long 0x5e0007,0x0e1007,0x0e2007,0x0e3007,0x0e4007,0x0e5007,0x0e6007,0x0e7007 - .long 0x5e8007,0x0e9007,0x0ea007,0x0eb007,0x0ec007,0x0ed007,0x0ee007,0x0ef007 - .long 0x5f0007,0x0f1007,0x0f2007,0x0f3007,0x0f4007,0x0f5007,0x0f6007,0x0f7007 - .long 0x5f8007,0x0f9007,0x0fa007,0x0fb007,0x0fc007,0x0fd007,0x0fe007,0x0ff007 - .long 0x600007,0x001007,0x002007,0x003007,0x004007,0x005007,0x006007,0x007007 - .long 0x608007,0x009007,0x00a007,0x00b007,0x00c007,0x00d007,0x00e007,0x00f007 - .long 0x610007,0x011007,0x012007,0x013007,0x014007,0x015007,0x016007,0x017007 - .long 0x618007,0x019007,0x01a007,0x01b007,0x01c007,0x01d007,0x01e007,0x01f007 - .long 0x620007,0x021007,0x022007,0x023007,0x024007,0x025007,0x026007,0x027007 - .long 0x628007,0x029007,0x02a007,0x02b007,0x02c007,0x02d007,0x02e007,0x02f007 - .long 0x630007,0x031007,0x032007,0x033007,0x034007,0x035007,0x036007,0x037007 - .long 0x638007,0x039007,0x03a007,0x03b007,0x03c007,0x03d007,0x03e007,0x03f007 - .long 0x640007,0x041007,0x042007,0x043007,0x044007,0x045007,0x046007,0x047007 - .long 0x648007,0x049007,0x04a007,0x04b007,0x04c007,0x04d007,0x04e007,0x04f007 - .long 0x650007,0x051007,0x052007,0x053007,0x054007,0x055007,0x056007,0x057007 - .long 0x658007,0x059007,0x05a007,0x05b007,0x05c007,0x05d007,0x05e007,0x05f007 - .long 0x660007,0x061007,0x062007,0x063007,0x064007,0x065007,0x066007,0x067007 - .long 0x668007,0x069007,0x06a007,0x06b007,0x06c007,0x06d007,0x06e007,0x06f007 - .long 0x670007,0x071007,0x072007,0x073007,0x074007,0x075007,0x076007,0x077007 - .long 0x678007,0x079007,0x07a007,0x07b007,0x07c007,0x07d007,0x07e007,0x07f007 - .long 0x680007,0x081007,0x082007,0x083007,0x084007,0x085007,0x086007,0x087007 - .long 0x688007,0x089007,0x08a007,0x08b007,0x08c007,0x08d007,0x08e007,0x08f007 - .long 0x690007,0x091007,0x092007,0x093007,0x094007,0x095007,0x096007,0x097007 - .long 0x698007,0x099007,0x09a007,0x09b007,0x09c007,0x09d007,0x09e007,0x09f007 - .long 0x6a0007,0x0a1007,0x0a2007,0x0a3007,0x0a4007,0x0a5007,0x0a6007,0x0a7007 - .long 0x6a8007,0x0a9007,0x0aa007,0x0ab007,0x0ac007,0x0ad007,0x0ae007,0x0af007 - .long 0x6b0007,0x0b1007,0x0b2007,0x0b3007,0x0b4007,0x0b5007,0x0b6007,0x0b7007 - .long 0x6b8007,0x0b9007,0x0ba007,0x0bb007,0x0bc007,0x0bd007,0x0be007,0x0bf007 - .long 0x6c0007,0x0c1007,0x0c2007,0x0c3007,0x0c4007,0x0c5007,0x0c6007,0x0c7007 - .long 0x6c8007,0x0c9007,0x0ca007,0x0cb007,0x0cc007,0x0cd007,0x0ce007,0x0cf007 - .long 0x6d0007,0x0d1007,0x0d2007,0x0d3007,0x0d4007,0x0d5007,0x0d6007,0x0d7007 - .long 0x6d8007,0x0d9007,0x0da007,0x0db007,0x0dc007,0x0dd007,0x0de007,0x0df007 - .long 0x6e0007,0x0e1007,0x0e2007,0x0e3007,0x0e4007,0x0e5007,0x0e6007,0x0e7007 - .long 0x6e8007,0x0e9007,0x0ea007,0x0eb007,0x0ec007,0x0ed007,0x0ee007,0x0ef007 - .long 0x6f0007,0x0f1007,0x0f2007,0x0f3007,0x0f4007,0x0f5007,0x0f6007,0x0f7007 - .long 0x6f8007,0x0f9007,0x0fa007,0x0fb007,0x0fc007,0x0fd007,0x0fe007,0x0ff007 - .long 0x700007,0x001007,0x002007,0x003007,0x004007,0x005007,0x006007,0x007007 - .long 0x708007,0x009007,0x00a007,0x00b007,0x00c007,0x00d007,0x00e007,0x00f007 - .long 0x710007,0x011007,0x012007,0x013007,0x014007,0x015007,0x016007,0x017007 - .long 0x718007,0x019007,0x01a007,0x01b007,0x01c007,0x01d007,0x01e007,0x01f007 - .long 0x720007,0x021007,0x022007,0x023007,0x024007,0x025007,0x026007,0x027007 - .long 0x728007,0x029007,0x02a007,0x02b007,0x02c007,0x02d007,0x02e007,0x02f007 - .long 0x730007,0x031007,0x032007,0x033007,0x034007,0x035007,0x036007,0x037007 - .long 0x738007,0x039007,0x03a007,0x03b007,0x03c007,0x03d007,0x03e007,0x03f007 - .long 0x740007,0x041007,0x042007,0x043007,0x044007,0x045007,0x046007,0x047007 - .long 0x748007,0x049007,0x04a007,0x04b007,0x04c007,0x04d007,0x04e007,0x04f007 - .long 0x750007,0x051007,0x052007,0x053007,0x054007,0x055007,0x056007,0x057007 - .long 0x758007,0x059007,0x05a007,0x05b007,0x05c007,0x05d007,0x05e007,0x05f007 - .long 0x760007,0x061007,0x062007,0x063007,0x064007,0x065007,0x066007,0x067007 - .long 0x768007,0x069007,0x06a007,0x06b007,0x06c007,0x06d007,0x06e007,0x06f007 - .long 0x770007,0x071007,0x072007,0x073007,0x074007,0x075007,0x076007,0x077007 - .long 0x778007,0x079007,0x07a007,0x07b007,0x07c007,0x07d007,0x07e007,0x07f007 - .long 0x780007,0x081007,0x082007,0x083007,0x084007,0x085007,0x086007,0x087007 - .long 0x788007,0x089007,0x08a007,0x08b007,0x08c007,0x08d007,0x08e007,0x08f007 - .long 0x790007,0x091007,0x092007,0x093007,0x094007,0x095007,0x096007,0x097007 - .long 0x798007,0x099007,0x09a007,0x09b007,0x09c007,0x09d007,0x09e007,0x09f007 - .long 0x7a0007,0x0a1007,0x0a2007,0x0a3007,0x0a4007,0x0a5007,0x0a6007,0x0a7007 - .long 0x7a8007,0x0a9007,0x0aa007,0x0ab007,0x0ac007,0x0ad007,0x0ae007,0x0af007 - .long 0x7b0007,0x0b1007,0x0b2007,0x0b3007,0x0b4007,0x0b5007,0x0b6007,0x0b7007 - .long 0x7b8007,0x0b9007,0x0ba007,0x0bb007,0x0bc007,0x0bd007,0x0be007,0x0bf007 - .long 0x7c0007,0x0c1007,0x0c2007,0x0c3007,0x0c4007,0x0c5007,0x0c6007,0x0c7007 - .long 0x7c8007,0x0c9007,0x0ca007,0x0cb007,0x0cc007,0x0cd007,0x0ce007,0x0cf007 - .long 0x7d0007,0x0d1007,0x0d2007,0x0d3007,0x0d4007,0x0d5007,0x0d6007,0x0d7007 - .long 0x7d8007,0x0d9007,0x0da007,0x0db007,0x0dc007,0x0dd007,0x0de007,0x0df007 - .long 0x7e0007,0x0e1007,0x0e2007,0x0e3007,0x0e4007,0x0e5007,0x0e6007,0x0e7007 - .long 0x7e8007,0x0e9007,0x0ea007,0x0eb007,0x0ec007,0x0ed007,0x0ee007,0x0ef007 - .long 0x7f0007,0x0f1007,0x0f2007,0x0f3007,0x0f4007,0x0f5007,0x0f6007,0x0f7007 - .long 0x7f8007,0x0f9007,0x0fa007,0x0fb007,0x0fc007,0x0fd007,0x0fe007,0x0ff007 -.org 0x4000 -ENTRY(empty_zero_page) - -.org 0x5000 -ENTRY(empty_bad_page) - -.org 0x6000 -ENTRY(empty_bad_pte_table) - -#if CONFIG_X86_PAE - - .org 0x7000 - ENTRY(empty_bad_pmd_table) - - .org 0x8000 - -#else - - .org 0x7000 - -#endif - -/* - * This starts the data section. Note that the above is all - * in the text section because it has alignment requirements - * that we cannot fulfill any other way. - */ -.data - -ALIGN -/* - * This contains typically 140 quadwords, depending on NR_CPUS. - * - * NOTE! Make sure the gdt descriptor in head.S matches this if you - * change anything. - */ -ENTRY(gdt_table) - .quad 0x0000000000000000 /* NULL descriptor */ - .quad 0x0000000000000000 /* not used */ - .quad 0x00cf9a000000ffff /* 0x10 kernel 4GB code at 0x00000000 */ - .quad 0x00cf92000000ffff /* 0x18 kernel 4GB data at 0x00000000 */ - .quad 0x00cffa000000ffff /* 0x23 user 4GB code at 0x00000000 */ - .quad 0x00cff2000000ffff /* 0x2b user 4GB data at 0x00000000 */ - .quad 0x0000000000000000 /* not used */ - .quad 0x0000000000000000 /* not used */ - /* - * The APM segments have byte granularity and their bases - * and limits are set at run time. - */ - .quad 0x0040920000000000 /* 0x40 APM set up for bad BIOS's */ - .quad 0x00409a0000000000 /* 0x48 APM CS code */ - .quad 0x00009a0000000000 /* 0x50 APM CS 16 code (16 bit) */ - .quad 0x0040920000000000 /* 0x58 APM DS data */ - .fill NR_CPUS*4,8,0 /* space for TSS's and LDT's */ - -/* - * This is to aid debugging, the various locking macros will be putting - * code fragments here. When an oops occurs we'd rather know that it's - * inside the .text.lock section rather than as some offset from whatever - * function happens to be last in the .text segment. - */ -.section .text.lock -ENTRY(stext_lock) diff -Nru --exclude-from exclude Linux/arch/i386/kernel/head.c linux-a386/arch/i386/kernel/head.c --- Linux/arch/i386/kernel/head.c Thu Jan 1 01:00:00 1970 +++ linux-a386/arch/i386/kernel/head.c Wed Jan 26 12:07:44 2000 @@ -0,0 +1,193 @@ +/* arch/a386/kernel/head.c */ + +#include +#include + +void +_stext (void) +{ + void start_kernel (void); + int x; + + a386_init (); + a386_set_sp ((char *)&init_task_union + 8192); + + /* FIXMEa386: this belongs in a386, not here */ + unix_munmap (0, A386_MEMORY_BASE); + + /* set up page tables */ + /* a386_enable_paging (); */ + a386_set_ip (start_kernel); +} + +void stext (void) __attribute__ ((alias ("_stext"))); +long stack_start = (long)&init_task_union + 8192; + +long long gdt_table[] __attribute__ ((aligned (4096))) = +{ + 0x0000000000000000, /* NULL descriptor */ + 0x0000000000000000, /* not used */ + 0x00cf9a000000ffff, /* 0x10 kernel 4GB code at 0x00000000 */ + 0x00cf92000000ffff, /* 0x18 kernel 4GB data at 0x00000000 */ + 0x00cffa000000ffff, /* 0x23 user 4GB code at 0x00000000 */ + 0x00cff2000000ffff, /* 0x2b user 4GB data at 0x00000000 */ + 0x0000000000000000, /* not used */ + 0x0000000000000000, /* not used */ + /* + * The APM segments have byte granularity and their bases + * and limits are set at run time. + */ + 0x0040920000000000, /* 0x40 APM set up for bad BIOS's */ + 0x00409a0000000000, /* 0x48 APM CS code */ + 0x00009a0000000000, /* 0x50 APM CS 16 code (16 bit) */ + 0x0040920000000000, /* 0x58 APM DS data */ + 0,0,0,0,0,0,0,0 +}; + +extern char idt_table; + +long idt = (long)&idt_table; +long gdt = (long)&gdt_table; + +long swapper_pg_dir[] __attribute__ ((aligned (4096))) = +{ 0x00102007, 0,0,0,0, + 0x00102007, 0,0,0,0 }; + +long pg0[] __attribute__ ((aligned (4096))) = +{ + 0x000007,0x001007,0x002007,0x003007,0x004007,0x005007,0x006007,0x007007, + 0x008007,0x009007,0x00a007,0x00b007,0x00c007,0x00d007,0x00e007,0x00f007, + 0x010007,0x011007,0x012007,0x013007,0x014007,0x015007,0x016007,0x017007, + 0x018007,0x019007,0x01a007,0x01b007,0x01c007,0x01d007,0x01e007,0x01f007, + 0x020007,0x021007,0x022007,0x023007,0x024007,0x025007,0x026007,0x027007, + 0x028007,0x029007,0x02a007,0x02b007,0x02c007,0x02d007,0x02e007,0x02f007, + 0x030007,0x031007,0x032007,0x033007,0x034007,0x035007,0x036007,0x037007, + 0x038007,0x039007,0x03a007,0x03b007,0x03c007,0x03d007,0x03e007,0x03f007, + 0x040007,0x041007,0x042007,0x043007,0x044007,0x045007,0x046007,0x047007, + 0x048007,0x049007,0x04a007,0x04b007,0x04c007,0x04d007,0x04e007,0x04f007, + 0x050007,0x051007,0x052007,0x053007,0x054007,0x055007,0x056007,0x057007, + 0x058007,0x059007,0x05a007,0x05b007,0x05c007,0x05d007,0x05e007,0x05f007, + 0x060007,0x061007,0x062007,0x063007,0x064007,0x065007,0x066007,0x067007, + 0x068007,0x069007,0x06a007,0x06b007,0x06c007,0x06d007,0x06e007,0x06f007, + 0x070007,0x071007,0x072007,0x073007,0x074007,0x075007,0x076007,0x077007, + 0x078007,0x079007,0x07a007,0x07b007,0x07c007,0x07d007,0x07e007,0x07f007, + 0x080007,0x081007,0x082007,0x083007,0x084007,0x085007,0x086007,0x087007, + 0x088007,0x089007,0x08a007,0x08b007,0x08c007,0x08d007,0x08e007,0x08f007, + 0x090007,0x091007,0x092007,0x093007,0x094007,0x095007,0x096007,0x097007, + 0x098007,0x099007,0x09a007,0x09b007,0x09c007,0x09d007,0x09e007,0x09f007, + 0x0a0007,0x0a1007,0x0a2007,0x0a3007,0x0a4007,0x0a5007,0x0a6007,0x0a7007, + 0x0a8007,0x0a9007,0x0aa007,0x0ab007,0x0ac007,0x0ad007,0x0ae007,0x0af007, + 0x0b0007,0x0b1007,0x0b2007,0x0b3007,0x0b4007,0x0b5007,0x0b6007,0x0b7007, + 0x0b8007,0x0b9007,0x0ba007,0x0bb007,0x0bc007,0x0bd007,0x0be007,0x0bf007, + 0x0c0007,0x0c1007,0x0c2007,0x0c3007,0x0c4007,0x0c5007,0x0c6007,0x0c7007, + 0x0c8007,0x0c9007,0x0ca007,0x0cb007,0x0cc007,0x0cd007,0x0ce007,0x0cf007, + 0x0d0007,0x0d1007,0x0d2007,0x0d3007,0x0d4007,0x0d5007,0x0d6007,0x0d7007, + 0x0d8007,0x0d9007,0x0da007,0x0db007,0x0dc007,0x0dd007,0x0de007,0x0df007, + 0x0e0007,0x0e1007,0x0e2007,0x0e3007,0x0e4007,0x0e5007,0x0e6007,0x0e7007, + 0x0e8007,0x0e9007,0x0ea007,0x0eb007,0x0ec007,0x0ed007,0x0ee007,0x0ef007, + 0x0f0007,0x0f1007,0x0f2007,0x0f3007,0x0f4007,0x0f5007,0x0f6007,0x0f7007, + 0x0f8007,0x0f9007,0x0fa007,0x0fb007,0x0fc007,0x0fd007,0x0fe007,0x0ff007, + 0x100007,0x101007,0x102007,0x103007,0x104007,0x105007,0x106007,0x107007, + 0x108007,0x109007,0x10a007,0x10b007,0x10c007,0x10d007,0x10e007,0x10f007, + 0x110007,0x111007,0x112007,0x113007,0x114007,0x115007,0x116007,0x117007, + 0x118007,0x119007,0x11a007,0x11b007,0x11c007,0x11d007,0x11e007,0x11f007, + 0x120007,0x121007,0x122007,0x123007,0x124007,0x125007,0x126007,0x127007, + 0x128007,0x129007,0x12a007,0x12b007,0x12c007,0x12d007,0x12e007,0x12f007, + 0x130007,0x131007,0x132007,0x133007,0x134007,0x135007,0x136007,0x137007, + 0x138007,0x139007,0x13a007,0x13b007,0x13c007,0x13d007,0x13e007,0x13f007, + 0x140007,0x141007,0x142007,0x143007,0x144007,0x145007,0x146007,0x147007, + 0x148007,0x149007,0x14a007,0x14b007,0x14c007,0x14d007,0x14e007,0x14f007, + 0x150007,0x151007,0x152007,0x153007,0x154007,0x155007,0x156007,0x157007, + 0x158007,0x159007,0x15a007,0x15b007,0x15c007,0x15d007,0x15e007,0x15f007, + 0x160007,0x161007,0x162007,0x163007,0x164007,0x165007,0x166007,0x167007, + 0x168007,0x169007,0x16a007,0x16b007,0x16c007,0x16d007,0x16e007,0x16f007, + 0x170007,0x171007,0x172007,0x173007,0x174007,0x175007,0x176007,0x177007, + 0x178007,0x179007,0x17a007,0x17b007,0x17c007,0x17d007,0x17e007,0x17f007, + 0x180007,0x181007,0x182007,0x183007,0x184007,0x185007,0x186007,0x187007, + 0x188007,0x189007,0x18a007,0x18b007,0x18c007,0x18d007,0x18e007,0x18f007, + 0x190007,0x191007,0x192007,0x193007,0x194007,0x195007,0x196007,0x197007, + 0x198007,0x199007,0x19a007,0x19b007,0x19c007,0x19d007,0x19e007,0x19f007, + 0x1a0007,0x1a1007,0x1a2007,0x1a3007,0x1a4007,0x1a5007,0x1a6007,0x1a7007, + 0x1a8007,0x1a9007,0x1aa007,0x1ab007,0x1ac007,0x1ad007,0x1ae007,0x1af007, + 0x1b0007,0x1b1007,0x1b2007,0x1b3007,0x1b4007,0x1b5007,0x1b6007,0x1b7007, + 0x1b8007,0x1b9007,0x1ba007,0x1bb007,0x1bc007,0x1bd007,0x1be007,0x1bf007, + 0x1c0007,0x1c1007,0x1c2007,0x1c3007,0x1c4007,0x1c5007,0x1c6007,0x1c7007, + 0x1c8007,0x1c9007,0x1ca007,0x1cb007,0x1cc007,0x1cd007,0x1ce007,0x1cf007, + 0x1d0007,0x1d1007,0x1d2007,0x1d3007,0x1d4007,0x1d5007,0x1d6007,0x1d7007, + 0x1d8007,0x1d9007,0x1da007,0x1db007,0x1dc007,0x1dd007,0x1de007,0x1df007, + 0x1e0007,0x1e1007,0x1e2007,0x1e3007,0x1e4007,0x1e5007,0x1e6007,0x1e7007, + 0x1e8007,0x1e9007,0x1ea007,0x1eb007,0x1ec007,0x1ed007,0x1ee007,0x1ef007, + 0x1f0007,0x1f1007,0x1f2007,0x1f3007,0x1f4007,0x1f5007,0x1f6007,0x1f7007, + 0x1f8007,0x1f9007,0x1fa007,0x1fb007,0x1fc007,0x1fd007,0x1fe007,0x1ff007, + 0x200007,0x201007,0x202007,0x203007,0x204007,0x205007,0x206007,0x207007, + 0x208007,0x209007,0x20a007,0x20b007,0x20c007,0x20d007,0x20e007,0x20f007, + 0x210007,0x211007,0x212007,0x213007,0x214007,0x215007,0x216007,0x217007, + 0x218007,0x219007,0x21a007,0x21b007,0x21c007,0x21d007,0x21e007,0x21f007, + 0x220007,0x221007,0x222007,0x223007,0x224007,0x225007,0x226007,0x227007, + 0x228007,0x229007,0x22a007,0x22b007,0x22c007,0x22d007,0x22e007,0x22f007, + 0x230007,0x231007,0x232007,0x233007,0x234007,0x235007,0x236007,0x237007, + 0x238007,0x239007,0x23a007,0x23b007,0x23c007,0x23d007,0x23e007,0x23f007, + 0x240007,0x241007,0x242007,0x243007,0x244007,0x245007,0x246007,0x247007, + 0x248007,0x249007,0x24a007,0x24b007,0x24c007,0x24d007,0x24e007,0x24f007, + 0x250007,0x251007,0x252007,0x253007,0x254007,0x255007,0x256007,0x257007, + 0x258007,0x259007,0x25a007,0x25b007,0x25c007,0x25d007,0x25e007,0x25f007, + 0x260007,0x261007,0x262007,0x263007,0x264007,0x265007,0x266007,0x267007, + 0x268007,0x269007,0x26a007,0x26b007,0x26c007,0x26d007,0x26e007,0x26f007, + 0x270007,0x271007,0x272007,0x273007,0x274007,0x275007,0x276007,0x277007, + 0x278007,0x279007,0x27a007,0x27b007,0x27c007,0x27d007,0x27e007,0x27f007, + 0x280007,0x281007,0x282007,0x283007,0x284007,0x285007,0x286007,0x287007, + 0x288007,0x289007,0x28a007,0x28b007,0x28c007,0x28d007,0x28e007,0x28f007, + 0x290007,0x291007,0x292007,0x293007,0x294007,0x295007,0x296007,0x297007, + 0x298007,0x299007,0x29a007,0x29b007,0x29c007,0x29d007,0x29e007,0x29f007, + 0x2a0007,0x2a1007,0x2a2007,0x2a3007,0x2a4007,0x2a5007,0x2a6007,0x2a7007, + 0x2a8007,0x2a9007,0x2aa007,0x2ab007,0x2ac007,0x2ad007,0x2ae007,0x2af007, + 0x2b0007,0x2b1007,0x2b2007,0x2b3007,0x2b4007,0x2b5007,0x2b6007,0x2b7007, + 0x2b8007,0x2b9007,0x2ba007,0x2bb007,0x2bc007,0x2bd007,0x2be007,0x2bf007, + 0x2c0007,0x2c1007,0x2c2007,0x2c3007,0x2c4007,0x2c5007,0x2c6007,0x2c7007, + 0x2c8007,0x2c9007,0x2ca007,0x2cb007,0x2cc007,0x2cd007,0x2ce007,0x2cf007, + 0x2d0007,0x2d1007,0x2d2007,0x2d3007,0x2d4007,0x2d5007,0x2d6007,0x2d7007, + 0x2d8007,0x2d9007,0x2da007,0x2db007,0x2dc007,0x2dd007,0x2de007,0x2df007, + 0x2e0007,0x2e1007,0x2e2007,0x2e3007,0x2e4007,0x2e5007,0x2e6007,0x2e7007, + 0x2e8007,0x2e9007,0x2ea007,0x2eb007,0x2ec007,0x2ed007,0x2ee007,0x2ef007, + 0x2f0007,0x2f1007,0x2f2007,0x2f3007,0x2f4007,0x2f5007,0x2f6007,0x2f7007, + 0x2f8007,0x2f9007,0x2fa007,0x2fb007,0x2fc007,0x2fd007,0x2fe007,0x2ff007, + 0x300007,0x301007,0x302007,0x303007,0x304007,0x305007,0x306007,0x307007, + 0x308007,0x309007,0x30a007,0x30b007,0x30c007,0x30d007,0x30e007,0x30f007, + 0x310007,0x311007,0x312007,0x313007,0x314007,0x315007,0x316007,0x317007, + 0x318007,0x319007,0x31a007,0x31b007,0x31c007,0x31d007,0x31e007,0x31f007, + 0x320007,0x321007,0x322007,0x323007,0x324007,0x325007,0x326007,0x327007, + 0x328007,0x329007,0x32a007,0x32b007,0x32c007,0x32d007,0x32e007,0x32f007, + 0x330007,0x331007,0x332007,0x333007,0x334007,0x335007,0x336007,0x337007, + 0x338007,0x339007,0x33a007,0x33b007,0x33c007,0x33d007,0x33e007,0x33f007, + 0x340007,0x341007,0x342007,0x343007,0x344007,0x345007,0x346007,0x347007, + 0x348007,0x349007,0x34a007,0x34b007,0x34c007,0x34d007,0x34e007,0x34f007, + 0x350007,0x351007,0x352007,0x353007,0x354007,0x355007,0x356007,0x357007, + 0x358007,0x359007,0x35a007,0x35b007,0x35c007,0x35d007,0x35e007,0x35f007, + 0x360007,0x361007,0x362007,0x363007,0x364007,0x365007,0x366007,0x367007, + 0x368007,0x369007,0x36a007,0x36b007,0x36c007,0x36d007,0x36e007,0x36f007, + 0x370007,0x371007,0x372007,0x373007,0x374007,0x375007,0x376007,0x377007, + 0x378007,0x379007,0x37a007,0x37b007,0x37c007,0x37d007,0x37e007,0x37f007, + 0x380007,0x381007,0x382007,0x383007,0x384007,0x385007,0x386007,0x387007, + 0x388007,0x389007,0x38a007,0x38b007,0x38c007,0x38d007,0x38e007,0x38f007, + 0x390007,0x391007,0x392007,0x393007,0x394007,0x395007,0x396007,0x397007, + 0x398007,0x399007,0x39a007,0x39b007,0x39c007,0x39d007,0x39e007,0x39f007, + 0x3a0007,0x3a1007,0x3a2007,0x3a3007,0x3a4007,0x3a5007,0x3a6007,0x3a7007, + 0x3a8007,0x3a9007,0x3aa007,0x3ab007,0x3ac007,0x3ad007,0x3ae007,0x3af007, + 0x3b0007,0x3b1007,0x3b2007,0x3b3007,0x3b4007,0x3b5007,0x3b6007,0x3b7007, + 0x3b8007,0x3b9007,0x3ba007,0x3bb007,0x3bc007,0x3bd007,0x3be007,0x3bf007, + 0x3c0007,0x3c1007,0x3c2007,0x3c3007,0x3c4007,0x3c5007,0x3c6007,0x3c7007, + 0x3c8007,0x3c9007,0x3ca007,0x3cb007,0x3cc007,0x3cd007,0x3ce007,0x3cf007, + 0x3d0007,0x3d1007,0x3d2007,0x3d3007,0x3d4007,0x3d5007,0x3d6007,0x3d7007, + 0x3d8007,0x3d9007,0x3da007,0x3db007,0x3dc007,0x3dd007,0x3de007,0x3df007, + 0x3e0007,0x3e1007,0x3e2007,0x3e3007,0x3e4007,0x3e5007,0x3e6007,0x3e7007, + 0x3e8007,0x3e9007,0x3ea007,0x3eb007,0x3ec007,0x3ed007,0x3ee007,0x3ef007, + 0x3f0007,0x3f1007,0x3f2007,0x3f3007,0x3f4007,0x3f5007,0x3f6007,0x3f7007, + 0x3f8007,0x3f9007,0x3fa007,0x3fb007,0x3fc007,0x3fd007,0x3fe007,0x3ff007, +}; + +char empty_zero_page[4096] __attribute__ ((aligned (4096))); +char empty_bad_page[4096] __attribute__ ((aligned (4096))); +char empty_bad_pte_table[4096] __attribute__ ((aligned (4096))); +char empty_bad_pmd_table[4096] __attribute__ ((aligned (4096))); + +char stext_lock __attribute ((section (".text.lock"))) = 0; diff -Nru --exclude-from exclude Linux/arch/i386/kernel/i8259.c linux-a386/arch/i386/kernel/i8259.c --- Linux/arch/i386/kernel/i8259.c Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/kernel/i8259.c Wed Jan 26 12:07:44 2000 @@ -22,6 +22,8 @@ #include +#include + /* * Common place to define all x86 IRQ vectors * @@ -413,21 +415,25 @@ { int i; +#if 0 /* FIXMEa386 */ #ifndef CONFIG_X86_VISWS_APIC init_ISA_irqs(); #else init_VISWS_APIC_irqs(); #endif +#endif /* * Cover the whole vector space, no vector can escape * us. (some of these will be overridden and become * 'special' SMP interrupts) */ +#if 0 /* FIXMEa386 */ for (i = 0; i < NR_IRQS; i++) { int vector = FIRST_EXTERNAL_VECTOR + i; if (vector != SYSCALL_VECTOR) set_intr_gate(vector, interrupt[i]); } +#endif #ifdef CONFIG_SMP /* @@ -462,12 +468,19 @@ * Set the clock to HZ Hz, we already have a valid * vector now: */ +#if 1 + a386_timer_set_hz (HZ); + a386_timer_start (); +#else outb_p(0x34,0x43); /* binary, mode 2, LSB/MSB, ch 0 */ outb_p(LATCH & 0xff , 0x40); /* LSB */ outb(LATCH >> 8 , 0x40); /* MSB */ +#endif +#if 0 #ifndef CONFIG_VISWS setup_irq(2, &irq2); setup_irq(13, &irq13); +#endif #endif } diff -Nru --exclude-from exclude Linux/arch/i386/kernel/ioport.c linux-a386/arch/i386/kernel/ioport.c --- Linux/arch/i386/kernel/ioport.c Tue Jul 20 00:22:48 1999 +++ linux-a386/arch/i386/kernel/ioport.c Tue Jan 25 17:04:36 2000 @@ -101,7 +101,10 @@ asmlinkage int sys_iopl(unsigned long unused) { struct pt_regs * regs = (struct pt_regs *) &unused; - unsigned int level = regs->ebx; + unsigned int level = a386_context_get_arg (®s->context, 0); + + a386_panic ("sys_iopl"); +#if 0 unsigned int old = (regs->eflags >> 12) & 3; if (level > 3) @@ -112,5 +115,6 @@ return -EPERM; } regs->eflags = (regs->eflags & 0xffffcfff) | (level << 12); +#endif return 0; } diff -Nru --exclude-from exclude Linux/arch/i386/kernel/irq.c linux-a386/arch/i386/kernel/irq.c --- Linux/arch/i386/kernel/irq.c Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/kernel/irq.c Tue Jan 25 17:04:36 2000 @@ -558,7 +558,7 @@ * 0 return value means that this irq is already being * handled by some other CPU. (or is disabled) */ - int irq = regs.orig_eax & 0xff; /* high bits used in ret_from_ code */ + int irq = pt_get_syscall (®s) & 0xff; /* high bits used in ret_from_ code */ int cpu = smp_processor_id(); irq_desc_t *desc; struct irqaction * action; diff -Nru --exclude-from exclude Linux/arch/i386/kernel/pci-pc.c linux-a386/arch/i386/kernel/pci-pc.c --- Linux/arch/i386/kernel/pci-pc.c Wed Jan 12 04:12:38 2000 +++ linux-a386/arch/i386/kernel/pci-pc.c Tue Jan 25 17:04:36 2000 @@ -223,6 +223,7 @@ unsigned int tmp; unsigned long flags; +#if 0 /* FIXMEa386 */ __save_flags(flags); __cli(); /* @@ -258,6 +259,7 @@ } __restore_flags(flags); +#endif return NULL; } diff -Nru --exclude-from exclude Linux/arch/i386/kernel/process.c linux-a386/arch/i386/kernel/process.c --- Linux/arch/i386/kernel/process.c Tue Dec 21 00:43:01 1999 +++ linux-a386/arch/i386/kernel/process.c Wed Jan 26 12:07:44 2000 @@ -44,6 +44,8 @@ #include +#include + asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); int hlt_counter=0; @@ -74,8 +76,8 @@ */ static void default_idle(void) { - if (current_cpu_data.hlt_works_ok && !hlt_counter) - asm volatile("sti ; hlt" : : : "memory"); + if (!hlt_counter) + a386_interrupt_wait (); } /* @@ -210,120 +212,19 @@ */ void machine_real_restart(unsigned char *code, int length) { - cli(); - - /* Write zero to CMOS register number 0x0f, which the BIOS POST - routine will recognize as telling it to do a proper reboot. (Well - that's what this book in front of me says -- it may only apply to - the Phoenix BIOS though, it's not clear). At the same time, - disable NMIs by setting the top bit in the CMOS address register, - as we're about to do peculiar things to the CPU. I'm not sure if - `outb_p' is needed instead of just `outb'. Use it to be on the - safe side. */ - - outb_p (0x8f, 0x70); - outb_p (0x00, 0x71); - - /* Remap the kernel at virtual address zero, as well as offset zero - from the kernel segment. This assumes the kernel segment starts at - virtual address PAGE_OFFSET. */ - - memcpy (swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS, - sizeof (swapper_pg_dir [0]) * KERNEL_PGD_PTRS); - - /* Make sure the first page is mapped to the start of physical memory. - It is normally not mapped, to trap kernel NULL pointer dereferences. */ - - pg0[0] = _PAGE_RW | _PAGE_PRESENT; - - /* - * Use `swapper_pg_dir' as our page directory. - */ - asm volatile("movl %0,%%cr3": :"r" (__pa(swapper_pg_dir))); - - /* Write 0x1234 to absolute memory location 0x472. The BIOS reads - this on booting to tell it to "Bypass memory test (also warm - boot)". This seems like a fairly standard thing that gets set by - REBOOT.COM programs, and the previous reset routine did this - too. */ - - *((unsigned short *)0x472) = reboot_mode; - - /* For the switch to real mode, copy some code to low memory. It has - to be in the first 64k because it is running in 16-bit mode, and it - has to have the same physical and virtual address, because it turns - off paging. Copy it near the end of the first page, out of the way - of BIOS variables. */ - - memcpy ((void *) (0x1000 - sizeof (real_mode_switch) - 100), - real_mode_switch, sizeof (real_mode_switch)); - memcpy ((void *) (0x1000 - 100), code, length); - - /* Set up the IDT for real mode. */ - - __asm__ __volatile__ ("lidt %0" : : "m" (real_mode_idt)); - - /* Set up a GDT from which we can load segment descriptors for real - mode. The GDT is not used in real mode; it is just needed here to - prepare the descriptors. */ - - __asm__ __volatile__ ("lgdt %0" : : "m" (real_mode_gdt)); - - /* Load the data segment registers, and thus the descriptors ready for - real mode. The base address of each segment is 0x100, 16 times the - selector value being loaded here. This is so that the segment - registers don't have to be reloaded after switching to real mode: - the values are consistent for real mode operation already. */ - - __asm__ __volatile__ ("movl $0x0010,%%eax\n" - "\tmovl %%eax,%%ds\n" - "\tmovl %%eax,%%es\n" - "\tmovl %%eax,%%fs\n" - "\tmovl %%eax,%%gs\n" - "\tmovl %%eax,%%ss" : : : "eax"); - - /* Jump to the 16-bit code that we copied earlier. It disables paging - and the cache, switches to real mode, and jumps to the BIOS reset - entry point. */ - - __asm__ __volatile__ ("ljmp $0x0008,%0" - : - : "i" ((void *) (0x1000 - sizeof (real_mode_switch) - 100))); + /* FIXMEa386: reboot instead? */ + a386_halt (); } void machine_restart(char * __unused) { -#if __SMP__ - /* - * Stop all CPUs and turn off local APICs and the IO-APIC, so - * other OSs see a clean IRQ state. - */ - smp_send_stop(); - disable_IO_APIC(); -#endif - - if(!reboot_thru_bios) { - /* rebooting needs to touch the page at absolute addr 0 */ - *((unsigned short *)__va(0x472)) = reboot_mode; - for (;;) { - int i; - for (i=0; i<100; i++) { - kb_wait(); - udelay(50); - outb(0xfe,0x64); /* pulse reset low */ - udelay(50); - } - /* That didn't work - force a triple fault.. */ - __asm__ __volatile__("lidt %0": :"m" (no_idt)); - __asm__ __volatile__("int3"); - } - } - - machine_real_restart(jump_to_bios, sizeof(jump_to_bios)); + /* FIXMEa386: reboot instead? */ + a386_halt (); } void machine_halt(void) { + a386_halt (); } void machine_power_off(void) @@ -337,6 +238,12 @@ { long cr0 = 0L, cr2 = 0L, cr3 = 0L; + a386_panic ("show_regs"); + +#if 0 /* FIXMEa386: do the right thing here */ + + regs = (struct pt_regs *)regs->context.regs; + printk("\n"); printk("EIP: %04x:[<%08lx>]",0xffff & regs->xcs,regs->eip); if (regs->xcs & 3) @@ -349,10 +256,13 @@ printk(" DS: %04x ES: %04x\n", 0xffff & regs->xds,0xffff & regs->xes); +#if 0 /* FIXMEa386 */ __asm__("movl %%cr0, %0": "=r" (cr0)); __asm__("movl %%cr2, %0": "=r" (cr2)); __asm__("movl %%cr3, %0": "=r" (cr3)); printk("CR0: %08lx CR2: %08lx CR3: %08lx\n", cr0, cr2, cr3); +#endif +#endif } /* @@ -377,28 +287,26 @@ */ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) { - long retval, d0; + long result; - __asm__ __volatile__( - "movl %%esp,%%esi\n\t" - "int $0x80\n\t" /* Linux/i386 system call */ - "cmpl %%esp,%%esi\n\t" /* child or parent? */ - "je 1f\n\t" /* parent - jump */ - /* Load the argument into eax, and push it. That way, it does - * not matter whether the called function is compiled with - * -mregparm or not. */ - "movl %4,%%eax\n\t" - "pushl %%eax\n\t" - "call *%5\n\t" /* call fn */ - "movl %3,%0\n\t" /* exit */ - "int $0x80\n" - "1:\t" - :"=&a" (retval), "=&S" (d0) - :"0" (__NR_clone), "i" (__NR_exit), - "r" (arg), "r" (fn), - "b" (flags | CLONE_VM) - : "memory"); - return retval; + a386_set_arg (0, flags | CLONE_VM); + a386_set_arg (1, 0); + a386_set_arg (2, fn); + a386_set_arg (3, arg); + result = a386_trap (__NR_clone); + if (result == 0) + { + int (*fn) (void *); + void *arg; + + /* FIXMEa386 */ + asm ("movl %%edx,%0; movl %%esi,%1" : "=m" (fn), "=m" (arg)); + + a386_set_arg (0, fn (arg)); + a386_trap (__NR_exit); + } + + return result; } /* @@ -477,8 +385,8 @@ childregs = ((struct pt_regs *) (THREAD_SIZE + (unsigned long) p)) - 1; struct_cpy(childregs, regs); - childregs->eax = 0; - childregs->esp = esp; + pt_set_result (childregs, 0); + pt_set_sp (childregs, esp); p->thread.esp = (unsigned long) childregs; p->thread.esp0 = (unsigned long) (childregs+1); @@ -518,6 +426,8 @@ { int i; + a386_panic ("dump_thread"); +#if 0 /* FIXMEa386 */ /* changed the size calculations - should hopefully work better. lbt */ dump->magic = CMAGIC; dump->start_code = 0; @@ -551,6 +461,7 @@ dump->regs.ss = regs->xss; dump->u_fpvalid = dump_fpu (regs, &dump->i387); +#endif } /* @@ -602,18 +513,21 @@ * Save away %fs and %gs. No need to save %es and %ds, as * those are always kernel segments while inside the kernel. */ + /* FIXMEa386: these shouldn't be necesary */ asm volatile("movl %%fs,%0":"=m" (*(int *)&prev->fs)); asm volatile("movl %%gs,%0":"=m" (*(int *)&prev->gs)); /* * Restore %fs and %gs. */ + /* FIXMEa386: these shouldn't be necesary */ loadsegment(fs, next->fs); loadsegment(gs, next->gs); /* * Now maybe reload the debug registers */ + /* FIXMEa386: these shouldn't be necesary */ if (next->debugreg[7]){ loaddebug(next, 0); loaddebug(next, 1); @@ -650,7 +564,7 @@ asmlinkage int sys_fork(struct pt_regs regs) { - return do_fork(SIGCHLD, regs.esp, ®s); + return do_fork(SIGCHLD, pt_get_sp (®s), ®s); } asmlinkage int sys_clone(struct pt_regs regs) @@ -658,10 +572,10 @@ unsigned long clone_flags; unsigned long newsp; - clone_flags = regs.ebx; - newsp = regs.ecx; + clone_flags = a386_context_get_arg (®s.context, 0); + newsp = a386_context_get_arg (®s.context, 1); if (!newsp) - newsp = regs.esp; + newsp = pt_get_sp (®s); return do_fork(clone_flags, newsp, ®s); } @@ -677,7 +591,8 @@ */ asmlinkage int sys_vfork(struct pt_regs regs) { - return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, ®s); + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, + pt_get_sp (®s), ®s); } /* @@ -689,11 +604,14 @@ char * filename; lock_kernel(); - filename = getname((char *) regs.ebx); + filename = getname((char *)a386_context_get_arg (®s.context, 0)); error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; - error = do_execve(filename, (char **) regs.ecx, (char **) regs.edx, ®s); + error = do_execve(filename, + (char **)a386_context_get_arg (®s.context, 1), + (char **)a386_context_get_arg (®s.context, 2), + ®s); if (error == 0) current->flags &= ~PF_DTRACE; putname(filename); diff -Nru --exclude-from exclude Linux/arch/i386/kernel/setup.c linux-a386/arch/i386/kernel/setup.c --- Linux/arch/i386/kernel/setup.c Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/kernel/setup.c Wed Jan 26 12:07:44 2000 @@ -76,6 +76,8 @@ #include #include +#include + /* * Machine setup.. */ @@ -125,7 +127,11 @@ /* * This is set up by the setup-routine at boot-time */ +#if 1 /* FIXMEa386 */ +#define PARAM ((unsigned char *)0x4000 + A386_MEMORY_BASE) +#else #define PARAM ((unsigned char *)empty_zero_page) +#endif #define SCREEN_INFO (*(struct screen_info *) (PARAM+0)) #define EXT_MEM_K (*(unsigned short *) (PARAM+2)) #define ALT_MEM_K (*(unsigned long *) (PARAM+0x1e0)) @@ -411,63 +417,7 @@ void __init setup_memory_region(void) { -#define E820_DEBUG 1 -#ifdef E820_DEBUG - int i; -#endif - - /* - * If we're lucky and live on a modern system, the setup code - * will have given us a memory map that we can use to properly - * set up memory. If we aren't, we'll fake a memory map. - * - * We check to see that the memory map contains at least 2 elements - * before we'll use it, because the detection code in setup.S may - * not be perfect and most every PC known to man has two memory - * regions: one from 0 to 640k, and one from 1mb up. (The IBM - * thinkpad 560x, for example, does not cooperate with the memory - * detection code.) - */ - if (E820_MAP_NR > 1) { - /* got a memory map; copy it into a safe place. - */ - e820.nr_map = E820_MAP_NR; - if (e820.nr_map > E820MAX) - e820.nr_map = E820MAX; - memcpy(e820.map, E820_MAP, e820.nr_map * sizeof e820.map[0]); -#ifdef E820_DEBUG - for (i=0; i < e820.nr_map; i++) { - printk("e820: %08x @ %08x ", (int)e820.map[i].size, - (int)e820.map[i].addr); - switch (e820.map[i].type) { - case E820_RAM: printk("(usable)\n"); - break; - case E820_RESERVED: - printk("(reserved)\n"); - break; - case E820_ACPI: - printk("(ACPI data)\n"); - break; - case E820_NVS: - printk("(ACPI NVS)\n"); - break; - default: printk("type %lu\n", e820.map[i].type); - break; - } - } -#endif - } - else { - /* otherwise fake a memory map; one section from 0k->640k, - * the next section from 1mb->appropriate_mem_k - */ - unsigned long mem_size; - - mem_size = (ALT_MEM_K < EXT_MEM_K) ? EXT_MEM_K : ALT_MEM_K; - - add_memory_region(0, LOWMEMSIZE(), E820_RAM); - add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM); - } + add_memory_region(0, a386_memory_size (), E820_RAM); } /* setup_memory_region */ @@ -736,7 +686,9 @@ * Request address space for all standard RAM and ROM resources * and also for regions reported as reserved by the e820. */ +#if 0 /* FIXMEa386 */ probe_roms(); +#endif for (i = 0; i < e820.nr_map; i++) { struct resource *res; if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) @@ -1527,16 +1479,22 @@ cpus_initialized++; printk("Initializing CPU#%d\n", nr); +#if 0 /* FIXMEa386 */ if (cpu_has_pse) clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); __asm__ __volatile__("lgdt %0": "=m" (gdt_descr)); __asm__ __volatile__("lidt %0": "=m" (idt_descr)); +#endif /* * Delete NT */ +#if 1 /* FIXMEa386 */ + a386_set_sp ((void *)((a386_address_t)a386_get_sp () & 0xffffbfff)); +#else __asm__("pushfl ; andl $0xffffbfff,(%esp) ; popfl"); +#endif /* * set up and load the per-CPU TSS and LDT @@ -1546,23 +1504,27 @@ t->esp0 = current->thread.esp0; set_tss_desc(nr,t); gdt_table[__TSS(nr)].b &= 0xfffffdff; - load_TR(nr); - load_LDT(&init_mm); + /* load_TR(nr); FIXMEa386 */ + /* load_LDT(&init_mm); FIXMEa386 */ /* * Clear all 6 debug registers: */ +#if 0 /* FIXMEa386 */ #define CD(register) __asm__("movl %0,%%db" #register ::"r"(0) ); CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7); #undef CD +#endif /* * Force FPU initialization: */ current->flags &= ~PF_USEDFPU; current->used_math = 0; +#if 0 /* FIXMEa386 */ stts(); +#endif } diff -Nru --exclude-from exclude Linux/arch/i386/kernel/signal.c linux-a386/arch/i386/kernel/signal.c --- Linux/arch/i386/kernel/signal.c Tue Jan 11 03:15:58 2000 +++ linux-a386/arch/i386/kernel/signal.c Wed Jan 26 12:07:44 2000 @@ -23,6 +23,8 @@ #include #include +#include + #define DEBUG_SIG 0 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) @@ -47,7 +49,7 @@ recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - regs->eax = -EINTR; + pt_set_result (regs, -EINTR); while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); @@ -76,7 +78,7 @@ recalc_sigpending(current); spin_unlock_irq(¤t->sigmask_lock); - regs->eax = -EINTR; + pt_set_result (regs, -EINTR); while (1) { current->state = TASK_INTERRUPTIBLE; schedule(); @@ -121,7 +123,7 @@ sys_sigaltstack(const stack_t *uss, stack_t *uoss) { struct pt_regs *regs = (struct pt_regs *) &uss; - return do_sigaltstack(uss, uoss, regs->esp); + return do_sigaltstack(uss, uoss, pt_get_sp (regs)); } @@ -179,6 +181,9 @@ { unsigned int err = 0; + a386_panic ("restore_sigcontext"); + +#if 0 /* FIXMEa386 */ #define COPY(x) err |= __get_user(regs->x, &sc->x) #define COPY_SEG(seg) \ @@ -231,6 +236,7 @@ err |= __get_user(*peax, &sc->eax); return err; +#endif badframe: return 1; } @@ -238,7 +244,8 @@ asmlinkage int sys_sigreturn(unsigned long __unused) { struct pt_regs *regs = (struct pt_regs *) &__unused; - struct sigframe *frame = (struct sigframe *)(regs->esp - 8); + struct sigframe *frame = + (struct sigframe *)(pt_get_sp (regs) - 8); sigset_t set; int eax; @@ -268,7 +275,8 @@ asmlinkage int sys_rt_sigreturn(unsigned long __unused) { struct pt_regs *regs = (struct pt_regs *) &__unused; - struct rt_sigframe *frame = (struct rt_sigframe *)(regs->esp - 4); + struct rt_sigframe *frame = + (struct rt_sigframe *)(pt_get_sp (regs) - 4); sigset_t set; stack_t st; int eax; @@ -291,7 +299,7 @@ goto badframe; /* It is more difficult to avoid calling this function than to call it and ignore errors. */ - do_sigaltstack(&st, NULL, regs->esp); + do_sigaltstack(&st, NULL, pt_get_sp (regs)); return eax; @@ -339,6 +347,9 @@ { int tmp, err = 0; + a386_panic ("setup_sigcontext"); + +#if 0 /* FIXMEa386 */ tmp = 0; __asm__("movl %%gs,%w0" : "=r"(tmp): "0"(tmp)); err |= __put_user(tmp, (unsigned int *)&sc->gs); @@ -372,6 +383,7 @@ /* non-iBCS2 extensions.. */ err |= __put_user(mask, &sc->oldmask); err |= __put_user(current->thread.cr2, &sc->cr2); +#endif return err; } @@ -385,7 +397,7 @@ unsigned long esp; /* Default to using normal stack */ - esp = regs->esp; + esp = pt_get_sp (regs); /* This is the X/Open sanctioned signal stack switching. */ if (ka->sa.sa_flags & SA_ONSTACK) { @@ -394,7 +406,7 @@ } /* This is the legacy signal stack switching. */ - else if ((regs->xss & 0xffff) != __USER_DS && + else if (1 && /* FIXMEa386 (regs->xss & 0xffff) != __USER_DS && */ !(ka->sa.sa_flags & SA_RESTORER) && ka->sa.sa_restorer) { esp = (unsigned long) ka->sa.sa_restorer; @@ -444,15 +456,17 @@ goto give_sigsegv; /* Set up registers for signal handler */ - regs->esp = (unsigned long) frame; - regs->eip = (unsigned long) ka->sa.sa_handler; + pt_set_sp (regs, (void *)frame); + pt_set_ip (regs, (void *)ka->sa.sa_handler); +#if 0 /* FIXMEa386 */ set_fs(USER_DS); regs->xds = __USER_DS; regs->xes = __USER_DS; regs->xss = __USER_DS; regs->xcs = __USER_CS; regs->eflags &= ~TF_MASK; +#endif #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", @@ -492,7 +506,7 @@ err |= __put_user(0, &frame->uc.uc_flags); err |= __put_user(0, &frame->uc.uc_link); err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); - err |= __put_user(sas_ss_flags(regs->esp), + err |= __put_user(sas_ss_flags(pt_get_sp (regs)), &frame->uc.uc_stack.ss_flags); err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate, @@ -515,15 +529,17 @@ goto give_sigsegv; /* Set up registers for signal handler */ - regs->esp = (unsigned long) frame; - regs->eip = (unsigned long) ka->sa.sa_handler; + pt_set_sp (regs, (void *)frame); + pt_set_ip (regs, (void *)ka->sa.sa_handler); +#if 0 /* FIXMEa386 */ set_fs(USER_DS); regs->xds = __USER_DS; regs->xes = __USER_DS; regs->xss = __USER_DS; regs->xcs = __USER_CS; regs->eflags &= ~TF_MASK; +#endif #if DEBUG_SIG printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", @@ -547,22 +563,27 @@ siginfo_t *info, sigset_t *oldset, struct pt_regs * regs) { /* Are we from a system call? */ - if (regs->orig_eax >= 0) { + if (pt_get_syscall (regs) >= 0) { /* If so, check system call restarting.. */ - switch (regs->eax) { + switch (pt_get_result (regs)) { case -ERESTARTNOHAND: - regs->eax = -EINTR; + pt_set_result (regs, -EINTR); break; case -ERESTARTSYS: if (!(ka->sa.sa_flags & SA_RESTART)) { - regs->eax = -EINTR; + pt_set_result (regs, -EINTR); break; } /* fallthrough */ - case -ERESTARTNOINTR: - regs->eax = regs->orig_eax; - regs->eip -= 2; + case -ERESTARTNOINTR: { + a386_address_t ip; + a386_word_t syscall; + syscall = pt_get_syscall (regs); + pt_set_result (regs, syscall); + ip = pt_get_ip (regs); + pt_set_ip (regs, ip - 2); + } } } @@ -604,7 +625,7 @@ * kernel mode. Just return without doing anything * if so. */ - if ((regs->xcs & 3) != 3) + if (kernel_mode (regs)) return 1; if (!oldset) @@ -710,13 +731,18 @@ } /* Did we come from a system call? */ - if (regs->orig_eax >= 0) { + if (pt_get_syscall (regs) >= 0) { /* Restart the system call - no handlers present */ - if (regs->eax == -ERESTARTNOHAND || - regs->eax == -ERESTARTSYS || - regs->eax == -ERESTARTNOINTR) { - regs->eax = regs->orig_eax; - regs->eip -= 2; + a386_word_t result = pt_get_result (regs); + if (result == -ERESTARTNOHAND || + result == -ERESTARTSYS || + result == -ERESTARTNOINTR) { + a386_address_t ip; + a386_word_t syscall; + syscall = pt_get_syscall (regs); + pt_set_result (regs, syscall); + ip = pt_get_ip (regs); + pt_set_ip (regs, ip - 2); } } return 0; diff -Nru --exclude-from exclude Linux/arch/i386/kernel/time.c linux-a386/arch/i386/kernel/time.c --- Linux/arch/i386/kernel/time.c Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/kernel/time.c Wed Jan 26 12:07:44 2000 @@ -63,6 +63,7 @@ */ #include +#include unsigned long cpu_hz; /* Detected as we calibrate the TSC */ @@ -243,7 +244,11 @@ unsigned long usec, sec; read_lock_irqsave(&xtime_lock, flags); +#if 0 /* FIXMEa386 */ usec = do_gettimeoffset(); +#else + usec = 0; +#endif { unsigned long lost = lost_ticks; if (lost) @@ -271,7 +276,9 @@ * Discover what correction gettimeofday * would have done, and then undo it! */ +#if 0 /* FIXMEa386 */ tv->tv_usec -= do_gettimeoffset(); +#endif while (tv->tv_usec < 0) { tv->tv_usec += 1000000; @@ -358,7 +365,7 @@ * timer_interrupt() needs to keep up the real-time clock, * as well as call the "do_timer()" routine every clocktick */ -static inline void do_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) +static inline void do_timer_interrupt(struct pt_regs *regs) { #ifdef CONFIG_VISWS /* Clear the interrupt */ @@ -372,7 +379,7 @@ */ #ifndef CONFIG_X86_LOCAL_APIC if (!user_mode(regs)) - x86_do_profile(regs->eip); + x86_do_profile(pt_get_ip(regs)); #else if (!smp_found_config) smp_local_timer_interrupt(regs); @@ -383,6 +390,7 @@ * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be * called as close as possible to 500 ms before the new second starts. */ +#if 0 /* FIXMEa386 */ if ((time_status & STA_UNSYNC) == 0 && xtime.tv_sec > last_rtc_update + 660 && xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 && @@ -392,6 +400,7 @@ else last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */ } +#endif #ifdef CONFIG_MCA if( MCA_bus ) { @@ -430,6 +439,7 @@ */ write_lock(&xtime_lock); +#if 0 if (use_tsc) { /* @@ -456,11 +466,135 @@ count = ((LATCH-1) - count) * TICK_SIZE; delay_at_last_interrupt = (count + LATCH/2) / LATCH; } +#endif - do_timer_interrupt(irq, NULL, regs); + do_timer_interrupt(regs); write_unlock(&xtime_lock); +} +static void real_timer_interrupt (void) +{ + /* FIXMEa386 */ + extern a386_result_t _a386_tmp_result; + extern a386_address_t _a386_tmp_ip, _a386_tmp_sp; + struct pt_regs *regs; + + /* SAVE_ALL */ + extern a386_word_t _a386_regs[17]; + +#if 1 + struct a386_context context; + regs = &context.regs; + timer_interrupt (0, 0, regs); + return; +#endif + +a386_putchar ('$'); + asm volatile ( + "pushl %0+4*16;" /* interrupts_enabled */ + "pushl %0+4*15;" /* kernel_mode */ + "pushl %0+4*14;" /* xss */ + "pushl %0+4*13;" /* esp */ + "pushl %0+4*12;" /* eflags */ + "pushl %0+4*11;" /* xcs */ + "pushl %0+4*10;" /* eip */ + "pushl %0+4*9;" /* orig_eax */ + "pushl %0+4*8;" /* xes */ + "pushl %0+4*7;" /* xds */ + "pushl %0+4*6;" /* eax */ + "pushl %0+4*5;" /* ebp */ + "pushl %0+4*4;" /* edi */ + "pushl %0+4*3;" /* esi */ + "pushl %0+4*2;" /* edx */ + "pushl %0+4*1;" /* ecx */ + "pushl %0+4*0;" /* ebx */ + : /* no outputs */ + : "m" (_a386_regs[0])); + regs = (struct pt_regs *)a386_get_sp (); + +#if 0 + { + int i; + long *r = (long *)regs; + static char *regname[] = + { "ebx", "ecx", "edx", "esi", "edi", "ebp", "eax", "xds", + "xes", "orig_eax", "eip", "xcs", "eflags", "esp", "xss", + "kernel_mode", "interrupts_enabled" }; + a386_printf ("before timer_interrupt:\n"); + for (i = 0; i < 17; i++) + a386_printf ("%s = %08lx\n", regname[i], r[i]); + } +#endif + + timer_interrupt (0, 0, regs); + +#if 0 + { + int i; + long *r = (long *)regs; + static char *regname[] = + { "ebx", "ecx", "edx", "esi", "edi", "ebp", "eax", "xds", + "xes", "orig_eax", "eip", "xcs", "eflags", "esp", "xss", + "kernel_mode", "interrupts_enabled" }; + a386_printf ("after timer_interrupt:\n"); + for (i = 0; i < 17; i++) + a386_printf ("%s = %08lx\n", regname[i], r[i]); + } +#endif + + /* RESTORE_ALL */ + a386_set_usp (a386_context_get_sp (®s->context)); + + _a386_tmp_ip = a386_context_get_ip (®s->context); + _a386_tmp_result = a386_context_get_result (®s->context); + _a386_tmp_sp = (a386_address_t)(regs + 1); + + a386_interrupts_enable (); + + if (!a386_context_get_kernel_mode (®s->context)) + { + _a386_memory_unmap (); + unix_kill (unix_getpid (), 10); + _a386_ksp = _a386_tmp_sp; + _a386_tmp_sp = _a386_usp; + /*_a386_mmu_map_address (_a386_usp);*/ + _a386_in_kernel_mode = 0; + } + +a386_putchar ('?'); + + a386_set_sp ((a386_address_t)regs); + asm volatile + ("popl %%ebx;" + "popl %%ecx;" + "popl %%edx;" + "popl %%esi;" + "popl %%edi;" + "popl %%ebp;" + "popl %%eax;" + "addl $4,%%esp;" /* xds */ + "addl $4,%%esp;" /* xes */ + "addl $4,%%esp;" /* orig_eax */ + "addl $4,%%esp;" /* eip */ + "addl $4,%%esp;" /* xcs */ + "popf;" /* eflags */ + "addl $4,%%esp;" /* esp */ + "addl $4,%%esp;" /* xss */ + "addl $4,%%esp;" /* kernel_mode */ + "addl $4,%%esp;" /* interrupts_enabled */ + : + : + : "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "cc"); + + asm volatile + ("movl %0,%%esp;" + "movl %1,%%eax;" + "jmp *%2;" + : /* no outputs */ + : "m" (_a386_tmp_sp), + "m" (_a386_tmp_result), + "m" (_a386_tmp_ip)); } /* Converts Gregorian date to seconds since 1970-01-01 00:00:00. @@ -550,6 +684,8 @@ static unsigned long __init calibrate_tsc(void) { + a386_panic ("calibrate_tsc"); + /* Set the Gate high, disable speaker */ outb((inb(0x61) & ~0x02) | 0x01, 0x61); @@ -615,7 +751,7 @@ void __init time_init(void) { - xtime.tv_sec = get_cmos_time(); + xtime.tv_sec = a386_rtc_get (); xtime.tv_usec = 0; /* @@ -643,6 +779,7 @@ * moaned if you have the only one in the world - you fix it! */ +#if 0 /* FIXMEa386 */ dodgy_tsc(); if (boot_cpu_data.x86_capability & X86_FEATURE_TSC) { @@ -668,6 +805,7 @@ } } } +#endif #ifdef CONFIG_VISWS printk("Starting Cobalt Timer system clock\n"); @@ -684,6 +822,10 @@ /* Wire cpu IDT entry to s/w handler (and Cobalt APIC to IDT) */ setup_irq(CO_IRQ_TIMER, &irq0); #else - setup_irq(0, &irq0); + /*setup_irq(0, &irq0);*/ + { + extern struct a386_vectors vectors; + vectors.timer = real_timer_interrupt; + } #endif } diff -Nru --exclude-from exclude Linux/arch/i386/kernel/traps.c linux-a386/arch/i386/kernel/traps.c --- Linux/arch/i386/kernel/traps.c Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/kernel/traps.c Wed Jan 26 12:07:44 2000 @@ -45,6 +45,8 @@ #include +#include + asmlinkage int system_call(void); asmlinkage void lcall7(void); asmlinkage void lcall27(void); @@ -81,11 +83,12 @@ force_sig(signr, tsk); \ } +/* FIXMEa386 if (regs->eflags & VM_MASK) { \ */ #define DO_VM86_ERROR(trapnr, signr, str, name, tsk) \ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ { \ lock_kernel(); \ - if (regs->eflags & VM_MASK) { \ + if (0) { \ if (!handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, trapnr)) \ goto out; \ /* else fall through */ \ @@ -138,6 +141,9 @@ unsigned short ss; unsigned long *stack, addr, module_start, module_end; + a386_panic ("show_registers"); + +#if 0 /* FIXMEa386 */ esp = (unsigned long) (®s->esp); ss = __KERNEL_DS; if (regs->xcs & 3) { @@ -198,6 +204,7 @@ for(i=0;i<20;i++) printk("%02x ", ((unsigned char *)regs->eip)[i]); } +#endif printk("\n"); } @@ -216,18 +223,18 @@ static inline void die_if_kernel(const char * str, struct pt_regs * regs, long err) { - if (!(regs->eflags & VM_MASK) && !(3 & regs->xcs)) + if (kernel_mode (regs)) die(str, regs, err); } static void die_if_no_fixup(const char * str, struct pt_regs * regs, long err) { - if (!(regs->eflags & VM_MASK) && !(3 & regs->xcs)) + if (kernel_mode (regs)) { unsigned long fixup; - fixup = search_exception_table(regs->eip); + fixup = search_exception_table(pt_get_ip (regs)); if (fixup) { - regs->eip = fixup; + pt_set_ip (regs, fixup); return; } die(str, regs, err); @@ -253,10 +260,6 @@ asmlinkage void cache_flush_denied(struct pt_regs * regs, long error_code) { - if (regs->eflags & VM_MASK) { - handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code); - return; - } die_if_kernel("cache flush denied",regs,error_code); current->thread.error_code = error_code; current->thread.trap_no = 19; @@ -265,10 +268,9 @@ asmlinkage void do_general_protection(struct pt_regs * regs, long error_code) { - if (regs->eflags & VM_MASK) - goto gp_in_vm86; +a386_puts ("do_general_protection()\n"); - if (!(regs->xcs & 3)) + if (kernel_mode (regs)) goto gp_in_kernel; current->thread.error_code = error_code; @@ -276,18 +278,12 @@ force_sig(SIGSEGV, current); return; -gp_in_vm86: - lock_kernel(); - handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code); - unlock_kernel(); - return; - gp_in_kernel: { unsigned long fixup; - fixup = search_exception_table(regs->eip); + fixup = search_exception_table(pt_get_ip (regs)); if (fixup) { - regs->eip = fixup; + pt_set_ip (regs, fixup); return; } die("general protection fault", regs, error_code); @@ -461,7 +457,11 @@ unsigned int condition; struct task_struct *tsk = current; + a386_panic ("do_debug"); + +#if 0 /* FIXMEa386 */ __asm__ __volatile__("movl %%db6,%0" : "=r" (condition)); +#endif /* Mask out spurious debug traps due to lazy DR7 setting */ if (condition & (DR_TRAP0|DR_TRAP1|DR_TRAP2|DR_TRAP3)) { @@ -469,9 +469,6 @@ goto clear_dr7; } - if (regs->eflags & VM_MASK) - goto debug_vm86; - /* Mask out spurious TF errors due to lazy TF clearing */ if (condition & DR_STEP) { /* @@ -488,7 +485,7 @@ } /* If this is a kernel mode trap, we need to reset db7 to allow us to continue sanely */ - if ((regs->xcs & 3) == 0) + if (kernel_mode(regs)) goto clear_dr7; /* Ok, finally something we can handle */ @@ -497,20 +494,16 @@ force_sig(SIGTRAP, tsk); return; -debug_vm86: - lock_kernel(); - handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1); - unlock_kernel(); - return; - clear_dr7: +#if 0 /* FIXMEa386 */ __asm__("movl %0,%%db7" : /* no output */ : "r" (0)); +#endif return; clear_TF: - regs->eflags &= ~TF_MASK; + /* FIXMEa386 regs->eflags &= ~TF_MASK; */ return; } @@ -781,11 +774,37 @@ printk("Cobalt APIC enabled: ID reg %lx\n", co_apic_read(CO_APIC_ID)); } #endif + +struct a386_vectors vectors; + void __init trap_init(void) { +#if 0 /* FIXME a386 */ if (isa_readl(0x0FFFD9) == 'E'+('I'<<8)+('S'<<16)+('A'<<24)) EISA_bus = 1; +#endif +#if 1 + { + int i; + + vectors.illegal_instruction = &invalid_op; + vectors.privilege_violation = 0; + vectors.trap = &system_call; + vectors.trace = &debug; + vectors.fpe = 0; + vectors.bus_error = 0; + vectors.address_error = 0; + vectors.page_fault = page_fault; + vectors.segmentation_violation = general_protection; + vectors.timer = 0; + + for (i = 0; i < A386_DEVICE_INTERRUPTS; i++) + vectors.device_interrupt[i] = 0; + } + + a386_set_vectors (&vectors); +#else set_trap_gate(0,÷_error); set_trap_gate(1,&debug); set_intr_gate(2,&nmi); @@ -812,6 +831,7 @@ */ set_call_gate(&default_ldt[0],lcall7); set_call_gate(&default_ldt[4],lcall27); +#endif /* * Should be a barrier for any external CPU state. diff -Nru --exclude-from exclude Linux/arch/i386/kernel/vm86.c linux-a386/arch/i386/kernel/vm86.c --- Linux/arch/i386/kernel/vm86.c Tue Dec 21 00:35:25 1999 +++ linux-a386/arch/i386/kernel/vm86.c Tue Jan 25 17:04:37 2000 @@ -158,6 +158,7 @@ return ret; } +extern void ret_from_sys_call (void); asmlinkage int sys_vm86(unsigned long subfunction, struct vm86plus_struct * v86) { @@ -218,6 +219,7 @@ info->regs.__null_ds = 0; info->regs.__null_es = 0; + a386_panic ("do_sys_vm86"); /* we are clearing fs,gs later just before "jmp ret_from_sys_call", * because starting with Linux 2.1.x they aren't no longer saved/restored */ @@ -228,9 +230,11 @@ * inherited from protected mode. */ VEFLAGS = info->regs.eflags; +#if 0 /* FIXMEa386 */ info->regs.eflags &= SAFE_MASK; info->regs.eflags |= info->regs32->eflags & ~SAFE_MASK; info->regs.eflags |= VM_MASK; +#endif switch (info->cpu_type) { case CPU_286: @@ -250,7 +254,9 @@ /* * Save old state, set default return value (%eax) to 0 */ +#if 0 /* FIXMEa386 */ info->regs32->eax = 0; +#endif tsk->thread.saved_esp0 = tsk->thread.esp0; tss = init_tss + smp_processor_id(); tss->esp0 = tsk->thread.esp0 = (unsigned long) &info->VM86_TSS_ESP0; @@ -259,12 +265,17 @@ if (info->flags & VM86_SCREEN_BITMAP) mark_screen_rdonly(tsk); unlock_kernel(); +#if 0 /* FIXMEa386 */ + ... + a386_set_sp (&info->regs); + a386_set_ip (ret_from_sys_call); __asm__ __volatile__( "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs\n\t" "movl %0,%%esp\n\t" "jmp ret_from_sys_call" : /* no outputs */ :"r" (&info->regs), "b" (tsk) : "ax"); +#endif /* we never return here */ } @@ -273,11 +284,10 @@ struct pt_regs * regs32; regs32 = save_v86_state(regs16); - regs32->eax = retval; + pt_set_result (regs32, retval); unlock_kernel(); - __asm__ __volatile__("movl %0,%%esp\n\t" - "jmp ret_from_sys_call" - : : "r" (regs32), "b" (current)); + a386_set_sp (regs32); + a386_set_ip (ret_from_sys_call); } static inline void set_IF(struct kernel_vm86_regs * regs) diff -Nru --exclude-from exclude Linux/arch/i386/lib/usercopy.c linux-a386/arch/i386/lib/usercopy.c --- Linux/arch/i386/lib/usercopy.c Fri Nov 12 13:29:47 1999 +++ linux-a386/arch/i386/lib/usercopy.c Tue Jan 25 17:04:37 2000 @@ -62,6 +62,14 @@ */ #define __do_strncpy_from_user(dst,src,count,res) \ +do { \ + res = count; \ + while (count && (*dst++ = *src++)) \ + count--; \ + res -= count; \ +} while (0) + +#if 0 do { \ int __d0, __d1, __d2; \ __asm__ __volatile__( \ @@ -88,6 +96,7 @@ : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \ : "memory"); \ } while (0) +#endif long __strncpy_from_user(char *dst, const char *src, long count) @@ -112,6 +121,12 @@ */ #define __do_clear_user(addr,size) \ +do { \ + while (--size) \ + *(char *)addr++ = 0; \ +} while (0) + +#if 0 /* FIXMEa386 */ do { \ int __d0; \ __asm__ __volatile__( \ @@ -131,6 +146,7 @@ : "=&c"(size), "=&D" (__d0) \ : "r"(size & 3), "0"(size / 4), "1"(addr), "a"(0)); \ } while (0) +#endif unsigned long clear_user(void *to, unsigned long n) diff -Nru --exclude-from exclude Linux/arch/i386/mm/fault.c linux-a386/arch/i386/mm/fault.c --- Linux/arch/i386/mm/fault.c Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/mm/fault.c Tue Jan 25 17:04:37 2000 @@ -127,7 +127,10 @@ int si_code = SEGV_MAPERR; /* get the address */ - __asm__("movl %%cr2,%0":"=r" (address)); + { /* FIXMEa386 */ + extern int _a386_page_fault_address; + address = _a386_page_fault_address; + } tsk = current; mm = tsk->mm; @@ -143,11 +146,15 @@ vma = find_vma(mm, address); if (!vma) +{ a386_printf ("\ndo_page_fault: !vma"); goto bad_area; +} if (vma->vm_start <= address) goto good_area; if (!(vma->vm_flags & VM_GROWSDOWN)) +{ a386_printf ("\ndo_page_fault: !(vma->vm_flags & VM_GROWSDOWN)"); goto bad_area; +} if (error_code & 4) { /* * accessing the stack below %esp is always a bug. @@ -155,11 +162,15 @@ * pusha) doing post-decrement on the stack and that * doesn't show up until later.. */ - if (address + 32 < regs->esp) + if (address + 32 < pt_get_sp (regs)) +{ a386_printf ("\ndo_page_fault: address + 32 < pt_get_sp (regs)"); goto bad_area; +} } if (expand_stack(vma, address)) +{ a386_printf ("\ndo_page_fault: expand_stack (vma, address)"); goto bad_area; +} /* * Ok, we have a good vm_area for this memory access, so * we can handle it.. @@ -171,20 +182,27 @@ switch (error_code & 3) { default: /* 3: write, present */ #ifdef TEST_VERIFY_AREA - if (regs->cs == KERNEL_CS) - printk("WP fault at %08lx\n", regs->eip); + a386_panic ("do_page_fault: TEST_VERIFY_AREA"); + if (kernel_mode (regs)) + printk("WP fault at %08lx\n", pt_reg_ip(regs)); #endif /* fall through */ case 2: /* write, not present */ if (!(vma->vm_flags & VM_WRITE)) +{ a386_printf ("\ndo_page_fault: !(vma->vm_flags & VM_WRITE)"); goto bad_area; +} write++; break; case 1: /* read, present */ +{ a386_printf ("\ndo_page_fault: cases 1: /* read, present */"); goto bad_area; +} case 0: /* read, not present */ if (!(vma->vm_flags & (VM_READ | VM_EXEC))) +{ a386_printf ("\ndo_page_fault: !(vma->vm_flags & (VM_READ | VM_EXEC))"); goto bad_area; +} } /* @@ -200,14 +218,6 @@ goto do_sigbus; } - /* - * Did it hit the DOS screen memory VA from vm86 mode? - */ - if (regs->eflags & VM_MASK) { - unsigned long bit = (address - 0xA0000) >> PAGE_SHIFT; - if (bit < 32) - tsk->thread.screen_bitmap |= 1 << bit; - } up(&mm->mmap_sem); return; @@ -216,6 +226,22 @@ * Fix it, but check if it's kernel or user first.. */ bad_area: +a386_puts ("\ndo_page_fault: bad area"); +a386_printf ("\ndo_page_fault: address = %p", address); +#if 1 + { + int i; + long *r = (long *)regs; + static char *regname[] = + { "ebx", "ecx", "edx", "esi", "edi", "ebp", "eax", "xds", + "xes", "orig_eax", "eip", "xcs", "eflags", "esp", "xss", + "kernel_mode", "interrupts_enabled" }; + a386_puts ("\ndo_page_fault: register dump:"); + for (i = 0; i < 17; i++) + a386_printf ("\n%s = %08lx", regname[i], r[i]); + } +#endif + up(&mm->mmap_sem); /* User mode accesses just cause a SIGSEGV */ @@ -227,6 +253,7 @@ si.si_signo = SIGSEGV; si.si_code = si_code; si.si_addr = (void*) address; +a386_printf ("\ndo_page_fault: force_sig_info (SIGSEGV, info = { address = %p }, pid = %d)", si.si_addr, tsk->pid); force_sig_info(SIGSEGV, &si, tsk); return; } @@ -246,9 +273,15 @@ } no_context: + +a386_puts ("\ndo_page_fault: no context"); +if (in_interrupt ()) a386_puts ("\nin_interrupt"); +if (!mm) a386_puts ("\n!mm"); +a386_printf ("\ntsk = %p, pid = %d", tsk, tsk->pid); + /* Are we prepared to handle this kernel fault? */ - if ((fixup = search_exception_table(regs->eip)) != 0) { - regs->eip = fixup; + if ((fixup = search_exception_table(pt_get_ip(regs))) != 0) { + pt_set_ip(regs, fixup); return; } @@ -270,9 +303,11 @@ printk(KERN_ALERT "Unable to handle kernel paging request"); printk(" at virtual address %08lx\n",address); printk(" printing eip:\n"); - printk("%08lx\n", regs->eip); - asm("movl %%cr3,%0":"=r" (page)); - page = ((unsigned long *) __va(page))[address >> 22]; + printk("%08lx\n", pt_get_ip(regs)); + page = a386_get_page_directory (); +a386_printf ("\npage = %p", page); + page = ((unsigned long *)page)[address >> 22]; +a386_printf ("\npage = %p", page); printk(KERN_ALERT "*pde = %08lx\n", page); if (page & 1) { page &= PAGE_MASK; @@ -288,6 +323,7 @@ * us unable to handle the page fault gracefully. */ out_of_memory: +a386_puts ("\ndo_page_fault: out of memory"); up(&mm->mmap_sem); printk("VM: killing process %s\n", tsk->comm); if (error_code & 4) @@ -295,6 +331,7 @@ goto no_context; do_sigbus: +a386_puts ("\ndo_page_fault: do sigbus"); up(&mm->mmap_sem); /* diff -Nru --exclude-from exclude Linux/arch/i386/mm/init.c linux-a386/arch/i386/mm/init.c --- Linux/arch/i386/mm/init.c Thu Jan 20 18:51:42 2000 +++ linux-a386/arch/i386/mm/init.c Tue Jan 25 17:04:37 2000 @@ -427,7 +427,11 @@ { pagetable_init(); +#if 1 /* FIXMEa386 */ + a386_enable_paging (); +#else __asm__( "movl %%ecx,%%cr3\n" ::"c"(__pa(swapper_pg_dir))); +#endif #if CONFIG_X86_PAE /* @@ -605,8 +609,10 @@ if (!cpu_has_pae) panic("cannot execute a PAE-enabled kernel on a PAE-less CPU!"); #endif +#if 0 /* FIXMEa386 */ if (boot_cpu_data.wp_works_ok < 0) test_wp_bit(); +#endif /* * Subtle. SMP is doing it's boot stuff late (because it has to diff -Nru --exclude-from exclude Linux/arch/i386/vmlinux.lds linux-a386/arch/i386/vmlinux.lds --- Linux/arch/i386/vmlinux.lds Tue Jan 11 23:26:21 2000 +++ linux-a386/arch/i386/vmlinux.lds Tue Jan 25 17:04:37 2000 @@ -6,7 +6,7 @@ ENTRY(_start) SECTIONS { - . = 0xC0000000 + 0x100000; + . = 0xA0000000 + 0x100000; _text = .; /* Text and read-only data */ .text : { *(.text) diff -Nru --exclude-from exclude Linux/drivers/block/Makefile linux-a386/drivers/block/Makefile --- Linux/drivers/block/Makefile Fri Jan 14 09:50:53 2000 +++ linux-a386/drivers/block/Makefile Tue Jan 25 17:04:37 2000 @@ -26,6 +26,8 @@ LX_OBJS := ll_rw_blk.o blkpg.o MX_OBJS := +L_OBJS += a386disk.o + ifeq ($(CONFIG_MAC_FLOPPY),y) L_OBJS += swim3.o endif diff -Nru --exclude-from exclude Linux/drivers/block/a386disk.c linux-a386/drivers/block/a386disk.c --- Linux/drivers/block/a386disk.c Thu Jan 1 01:00:00 1970 +++ linux-a386/drivers/block/a386disk.c Wed Jan 26 12:07:44 2000 @@ -0,0 +1,187 @@ +/* + * linux/drivers/block/a386disk.c + * + * Written by Lars Brinkhoff 1999-10-27. + * + * Copyright 1993 by Lars Brinkhoff. Redistribution of this file is + * permitted under the GNU Public License. + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include + +/* FIXMEa386: find out what major number to use instead of 42 */ +#define MAJOR_NR 42 + +#define DEVICE_NAME "a386disk" +#define DEVICE_REQUEST a386disk_request +#define DEVICE_NR(device) (MINOR(device)) +#define DEVICE_ON(device) +#define DEVICE_OFF(device) +#define DEVICE_NO_RANDOM +#define TIMEOUT_VALUE (6 * HZ) +#include + +#include + +#include + +#define FALSE 0 +#define TRUE (!FALSE) + +static void a386disk_request(request_queue_t *request) +{ + int n; + unsigned int minor; + unsigned long offset, len; + +repeat: + INIT_REQUEST; + + minor = MINOR(request->current_request->rq_dev); + + offset = request->current_request->sector << 9; + len = request->current_request->current_nr_sectors << 9; + + if ((request->current_request->cmd != READ) && + (request->current_request->cmd != WRITE)) { + printk(KERN_INFO "RAMDISK: bad command: %d\n", + request->current_request->cmd); + end_request(0); + goto repeat; + } + + a386_disk_seek (request->current_request->sector); + if (request->current_request->cmd == READ) + { + n = a386_disk_read (request->current_request->buffer, + request->current_request->current_nr_sectors); + if (n < 0) + a386_printf ("a386disk_request: error\n"); + } + else + { + n = a386_disk_write (request->current_request->buffer, + request->current_request->current_nr_sectors); + if (n < 0) + a386_printf ("a386disk_request: error\n"); + } + + end_request(1); + goto repeat; +} + +static int a386disk_open(struct inode *inode, struct file *file) +{ + int dev; + + if (!inode) + return -EINVAL; + if (MAJOR(inode->i_rdev) != MAJOR_NR) { + printk(KERN_WARNING "a386disk_open: pseudo-major != %d\n", MAJOR_NR); + return -ENODEV; + } + dev = MINOR(inode->i_rdev); + +#if 0 + a386disk_fd = unix_open ("./root_fs", UNIX_O_RDWR); + if (a386disk_fd == -1) + { + printk(KERN_ERR "a386disk_open: couldn't open ./root_fs\n"); + return -ENOENT; + } +#endif + + MOD_INC_USE_COUNT; + return 0; +} + +static int a386disk_release(struct inode *inode, struct file *file) +{ + int dev, err; + + if (!inode) + return 0; + if (MAJOR(inode->i_rdev) != MAJOR_NR) { + printk(KERN_WARNING "a386disk_release: pseudo-major != %d\n", MAJOR_NR); + return 0; + } + dev = MINOR(inode->i_rdev); + + err = fsync_dev(inode->i_rdev); + + //unix_close (a386disk_fd); + + return err; +} + +static struct file_operations a386disk_fops = { + NULL, /* lseek - default */ + block_read, /* read - general block-dev read */ + block_write, /* write - general block-dev write */ + NULL, /* readdir - bad */ + NULL, /* poll */ + NULL, /* ioctl */ + NULL, /* mmap */ + a386disk_open, /* open */ + NULL, /* flush */ + a386disk_release, /* release */ + NULL, /* fsync */ + NULL, /* fasync */ + NULL, /* check_media_change */ + NULL, /* revalidate */ + NULL, /* lock */ +}; + +/* + * And now the modules code and kernel interface. + */ +#ifdef MODULE +#define a386disk_init init_module +#endif + +int __init a386disk_init(void) +{ + if (a386_disk_init () < 0) { + printk (KERN_WARNING DEVICE_NAME ": hardware initialization" + "failed\n"); + return -EIO; + } + + if (register_blkdev(MAJOR_NR, "a386disk", &a386disk_fops)) { + printk(KERN_WARNING "Unable to get major number %d for a386disk device\n", + MAJOR_NR); + return -EIO; + } + +#ifndef MODULE + printk(KERN_INFO "a386disk: registered device at major %d\n", MAJOR_NR); +#endif + + blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST); + /*blk_dev[MAJOR_NR].request_fn = DEVICE_REQUEST;*/ + + return 0; +} + +#ifdef MODULE +void cleanup_module(void) +{ + if (unregister_blkdev(MAJOR_NR, DEVICE_NAME) != 0) + printk(KERN_WARNING "a386disk: cannot unregister blkdev\n"); + + kfree (a386disk_dev); + kfree (a386disk_sizes); + kfree (a386disk_blksizes); +} +#endif diff -Nru --exclude-from exclude Linux/drivers/block/ll_rw_blk.c linux-a386/drivers/block/ll_rw_blk.c --- Linux/drivers/block/ll_rw_blk.c Mon Dec 13 07:55:54 1999 +++ linux-a386/drivers/block/ll_rw_blk.c Tue Jan 25 17:04:37 2000 @@ -948,6 +948,7 @@ memset(ro_bits,0,sizeof(ro_bits)); memset(max_readahead, 0, sizeof(max_readahead)); memset(max_sectors, 0, sizeof(max_sectors)); + a386disk_init (); #ifdef CONFIG_AMIGA_Z2RAM z2_init(); #endif @@ -997,7 +998,8 @@ floppy_init(); #else #if !defined (__mc68000__) && !defined(CONFIG_PPC) && !defined(__sparc__)\ - && !defined(CONFIG_APUS) && !defined(__sh__) + && !defined(CONFIG_APUS) && !defined(__sh__) && !defined(A386) + /* FIXMEa386: do something about this */ outb_p(0xc, 0x3f2); #endif #endif diff -Nru --exclude-from exclude Linux/drivers/char/Makefile linux-a386/drivers/char/Makefile --- Linux/drivers/char/Makefile Thu Jan 20 19:44:46 2000 +++ linux-a386/drivers/char/Makefile Tue Jan 25 17:04:37 2000 @@ -49,6 +49,10 @@ OX_OBJS += $(CONSOLE) selection.o endif +ifeq ($(ARCH),a386) + OX_OBJS += a386_serial.o +endif + ifeq ($(CONFIG_SERIAL),y) OX_OBJS += $(SERIAL) else diff -Nru --exclude-from exclude Linux/drivers/char/a386_serial.c linux-a386/drivers/char/a386_serial.c --- Linux/drivers/char/a386_serial.c Thu Jan 1 01:00:00 1970 +++ linux-a386/drivers/char/a386_serial.c Wed Jan 26 12:07:44 2000 @@ -0,0 +1,261 @@ +/* + * a386_serial.c: Serial port driver for a386. + * Based on dz.c. + */ + +#ifdef MODULE +#include +#include +#else +#define MOD_INC_USE_COUNT +#define MOD_DEC_USE_COUNT +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include + +DECLARE_TASK_QUEUE(tq_serial); + +static struct tty_driver serial_driver; +static struct tty_struct *serial_table[1]; +static struct termios *serial_termios[1]; +static struct termios *serial_termios_locked[1]; +static int serial_refcount; + +static struct tty_struct *serial_tty; + +static void do_serial_bh (void) +{ + run_task_queue (&tq_serial); +} + +static inline void +receive_chars (void) +{ + struct tty_struct *tty = 0; + + tty = serial_tty; + + do + { + unsigned char ch; + + ch = a386_serial_receive (); + + if (!tty) break; + if (tty->flip.count >= TTY_FLIPBUF_SIZE) break; + + *tty->flip.char_buf_ptr = ch; + *tty->flip.flag_buf_ptr = 0; + + tty->flip.flag_buf_ptr++; + tty->flip.char_buf_ptr++; + tty->flip.count++; + } + while (a386_serial_rx_ready ()); + + if (tty) + { + tty_flip_buffer_push (tty); + /*queue_task (&info->tqueue, &tq_serial);*/ + mark_bh (SERIAL_BH); + } +} + +static void +serial_interrupt (int irq, void *dev, struct pt_regs *regs) +{ + if (a386_serial_rx_ready ()) + receive_chars (); +/*if (a386_serial_tx_ready ()) + transmit_chars ();*/ + + if (bh_active & bh_mask) + do_bottom_half(); +} + +static int +serial_write (struct tty_struct *tty, int from_user, + const unsigned char *buf, int count) +{ + int n = count; + while (n--) + a386_serial_transmit (*buf++); + return count; +} + +static int +serial_write_room (struct tty_struct *tty) +{ + return 42; +} + +static int users = 0; + +static int +serial_open (struct tty_struct *tty, struct file *filp) +{ + int line; + + line = MINOR (tty->device) - tty->driver.minor_start; + if (line != 0) + return -ENODEV; + + serial_tty = tty; + *tty->termios = serial_driver.init_termios; + + a386_serial_rx_interrupt_enable (); + a386_serial_tx_interrupt_enable (); + users++; + + return 0; +} + +static void +serial_close (struct tty_struct *tty, struct file *filp) +{ + users--; + if (users == 0) + { + a386_serial_rx_interrupt_disable (); + a386_serial_tx_interrupt_disable (); + serial_tty = 0; + } +} + +int __init +init_a386_serial (void) +{ + printk ("a386_serial: ttyS0\n"); + + init_bh (SERIAL_BH, do_serial_bh); + + memset (&serial_driver, 0, sizeof(struct tty_driver)); + + serial_driver.magic = TTY_DRIVER_MAGIC; + serial_driver.name = "ttyS"; + serial_driver.major = TTY_MAJOR; + serial_driver.minor_start = 64; + serial_driver.num = 1; + serial_driver.type = TTY_DRIVER_TYPE_SERIAL; + serial_driver.subtype = SERIAL_TYPE_NORMAL; + serial_driver.init_termios = tty_std_termios; + + serial_driver.init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; + serial_driver.flags = TTY_DRIVER_REAL_RAW; + serial_driver.refcount = &serial_refcount; + serial_driver.table = serial_table; + serial_driver.termios = serial_termios; + serial_driver.termios_locked = serial_termios_locked; + + serial_driver.open = serial_open; + serial_driver.close = serial_close; + serial_driver.write = serial_write; + serial_driver.flush_chars = NULL; + serial_driver.write_room = serial_write_room; + serial_driver.chars_in_buffer = NULL; + serial_driver.flush_buffer = NULL; + serial_driver.ioctl = NULL; + serial_driver.throttle = NULL; + serial_driver.unthrottle = NULL; + serial_driver.send_xchar = NULL; + serial_driver.set_termios = NULL; + serial_driver.stop = NULL; + serial_driver.start = NULL; + serial_driver.hangup = NULL; + + serial_tty = 0; + + if (tty_register_driver (&serial_driver)) + panic("Couldn't register serial driver\n"); + +#if 1 /* FIXMEa386: should call request_irq() */ + { + extern struct a386_vectors vectors; + vectors.serial_interrupt = serial_interrupt; + } +#else + if (request_irq (SERIAL, serial_interrupt, SA_INTERRUPT, "a386_serial", lines[0])) + panic ("Unable to register a386_serial interrupt\n"); +#endif + + return 0; +} + +#ifdef CONFIG_SERIAL_CONSOLE + +static void +serial_console_print (struct console *cons, + const char *str, + unsigned int count) +{ + int n = count; + while (n--) + { + if (*str == '\n') + a386_serial_transmit ('\r'); + a386_serial_transmit (*str++); + } +} + +static int +serial_console_wait_key (struct console *co) +{ + a386_printf ("serial_console_wait_key()\n"); + return 0; +} + +static kdev_t +serial_console_device (struct console *console) +{ + return MKDEV (TTY_MAJOR, 64 + console->index); +} + +static int __init +serial_console_setup (struct console *console, char *options) +{ + return 0; +} + +static struct console serial_console = +{ + "ttyS", + serial_console_print, + NULL, + serial_console_device, + serial_console_wait_key, + NULL, + serial_console_setup, + CON_CONSDEV | CON_PRINTBUFFER, + -1, + 0, + NULL +}; + +void __init +init_a386_serial_console (void) +{ + a386_serial_init (); + a386_serial_rx_interrupt_disable (); + a386_serial_tx_interrupt_disable (); + register_console (&serial_console); +} + +#endif /* ifdef CONFIG_SERIAL_CONSOLE */ diff -Nru --exclude-from exclude Linux/drivers/char/tty_io.c linux-a386/drivers/char/tty_io.c --- Linux/drivers/char/tty_io.c Thu Jan 20 19:44:46 2000 +++ linux-a386/drivers/char/tty_io.c Tue Jan 25 17:04:37 2000 @@ -2088,11 +2088,19 @@ con_init(); #endif #ifdef CONFIG_SERIAL_CONSOLE +#ifdef A386 + /* FIXMEa386 */ + { + void init_a386_serial_console (void); + init_a386_serial_console (); + } +#else #ifdef CONFIG_8xx console_8xx_init(); #else serial_console_init(); #endif /* CONFIG_8xx */ +#endif /* A386 */ #endif } @@ -2174,7 +2182,11 @@ espserial_init(); #endif #ifdef CONFIG_SERIAL +#ifdef A386 /* FIXMEa386 */ + init_a386_serial (); +#else rs_init(); +#endif #endif #ifdef CONFIG_COMPUTONE ip2_init(); diff -Nru --exclude-from exclude Linux/include/asm-i386/bugs.h linux-a386/include/asm-i386/bugs.h --- Linux/include/asm-i386/bugs.h Fri Jan 21 01:05:26 2000 +++ linux-a386/include/asm-i386/bugs.h Tue Jan 25 20:27:19 2000 @@ -421,6 +421,7 @@ static void __init check_bugs(void) { +#if 0 /* FIXMEa386 */ check_cyrix_cpu(); identify_cpu(&boot_cpu_data); check_cx686_cpuid(); @@ -439,4 +440,5 @@ #endif check_cyrix_coma(); system_utsname.machine[1] = '0' + boot_cpu_data.x86; +#endif } diff -Nru --exclude-from exclude Linux/include/asm-i386/elf.h linux-a386/include/asm-i386/elf.h --- Linux/include/asm-i386/elf.h Fri Jan 21 01:05:33 2000 +++ linux-a386/include/asm-i386/elf.h Wed Jan 26 12:13:06 2000 @@ -37,10 +37,8 @@ We might as well make sure everything else is cleared too (except for %esp), just to make things more deterministic. */ +/* FIXMEa386: clear regs? */ #define ELF_PLAT_INIT(_r) do { \ - _r->ebx = 0; _r->ecx = 0; _r->edx = 0; \ - _r->esi = 0; _r->edi = 0; _r->ebp = 0; \ - _r->eax = 0; \ } while (0) #define USE_ELF_CORE_DUMP @@ -58,7 +56,10 @@ /* regs is struct pt_regs, pr_reg is elf_gregset_t (which is now struct_user_regs, they are different) */ -#define ELF_CORE_COPY_REGS(pr_reg, regs) \ +/* FIXMEa386: make ELF_CORE_COPY_REGS do something useful */ +#define ELF_CORE_COPY_REGS(pr_reg, regs) \ + a386_printf ("ELF_CORE_COPY_REGS\n"); +#if 0 pr_reg[0] = regs->ebx; \ pr_reg[1] = regs->ecx; \ pr_reg[2] = regs->edx; \ @@ -77,6 +78,7 @@ pr_reg[14] = regs->eflags; \ pr_reg[15] = regs->esp; \ pr_reg[16] = regs->xss; +#endif /* This yields a mask that user programs can use to figure out what instruction set this CPU supports. This could be done in user space, diff -Nru --exclude-from exclude Linux/include/asm-i386/io.h linux-a386/include/asm-i386/io.h --- Linux/include/asm-i386/io.h Fri Jan 21 01:06:01 2000 +++ linux-a386/include/asm-i386/io.h Wed Jan 26 12:08:22 2000 @@ -1,6 +1,8 @@ #ifndef _ASM_IO_H #define _ASM_IO_H +#include + /* * This file contains the definitions for the x86 IO instructions * inb/inw/inl/outb/outw/outl and the "string versions" of the same @@ -46,6 +48,78 @@ #define __FULL_SLOW_DOWN_IO __SLOW_DOWN_IO #endif +#if 1 /* FIXMEa386 */ + +#define OUT(a,b) \ +extern inline void out##a(unsigned b value, unsigned short port) \ +{ \ + a386_printf ("\nout" #a "(0x%x, 0x%04x)", value, port); \ + a386_panic ("unsupported I/O address"); \ +} + +OUT(b, char) +OUT(w, short) +OUT(l, int) + +OUT(b_p, char) +OUT(w_p, short) +OUT(l_p, int) + +#undef OUT + +#define OUTS(a) \ +extern inline void outs##a(unsigned short port, const void *addr, unsigned long count) \ +{ \ + a386_printf ("outs" #a "(0x%04x, %p, %ld)\n", port, addr, count); \ + a386_panic ("unsupported I/O address"); \ +} + +OUTS(b) +OUTS(w) +OUTS(l) + +OUTS(b_p) +OUTS(w_p) +OUTS(l_p) + +#undef OUTS + +#define IN(a, b) \ +extern inline b in##a(unsigned short port) \ +{ \ + a386_printf ("in" #a "(0x%04x)\n", port); \ + a386_panic ("unsupported I/O address"); \ + return (b)-1; \ +} + +IN(b, char) +IN(w, short) +IN(l, int) + +IN(b_p, char) +IN(w_p, short) +IN(l_p, int) + +#undef IN + +#define INS(a) \ +extern inline void ins##a(unsigned short port, const void *addr, unsigned long count) \ +{ \ + a386_printf ("ins" #a "(0x%04x, %p, %ld)\n", port, addr, count); \ + a386_panic ("unsupported I/O address"); \ +} + +INS(b) +INS(w) +INS(l) + +INS(b_p) +INS(w_p) +INS(l_p) + +#undef INS + +#else /* * Talk about misusing macros.. */ @@ -100,6 +174,7 @@ __OUTS(b) __OUTS(w) __OUTS(l) +#endif #define IO_SPACE_LIMIT 0xffff diff -Nru --exclude-from exclude Linux/include/asm-i386/mmu_context.h linux-a386/include/asm-i386/mmu_context.h --- Linux/include/asm-i386/mmu_context.h Fri Jan 21 01:05:31 2000 +++ linux-a386/include/asm-i386/mmu_context.h Wed Jan 26 12:11:25 2000 @@ -5,6 +5,8 @@ #include #include +#include + /* * possibly do the LDT unload here? */ @@ -21,12 +23,23 @@ /* * Re-load LDT if necessary */ +#if 0 /* FIXMEa386 */ if (prev->segments != next->segments) load_LDT(next); /* Re-load page tables */ asm volatile("movl %0,%%cr3": :"r" (__pa(next->pgd))); +#endif + a386_set_page_directory ((struct a386_page_directory_entry *) + next->pgd); +#if 1 /* FIXMEa386 */ +if (prev == 0) + a386_puts ("\nswitch_mm(): prev == NULL!\n"); +else clear_bit(cpu, &prev->cpu_vm_mask); +#else + clear_bit(cpu, &prev->cpu_vm_mask); +#endif } #ifdef __SMP__ else { diff -Nru --exclude-from exclude Linux/include/asm-i386/page.h linux-a386/include/asm-i386/page.h --- Linux/include/asm-i386/page.h Fri Jan 21 01:05:26 2000 +++ linux-a386/include/asm-i386/page.h Tue Jan 25 20:27:17 2000 @@ -73,7 +73,7 @@ * amd CONFIG_HIGHMEM64G options in the kernel configuration. */ -#define __PAGE_OFFSET (0xC0000000) +#define __PAGE_OFFSET (0xA0000000) #ifndef __ASSEMBLY__ @@ -85,7 +85,7 @@ */ #define BUG() do { \ printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ - __asm__ __volatile__(".byte 0x0f,0x0b"); \ + a386_panic ("BUG"); \ } while (0) #define PAGE_BUG(page) do { \ diff -Nru --exclude-from exclude Linux/include/asm-i386/param.h linux-a386/include/asm-i386/param.h --- Linux/include/asm-i386/param.h Tue Aug 1 17:08:17 1995 +++ linux-a386/include/asm-i386/param.h Tue Jan 25 17:04:37 2000 @@ -2,7 +2,7 @@ #define _ASMi386_PARAM_H #ifndef HZ -#define HZ 100 +#define HZ 10 #endif #define EXEC_PAGESIZE 4096 diff -Nru --exclude-from exclude Linux/include/asm-i386/pgtable.h linux-a386/include/asm-i386/pgtable.h --- Linux/include/asm-i386/pgtable.h Fri Jan 21 01:05:30 2000 +++ linux-a386/include/asm-i386/pgtable.h Wed Jan 26 12:07:44 2000 @@ -3,6 +3,8 @@ #include +#include + /* * The Linux memory management assumes a three-level page table setup. On * the i386, we use that, but "fold" the mid level into the top-level page @@ -27,56 +29,13 @@ #define flush_page_to_ram(page) do { } while (0) #define flush_icache_range(start, end) do { } while (0) -#define __flush_tlb() \ - do { \ - __asm__ __volatile__ \ - ("movl %0, %%cr3;" \ - : \ - : "r" __pa(current->active_mm->pgd) \ - : "memory" \ - ); \ - } while (0) - -/* - * Global pages have to be flushed a bit differently. Not a real - * performance problem because this does not happen often. - */ -#define __flush_tlb_global() \ - do { \ - __asm__ __volatile__( \ - "movl %0, %%cr4; # turn off PGE \n" \ - "mov %2, %%cr3; # flush TLB \n" \ - "mov %1, %%cr4; # turn PGE back on \n" \ - : \ - : "r" (mmu_cr4_features), \ - "r" (mmu_cr4_features & ~X86_CR4_PGE), \ - "r" (__pa(current->active_mm->pgd)) \ - : "memory"); \ - } while (0) - -extern unsigned long pgkern_mask; - -/* - * Do not check the PGE bit unnecesserily if this is a PPro+ kernel. - */ -#ifdef CONFIG_X86_PGE -# define __flush_tlb_all() __flush_tlb_global() -#else -# define __flush_tlb_all() \ - do { \ - if (cpu_has_pge) \ - __flush_tlb_global(); \ - else \ - __flush_tlb(); \ - } while (0) -#endif +#define __flush_tlb() a386_tlb_flush () -#ifndef CONFIG_X86_INVLPG -#define __flush_tlb_one(addr) __flush_tlb() -#else -#define __flush_tlb_one(addr) \ -__asm__ __volatile__("invlpg %0": :"m" (*(char *) addr)) -#endif +#define __flush_tlb() a386_tlb_flush () +#define __flush_tlb_global() a386_tlb_flush () +#define __flush_tlb_all() a386_tlb_flush +#define __flush_tlb_one(addr) a386_tlb_flush_one (addr) +#define __flush_tlb_range(start, end) a386_tlb_flush_range (start, end) /* * ZERO_PAGE is a global shared page that is always zero: used diff -Nru --exclude-from exclude Linux/include/asm-i386/processor.h linux-a386/include/asm-i386/processor.h --- Linux/include/asm-i386/processor.h Fri Jan 21 01:05:28 2000 +++ linux-a386/include/asm-i386/processor.h Tue Jan 25 20:27:17 2000 @@ -352,14 +352,9 @@ } #define start_thread(regs, new_eip, new_esp) do { \ - __asm__("movl %w0,%%fs ; movl %w0,%%gs": :"r" (0)); \ - set_fs(USER_DS); \ - regs->xds = __USER_DS; \ - regs->xes = __USER_DS; \ - regs->xss = __USER_DS; \ - regs->xcs = __USER_CS; \ - regs->eip = new_eip; \ - regs->esp = new_esp; \ + a386_context_set_kernel_mode (®s->context, 0); \ + pt_set_ip (regs, new_eip); \ + pt_set_sp (regs, new_esp); \ } while (0) /* Forward declaration, a strange C thing */ diff -Nru --exclude-from exclude Linux/include/asm-i386/ptrace.h linux-a386/include/asm-i386/ptrace.h --- Linux/include/asm-i386/ptrace.h Wed Dec 10 02:57:09 1997 +++ linux-a386/include/asm-i386/ptrace.h Wed Jan 26 12:07:44 2000 @@ -1,6 +1,8 @@ #ifndef _I386_PTRACE_H #define _I386_PTRACE_H +#include + #define EBX 0 #define ECX 1 #define EDX 2 @@ -24,6 +26,9 @@ stack during a system call. */ struct pt_regs { +#if 1 + struct a386_context context; +#else long ebx; long ecx; long edx; @@ -39,6 +44,7 @@ long eflags; long esp; int xss; +#endif }; /* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */ @@ -48,8 +54,20 @@ #define PTRACE_SETFPREGS 15 #ifdef __KERNEL__ -#define user_mode(regs) ((VM_MASK & (regs)->eflags) || (3 & (regs)->xcs)) -#define instruction_pointer(regs) ((regs)->eip) + +#define kernel_mode(regs) (a386_context_get_kernel_mode (&(regs)->context)) +#define user_mode(regs) (!kernel_mode (regs)) +#define instruction_pointer(regs) (a386_context_get_ip (&(regs)->context)) + +#define pt_get_ip(regs) a386_context_get_ip (&(regs)->context) +#define pt_set_ip(regs, x) a386_context_set_ip (&(regs)->context, (x)) +#define pt_get_sp(regs) a386_context_get_sp (&(regs)->context) +#define pt_set_sp(regs, x) a386_context_set_sp (&(regs)->context, (x)) +#define pt_get_result(regs) a386_context_get_result (&(regs)->context) +#define pt_set_result(regs, x) a386_context_set_result (&(regs)->context, x) +#define pt_get_syscall(regs) a386_context_get_syscall (&(regs)->context) +#define pt_set_syscall(regs, x) a386_context_set_syscall (&(regs)->context, x) + extern void show_regs(struct pt_regs *); #endif diff -Nru --exclude-from exclude Linux/include/asm-i386/system.h linux-a386/include/asm-i386/system.h --- Linux/include/asm-i386/system.h Fri Jan 21 01:05:28 2000 +++ linux-a386/include/asm-i386/system.h Wed Jan 26 12:07:44 2000 @@ -1,6 +1,8 @@ #ifndef __ASM_SYSTEM_H #define __ASM_SYSTEM_H +#include + #include #include #include /* for LOCK_PREFIX */ @@ -275,16 +277,18 @@ #define set_wmb(var, value) do { var = value; wmb(); } while (0) /* interrupt control.. */ -#define __save_flags(x) __asm__ __volatile__("pushfl ; popl %0":"=g" (x): /* no input */ :"memory") -#define __restore_flags(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory") -#define __cli() __asm__ __volatile__("cli": : :"memory") -#define __sti() __asm__ __volatile__("sti": : :"memory") +#define __save_flags(x) x = a386_interrupts_enabled () +#define __restore_flags(x) do { if (x) a386_interrupts_enable (); else \ + a386_interrupts_disable (); } while (0) +#define __cli() a386_interrupts_disable () +#define __sti() a386_interrupts_enable () /* For spinlocks etc */ -#define local_irq_save(x) __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (x): /* no input */ :"memory") -#define local_irq_restore(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"g" (x):"memory") -#define local_irq_disable() __asm__ __volatile__("cli": : :"memory") -#define local_irq_enable() __asm__ __volatile__("sti": : :"memory") +#define local_irq_save(x) x = a386_interrupts_enabled () +#define local_irq_restore(x) do { if (x) a386_interrupts_enable (); else \ + a386_interrupts_disable (); } while (0) +#define local_irq_disable() a386_interrupts_disable () +#define local_irq_enable() a386_interrupts_enable () #ifdef __SMP__ diff -Nru --exclude-from exclude Linux/include/asm-i386/uaccess.h linux-a386/include/asm-i386/uaccess.h --- Linux/include/asm-i386/uaccess.h Fri Jan 21 01:05:41 2000 +++ linux-a386/include/asm-i386/uaccess.h Wed Jan 26 12:11:21 2000 @@ -146,10 +146,17 @@ __ret_pu; \ }) +#if 1 /* FIXMEa386 */ #define __get_user(x,ptr) \ __get_user_nocheck((x),(ptr),sizeof(*(ptr))) #define __put_user(x,ptr) \ __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) +#else +#define __get_user(x,ptr) \ + __get_user_nocheck((x),(ptr),sizeof(*(ptr))) +#define __put_user(x,ptr) \ + __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr))) +#endif #define __put_user_nocheck(x,ptr,size) \ ({ \ diff -Nru --exclude-from exclude Linux/include/asm-i386/unistd.h linux-a386/include/asm-i386/unistd.h --- Linux/include/asm-i386/unistd.h Tue Jan 11 03:15:58 2000 +++ linux-a386/include/asm-i386/unistd.h Wed Jan 26 12:07:44 2000 @@ -1,6 +1,8 @@ #ifndef _ASM_I386_UNISTD_H_ #define _ASM_I386_UNISTD_H_ +#include + /* * This file contains the system call numbers. */ @@ -237,10 +239,7 @@ #define _syscall0(type,name) \ type name(void) \ { \ -long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name)); \ +long __res = a386_trap (__NR_##name); \ __syscall_return(type,__res); \ } @@ -248,9 +247,8 @@ type name(type1 arg1) \ { \ long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name),"b" ((long)(arg1))); \ +a386_set_arg (0, (a386_arg_t)arg1); \ +__res = a386_trap (__NR_##name); \ __syscall_return(type,__res); \ } @@ -258,9 +256,9 @@ type name(type1 arg1,type2 arg2) \ { \ long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2))); \ +a386_set_arg (0, (a386_arg_t)arg1); \ +a386_set_arg (1, (a386_arg_t)arg2); \ +__res = a386_trap (__NR_##name); \ __syscall_return(type,__res); \ } @@ -268,10 +266,10 @@ type name(type1 arg1,type2 arg2,type3 arg3) \ { \ long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ - "d" ((long)(arg3))); \ +a386_set_arg (0, (a386_arg_t)arg1); \ +a386_set_arg (1, (a386_arg_t)arg2); \ +a386_set_arg (2, (a386_arg_t)arg3); \ +__res = a386_trap (__NR_##name); \ __syscall_return(type,__res); \ } @@ -279,10 +277,11 @@ type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ - "d" ((long)(arg3)),"S" ((long)(arg4))); \ +a386_set_arg (0, (a386_arg_t)arg1); \ +a386_set_arg (1, (a386_arg_t)arg2); \ +a386_set_arg (2, (a386_arg_t)arg3); \ +a386_set_arg (3, (a386_arg_t)arg4); \ +__res = a386_trap (__NR_##name); \ __syscall_return(type,__res); \ } @@ -291,13 +290,22 @@ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ { \ long __res; \ -__asm__ volatile ("int $0x80" \ - : "=a" (__res) \ - : "0" (__NR_##name),"b" ((long)(arg1)),"c" ((long)(arg2)), \ - "d" ((long)(arg3)),"S" ((long)(arg4)),"D" ((long)(arg5))); \ +a386_set_arg (0, (a386_arg_t)arg1); \ +a386_set_arg (1, (a386_arg_t)arg2); \ +a386_set_arg (2, (a386_arg_t)arg3); \ +a386_set_arg (3, (a386_arg_t)arg4); \ +a386_set_arg (4, (a386_arg_t)arg5); \ +__res = a386_trap (__NR_##name); \ __syscall_return(type,__res); \ } +#if 1 /* FIXMEa386 */ +#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ + type5,arg5,type6,arg6) \ +do { \ + a386_panic ("syscall6"); \ +} while (0) +#else #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5,type6,arg6) \ type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \ @@ -310,6 +318,7 @@ "0" ((long)(arg6))); \ __syscall_return(type,__res); \ } +#endif #ifdef __KERNEL_SYSCALLS__