diff -c linux/linux/arch/i386/Makefile:1.1.1.1 linux/linux/arch/i386/Makefile:1.2
*** linux/linux/arch/i386/Makefile:1.1.1.1	Tue Jun  6 23:10:33 1995
--- linux/linux/arch/i386/Makefile	Tue Jun  6 23:10:33 1995
***************
*** 1,4 ****
--- 1,12 ----
  #
+ # We use ELF.
+ #
+ USE_ELF=yes
+ #
+ # We use a.out.
+ #USE_ELF=no
+ 
+ #
  # i386/Makefile
  #
  # This file is included by the global makefile so that you can add your own
***************
*** 21,30 ****
--- 29,55 ----
  # ZLINKFLAGS   = -Ttext 0x1000
  # LINKFLAGS    = -Ttext 0x100000
  #
+ #
+ ifeq ($(USE_ELF),yes)
+ LD=ld -m elf_i386
+ CPP=$(CC) -E -D__ELF__
+ OBJDUMP =objdump
+ OBJDUMP_FLAGS=-k -q 
+ LDFLAGS=-e startup_32 
+ ZIMAGE_OFFSET=0x1000
+ IMAGE_OFFSET=0x100000
+ ZLINKFLAGS =-Ttext $(ZIMAGE_OFFSET) $(LDFLAGS)
+ LINKFLAGS =-Ttext $(IMAGE_OFFSET) $(LDFLAGS)
+ else
+ AS=/usr/i486-linuxaout/bin/as
+ LD=/usr/i486-linuxaout/bin/ld -m i386linux
+ CC=gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include
+ #
  # -qmagic (we need to remove the 32 byte header for bootup purposes)
  #
  ZLINKFLAGS =-qmagic -Ttext 0xfe0
  LINKFLAGS =-qmagic -Ttext 0xfffe0
+ endif
  CFLAGS := $(CFLAGS) -pipe
  
  ifdef CONFIG_M486
diff -c linux/linux/arch/i386/boot/Makefile:1.1.1.1 linux/linux/arch/i386/boot/Makefile:1.2
*** linux/linux/arch/i386/boot/Makefile:1.1.1.1	Tue Jun  6 23:10:33 1995
--- linux/linux/arch/i386/boot/Makefile	Tue Jun  6 23:10:33 1995
***************
*** 11,18 ****
--- 11,27 ----
  AS86    =as86 -0 -a
  LD86    =ld86 -0
  
+ ifeq ($(USE_ELF),yes)
+ CFLAGS := $(CFLAGS) -D__BFD__
+ endif
+ 
  zImage: $(CONFIGURE) bootsect setup compressed/vmlinux tools/build
+ ifeq ($(USE_ELF),yes)
+ 	$(OBJDUMP) $(OBJDUMP_FLAGS) -o $(ZIMAGE_OFFSET) compressed/vmlinux > compressed/vmlinux.out
+ 	tools/build bootsect setup compressed/vmlinux.out $(ROOT_DEV) > zImage
+ else
  	tools/build bootsect setup compressed/vmlinux $(ROOT_DEV) > zImage
+ endif
  	sync
  
  compressed/vmlinux: $(TOPDIR)/vmlinux
***************
*** 56,60 ****
  
  clean:
  	rm -f bootsect setup
! 	rm -f zImage tools/build
  	@$(MAKE) -C compressed clean
--- 65,69 ----
  
  clean:
  	rm -f bootsect setup
! 	rm -f zImage tools/build compressed/vmlinux.out
  	@$(MAKE) -C compressed clean
diff -c linux/linux/arch/i386/boot/compressed/Makefile:1.1.1.1 linux/linux/arch/i386/boot/compressed/Makefile:1.2
*** linux/linux/arch/i386/boot/compressed/Makefile:1.1.1.1	Tue Jun  6 23:10:34 1995
--- linux/linux/arch/i386/boot/compressed/Makefile	Tue Jun  6 23:10:34 1995
***************
*** 11,16 ****
--- 11,22 ----
  
  CFLAGS = -O2 -DSTDC_HEADERS
  
+ ifeq ($(USE_ELF),yes)
+ TARGET=--target elf32-i386
+ INPUT_DATA=input_data
+ INPUT_LEN=input_len
+ endif
+ 
  .c.s:
  	$(CC) $(CFLAGS) -S $<
  .s.o:
***************
*** 20,32 ****
  
  all: vmlinux
  
! vmlinux:	piggy.o $(OBJECTS)
! 		$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
  
! head.o:	head.s
  
! head.s: head.S $(TOPDIR)/include/linux/tasks.h
! 	$(CPP) -traditional head.S -o head.s
  
  piggy.o:	$(SYSTEM) xtract piggyback
  		./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o
--- 26,51 ----
  
  all: vmlinux
  
! vmlinux: piggy.o $(OBJECTS)
! 	$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
! 
! #head.o:	head.s
  
! head.o: head.S $(TOPDIR)/include/linux/tasks.h
! 	$(CC) -traditional -c head.S
  
! ifeq ($(USE_ELF),yes)
! 
! # You cannot compress a file and have the kernel uncompress it, it must
! # be stdin
! piggy.o:	$(SYSTEM)
! 	tmppiggy=/tmp/$$.piggy; \
! 	rm -f $$tmppiggy $$tmppiggy.gz; \
! 	$(OBJDUMP) $(OBJDUMP_FLAGS) -o $(IMAGE_OFFSET) $(SYSTEM) > $$tmppiggy; \
! 	gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
! 	encaps $(TARGET) piggy.o $$tmppiggy.gz $(INPUT_DATA) $(INPUT_LEN); \
! 	rm -f $$tmppiggy $$tmppiggy.gz
! else
  
  piggy.o:	$(SYSTEM) xtract piggyback
  		./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o
***************
*** 36,41 ****
--- 55,62 ----
  
  piggyback: piggyback.c
  	$(HOSTCC) $(CFLAGS) -o piggyback piggyback.c
+ 
+ endif
  
  clean:
  	rm -f xtract piggyback vmlinux
diff -c linux/linux/arch/i386/boot/compressed/head.S:1.1.1.1 linux/linux/arch/i386/boot/compressed/head.S:1.2
*** linux/linux/arch/i386/boot/compressed/head.S:1.1.1.1	Tue Jun  6 23:10:34 1995
--- linux/linux/arch/i386/boot/compressed/head.S	Tue Jun  6 23:10:34 1995
***************
*** 19,26 ****
--- 19,28 ----
  .text
  
  #define __ASSEMBLY__
+ #include <linux/linkage.h>
  #include <asm/segment.h>
  
+ 	.globl startup_32
  startup_32:
  	cld
  	cli
***************
*** 29,35 ****
  	mov %ax,%es
  	mov %ax,%fs
  	mov %ax,%gs
! 	lss _stack_start,%esp
  	xorl %eax,%eax
  1:	incl %eax		# check that A20 really IS enabled
  	movl %eax,0x000000	# loop forever if it isn't
--- 31,37 ----
  	mov %ax,%es
  	mov %ax,%fs
  	mov %ax,%gs
! 	lss SYMBOL_NAME(stack_start),%esp
  	xorl %eax,%eax
  1:	incl %eax		# check that A20 really IS enabled
  	movl %eax,0x000000	# loop forever if it isn't
***************
*** 46,53 ****
   * Clear BSS
   */
  	xorl %eax,%eax
! 	movl $__edata,%edi
! 	movl $__end,%ecx
  	subl %edi,%ecx
  	cld
  	rep
--- 48,55 ----
   * Clear BSS
   */
  	xorl %eax,%eax
! 	movl $ SYMBOL_NAME(_edata),%edi
! 	movl $ SYMBOL_NAME(_end),%ecx
  	subl %edi,%ecx
  	cld
  	rep
***************
*** 55,59 ****
  /*
   * Do the decompression, and jump to the new kernel..
   */
! 	call _decompress_kernel
  	ljmp $(KERNEL_CS), $0x100000
--- 57,61 ----
  /*
   * Do the decompression, and jump to the new kernel..
   */
! 	call SYMBOL_NAME(decompress_kernel)
  	ljmp $(KERNEL_CS), $0x100000
diff -c linux/linux/arch/i386/boot/tools/build.c:1.1.1.1 linux/linux/arch/i386/boot/tools/build.c:1.2
*** linux/linux/arch/i386/boot/tools/build.c:1.1.1.1	Tue Jun  6 23:10:34 1995
--- linux/linux/arch/i386/boot/tools/build.c	Tue Jun  6 23:10:34 1995
***************
*** 30,40 ****
--- 30,43 ----
  #include <fcntl.h>
  #include <linux/a.out.h>
  #include <linux/config.h>
+ #include <errno.h>
  
  #define MINIX_HEADER 32
  
  #define N_MAGIC_OFFSET 1024
+ #ifndef __BFD__
  static int GCC_HEADER = sizeof(struct exec);
+ #endif
  
  #define SYS_SIZE DEF_SYSSIZE
  
***************
*** 89,95 ****
--- 92,100 ----
  	int i,c,id, sz;
  	unsigned long sys_size;
  	char buf[1024];
+ #ifndef __BFD__
  	struct exec *ex = (struct exec *)buf;
+ #endif
  	char major_root, minor_root;
  	struct stat sb;
  	unsigned char setup_sectors;
***************
*** 190,195 ****
--- 195,201 ----
  	
  	if ((id=open(argv[3],O_RDONLY,0))<0)
  		die("Unable to open 'system'");
+ #ifndef __BFD__
  	if (read(id,buf,GCC_HEADER) != GCC_HEADER)
  		die("Unable to read header of 'system'");
  	if (N_MAGIC(*ex) == ZMAGIC) {
***************
*** 203,208 ****
--- 209,222 ----
  		ex->a_data /1024,
  		ex->a_bss  /1024);
  	sz = N_SYMOFF(*ex) - GCC_HEADER + 4;
+ #else
+ 	if (fstat (id, &sb)) {
+ 	  perror ("fstat");
+ 	  die ("Unable to stat 'system'");
+ 	}
+ 	sz = sb.st_size;
+ 	fprintf (stderr, "System is %d kB\n", sz/1024);
+ #endif
  	sys_size = (sz + 15) / 16;
  	if (sys_size > SYS_SIZE)
  		die("System is too big");
diff -c linux/linux/arch/i386/ibcs/Makefile:1.1.1.1 linux/linux/arch/i386/ibcs/Makefile:1.2
*** linux/linux/arch/i386/ibcs/Makefile:1.1.1.1	Tue Jun  6 23:10:35 1995
--- linux/linux/arch/i386/ibcs/Makefile	Tue Jun  6 23:10:35 1995
***************
*** 7,12 ****
--- 7,14 ----
  #
  # Note 2! The CFLAGS definitions are now in the main makefile...
  
+ .S.o:
+ 	$(CC) $(CFLAGS) -c -traditional $< -o $*.s
  .S.s:
  	$(CPP) -traditional $< -o $*.s
  .c.s:
diff -c linux/linux/arch/i386/kernel/Makefile:1.1.1.1 linux/linux/arch/i386/kernel/Makefile:1.2
*** linux/linux/arch/i386/kernel/Makefile:1.1.1.1	Tue Jun  6 23:10:35 1995
--- linux/linux/arch/i386/kernel/Makefile	Tue Jun  6 23:10:35 1995
***************
*** 13,20 ****
  	$(AS) -o $*.o $<
  .c.o:
  	$(CC) $(CFLAGS) -c $<
! .S.s:
! 	$(CPP) -D__ASSEMBLY__ -traditional $< -o $*.s
  .S.o:
  	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
  
--- 13,20 ----
  	$(AS) -o $*.o $<
  .c.o:
  	$(CC) $(CFLAGS) -c $<
! #.S.s:
! #	$(CPP) -D__ASSEMBLY__ -traditional $< -o $*.s
  .S.o:
  	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o
  
***************
*** 22,31 ****
  
  all: kernel.o head.o
  
! head.o: head.s
  
! head.s: head.S $(TOPDIR)/include/linux/tasks.h
! 	$(CPP) -traditional -o $*.s $<
  
  kernel.o: $(OBJS)
  	$(LD) -r -o kernel.o $(OBJS)
--- 22,32 ----
  
  all: kernel.o head.o
  
! #head.o: head.s
  
! head.o: head.S $(TOPDIR)/include/linux/tasks.h
! 	$(CC) -D__ASSEMBLY__ -traditional -c $*.S -o $*.o
! #	$(CPP) -traditional -o $*.s $<
  
  kernel.o: $(OBJS)
  	$(LD) -r -o kernel.o $(OBJS)
diff -c linux/linux/arch/i386/kernel/entry.S:1.1.1.1 linux/linux/arch/i386/kernel/entry.S:1.2
*** linux/linux/arch/i386/kernel/entry.S:1.1.1.1	Tue Jun  6 23:10:35 1995
--- linux/linux/arch/i386/kernel/entry.S	Tue Jun  6 23:10:35 1995
***************
*** 41,46 ****
--- 41,47 ----
   */
  
  #include <linux/sys.h>
+ #include <linux/linkage.h>
  #include <asm/segment.h>
  
  EBX		= 0x00
***************
*** 82,96 ****
  
  ENOSYS = 38
  
- .globl _system_call,_lcall7
- .globl _device_not_available, _coprocessor_error
- .globl _divide_error,_debug,_nmi,_int3,_overflow,_bounds,_invalid_op
- .globl _double_fault,_coprocessor_segment_overrun
- .globl _invalid_TSS,_segment_not_present,_stack_segment
- .globl _general_protection,_reserved
- .globl _alignment_check,_page_fault
- .globl ret_from_sys_call, _sys_call_table
- 
  #define SAVE_ALL \
  	cld; \
  	push %gs; \
--- 83,88 ----
***************
*** 113,119 ****
  #define RESTORE_ALL \
  	cmpw $(KERNEL_CS),CS(%esp); \
  	je 1f;   \
! 	movl _current,%eax; \
  	movl dbgreg7(%eax),%ebx; \
  	movl %ebx,%db7;	\
  1:	popl %ebx; \
--- 105,111 ----
  #define RESTORE_ALL \
  	cmpw $(KERNEL_CS),CS(%esp); \
  	je 1f;   \
! 	movl SYMBOL_NAME(current),%eax; \
  	movl dbgreg7(%eax),%ebx; \
  	movl %ebx,%db7;	\
  1:	popl %ebx; \
***************
*** 130,137 ****
  	addl $4,%esp; \
  	iret
  
! .align 4
! _lcall7:
  	pushfl			# We get a different stack layout with call gates,
  	pushl %eax		# which has to be cleaned up later..
  	SAVE_ALL
--- 122,128 ----
  	addl $4,%esp; \
  	iret
  
! ENTRY(lcall7)
  	pushfl			# We get a different stack layout with call gates,
  	pushl %eax		# which has to be cleaned up later..
  	SAVE_ALL
***************
*** 142,148 ****
  	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
  	movl %ecx,CS(%esp)	#
  	movl %esp,%eax
! 	movl _current,%edx
  	pushl %eax
  	movl exec_domain(%edx),%edx	# Get the execution domain
  	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
--- 133,139 ----
  	movl %edx,EIP(%esp)	# Now we move them to their "normal" places
  	movl %ecx,CS(%esp)	#
  	movl %esp,%eax
! 	movl SYMBOL_NAME(current),%edx
  	pushl %eax
  	movl exec_domain(%edx),%edx	# Get the execution domain
  	movl 4(%edx),%edx	# Get the lcall7 handler for the domain
***************
*** 150,179 ****
  	popl %eax
  	jmp ret_from_sys_call
  
! .align 4
  handle_bottom_half:
  	pushfl
! 	incl _intr_count
  	sti
! 	call _do_bottom_half
  	popfl
! 	decl _intr_count
  	jmp 9f
! .align 4
  reschedule:
  	pushl $ret_from_sys_call
! 	jmp _schedule
! .align 4
! _system_call:
  	pushl %eax			# save orig_eax
  	SAVE_ALL
  	movl $-ENOSYS,EAX(%esp)
  	cmpl $(NR_syscalls),%eax
  	jae ret_from_sys_call
! 	movl _sys_call_table(,%eax,4),%eax
  	testl %eax,%eax
  	je ret_from_sys_call
! 	movl _current,%ebx
  	andl $~CF_MASK,EFLAGS(%esp)	# clear carry - assume no errors
  	movl $0,errno(%ebx)
  	movl %db6,%edx
--- 141,170 ----
  	popl %eax
  	jmp ret_from_sys_call
  
! 	ALIGN
  handle_bottom_half:
  	pushfl
! 	incl SYMBOL_NAME(intr_count)
  	sti
! 	call SYMBOL_NAME(do_bottom_half)
  	popfl
! 	decl SYMBOL_NAME(intr_count)
  	jmp 9f
! 	ALIGN
  reschedule:
  	pushl $ret_from_sys_call
! 	jmp SYMBOL_NAME(schedule)
! 
! ENTRY(system_call)
  	pushl %eax			# save orig_eax
  	SAVE_ALL
  	movl $-ENOSYS,EAX(%esp)
  	cmpl $(NR_syscalls),%eax
  	jae ret_from_sys_call
! 	movl SYMBOL_NAME(sys_call_table)(,%eax,4),%eax
  	testl %eax,%eax
  	je ret_from_sys_call
! 	movl SYMBOL_NAME(current),%ebx
  	andl $~CF_MASK,EFLAGS(%esp)	# clear carry - assume no errors
  	movl $0,errno(%ebx)
  	movl %db6,%edx
***************
*** 188,212 ****
  	movl %edx,EAX(%esp)
  	orl $(CF_MASK),EFLAGS(%esp)	# set carry to indicate error
  	jmp ret_from_sys_call
! .align 4
! 1:	call _syscall_trace
  	movl ORIG_EAX(%esp),%eax
! 	call _sys_call_table(,%eax,4)
  	movl %eax,EAX(%esp)		# save the return value
! 	movl _current,%eax
  	movl errno(%eax),%edx
  	negl %edx
  	je 1f
  	movl %edx,EAX(%esp)
  	orl $(CF_MASK),EFLAGS(%esp)	# set carry to indicate error
! 1:	call _syscall_trace
  
! 	.align 4,0x90
  ret_from_sys_call:
! 	cmpl $0,_intr_count
  	jne 2f
! 9:	movl _bh_mask,%eax
! 	andl _bh_active,%eax
  	jne handle_bottom_half
  	movl EFLAGS(%esp),%eax		# check VM86 flag: CS/SS are
  	testl $(VM_MASK),%eax		# different then
--- 179,204 ----
  	movl %edx,EAX(%esp)
  	orl $(CF_MASK),EFLAGS(%esp)	# set carry to indicate error
  	jmp ret_from_sys_call
! 	ALIGN
! 1:	call SYMBOL_NAME(syscall_trace)
  	movl ORIG_EAX(%esp),%eax
! 	call SYMBOL_NAME(sys_call_table)(,%eax,4)
  	movl %eax,EAX(%esp)		# save the return value
! 	movl SYMBOL_NAME(current),%eax
  	movl errno(%eax),%edx
  	negl %edx
  	je 1f
  	movl %edx,EAX(%esp)
  	orl $(CF_MASK),EFLAGS(%esp)	# set carry to indicate error
! 1:	call SYMBOL_NAME(syscall_trace)
  
! 	ALIGN
! 	.globl ret_from_sys_call
  ret_from_sys_call:
! 	cmpl $0,SYMBOL_NAME(intr_count)
  	jne 2f
! 9:	movl SYMBOL_NAME(bh_mask),%eax
! 	andl SYMBOL_NAME(bh_active),%eax
  	jne handle_bottom_half
  	movl EFLAGS(%esp),%eax		# check VM86 flag: CS/SS are
  	testl $(VM_MASK),%eax		# different then
***************
*** 217,226 ****
  	orl $(IF_MASK),%eax		# these just try to make sure
  	andl $~NT_MASK,%eax		# the program doesn't do anything
  	movl %eax,EFLAGS(%esp)		# stupid
! 	cmpl $0,_need_resched
  	jne reschedule
! 	movl _current,%eax
! 	cmpl _task,%eax			# task[0] cannot have signals
  	je 2f
  	cmpl $0,state(%eax)		# state
  	jne reschedule
--- 209,218 ----
  	orl $(IF_MASK),%eax		# these just try to make sure
  	andl $~NT_MASK,%eax		# the program doesn't do anything
  	movl %eax,EFLAGS(%esp)		# stupid
! 	cmpl $0,SYMBOL_NAME(need_resched)
  	jne reschedule
! 	movl SYMBOL_NAME(current),%eax
! 	cmpl SYMBOL_NAME(task),%eax	# task[0] cannot have signals
  	je 2f
  	cmpl $0,state(%eax)		# state
  	jne reschedule
***************
*** 232,264 ****
  	andl signal(%eax),%ecx
  	jne signal_return
  2:	RESTORE_ALL
! .align 4
  signal_return:
  	movl %esp,%ecx
  	pushl %ecx
  	testl $(VM_MASK),EFLAGS(%ecx)
  	jne v86_signal_return
  	pushl %ebx
! 	call _do_signal
  	popl %ebx
  	popl %ebx
  	RESTORE_ALL
! .align 4
  v86_signal_return:
! 	call _save_v86_state
  	movl %eax,%esp
  	pushl %eax
  	pushl %ebx
! 	call _do_signal
  	popl %ebx
  	popl %ebx
  	RESTORE_ALL
  
! .align 4
! _divide_error:
  	pushl $0		# no error code
! 	pushl $_do_divide_error
! .align 4,0x90
  error_code:
  	push %fs
  	push %es
--- 224,255 ----
  	andl signal(%eax),%ecx
  	jne signal_return
  2:	RESTORE_ALL
! 	ALIGN
  signal_return:
  	movl %esp,%ecx
  	pushl %ecx
  	testl $(VM_MASK),EFLAGS(%ecx)
  	jne v86_signal_return
  	pushl %ebx
! 	call SYMBOL_NAME(do_signal)
  	popl %ebx
  	popl %ebx
  	RESTORE_ALL
! 	ALIGN
  v86_signal_return:
! 	call SYMBOL_NAME(save_v86_state)
  	movl %eax,%esp
  	pushl %eax
  	pushl %ebx
! 	call SYMBOL_NAME(do_signal)
  	popl %ebx
  	popl %ebx
  	RESTORE_ALL
  
! ENTRY(divide_error)
  	pushl $0		# no error code
! 	pushl $ SYMBOL_NAME(do_divide_error)
! 	ALIGN
  error_code:
  	push %fs
  	push %es
***************
*** 287,293 ****
  	movl $(USER_DS),%edx
  	mov %dx,%fs
  	pushl %eax
! 	movl _current,%eax
  	movl %db6,%edx
  	movl %edx,dbgreg6(%eax)  # save current hardware debugging status
  	popl %eax
--- 278,284 ----
  	movl $(USER_DS),%edx
  	mov %dx,%fs
  	pushl %eax
! 	movl SYMBOL_NAME(current),%eax
  	movl %db6,%edx
  	movl %edx,dbgreg6(%eax)  # save current hardware debugging status
  	popl %eax
***************
*** 295,544 ****
  	addl $8,%esp
  	jmp ret_from_sys_call
  
! .align 4
! _coprocessor_error:
  	pushl $0
! 	pushl $_do_coprocessor_error
  	jmp error_code
  
! .align 4
! _device_not_available:
  	pushl $-1		# mark this as an int
  	SAVE_ALL
  	pushl $ret_from_sys_call
  	movl %cr0,%eax
  	testl $0x4,%eax			# EM (math emulation bit)
! 	je _math_state_restore
  	pushl $0		# temporary storage for ORIG_EIP
! 	call _math_emulate
  	addl $4,%esp
  	ret
  
! .align 4
! _debug:
  	pushl $0
! 	pushl $_do_debug
  	jmp error_code
  
! .align 4
! _nmi:
  	pushl $0
! 	pushl $_do_nmi
  	jmp error_code
  
! .align 4
! _int3:
  	pushl $0
! 	pushl $_do_int3
  	jmp error_code
  
! .align 4
! _overflow:
  	pushl $0
! 	pushl $_do_overflow
  	jmp error_code
  
! .align 4
! _bounds:
  	pushl $0
! 	pushl $_do_bounds
  	jmp error_code
  
! .align 4
! _invalid_op:
  	pushl $0
! 	pushl $_do_invalid_op
  	jmp error_code
  
! .align 4
! _coprocessor_segment_overrun:
  	pushl $0
! 	pushl $_do_coprocessor_segment_overrun
  	jmp error_code
  
! .align 4
! _reserved:
  	pushl $0
! 	pushl $_do_reserved
  	jmp error_code
  
! .align 4
! _double_fault:
! 	pushl $_do_double_fault
  	jmp error_code
  
! .align 4
! _invalid_TSS:
! 	pushl $_do_invalid_TSS
  	jmp error_code
  
! .align 4
! _segment_not_present:
! 	pushl $_do_segment_not_present
  	jmp error_code
  
! .align 4
! _stack_segment:
! 	pushl $_do_stack_segment
  	jmp error_code
  
! .align 4
! _general_protection:
! 	pushl $_do_general_protection
  	jmp error_code
  
! .align 4
! _alignment_check:
! 	pushl $_do_alignment_check
  	jmp error_code
  
! .align 4
! _page_fault:
! 	pushl $_do_page_fault
  	jmp error_code
  
  .data
! .align 4
! _sys_call_table:
! 	.long _sys_setup		/* 0 */
! 	.long _sys_exit
! 	.long _sys_fork
! 	.long _sys_read
! 	.long _sys_write
! 	.long _sys_open			/* 5 */
! 	.long _sys_close
! 	.long _sys_waitpid
! 	.long _sys_creat
! 	.long _sys_link
! 	.long _sys_unlink		/* 10 */
! 	.long _sys_execve
! 	.long _sys_chdir
! 	.long _sys_time
! 	.long _sys_mknod
! 	.long _sys_chmod		/* 15 */
! 	.long _sys_chown
! 	.long _sys_break
! 	.long _sys_stat
! 	.long _sys_lseek
! 	.long _sys_getpid		/* 20 */
! 	.long _sys_mount
! 	.long _sys_umount
! 	.long _sys_setuid
! 	.long _sys_getuid
! 	.long _sys_stime		/* 25 */
! 	.long _sys_ptrace
! 	.long _sys_alarm
! 	.long _sys_fstat
! 	.long _sys_pause
! 	.long _sys_utime		/* 30 */
! 	.long _sys_stty
! 	.long _sys_gtty
! 	.long _sys_access
! 	.long _sys_nice
! 	.long _sys_ftime		/* 35 */
! 	.long _sys_sync
! 	.long _sys_kill
! 	.long _sys_rename
! 	.long _sys_mkdir
! 	.long _sys_rmdir		/* 40 */
! 	.long _sys_dup
! 	.long _sys_pipe
! 	.long _sys_times
! 	.long _sys_prof
! 	.long _sys_brk			/* 45 */
! 	.long _sys_setgid
! 	.long _sys_getgid
! 	.long _sys_signal
! 	.long _sys_geteuid
! 	.long _sys_getegid		/* 50 */
! 	.long _sys_acct
! 	.long _sys_phys
! 	.long _sys_lock
! 	.long _sys_ioctl
! 	.long _sys_fcntl		/* 55 */
! 	.long _sys_mpx
! 	.long _sys_setpgid
! 	.long _sys_ulimit
! 	.long _sys_olduname
! 	.long _sys_umask		/* 60 */
! 	.long _sys_chroot
! 	.long _sys_ustat
! 	.long _sys_dup2
! 	.long _sys_getppid
! 	.long _sys_getpgrp		/* 65 */
! 	.long _sys_setsid
! 	.long _sys_sigaction
! 	.long _sys_sgetmask
! 	.long _sys_ssetmask
! 	.long _sys_setreuid		/* 70 */
! 	.long _sys_setregid
! 	.long _sys_sigsuspend
! 	.long _sys_sigpending
! 	.long _sys_sethostname
! 	.long _sys_setrlimit		/* 75 */
! 	.long _sys_getrlimit
! 	.long _sys_getrusage
! 	.long _sys_gettimeofday
! 	.long _sys_settimeofday
! 	.long _sys_getgroups		/* 80 */
! 	.long _sys_setgroups
! 	.long _sys_select
! 	.long _sys_symlink
! 	.long _sys_lstat
! 	.long _sys_readlink		/* 85 */
! 	.long _sys_uselib
! 	.long _sys_swapon
! 	.long _sys_reboot
! 	.long _sys_readdir
! 	.long _sys_mmap			/* 90 */
! 	.long _sys_munmap
! 	.long _sys_truncate
! 	.long _sys_ftruncate
! 	.long _sys_fchmod
! 	.long _sys_fchown		/* 95 */
! 	.long _sys_getpriority
! 	.long _sys_setpriority
! 	.long _sys_profil
! 	.long _sys_statfs
! 	.long _sys_fstatfs		/* 100 */
! 	.long _sys_ioperm
! 	.long _sys_socketcall
! 	.long _sys_syslog
! 	.long _sys_setitimer
! 	.long _sys_getitimer		/* 105 */
! 	.long _sys_newstat
! 	.long _sys_newlstat
! 	.long _sys_newfstat
! 	.long _sys_uname
! 	.long _sys_iopl			/* 110 */
! 	.long _sys_vhangup
! 	.long _sys_idle
! 	.long _sys_vm86
! 	.long _sys_wait4
! 	.long _sys_swapoff		/* 115 */
! 	.long _sys_sysinfo
! 	.long _sys_ipc
! 	.long _sys_fsync
! 	.long _sys_sigreturn
! 	.long _sys_clone		/* 120 */
! 	.long _sys_setdomainname
! 	.long _sys_newuname
! 	.long _sys_modify_ldt
! 	.long _sys_adjtimex
! 	.long _sys_mprotect		/* 125 */
! 	.long _sys_sigprocmask
! 	.long _sys_create_module
! 	.long _sys_init_module
! 	.long _sys_delete_module
! 	.long _sys_get_kernel_syms	/* 130 */
! 	.long _sys_quotactl
! 	.long _sys_getpgid
! 	.long _sys_fchdir
! 	.long _sys_bdflush
! 	.long _sys_sysfs		/* 135 */
! 	.long _sys_personality
  	.long 0				/* for afs_syscall */
! 	.long _sys_setfsuid
! 	.long _sys_setfsgid
! 	.long _sys_llseek		/* 140 */
  	.space (NR_syscalls-140)*4
--- 286,517 ----
  	addl $8,%esp
  	jmp ret_from_sys_call
  
! 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
  	pushl $ret_from_sys_call
  	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 $0
! 	pushl $ SYMBOL_NAME(do_nmi)
  	jmp error_code
  
! 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
  
  .data
! ENTRY(sys_call_table)
! 	.long SYMBOL_NAME(sys_setup)		/* 0 */
! 	.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_chown)
! 	.long SYMBOL_NAME(sys_break)
! 	.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_umount)
! 	.long SYMBOL_NAME(sys_setuid)
! 	.long SYMBOL_NAME(sys_getuid)
! 	.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_stty)
! 	.long SYMBOL_NAME(sys_gtty)
! 	.long SYMBOL_NAME(sys_access)
! 	.long SYMBOL_NAME(sys_nice)
! 	.long SYMBOL_NAME(sys_ftime)		/* 35 */
! 	.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_prof)
! 	.long SYMBOL_NAME(sys_brk)		/* 45 */
! 	.long SYMBOL_NAME(sys_setgid)
! 	.long SYMBOL_NAME(sys_getgid)
! 	.long SYMBOL_NAME(sys_signal)
! 	.long SYMBOL_NAME(sys_geteuid)
! 	.long SYMBOL_NAME(sys_getegid)		/* 50 */
! 	.long SYMBOL_NAME(sys_acct)
! 	.long SYMBOL_NAME(sys_phys)
! 	.long SYMBOL_NAME(sys_lock)
! 	.long SYMBOL_NAME(sys_ioctl)
! 	.long SYMBOL_NAME(sys_fcntl)		/* 55 */
! 	.long SYMBOL_NAME(sys_mpx)
! 	.long SYMBOL_NAME(sys_setpgid)
! 	.long SYMBOL_NAME(sys_ulimit)
! 	.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_setreuid)		/* 70 */
! 	.long SYMBOL_NAME(sys_setregid)
! 	.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_getrlimit)
! 	.long SYMBOL_NAME(sys_getrusage)
! 	.long SYMBOL_NAME(sys_gettimeofday)
! 	.long SYMBOL_NAME(sys_settimeofday)
! 	.long SYMBOL_NAME(sys_getgroups)	/* 80 */
! 	.long SYMBOL_NAME(sys_setgroups)
! 	.long SYMBOL_NAME(sys_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(sys_readdir)
! 	.long SYMBOL_NAME(sys_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_fchown)		/* 95 */
! 	.long SYMBOL_NAME(sys_getpriority)
! 	.long SYMBOL_NAME(sys_setpriority)
! 	.long SYMBOL_NAME(sys_profil)
! 	.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_idle)
! 	.long SYMBOL_NAME(sys_vm86)
! 	.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 0				/* for afs_syscall */
! 	.long SYMBOL_NAME(sys_setfsuid)
! 	.long SYMBOL_NAME(sys_setfsgid)
! 	.long SYMBOL_NAME(sys_llseek)		/* 140 */
  	.space (NR_syscalls-140)*4
diff -c linux/linux/arch/i386/kernel/head.S:1.1.1.1 linux/linux/arch/i386/kernel/head.S:1.2
*** linux/linux/arch/i386/kernel/head.S:1.1.1.1	Tue Jun  6 23:10:35 1995
--- linux/linux/arch/i386/kernel/head.S	Tue Jun  6 23:10:36 1995
***************
*** 9,24 ****
   */
  
  .text
- .globl _idt,_gdt,
- .globl _swapper_pg_dir,_pg0
- .globl _empty_bad_page
- .globl _empty_bad_page_table
- .globl _empty_zero_page
- .globl _floppy_track_buffer
  
- #define __ASSEMBLY__
  #include <linux/tasks.h>
  #include <linux/fd.h>
  #include <asm/segment.h>
  
  #define CL_MAGIC_ADDR	0x90020
--- 9,18 ----
   */
  
  .text
  
  #include <linux/tasks.h>
  #include <linux/fd.h>
+ #include <linux/linkage.h>
  #include <asm/segment.h>
  
  #define CL_MAGIC_ADDR	0x90020
***************
*** 30,35 ****
--- 24,30 ----
   * swapper_pg_dir is the main page directory, address 0x00001000 (or at
   * address 0x00101000 for a compressed boot).
   */
+ 	.globl startup_32
  startup_32:
  	cld
  	movl $(KERNEL_DS),%eax
***************
*** 42,49 ****
   * Clear BSS first so that there are no surprises...
   */
  	xorl %eax,%eax
! 	movl $__edata,%edi
! 	movl $__end,%ecx
  	subl %edi,%ecx
  	cld
  	rep
--- 37,44 ----
   * Clear BSS first so that there are no surprises...
   */
  	xorl %eax,%eax
! 	movl $ SYMBOL_NAME(_edata),%edi
! 	movl $ SYMBOL_NAME(_end),%ecx
  	subl %edi,%ecx
  	cld
  	rep
***************
*** 71,77 ****
   * is for the command line.
   */
  	movl $0x90000,%esi
! 	movl $_empty_zero_page,%edi
  	movl $512,%ecx
  	cld
  	rep
--- 66,72 ----
   * is for the command line.
   */
  	movl $0x90000,%esi
! 	movl $ SYMBOL_NAME(empty_zero_page),%edi
  	movl $512,%ecx
  	cld
  	rep
***************
*** 82,88 ****
  	stosl
  	cmpw $(CL_MAGIC),CL_MAGIC_ADDR
  	jne 1f
! 	movl $_empty_zero_page+2048,%edi
  	movzwl CL_OFFSET,%esi
  	addl $(CL_BASE_ADDR),%esi
  	movl $2048,%ecx
--- 77,83 ----
  	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 $2048,%ecx
***************
*** 95,101 ****
   * 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
  	pushfl			# push EFLAGS
  	popl %eax		# get EFLAGS
  	movl %eax,%ecx		# save original EFLAGS
--- 90,96 ----
   * apply at our cpl of 0 and the stack ought to be aligned already, and
   * we don't need to preserve eflags.
   */
! 	movl $3, SYMBOL_NAME(x86)
  	pushfl			# push EFLAGS
  	popl %eax		# get EFLAGS
  	movl %eax,%ecx		# save original EFLAGS
***************
*** 107,113 ****
  	xorl %ecx,%eax		# change in flags
  	andl $0x40000,%eax	# check if AC bit changed
  	je is386
! 	movl $4,_x86
  	movl %ecx,%eax
  	xorl $0x200000,%eax	# check ID flag
  	pushl %eax
--- 102,108 ----
  	xorl %ecx,%eax		# change in flags
  	andl $0x40000,%eax	# check if AC bit changed
  	je is386
! 	movl $4,SYMBOL_NAME(x86)
  	movl %ecx,%eax
  	xorl $0x200000,%eax	# check ID flag
  	pushl %eax
***************
*** 124,142 ****
  	.byte 0x0f, 0xa2	# check the processor type
  	movb %al, %cl		# save reg for future use
  	andb $0x0f,%ah		# mask processor family
! 	movb %ah, _x86
  	andb $0xf0, %eax	# mask model
  	shrb $4, %al
! 	movb %al, _x86_model
  	andb $0x0f, %cl		# mask mask revision
! 	movb %cl, _x86_mask
! 	movl %edx, _x86_capability
  	/* get vendor info */
  	xorl %eax, %eax			# call CPUID with 0 -> return vendor ID
  	.byte 0x0f, 0xa2		# CPUID
! 	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
  
  	movl %cr0,%eax		# 486+
  	andl $0x80000011,%eax	# Save PG,PE,ET
--- 119,137 ----
  	.byte 0x0f, 0xa2	# check the processor type
  	movb %al, %cl		# save reg for future use
  	andb $0x0f,%ah		# mask processor family
! 	movb %ah,SYMBOL_NAME(x86)
  	andb $0xf0, %eax	# mask model
  	shrb $4, %al
! 	movb %al,SYMBOL_NAME(x86_model)
  	andb $0x0f, %cl		# mask mask revision
! 	movb %cl,SYMBOL_NAME(x86_mask)
! 	movl %edx,SYMBOL_NAME(x86_capability)
  	/* get vendor info */
  	xorl %eax, %eax			# call CPUID with 0 -> return vendor ID
  	.byte 0x0f, 0xa2		# CPUID
! 	movl %ebx,SYMBOL_NAME(x86_vendor_id)	# lo 4 chars
! 	movl %edx,SYMBOL_NAME(x86_vendor_id)+4	# next 4 chars
! 	movl %ecx,SYMBOL_NAME(x86_vendor_id)+8	# last 4 chars
  
  	movl %cr0,%eax		# 486+
  	andl $0x80000011,%eax	# Save PG,PE,ET
***************
*** 171,177 ****
  	pushl %eax
  	pushl %eax
  	cld			# gcc2 wants the direction flag cleared at all times
! 	call _start_kernel
  L6:
  	jmp L6			# main should never return here, but
  				# just in case, we know what happens.
--- 166,172 ----
  	pushl %eax
  	pushl %eax
  	cld			# gcc2 wants the direction flag cleared at all times
! 	call SYMBOL_NAME(start_kernel)
  L6:
  	jmp L6			# main should never return here, but
  				# just in case, we know what happens.
***************
*** 180,186 ****
   * We depend on ET to be correct. This checks for 287/387.
   */
  check_x87:
! 	movb $0,_hard_math
  	clts
  	fninit
  	fstsw %ax
--- 175,181 ----
   * We depend on ET to be correct. This checks for 287/387.
   */
  check_x87:
! 	movb $0,SYMBOL_NAME(hard_math)
  	clts
  	fninit
  	fstsw %ax
***************
*** 190,197 ****
  	xorl $4,%eax		/* set EM */
  	movl %eax,%cr0
  	ret
! .align 2
! 1:	movb $1,_hard_math
  	.byte 0xDB,0xE4		/* fsetpm for 287, ignored by 387 */
  	ret
  
--- 185,192 ----
  	xorl $4,%eax		/* set EM */
  	movl %eax,%cr0
  	ret
! 	ALIGN
! 1:	movb $1,SYMBOL_NAME(hard_math)
  	.byte 0xDB,0xE4		/* fsetpm for 287, ignored by 387 */
  	ret
  
***************
*** 211,217 ****
  	movw %dx,%ax		/* selector = 0x0010 = cs */
  	movw $0x8E00,%dx	/* interrupt gate - dpl=0, present */
  
! 	lea _idt,%edi
  	mov $256,%ecx
  rp_sidt:
  	movl %eax,(%edi)
--- 206,212 ----
  	movw %dx,%ax		/* selector = 0x0010 = cs */
  	movw $0x8E00,%dx	/* interrupt gate - dpl=0, present */
  
! 	lea SYMBOL_NAME(idt),%edi
  	mov $256,%ecx
  rp_sidt:
  	movl %eax,(%edi)
***************
*** 233,256 ****
   * (ref: update, 25Sept92)  -- croutons@crunchy.uucp 
   * (ref: 92.10.11 - Linus Torvalds. Corrected 16M limit - no upper memory limit)
   */
! .align 2
  setup_paging:
  	movl $1024*2,%ecx		/* 2 pages - swapper_pg_dir+1 page table */
  	xorl %eax,%eax
! 	movl $_swapper_pg_dir,%edi	/* swapper_pg_dir is at 0x1000 */
  	cld;rep;stosl
  /* Identity-map the kernel in low 4MB memory for ease of transition */
! 	movl $_pg0+7,_swapper_pg_dir		/* set present bit/user r/w */
  /* But the real place is at 0xC0000000 */
! 	movl $_pg0+7,_swapper_pg_dir+3072	/* set present bit/user r/w */
! 	movl $_pg0+4092,%edi
  	movl $0x03ff007,%eax		/*  4Mb - 4096 + 7 (r/w user,p) */
  	std
  1:	stosl			/* fill the page backwards - more efficient :-) */
  	subl $0x1000,%eax
  	jge 1b
  	cld
! 	movl $_swapper_pg_dir,%eax
  	movl %eax,%cr3			/* cr3 - page directory start */
  	movl %cr0,%eax
  	orl $0x80000000,%eax
--- 228,253 ----
   * (ref: update, 25Sept92)  -- croutons@crunchy.uucp 
   * (ref: 92.10.11 - Linus Torvalds. Corrected 16M limit - no upper memory limit)
   */
! 	ALIGN
  setup_paging:
  	movl $1024*2,%ecx		/* 2 pages - swapper_pg_dir+1 page table */
  	xorl %eax,%eax
! 	movl $ SYMBOL_NAME(swapper_pg_dir),%edi	/* swapper_pg_dir is at 0x1000 */
  	cld;rep;stosl
  /* Identity-map the kernel in low 4MB memory for ease of transition */
! /* set present bit/user r/w */
! 	movl $ SYMBOL_NAME(pg0)+7,SYMBOL_NAME(swapper_pg_dir)
  /* But the real place is at 0xC0000000 */
! /* set present bit/user r/w */
! 	movl $ SYMBOL_NAME(pg0)+7,SYMBOL_NAME(swapper_pg_dir)+3072
! 	movl $ SYMBOL_NAME(pg0)+4092,%edi
  	movl $0x03ff007,%eax		/*  4Mb - 4096 + 7 (r/w user,p) */
  	std
  1:	stosl			/* fill the page backwards - more efficient :-) */
  	subl $0x1000,%eax
  	jge 1b
  	cld
! 	movl $ SYMBOL_NAME(swapper_pg_dir),%eax
  	movl %eax,%cr3			/* cr3 - page directory start */
  	movl %cr0,%eax
  	orl $0x80000000,%eax
***************
*** 268,289 ****
   * by 2-3k.  This would be a good thing to do at some point.....
   */
  .org 0x1000
! _swapper_pg_dir:
  /*
   * The page tables are initialized to only 4MB here - the final page
   * tables are set up later depending on memory size.
   */
  .org 0x2000
! _pg0:
  
  .org 0x3000
! _empty_bad_page:
  
  .org 0x4000
! _empty_bad_page_table:
  
  .org 0x5000
! _empty_zero_page:
  
  .org 0x6000
  /*
--- 265,286 ----
   * by 2-3k.  This would be a good thing to do at some point.....
   */
  .org 0x1000
! ENTRY(swapper_pg_dir)
  /*
   * The page tables are initialized to only 4MB here - the final page
   * tables are set up later depending on memory size.
   */
  .org 0x2000
! ENTRY(pg0)
  
  .org 0x3000
! ENTRY(empty_bad_page)
  
  .org 0x4000
! ENTRY(empty_bad_page_table)
  
  .org 0x5000
! ENTRY(empty_zero_page)
  
  .org 0x6000
  /*
***************
*** 292,308 ****
   * sector read/write can mess it up. It can contain one full cylinder (sic) of
   * data (36*2*512 bytes).
   */
! _floppy_track_buffer:
  	.fill 512*2*MAX_BUFFER_SECTORS,1,0
  	
  stack_start:
! 	.long _init_user_stack+4096
  	.long KERNEL_DS
  
  /* This is the default interrupt "handler" :-) */
  int_msg:
  	.asciz "Unknown interrupt\n"
! .align 2
  ignore_int:
  	cld
  	pushl %eax
--- 289,305 ----
   * sector read/write can mess it up. It can contain one full cylinder (sic) of
   * data (36*2*512 bytes).
   */
! ENTRY(floppy_track_buffer)
  	.fill 512*2*MAX_BUFFER_SECTORS,1,0
  	
  stack_start:
! 	.long SYMBOL_NAME(init_user_stack)+4096
  	.long KERNEL_DS
  
  /* This is the default interrupt "handler" :-) */
  int_msg:
  	.asciz "Unknown interrupt\n"
! 	ALIGN
  ignore_int:
  	cld
  	pushl %eax
***************
*** 316,322 ****
  	mov %ax,%es
  	mov %ax,%fs
  	pushl $int_msg
! 	call _printk
  	popl %eax
  	pop %fs
  	pop %es
--- 313,319 ----
  	mov %ax,%es
  	mov %ax,%fs
  	pushl $int_msg
! 	call SYMBOL_NAME(printk)
  	popl %eax
  	pop %fs
  	pop %es
***************
*** 329,356 ****
  /*
   * The interrupt descriptor table has room for 256 idt's
   */
! .align 4
  .word 0
  idt_descr:
  	.word 256*8-1		# idt contains 256 entries
! 	.long 0xc0000000+_idt
  
! .align 4
! _idt:
  	.fill 256,8,0		# idt is uninitialized
  
! .align 4
  .word 0
  gdt_descr:
  	.word (8+2*NR_TASKS)*8-1
! 	.long 0xc0000000+_gdt
  
  /*
   * This gdt setup gives the kernel a 1GB address space at virtual
   * address 0xC0000000 - space enough for expansion, I hope.
   */
! .align 4
! _gdt:
  	.quad 0x0000000000000000	/* NULL descriptor */
  	.quad 0x0000000000000000	/* not used */
  	.quad 0xc0c39a000000ffff	/* 0x10 kernel 1GB code at 0xC0000000 */
--- 326,351 ----
  /*
   * The interrupt descriptor table has room for 256 idt's
   */
! 	ALIGN
  .word 0
  idt_descr:
  	.word 256*8-1		# idt contains 256 entries
! 	.long 0xc0000000+SYMBOL_NAME(idt)
  
! ENTRY(idt)
  	.fill 256,8,0		# idt is uninitialized
  
! 	ALIGN
  .word 0
  gdt_descr:
  	.word (8+2*NR_TASKS)*8-1
! 	.long 0xc0000000+SYMBOL_NAME(gdt)
  
  /*
   * This gdt setup gives the kernel a 1GB address space at virtual
   * address 0xC0000000 - space enough for expansion, I hope.
   */
! ENTRY(gdt)
  	.quad 0x0000000000000000	/* NULL descriptor */
  	.quad 0x0000000000000000	/* not used */
  	.quad 0xc0c39a000000ffff	/* 0x10 kernel 1GB code at 0xC0000000 */
diff -c linux/linux/arch/i386/kernel/process.c:1.1.1.2 linux/linux/arch/i386/kernel/process.c:1.5
*** linux/linux/arch/i386/kernel/process.c:1.1.1.2	Tue Jun  6 23:10:36 1995
--- linux/linux/arch/i386/kernel/process.c	Tue Jun  6 23:10:36 1995
***************
*** 194,199 ****
--- 194,224 ----
  }
  
  /*
+  * fill in the fpu structure for a core dump..
+  */
+ int dump_fpu (struct user_i387_struct* fpu)
+ {
+ 	int fpvalid;
+ 
+ /* Flag indicating the math stuff is valid. We don't support this for the
+    soft-float routines yet */
+ 	if (hard_math) {
+ 		if ((fpvalid = current->used_math) != 0) {
+ 			if (last_task_used_math == current)
+ 				__asm__("clts ; fnsave %0": :"m" (*fpu));
+ 			else
+ 				memcpy(fpu,&current->tss.i387.hard,sizeof(*fpu));
+ 		}
+ 	} else {
+ 		/* we should dump the emulator state here, but we need to
+ 		   convert it into standard 387 format first.. */
+ 		fpvalid = 0;
+ 	}
+ 
+ 	return fpvalid;
+ }
+ 
+ /*
   * fill in the user structure for a core dump..
   */
  void dump_thread(struct pt_regs * regs, struct user * dump)
***************
*** 216,235 ****
  
  	dump->regs = *regs;
  
! /* Flag indicating the math stuff is valid. We don't support this for the
!    soft-float routines yet */
! 	if (hard_math) {
! 		if ((dump->u_fpvalid = current->used_math) != 0) {
! 			if (last_task_used_math == current)
! 				__asm__("clts ; fnsave %0": :"m" (dump->i387));
! 			else
! 				memcpy(&dump->i387,&current->tss.i387.hard,sizeof(dump->i387));
! 		}
! 	} else {
! 		/* we should dump the emulator state here, but we need to
! 		   convert it into standard 387 format first.. */
! 		dump->u_fpvalid = 0;
! 	}
  }
  
  asmlinkage int sys_fork(struct pt_regs regs)
--- 241,247 ----
  
  	dump->regs = *regs;
  
! 	dump->u_fpvalid = dump_fpu (&dump->i387);
  }
  
  asmlinkage int sys_fork(struct pt_regs regs)
diff -c linux/linux/arch/i386/kernel/setup.c:1.1.1.1 linux/linux/arch/i386/kernel/setup.c:1.2
*** linux/linux/arch/i386/kernel/setup.c:1.1.1.1	Tue Jun  6 23:10:36 1995
--- linux/linux/arch/i386/kernel/setup.c	Tue Jun  6 23:10:36 1995
***************
*** 55,61 ****
  unsigned char aux_device_present;
  extern int ramdisk_size;
  extern int root_mountflags;
! extern int etext, edata, end;
  
  extern char empty_zero_page[PAGE_SIZE];
  
--- 55,61 ----
  unsigned char aux_device_present;
  extern int ramdisk_size;
  extern int root_mountflags;
! extern int _etext, _edata, _end;
  
  extern char empty_zero_page[PAGE_SIZE];
  
***************
*** 95,105 ****
  #endif
  	if (MOUNT_ROOT_RDONLY)
  		root_mountflags |= MS_RDONLY;
! 	memory_start = (unsigned long) &end;
  	init_task.mm->start_code = TASK_SIZE;
! 	init_task.mm->end_code = TASK_SIZE + (unsigned long) &etext;
! 	init_task.mm->end_data = TASK_SIZE + (unsigned long) &edata;
! 	init_task.mm->brk = TASK_SIZE + (unsigned long) &end;
  
  	for (;;) {
  		if (c == ' ' && *(unsigned long *)from == *(unsigned long *)"mem=") {
--- 95,105 ----
  #endif
  	if (MOUNT_ROOT_RDONLY)
  		root_mountflags |= MS_RDONLY;
! 	memory_start = (unsigned long) &_end;
  	init_task.mm->start_code = TASK_SIZE;
! 	init_task.mm->end_code = TASK_SIZE + (unsigned long) &_etext;
! 	init_task.mm->end_data = TASK_SIZE + (unsigned long) &_edata;
! 	init_task.mm->brk = TASK_SIZE + (unsigned long) &_end;
  
  	for (;;) {
  		if (c == ' ' && *(unsigned long *)from == *(unsigned long *)"mem=") {
diff -c linux/linux/arch/i386/kernel/traps.c:1.1.1.1 linux/linux/arch/i386/kernel/traps.c:1.2
*** linux/linux/arch/i386/kernel/traps.c:1.1.1.1	Tue Jun  6 23:10:36 1995
--- linux/linux/arch/i386/kernel/traps.c	Tue Jun  6 23:10:36 1995
***************
*** 99,105 ****
  	unsigned long esp;
  	unsigned short ss;
  	unsigned long *stack, addr, module_start, module_end;
! 	extern char start_kernel, etext;
  
  	esp = (unsigned long) &regs->esp;
  	ss = KERNEL_DS;
--- 99,105 ----
  	unsigned long esp;
  	unsigned short ss;
  	unsigned long *stack, addr, module_start, module_end;
! 	extern char start_kernel, _etext;
  
  	esp = (unsigned long) &regs->esp;
  	ss = KERNEL_DS;
***************
*** 147,153 ****
  		 * out the call path that was taken.
  		 */
  		if (((addr >= (unsigned long) &start_kernel) &&
! 		     (addr <= (unsigned long) &etext)) ||
  		    ((addr >= module_start) && (addr <= module_end))) {
  			if (i && ((i % 8) == 0))
  				printk("\n       ");
--- 147,153 ----
  		 * out the call path that was taken.
  		 */
  		if (((addr >= (unsigned long) &start_kernel) &&
! 		     (addr <= (unsigned long) &_etext)) ||
  		    ((addr >= module_start) && (addr <= module_end))) {
  			if (i && ((i % 8) == 0))
  				printk("\n       ");
diff -c linux/linux/arch/i386/math-emu/div_Xsig.S:1.1.1.1 linux/linux/arch/i386/math-emu/div_Xsig.S:1.2
*** linux/linux/arch/i386/math-emu/div_Xsig.S:1.1.1.1	Tue Jun  6 23:10:37 1995
--- linux/linux/arch/i386/math-emu/div_Xsig.S	Tue Jun  6 23:10:37 1995
***************
*** 74,84 ****
  
  
  .text
! 	.align 2,144
! 
! .globl _div_Xsig
! 
! _div_Xsig:
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
--- 74,80 ----
  
  
  .text
! ENTRY(div_Xsig)
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
diff -c linux/linux/arch/i386/math-emu/div_small.S:1.1.1.1 linux/linux/arch/i386/math-emu/div_small.S:1.2
*** linux/linux/arch/i386/math-emu/div_small.S:1.1.1.1	Tue Jun  6 23:10:37 1995
--- linux/linux/arch/i386/math-emu/div_small.S	Tue Jun  6 23:10:37 1995
***************
*** 17,27 ****
  #include "fpu_asm.h"
  
  .text
! 	.align 2,144
! 
! .globl _div_small
! 
! _div_small:
  	pushl	%ebp
  	movl	%esp,%ebp
  
--- 17,23 ----
  #include "fpu_asm.h"
  
  .text
! ENTRY(div_small)
  	pushl	%ebp
  	movl	%esp,%ebp
  
diff -c linux/linux/arch/i386/math-emu/fpu_asm.h:1.1.1.1 linux/linux/arch/i386/math-emu/fpu_asm.h:1.3
*** linux/linux/arch/i386/math-emu/fpu_asm.h:1.1.1.1	Tue Jun  6 23:10:37 1995
--- linux/linux/arch/i386/math-emu/fpu_asm.h	Tue Jun  6 23:10:37 1995
***************
*** 9,17 ****
  #ifndef _FPU_ASM_H_
  #define _FPU_ASM_H_
  
  #include "fpu_emu.h"
  
! #define	EXCEPTION	_exception
  
  
  #define PARAM1	8(%ebp)
--- 9,18 ----
  #ifndef _FPU_ASM_H_
  #define _FPU_ASM_H_
  
+ #include <linux/linkage.h>
  #include "fpu_emu.h"
  
! #define	EXCEPTION	SYMBOL_NAME(exception)
  
  
  #define PARAM1	8(%ebp)
diff -c linux/linux/arch/i386/math-emu/mul_Xsig.S:1.1.1.1 linux/linux/arch/i386/math-emu/mul_Xsig.S:1.3
*** linux/linux/arch/i386/math-emu/mul_Xsig.S:1.1.1.1	Tue Jun  6 23:10:37 1995
--- linux/linux/arch/i386/math-emu/mul_Xsig.S	Tue Jun  6 23:10:38 1995
***************
*** 24,32 ****
  #include "fpu_asm.h"
  
  .text
! 	.align 2,144
! .globl _mul32_Xsig
! _mul32_Xsig:
  	pushl %ebp
  	movl %esp,%ebp
  	subl $16,%esp
--- 24,30 ----
  #include "fpu_asm.h"
  
  .text
! ENTRY(mul32_Xsig)
  	pushl %ebp
  	movl %esp,%ebp
  	subl $16,%esp
***************
*** 66,74 ****
  	ret
  
  
! 	.align 2,144
! .globl _mul64_Xsig
! _mul64_Xsig:
  	pushl %ebp
  	movl %esp,%ebp
  	subl $16,%esp
--- 64,70 ----
  	ret
  
  
! ENTRY(mul64_Xsig)
  	pushl %ebp
  	movl %esp,%ebp
  	subl $16,%esp
***************
*** 121,129 ****
  
  
  
! 	.align 2,144
! .globl _mul_Xsig_Xsig
! _mul_Xsig_Xsig:
  	pushl %ebp
  	movl %esp,%ebp
  	subl $16,%esp
--- 117,123 ----
  
  
  
! ENTRY(mul_Xsig_Xsig)
  	pushl %ebp
  	movl %esp,%ebp
  	subl $16,%esp
diff -c linux/linux/arch/i386/math-emu/polynom_Xsig.S:1.1.1.1 linux/linux/arch/i386/math-emu/polynom_Xsig.S:1.2
*** linux/linux/arch/i386/math-emu/polynom_Xsig.S:1.1.1.1	Tue Jun  6 23:10:38 1995
--- linux/linux/arch/i386/math-emu/polynom_Xsig.S	Tue Jun  6 23:10:38 1995
***************
*** 36,44 ****
  #define OVERFLOWED      -16(%ebp)	/* addition overflow flag */
  
  .text
! 	.align 2,144
! .globl _polynomial_Xsig
! _polynomial_Xsig:
  	pushl	%ebp
  	movl	%esp,%ebp
  	subl	$32,%esp
--- 36,42 ----
  #define OVERFLOWED      -16(%ebp)	/* addition overflow flag */
  
  .text
! ENTRY(polynomial_Xsig)
  	pushl	%ebp
  	movl	%esp,%ebp
  	subl	$32,%esp
diff -c linux/linux/arch/i386/math-emu/reg_div.S:1.1.1.1 linux/linux/arch/i386/math-emu/reg_div.S:1.3
*** linux/linux/arch/i386/math-emu/reg_div.S:1.1.1.1	Tue Jun  6 23:10:38 1995
--- linux/linux/arch/i386/math-emu/reg_div.S	Tue Jun  6 23:10:38 1995
***************
*** 19,28 ****
  
  
  .text
! 	.align 2
! 
! .globl	_reg_div
! _reg_div:
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
--- 19,25 ----
  
  
  .text
! ENTRY(reg_div)
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
***************
*** 47,53 ****
  	cmpl	EXP_UNDER,EXP(%esi)
  	jg	xL_arg1_not_denormal
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 44,50 ----
  	cmpl	EXP_UNDER,EXP(%esi)
  	jg	xL_arg1_not_denormal
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
***************
*** 55,61 ****
  	cmpl	EXP_UNDER,EXP(%ebx)
  	jg	xL_arg2_not_denormal
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 52,58 ----
  	cmpl	EXP_UNDER,EXP(%ebx)
  	jg	xL_arg2_not_denormal
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
***************
*** 75,81 ****
  	addl	EXP_BIAS,%edx
  	movl	%edx,EXP(%edi)
  
! 	jmp	_divide_kernel
  
  
  /*-----------------------------------------------------------------------*/
--- 72,78 ----
  	addl	EXP_BIAS,%edx
  	movl	%edx,EXP(%edi)
  
! 	jmp	SYMBOL_NAME(divide_kernel)
  
  
  /*-----------------------------------------------------------------------*/
***************
*** 92,105 ****
  	pushl	%edi			/* Destination */
  	pushl	%esi
  	pushl	%ebx			/* Ordering is important here */
! 	call	_real_2op_NaN
  	jmp	LDiv_exit
  
  /* Invalid operations */
  L_zero_zero:
  L_inf_inf:
  	pushl	%edi			/* Destination */
! 	call	_arith_invalid		/* 0/0 or Infinity/Infinity */
  	jmp	LDiv_exit
  
  L_no_NaN_arg:
--- 89,102 ----
  	pushl	%edi			/* Destination */
  	pushl	%esi
  	pushl	%ebx			/* Ordering is important here */
! 	call	SYMBOL_NAME(real_2op_NaN)
  	jmp	LDiv_exit
  
  /* Invalid operations */
  L_zero_zero:
  L_inf_inf:
  	pushl	%edi			/* Destination */
! 	call	SYMBOL_NAME(arith_invalid) /* 0/0 or Infinity/Infinity */
  	jmp	LDiv_exit
  
  L_no_NaN_arg:
***************
*** 126,132 ****
  	cmpl	EXP_UNDER,EXP(%ebx)
  	jg	L_copy_arg1		/* Answer is Inf */
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  #endif DENORM_OPERAND
--- 123,129 ----
  	cmpl	EXP_UNDER,EXP(%ebx)
  	jg	L_copy_arg1		/* Answer is Inf */
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  #endif DENORM_OPERAND
***************
*** 151,157 ****
  	movb	SIGN(%esi),%al
  	xorb	SIGN(%ebx),%al
  	pushl	%eax			/* lower 8 bits have the sign */
! 	call	_divide_by_zero
  	jmp	LDiv_exit
  
  L_arg2_not_zero:
--- 148,154 ----
  	movb	SIGN(%esi),%al
  	xorb	SIGN(%ebx),%al
  	pushl	%eax			/* lower 8 bits have the sign */
! 	call	SYMBOL_NAME(divide_by_zero)
  	jmp	LDiv_exit
  
  L_arg2_not_zero:
***************
*** 165,171 ****
  	cmpl	EXP_UNDER,EXP(%esi)
  	jg	L_return_zero		/* Answer is zero */
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  #endif DENORM_OPERAND
--- 162,168 ----
  	cmpl	EXP_UNDER,EXP(%esi)
  	jg	L_return_zero		/* Answer is zero */
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  #endif DENORM_OPERAND
***************
*** 185,191 ****
  	cmpl	EXP_UNDER,EXP(%ebx)
  	jg	L_copy_arg1		/* Answer is zero */
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  #endif DENORM_OPERAND
--- 182,188 ----
  	cmpl	EXP_UNDER,EXP(%ebx)
  	jg	L_copy_arg1		/* Answer is zero */
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  #endif DENORM_OPERAND
***************
*** 241,251 ****
  	call	EXCEPTION
  
  	/* Generate a NaN for unknown tags */
! 	movl	_CONST_QNaN,%eax
  	movl	%eax,(%edi)
! 	movl	_CONST_QNaN+4,%eax
  	movl	%eax,SIGL(%edi)
! 	movl	_CONST_QNaN+8,%eax
  	movl	%eax,SIGH(%edi)
  	jmp	LDiv_exit		/* %eax is nz */
  #endif PARANOID
--- 238,248 ----
  	call	EXCEPTION
  
  	/* Generate a NaN for unknown tags */
! 	movl	SYMBOL_NAME(CONST_QNaN),%eax
  	movl	%eax,(%edi)
! 	movl	SYMBOL_NAME(CONST_QNaN)+4,%eax
  	movl	%eax,SIGL(%edi)
! 	movl	SYMBOL_NAME(CONST_QNaN)+8,%eax
  	movl	%eax,SIGH(%edi)
  	jmp	LDiv_exit		/* %eax is nz */
  #endif PARANOID
diff -c linux/linux/arch/i386/math-emu/reg_norm.S:1.1.1.1 linux/linux/arch/i386/math-emu/reg_norm.S:1.3
*** linux/linux/arch/i386/math-emu/reg_norm.S:1.1.1.1	Tue Jun  6 23:10:38 1995
--- linux/linux/arch/i386/math-emu/reg_norm.S	Tue Jun  6 23:10:38 1995
***************
*** 18,28 ****
  
  
  .text
! 
! 	.align 2,144
! .globl _normalize
! 
! _normalize:
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%ebx
--- 18,24 ----
  
  
  .text
! ENTRY(normalize)
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%ebx
***************
*** 34,40 ****
  	je	L_ok
  
  	pushl	$0x220
! 	call	_exception
  	addl	$4,%esp
  
  L_ok:
--- 30,36 ----
  	je	L_ok
  
  	pushl	$0x220
! 	call	SYMBOL_NAME(exception)
  	addl	$4,%esp
  
  L_ok:
***************
*** 86,108 ****
  
  L_underflow:
  	push	%ebx
! 	call	_arith_underflow
  	pop	%ebx
  	jmp	L_exit
  
  L_overflow:
  	push	%ebx
! 	call	_arith_overflow
  	pop	%ebx
  	jmp	L_exit
  
  
  
  /* Normalise without reporting underflow or overflow */
! 	.align 2,144
! .globl _normalize_nuo
! 
! _normalize_nuo:
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%ebx
--- 82,101 ----
  
  L_underflow:
  	push	%ebx
! 	call	SYMBOL_NAME(arith_underflow)
  	pop	%ebx
  	jmp	L_exit
  
  L_overflow:
  	push	%ebx
! 	call	SYMBOL_NAME(arith_overflow)
  	pop	%ebx
  	jmp	L_exit
  
  
  
  /* Normalise without reporting underflow or overflow */
! ENTRY(normalize_nuo)
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%ebx
***************
*** 114,120 ****
  	je	L_ok_nuo
  
  	pushl	$0x221
! 	call	_exception
  	addl	$4,%esp
  
  L_ok_nuo:
--- 107,113 ----
  	je	L_ok_nuo
  
  	pushl	$0x221
! 	call	SYMBOL_NAME(exception)
  	addl	$4,%esp
  
  L_ok_nuo:
diff -c linux/linux/arch/i386/math-emu/reg_round.S:1.1.1.1 linux/linux/arch/i386/math-emu/reg_round.S:1.3
*** linux/linux/arch/i386/math-emu/reg_round.S:1.1.1.1	Tue Jun  6 23:10:38 1995
--- linux/linux/arch/i386/math-emu/reg_round.S	Tue Jun  6 23:10:38 1995
***************
*** 101,114 ****
  
  
  .text
- 	.align 2,144
  .globl fpu_reg_round
  .globl fpu_reg_round_sqrt
  .globl fpu_Arith_exit
- .globl _round_reg
  
  /* Entry point when called from C */
! _round_reg:
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
--- 101,112 ----
  
  
  .text
  .globl fpu_reg_round
  .globl fpu_reg_round_sqrt
  .globl fpu_Arith_exit
  
  /* Entry point when called from C */
! ENTRY(round_reg)
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
***************
*** 435,441 ****
   */
  xL_precision_lost_up:
  	push	%eax
! 	call	_set_precision_flag_up
  	popl	%eax
  	jmp	xL_no_precision_loss
  
--- 433,439 ----
   */
  xL_precision_lost_up:
  	push	%eax
! 	call	SYMBOL_NAME(set_precision_flag_up)
  	popl	%eax
  	jmp	xL_no_precision_loss
  
***************
*** 445,451 ****
   */
  xL_precision_lost_down:
  	push	%eax
! 	call	_set_precision_flag_down
  	popl	%eax
  	jmp	xL_no_precision_loss
  
--- 443,449 ----
   */
  xL_precision_lost_down:
  	push	%eax
! 	call	SYMBOL_NAME(set_precision_flag_down)
  	popl	%eax
  	jmp	xL_no_precision_loss
  
***************
*** 598,604 ****
  	/* There must be a masked underflow */
  	push	%eax
  	pushl	EX_Underflow
! 	call	_exception
  	popl	%eax
  	popl	%eax
  	jmp	xL_Normalised
--- 596,602 ----
  	/* There must be a masked underflow */
  	push	%eax
  	pushl	EX_Underflow
! 	call	SYMBOL_NAME(exception)
  	popl	%eax
  	popl	%eax
  	jmp	xL_Normalised
***************
*** 610,621 ****
   */
  L_underflow_to_zero:
  	push	%eax
! 	call	_set_precision_flag_down
  	popl	%eax
  
  	push	%eax
  	pushl	EX_Underflow
! 	call	_exception
  	popl	%eax
  	popl	%eax
  
--- 608,619 ----
   */
  L_underflow_to_zero:
  	push	%eax
! 	call	SYMBOL_NAME(set_precision_flag_down)
  	popl	%eax
  
  	push	%eax
  	pushl	EX_Underflow
! 	call	SYMBOL_NAME(exception)
  	popl	%eax
  	popl	%eax
  
***************
*** 628,634 ****
  /* The operations resulted in a number too large to represent. */
  L_overflow:
  	push	%edi
! 	call	_arith_overflow
  	pop	%edi
  	jmp	fpu_reg_round_exit
  
--- 626,632 ----
  /* The operations resulted in a number too large to represent. */
  L_overflow:
  	push	%edi
! 	call	SYMBOL_NAME(arith_overflow)
  	pop	%edi
  	jmp	fpu_reg_round_exit
  
diff -c linux/linux/arch/i386/math-emu/reg_u_add.S:1.1.1.1 linux/linux/arch/i386/math-emu/reg_u_add.S:1.3
*** linux/linux/arch/i386/math-emu/reg_u_add.S:1.1.1.1	Tue Jun  6 23:10:38 1995
--- linux/linux/arch/i386/math-emu/reg_u_add.S	Tue Jun  6 23:10:38 1995
***************
*** 29,37 ****
  #include "control_w.h"
  
  .text
! 	.align 2,144
! .globl _reg_u_add
! _reg_u_add:
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
--- 29,35 ----
  #include "control_w.h"
  
  .text
! ENTRY(reg_u_add)
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
***************
*** 45,51 ****
  	cmpl	EXP_UNDER,EXP(%esi)
  	jg	xOp1_not_denorm
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 43,49 ----
  	cmpl	EXP_UNDER,EXP(%esi)
  	jg	xOp1_not_denorm
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
***************
*** 53,59 ****
  	cmpl	EXP_UNDER,EXP(%edi)
  	jg	xOp2_not_denorm
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 51,57 ----
  	cmpl	EXP_UNDER,EXP(%edi)
  	jg	xOp2_not_denorm
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
diff -c linux/linux/arch/i386/math-emu/reg_u_div.S:1.1.1.1 linux/linux/arch/i386/math-emu/reg_u_div.S:1.3
*** linux/linux/arch/i386/math-emu/reg_u_div.S:1.1.1.1	Tue Jun  6 23:10:39 1995
--- linux/linux/arch/i386/math-emu/reg_u_div.S	Tue Jun  6 23:10:39 1995
***************
*** 69,81 ****
  
  
  .text
! 	.align 2,144
! 
! .globl _reg_u_div
! 
! .globl _divide_kernel
! 
! _reg_u_div:
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
--- 69,75 ----
  
  
  .text
! ENTRY(reg_u_div)
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
***************
*** 95,101 ****
  	cmpl	EXP_UNDER,%eax
  	jg	xOp1_not_denorm
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 89,95 ----
  	cmpl	EXP_UNDER,%eax
  	jg	xOp1_not_denorm
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
***************
*** 104,117 ****
  	cmpl	EXP_UNDER,%eax
  	jg	xOp2_not_denorm
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
  xOp2_not_denorm:
  #endif DENORM_OPERAND
  
! _divide_kernel:
  #ifdef PARANOID
  /*	testl	$0x80000000, SIGH(%esi)	// Dividend */
  /*	je	L_bugged */
--- 98,111 ----
  	cmpl	EXP_UNDER,%eax
  	jg	xOp2_not_denorm
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
  xOp2_not_denorm:
  #endif DENORM_OPERAND
  
! ENTRY(divide_kernel)
  #ifdef PARANOID
  /*	testl	$0x80000000, SIGH(%esi)	// Dividend */
  /*	je	L_bugged */
diff -c linux/linux/arch/i386/math-emu/reg_u_mul.S:1.1.1.1 linux/linux/arch/i386/math-emu/reg_u_mul.S:1.3
*** linux/linux/arch/i386/math-emu/reg_u_mul.S:1.1.1.1	Tue Jun  6 23:10:39 1995
--- linux/linux/arch/i386/math-emu/reg_u_mul.S	Tue Jun  6 23:10:39 1995
***************
*** 44,53 ****
  
  
  .text
! 	.align 2,144
! 
! .globl _reg_u_mul
! _reg_u_mul:
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
--- 44,50 ----
  
  
  .text
! ENTRY(reg_u_mul)
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
***************
*** 73,79 ****
  	cmpl	EXP_UNDER,%eax
  	jg	xOp1_not_denorm
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 70,76 ----
  	cmpl	EXP_UNDER,%eax
  	jg	xOp1_not_denorm
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
***************
*** 82,88 ****
  	cmpl	EXP_UNDER,%eax
  	jg	xOp2_not_denorm
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 79,85 ----
  	cmpl	EXP_UNDER,%eax
  	jg	xOp2_not_denorm
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
diff -c linux/linux/arch/i386/math-emu/reg_u_sub.S:1.1.1.1 linux/linux/arch/i386/math-emu/reg_u_sub.S:1.3
*** linux/linux/arch/i386/math-emu/reg_u_sub.S:1.1.1.1	Tue Jun  6 23:10:39 1995
--- linux/linux/arch/i386/math-emu/reg_u_sub.S	Tue Jun  6 23:10:39 1995
***************
*** 30,38 ****
  #include "control_w.h"
  
  .text
! 	.align 2,144
! .globl _reg_u_sub
! _reg_u_sub:
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
--- 30,36 ----
  #include "control_w.h"
  
  .text
! ENTRY(reg_u_sub)
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
***************
*** 46,52 ****
  	cmpl	EXP_UNDER,EXP(%esi)
  	jg	xOp1_not_denorm
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 44,50 ----
  	cmpl	EXP_UNDER,EXP(%esi)
  	jg	xOp1_not_denorm
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
***************
*** 54,60 ****
  	cmpl	EXP_UNDER,EXP(%edi)
  	jg	xOp2_not_denorm
  
! 	call	_denormal_operand
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
--- 52,58 ----
  	cmpl	EXP_UNDER,EXP(%edi)
  	jg	xOp2_not_denorm
  
! 	call	SYMBOL_NAME(denormal_operand)
  	orl	%eax,%eax
  	jnz	fpu_Arith_exit
  
diff -c linux/linux/arch/i386/math-emu/round_Xsig.S:1.1.1.1 linux/linux/arch/i386/math-emu/round_Xsig.S:1.2
*** linux/linux/arch/i386/math-emu/round_Xsig.S:1.1.1.1	Tue Jun  6 23:10:39 1995
--- linux/linux/arch/i386/math-emu/round_Xsig.S	Tue Jun  6 23:10:39 1995
***************
*** 22,32 ****
  
  
  .text
! 
! 	.align 2,144
! .globl _round_Xsig
! 
! _round_Xsig:
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%ebx		/* Reserve some space */
--- 22,28 ----
  
  
  .text
! ENTRY(round_Xsig)
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%ebx		/* Reserve some space */
***************
*** 86,95 ****
  
  
  
! 	.align 2,144
! .globl _norm_Xsig
! 
! _norm_Xsig:
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%ebx		/* Reserve some space */
--- 82,88 ----
  
  
  
! ENTRY(norm_Xsig)
  	pushl	%ebp
  	movl	%esp,%ebp
  	pushl	%ebx		/* Reserve some space */
diff -c linux/linux/arch/i386/math-emu/shr_Xsig.S:1.1.1.1 linux/linux/arch/i386/math-emu/shr_Xsig.S:1.2
*** linux/linux/arch/i386/math-emu/shr_Xsig.S:1.1.1.1	Tue Jun  6 23:10:39 1995
--- linux/linux/arch/i386/math-emu/shr_Xsig.S	Tue Jun  6 23:10:39 1995
***************
*** 21,30 ****
  #include "fpu_asm.h"
  
  .text
! 	.align 2,144
! 
! 	.globl	_shr_Xsig
! _shr_Xsig:
  	push	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
--- 21,27 ----
  #include "fpu_asm.h"
  
  .text
! ENTRY(shr_Xsig)
  	push	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
diff -c linux/linux/arch/i386/math-emu/wm_shrx.S:1.1.1.1 linux/linux/arch/i386/math-emu/wm_shrx.S:1.2
*** linux/linux/arch/i386/math-emu/wm_shrx.S:1.1.1.1	Tue Jun  6 23:10:39 1995
--- linux/linux/arch/i386/math-emu/wm_shrx.S	Tue Jun  6 23:10:39 1995
***************
*** 17,24 ****
  #include "fpu_asm.h"
  
  .text
- 	.align 2,144
- 
  /*---------------------------------------------------------------------------+
   |   unsigned shrx(void *arg1, unsigned arg2)                                |
   |                                                                           |
--- 17,22 ----
***************
*** 33,41 ****
   |   Results returned in the 64 bit arg and eax.                             |
   +---------------------------------------------------------------------------*/
  
! 	.globl	_shrx
! 
! _shrx:
  	push	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
--- 31,37 ----
   |   Results returned in the 64 bit arg and eax.                             |
   +---------------------------------------------------------------------------*/
  
! ENTRY(shrx)
  	push	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
***************
*** 113,120 ****
   |   part which has been shifted out of the arg.                             |
   |   Results returned in the 64 bit arg and eax.                             |
   +---------------------------------------------------------------------------*/
! 	.globl	_shrxs
! _shrxs:
  	push	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
--- 109,115 ----
   |   part which has been shifted out of the arg.                             |
   |   Results returned in the 64 bit arg and eax.                             |
   +---------------------------------------------------------------------------*/
! ENTRY(shrxs)
  	push	%ebp
  	movl	%esp,%ebp
  	pushl	%esi
diff -c linux/linux/arch/i386/math-emu/wm_sqrt.S:1.1.1.1 linux/linux/arch/i386/math-emu/wm_sqrt.S:1.2
*** linux/linux/arch/i386/math-emu/wm_sqrt.S:1.1.1.1	Tue Jun  6 23:10:40 1995
--- linux/linux/arch/i386/math-emu/wm_sqrt.S	Tue Jun  6 23:10:40 1995
***************
*** 74,83 ****
  
  
  .text
! 	.align 2,144
! 
! .globl _wm_sqrt
! _wm_sqrt:
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
--- 74,80 ----
  
  
  .text
! ENTRY(wm_sqrt)
  	pushl	%ebp
  	movl	%esp,%ebp
  #ifndef NON_REENTRANT_FPU
diff -c linux/linux/arch/i386/mm/init.c:1.1.1.2 linux/linux/arch/i386/mm/init.c:1.3
*** linux/linux/arch/i386/mm/init.c:1.1.1.2	Tue Jun  6 23:10:40 1995
--- linux/linux/arch/i386/mm/init.c	Tue Jun  6 23:10:40 1995
***************
*** 161,167 ****
  	int reservedpages = 0;
  	int datapages = 0;
  	unsigned long tmp;
! 	extern int etext;
  
  	end_mem &= PAGE_MASK;
  	high_memory = end_mem;
--- 161,167 ----
  	int reservedpages = 0;
  	int datapages = 0;
  	unsigned long tmp;
! 	extern int _etext;
  
  	end_mem &= PAGE_MASK;
  	high_memory = end_mem;
***************
*** 194,200 ****
  		if (mem_map[MAP_NR(tmp)]) {
  			if (tmp >= 0xA0000 && tmp < 0x100000)
  				reservedpages++;
! 			else if (tmp < (unsigned long) &etext)
  				codepages++;
  			else
  				datapages++;
--- 194,200 ----
  		if (mem_map[MAP_NR(tmp)]) {
  			if (tmp >= 0xA0000 && tmp < 0x100000)
  				reservedpages++;
! 			else if (tmp < (unsigned long) &_etext)
  				codepages++;
  			else
  				datapages++;
diff -c linux/linux/drivers/block/aztcd.c:1.1.1.3 linux/linux/drivers/block/aztcd.c:1.2
*** linux/linux/drivers/block/aztcd.c:1.1.1.3	Tue Jun  6 23:10:41 1995
--- linux/linux/drivers/block/aztcd.c	Tue Jun  6 23:10:41 1995
***************
*** 1,5 ****
  #define AZT_VERSION "V1.0"
! /*      aztcd.c,v 1.1.1.2 1995/03/29 23:36:22 hjl Exp
  	linux/drivers/block/aztcd.c - AztechCD268 CDROM driver
  
  	Copyright (C) 1994,1995 Werner Zimmermann (zimmerma@rz.fht-esslingen.de)
--- 1,5 ----
  #define AZT_VERSION "V1.0"
! /*      $Id: aztcd.c,v 1.2 1995/04/22 13:09:11 hjl Exp $
  	linux/drivers/block/aztcd.c - AztechCD268 CDROM driver
  
  	Copyright (C) 1994,1995 Werner Zimmermann (zimmerma@rz.fht-esslingen.de)
***************
*** 134,143 ****
  
  #define MAJOR_NR AZTECH_CDROM_MAJOR 
  
! #ifdef MODULE
! # include "/usr/src/linux/drivers/block/blk.h"
! #else
! # include "blk.h"
  # define MOD_INC_USE_COUNT
  # define MOD_DEC_USE_COUNT
  #endif
--- 134,142 ----
  
  #define MAJOR_NR AZTECH_CDROM_MAJOR 
  
! #include "blk.h"
! 
! #ifndef MODULE
  # define MOD_INC_USE_COUNT
  # define MOD_DEC_USE_COUNT
  #endif
diff -c linux/linux/drivers/block/sonycd535.c:1.1.1.1 linux/linux/drivers/block/sonycd535.c:1.2
*** linux/linux/drivers/block/sonycd535.c:1.1.1.1	Tue Jun  6 23:10:42 1995
--- linux/linux/drivers/block/sonycd535.c	Tue Jun  6 23:10:42 1995
***************
*** 130,139 ****
  
  #define MAJOR_NR CDU535_CDROM_MAJOR
  
! #ifdef MODULE
! # include "/usr/src/linux/drivers/block/blk.h"
! #else
! # include "blk.h"
  # define MOD_INC_USE_COUNT
  # define MOD_DEC_USE_COUNT
  #endif
--- 130,138 ----
  
  #define MAJOR_NR CDU535_CDROM_MAJOR
  
! #include "blk.h"
! 
! #ifndef MODULE
  # define MOD_INC_USE_COUNT
  # define MOD_DEC_USE_COUNT
  #endif
diff -c linux/linux/drivers/scsi/53c7,8xx.c:1.1.1.4 linux/linux/drivers/scsi/53c7,8xx.c:1.7
*** linux/linux/drivers/scsi/53c7,8xx.c:1.1.1.4	Tue Jun  6 23:10:43 1995
--- linux/linux/drivers/scsi/53c7,8xx.c	Tue Jun  6 23:10:43 1995
***************
*** 2266,2278 ****
       * and SCSI recommended .5s selection timeout.
       */
  
      NCR53c7x0_write8(STIME0_REG_800, 
      	((14 << STIME0_800_SEL_SHIFT) & STIME0_800_SEL_MASK) 
  /* Disable HTH interrupt */
! #if 0
! 	| ((15 << STIME0_800_HTH_SHIFT) & STIME0_800_HTH_MASK)
  #endif
-     );
  
  
  
--- 2266,2284 ----
       * and SCSI recommended .5s selection timeout.
       */
  
+     /*
+      * The new gcc won't recognize preprocessing directives
+      * within macro args.
+      */
+ #if 0
      NCR53c7x0_write8(STIME0_REG_800, 
      	((14 << STIME0_800_SEL_SHIFT) & STIME0_800_SEL_MASK) 
  /* Disable HTH interrupt */
! 	| ((15 << STIME0_800_HTH_SHIFT) & STIME0_800_HTH_MASK));
! #else
!     NCR53c7x0_write8(STIME0_REG_800, 
!     	((14 << STIME0_800_SEL_SHIFT) & STIME0_800_SEL_MASK));
  #endif
  
  
  
diff -c linux/linux/drivers/scsi/seagate.c:1.1.1.2 linux/linux/drivers/scsi/seagate.c:1.3
*** linux/linux/drivers/scsi/seagate.c:1.1.1.2	Tue Jun  6 23:10:46 1995
--- linux/linux/drivers/scsi/seagate.c	Tue Jun  6 23:10:46 1995
***************
*** 1105,1112 ****
  
  	cld
  
! 	movl _st0x_cr_sr, %%ebx
! 	movl _st0x_dr, %%edi
  	
  1:	movb (%%ebx), %%al\n"
  /*
--- 1105,1112 ----
  
  	cld
  
! 	movl " SYMBOL_NAME_STR(st0x_cr_sr) ", %%ebx
! 	movl " SYMBOL_NAME_STR(st0x_dr) ", %%edi
  	
  1:	movb (%%ebx), %%al\n"
  /*
***************
*** 1241,1248 ****
  	jz 2f
  
  	cld
! 	movl _st0x_cr_sr, %%esi
! 	movl _st0x_dr, %%ebx
  
  1:	movb (%%esi), %%al\n"
  /*
--- 1241,1248 ----
  	jz 2f
  
  	cld
! 	movl " SYMBOL_NAME_STR(st0x_cr_sr) ", %%esi
! 	movl " SYMBOL_NAME_STR(st0x_dr) ", %%ebx
  
  1:	movb (%%esi), %%al\n"
  /*
diff -c linux/linux/fs/binfmt_elf.c:1.1.1.1 linux/linux/fs/binfmt_elf.c:1.5
*** linux/linux/fs/binfmt_elf.c:1.1.1.1	Tue Jun  6 23:10:48 1995
--- linux/linux/fs/binfmt_elf.c	Tue Jun  6 23:10:48 1995
***************
*** 18,23 ****
--- 18,24 ----
  #endif
  
  #include <linux/fs.h>
+ #include <linux/stat.h>
  #include <linux/sched.h>
  #include <linux/mm.h>
  #include <linux/mman.h>
***************
*** 31,36 ****
--- 32,38 ----
  #include <linux/malloc.h>
  #include <linux/shm.h>
  #include <linux/personality.h>
+ #include <linux/elfcore.h>
  
  #include <asm/segment.h>
  #include <asm/pgtable.h>
***************
*** 48,59 ****
  
  static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
  static int load_elf_library(int fd);
  
  struct linux_binfmt elf_format = {
  #ifndef MODULE
! 	NULL, NULL, load_elf_binary, load_elf_library, NULL
  #else
! 	NULL, &mod_use_count_, load_elf_binary, load_elf_library, NULL
  #endif
  };
  
--- 50,63 ----
  
  static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs);
  static int load_elf_library(int fd);
+ static int elf_core_dump(long signr, struct pt_regs * regs);
+ extern int dump_fpu (elf_fpregset_t *);
  
  struct linux_binfmt elf_format = {
  #ifndef MODULE
! 	NULL, NULL, load_elf_binary, load_elf_library, elf_core_dump
  #else
! 	NULL, &mod_use_count_, load_elf_binary, load_elf_library, elf_core_dump
  #endif
  };
  
***************
*** 208,217 ****
  	eppnt = elf_phdata;
  	for(i=0; i<interp_elf_ex->e_phnum; i++, eppnt++)
  	  if(eppnt->p_type == PT_LOAD) {
  	    error = do_mmap(file, 
  			    eppnt->p_vaddr & 0xfffff000,
  			    eppnt->p_filesz + (eppnt->p_vaddr & 0xfff),
! 			    PROT_READ | PROT_WRITE | PROT_EXEC,
  			    MAP_PRIVATE | MAP_DENYWRITE | (interp_elf_ex->e_type == ET_EXEC ? MAP_FIXED : 0),
  			    eppnt->p_offset & 0xfffff000);
  	    
--- 212,224 ----
  	eppnt = elf_phdata;
  	for(i=0; i<interp_elf_ex->e_phnum; i++, eppnt++)
  	  if(eppnt->p_type == PT_LOAD) {
+ 	    int elf_prot = (eppnt->p_flags & PF_R) ? PROT_READ : 0;
+ 	    if (eppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
+ 	    if (eppnt->p_flags & PF_X) elf_prot |= PROT_EXEC;
  	    error = do_mmap(file, 
  			    eppnt->p_vaddr & 0xfffff000,
  			    eppnt->p_filesz + (eppnt->p_vaddr & 0xfff),
! 			    elf_prot,
  			    MAP_PRIVATE | MAP_DENYWRITE | (interp_elf_ex->e_type == ET_EXEC ? MAP_FIXED : 0),
  			    eppnt->p_offset & 0xfffff000);
  	    
***************
*** 530,539 ****
  		
  		
  		if(elf_ppnt->p_type == PT_LOAD) {
  			error = do_mmap(file,
  					elf_ppnt->p_vaddr & 0xfffff000,
  					elf_ppnt->p_filesz + (elf_ppnt->p_vaddr & 0xfff),
! 					PROT_READ | PROT_WRITE | PROT_EXEC,
  					MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
  					elf_ppnt->p_offset & 0xfffff000);
  			
--- 537,549 ----
  		
  		
  		if(elf_ppnt->p_type == PT_LOAD) {
+ 			int elf_prot = (elf_ppnt->p_flags & PF_R) ? PROT_READ : 0;
+ 			if (elf_ppnt->p_flags & PF_W) elf_prot |= PROT_WRITE;
+ 			if (elf_ppnt->p_flags & PF_X) elf_prot |= PROT_EXEC;
  			error = do_mmap(file,
  					elf_ppnt->p_vaddr & 0xfffff000,
  					elf_ppnt->p_filesz + (elf_ppnt->p_vaddr & 0xfff),
! 					elf_prot,
  					MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
  					elf_ppnt->p_offset & 0xfffff000);
  			
***************
*** 732,737 ****
--- 742,1152 ----
  	return 0;
  }
  
+ /*
+  * ELF core dumper
+  *
+  * Modelled on fs/exec.c:aout_core_dump()
+  * Jeremy Fitzhardinge <jeremy@sw.oz.au>
+  */
+ /*
+  * These are the only things you should do on a core-file: use only these
+  * functions to write out all the necessary info.
+  */
+ static int dump_write(struct file *file, void *addr, int nr)
+ {
+ 	return file->f_op->write(file->f_inode, file, addr, nr) == nr;
+ }
+ 
+ static int dump_seek(struct file *file, off_t off)
+ {
+ 	if (file->f_op->lseek) {
+ 		if (file->f_op->lseek(file->f_inode, file, off, 0) != off)
+ 			return 0;
+ 	} else
+ 		file->f_pos = off;
+ 	return 1;
+ }
+ 
+ /*
+  * Decide whether a segment is worth dumping; default is yes to be
+  * sure (missing info is worse than too much; etc).
+  * Personally I'd include everything, and use the coredump limit...
+  *
+  * I think we should skip something. But I am not sure how. H.J.
+  */
+ static inline int maydump(struct vm_area_struct *vma)
+ {
+ #if 1
+ 	if (vma->vm_flags & (VM_WRITE|VM_GROWSUP|VM_GROWSDOWN))
+ 		return 1;
+ 	if (vma->vm_flags & (VM_READ|VM_EXEC|VM_EXECUTABLE|VM_SHARED))
+ 		return 0;
+ #endif
+ 	return 1;
+ }
+ 
+ #define roundup(x, y)  ((((x)+((y)-1))/(y))*(y))
+ 
+ /* An ELF note in memory */
+ struct memelfnote
+ {
+ 	char *name;
+ 	int type;
+ 	unsigned int datasz;
+ 	void *data;
+ };
+ 
+ static int notesize(struct memelfnote *en)
+ {
+ 	int sz;
+ 	
+ 	sz = sizeof(struct elf_note);
+ 	sz += roundup(strlen(en->name), 4);
+ 	sz += roundup(en->datasz, 4);
+ 	
+ 	return sz;
+ }
+ 
+ /* #define DEBUG */
+ 
+ #ifdef DEBUG
+ static void dump_regs(const char *str, elf_greg_t *r)
+ {
+ 	int i;
+ 	static const char *regs[] = { "ebx", "ecx", "edx", "esi", "edi", "ebp",
+ 					      "eax", "ds", "es", "fs", "gs",
+ 					      "orig_eax", "eip", "cs",
+ 					      "efl", "uesp", "ss"};
+ 	printk("Registers: %s\n", str);
+ 
+ 	for(i = 0; i < ELF_NGREG; i++)
+ 	{
+ 		unsigned long val = r[i];
+ 		printk("   %-2d %-5s=%08lx %lu\n", i, regs[i], val, val);
+ 	}
+ }
+ #endif
+ 
+ #define DUMP_WRITE(addr, nr)	\
+ 	do { if (!dump_write(file, (addr), (nr))) return 0; } while(0)
+ #define DUMP_SEEK(off)	\
+ 	do { if (!dump_seek(file, (off))) return 0; } while(0)
+ 
+ static int writenote(struct memelfnote *men, struct file *file)
+ {
+ 	struct elf_note en;
+ 
+ 	en.n_namesz = strlen(men->name);
+ 	en.n_descsz = men->datasz;
+ 	en.n_type = men->type;
+ 
+ 	DUMP_WRITE(&en, sizeof(en));
+ 	DUMP_WRITE(men->name, en.n_namesz);
+ 	/* XXX - cast from long long to long to avoid need for libgcc.a */
+ 	DUMP_SEEK(roundup((unsigned long)file->f_pos, 4));	/* XXX */
+ 	DUMP_WRITE(men->data, men->datasz);
+ 	DUMP_SEEK(roundup((unsigned long)file->f_pos, 4));	/* XXX */
+ 	
+ 	return 1;
+ }
+ #undef DUMP_WRITE
+ #undef DUMP_SEEK
+ 
+ #define DUMP_WRITE(addr, nr)	\
+ 	if (!dump_write(&file, (addr), (nr))) \
+ 		goto close_coredump;
+ #define DUMP_SEEK(off)	\
+ 	if (!dump_seek(&file, (off))) \
+ 		goto close_coredump;
+ /*
+  * Actual dumper
+  *
+  * This is a two-pass process; first we find the offsets of the bits,
+  * and then they are actually written out.  If we run out of core limit
+  * we just truncate.
+  */
+ static int elf_core_dump(long signr, struct pt_regs * regs)
+ {
+ 	int has_dumped = 0;
+ 	struct file file;
+ 	struct inode *inode;
+ 	unsigned short fs;
+ 	char corefile[6+sizeof(current->comm)];
+ 	int segs;
+ 	int i;
+ 	size_t size;
+ 	struct vm_area_struct *vma;
+ 	struct elfhdr elf;
+ 	off_t offset = 0, dataoff;
+ 	int limit = current->rlim[RLIMIT_CORE].rlim_cur;
+ 	int numnote = 4;
+ 	struct memelfnote notes[4];
+ 	struct elf_prstatus prstatus;	/* NT_PRSTATUS */
+ 	elf_fpregset_t fpu;		/* NT_PRFPREG */
+ 	struct elf_prpsinfo psinfo;	/* NT_PRPSINFO */
+ 	
+ 	if (!current->dumpable || limit < PAGE_SIZE)
+ 		return 0;
+ 	current->dumpable = 0;
+ 
+ #ifndef CONFIG_BINFMT_ELF
+ 	MOD_INC_USE_COUNT;
+ #endif
+ 
+ 	/* Count what's needed to dump, up to the limit of coredump size */
+ 	segs = 0;
+ 	size = 0;
+ 	for(vma = current->mm->mmap; vma != NULL; vma = vma->vm_next) {
+ 		int sz = vma->vm_end-vma->vm_start;
+ 		
+ 		if (!maydump(vma))
+ 			continue;
+ 
+ 		if (size+sz > limit)
+ 			break;
+ 		
+ 		segs++;
+ 		size += sz;
+ 	}
+ #ifdef DEBUG
+ 	printk("elf_core_dump: %d segs taking %d bytes\n", segs, size);
+ #endif
+ 
+ 	/* Set up header */
+ 	memcpy(elf.e_ident, ELFMAG, SELFMAG);
+ 	elf.e_ident[EI_CLASS] = ELFCLASS32;
+ 	elf.e_ident[EI_DATA] = ELFDATA2LSB;
+ 	elf.e_ident[EI_VERSION] = EV_CURRENT;
+ 	memset(elf.e_ident+EI_PAD, 0, EI_NIDENT-EI_PAD);
+ 	
+ 	elf.e_type = ET_CORE;
+ 	elf.e_machine = EM_386;
+ 	elf.e_version = EV_CURRENT;
+ 	elf.e_entry = 0;
+ 	elf.e_phoff = sizeof(elf);
+ 	elf.e_shoff = 0;
+ 	elf.e_flags = 0;
+ 	elf.e_ehsize = sizeof(elf);
+ 	elf.e_phentsize = sizeof(struct elf_phdr);
+ 	elf.e_phnum = segs+1;		/* Include notes */
+ 	elf.e_shentsize = 0;
+ 	elf.e_shnum = 0;
+ 	elf.e_shstrndx = 0;
+ 	
+ 	fs = get_fs();
+ 	set_fs(KERNEL_DS);
+ 	memcpy(corefile,"core.",5);
+ #if 0
+ 	memcpy(corefile+5,current->comm,sizeof(current->comm));
+ #else
+ 	corefile[4] = '\0';
+ #endif
+ 	if (open_namei(corefile,O_CREAT | 2 | O_TRUNC,0600,&inode,NULL)) {
+ 		inode = NULL;
+ 		goto end_coredump;
+ 	}
+ 	if (!S_ISREG(inode->i_mode))
+ 		goto end_coredump;
+ 	if (!inode->i_op || !inode->i_op->default_file_ops)
+ 		goto end_coredump;
+ 	file.f_mode = 3;
+ 	file.f_flags = 0;
+ 	file.f_count = 1;
+ 	file.f_inode = inode;
+ 	file.f_pos = 0;
+ 	file.f_reada = 0;
+ 	file.f_op = inode->i_op->default_file_ops;
+ 	if (file.f_op->open)
+ 		if (file.f_op->open(inode,&file))
+ 			goto end_coredump;
+ 	if (!file.f_op->write)
+ 		goto close_coredump;
+ 	has_dumped = 1;
+ 
+ 	DUMP_WRITE(&elf, sizeof(elf));
+ 	offset += sizeof(elf);				/* Elf header */
+ 	offset += (segs+1) * sizeof(struct elf_phdr);	/* Program headers */
+ 
+ 	/*
+ 	 * Set up the notes in similar form to SVR4 core dumps made
+ 	 * with info from their /proc.
+ 	 */
+ 	memset(&psinfo, 0, sizeof(psinfo));
+ 	memset(&prstatus, 0, sizeof(prstatus));
+ 
+ 	notes[0].name = "CORE";
+ 	notes[0].type = NT_PRSTATUS;
+ 	notes[0].datasz = sizeof(prstatus);
+ 	notes[0].data = &prstatus;
+ 	prstatus.pr_info.si_signo = prstatus.pr_cursig = signr;
+ 	prstatus.pr_sigpend = current->signal;
+ 	prstatus.pr_sighold = current->blocked;
+ 	psinfo.pr_pid = prstatus.pr_pid = current->pid;
+ 	psinfo.pr_ppid = prstatus.pr_ppid = current->p_pptr->pid;
+ 	psinfo.pr_pgrp = prstatus.pr_pgrp = current->pgrp;
+ 	psinfo.pr_sid = prstatus.pr_sid = current->session;
+ 	prstatus.pr_utime.tv_sec = CT_TO_SECS(current->utime);
+ 	prstatus.pr_utime.tv_usec = CT_TO_USECS(current->utime);
+ 	prstatus.pr_stime.tv_sec = CT_TO_SECS(current->stime);
+ 	prstatus.pr_stime.tv_usec = CT_TO_USECS(current->stime);
+ 	prstatus.pr_cutime.tv_sec = CT_TO_SECS(current->cutime);
+ 	prstatus.pr_cutime.tv_usec = CT_TO_USECS(current->cutime);
+ 	prstatus.pr_cstime.tv_sec = CT_TO_SECS(current->cstime);
+ 	prstatus.pr_cstime.tv_usec = CT_TO_USECS(current->cstime);
+ 	if (sizeof(elf_gregset_t) != sizeof(struct pt_regs))
+ 	{
+ 		printk("sizeof(elf_gregset_t) (%d) != sizeof(struct pt_regs) (%d)\n",
+ 			sizeof(elf_gregset_t), sizeof(struct pt_regs));
+ 	}
+ 	else
+ 		*(struct pt_regs *)&prstatus.pr_reg = *regs;
+ 	
+ #ifdef DEBUG
+ 	dump_regs("Passed in regs", (elf_greg_t *)regs);
+ 	dump_regs("prstatus regs", (elf_greg_t *)&prstatus.pr_reg);
+ #endif
+ 
+ 	notes[1].name = "CORE";
+ 	notes[1].type = NT_PRPSINFO;
+ 	notes[1].datasz = sizeof(psinfo);
+ 	notes[1].data = &psinfo;
+ 	psinfo.pr_state = current->state;
+ 	psinfo.pr_sname = (current->state < 0 || current->state > 5) ? '.' : "RSDZTD"[current->state];
+ 	psinfo.pr_zomb = psinfo.pr_sname == 'Z';
+ 	psinfo.pr_nice = current->priority-15;
+ 	psinfo.pr_flag = current->flags;
+ 	psinfo.pr_uid = current->uid;
+ 	psinfo.pr_gid = current->gid;
+ 	{
+ 		int i, len;
+ 
+ 		set_fs(fs);
+ 		
+ 		len = current->mm->arg_end - current->mm->arg_start;
+ 		len = len >= ELF_PRARGSZ ? ELF_PRARGSZ : len;
+ 		memcpy_fromfs(&psinfo.pr_psargs,
+ 			      (const char *)current->mm->arg_start, len);
+ 		for(i = 0; i < len; i++)
+ 			if (psinfo.pr_psargs[i] == 0)
+ 				psinfo.pr_psargs[i] = ' ';
+ 		psinfo.pr_psargs[len] = 0;
+ 
+ 		set_fs(KERNEL_DS);
+ 	}
+ 	strncpy(psinfo.pr_fname, current->comm, sizeof(psinfo.pr_fname));
+ 
+ 	notes[2].name = "CORE";
+ 	notes[2].type = NT_TASKSTRUCT;
+ 	notes[2].datasz = sizeof(*current);
+ 	notes[2].data = current;
+ 	
+ 	/* Try to dump the fpu. */
+ 	prstatus.pr_fpvalid = dump_fpu (&fpu);
+ 	if (!prstatus.pr_fpvalid)
+ 	{
+ 		numnote--;
+ 	}
+ 	else
+ 	{
+ 		notes[3].name = "CORE";
+ 		notes[3].type = NT_PRFPREG;
+ 		notes[3].datasz = sizeof(fpu);
+ 		notes[3].data = &fpu;
+ 	}
+ 	
+ 	/* Write notes phdr entry */
+ 	{
+ 		struct elf_phdr phdr;
+ 		int sz = 0;
+ 
+ 		for(i = 0; i < numnote; i++)
+ 			sz += notesize(&notes[i]);
+ 		
+ 		phdr.p_type = PT_NOTE;
+ 		phdr.p_offset = offset;
+ 		phdr.p_vaddr = 0;
+ 		phdr.p_paddr = 0;
+ 		phdr.p_filesz = sz;
+ 		phdr.p_memsz = 0;
+ 		phdr.p_flags = 0;
+ 		phdr.p_align = 0;
+ 
+ 		offset += phdr.p_filesz;
+ 		DUMP_WRITE(&phdr, sizeof(phdr));
+ 	}
+ 
+ 	/* Page-align dumped data */
+ 	dataoff = offset = roundup(offset, PAGE_SIZE);
+ 	
+ 	/* Write program headers for segments dump */
+ 	for(vma = current->mm->mmap, i = 0;
+ 		i < segs && vma != NULL; vma = vma->vm_next) {
+ 		struct elf_phdr phdr;
+ 		size_t sz;
+ 
+ 		if (!maydump(vma))
+ 			continue;
+ 		i++;
+ 
+ 		sz = vma->vm_end - vma->vm_start;
+ 		
+ 		phdr.p_type = PT_LOAD;
+ 		phdr.p_offset = offset;
+ 		phdr.p_vaddr = vma->vm_start;
+ 		phdr.p_paddr = 0;
+ 		phdr.p_filesz = sz;
+ 		phdr.p_memsz = sz;
+ 		offset += sz;
+ 		phdr.p_flags = vma->vm_flags & VM_READ ? PF_R : 0;
+ 		if (vma->vm_flags & VM_WRITE) phdr.p_flags |= PF_W;
+ 		if (vma->vm_flags & VM_EXEC) phdr.p_flags |= PF_X;
+ 		phdr.p_align = PAGE_SIZE;
+ 
+ 		DUMP_WRITE(&phdr, sizeof(phdr));
+ 	}
+ 
+ 	for(i = 0; i < numnote; i++)
+ 		if (!writenote(&notes[i], &file))
+ 			goto close_coredump;
+ 	
+ 	set_fs(fs);
+ 
+ 	DUMP_SEEK(dataoff);
+ 	
+ 	for(i = 0, vma = current->mm->mmap;
+ 	    i < segs && vma != NULL;
+ 	    vma = vma->vm_next) {
+ 		unsigned long addr = vma->vm_start;
+ 		unsigned long len = vma->vm_end - vma->vm_start;
+ 		
+ 		if (!maydump(vma))
+ 			continue;
+ 		i++;
+ #ifdef DEBUG
+ 		printk("elf_core_dump: writing %08lx %lx\n", addr, len);
+ #endif
+ 		DUMP_WRITE((void *)addr, len);
+ 	}
+ 
+ 	if (file.f_pos != offset) {
+ 		/* Sanity check */
+ 		printk("elf_core_dump: file.f_pos (%ld) != offset (%ld)\n",
+ 		       file.f_pos, offset);
+ 	}
+ 
+  close_coredump:
+ 	if (file.f_op->release)
+ 		file.f_op->release(inode,&file);
+ 
+  end_coredump:
+ 	set_fs(fs);
+ 	iput(inode);
+ #ifndef CONFIG_BINFMT_ELF
+ 	MOD_DEC_USE_COUNT;
+ #endif
+ 	return has_dumped;
+ }
+ 
  #ifdef MODULE
  char kernel_version[] = UTS_RELEASE;
  
***************
*** 743,748 ****
--- 1158,1164 ----
  	register_binfmt(&elf_format);
  	return 0;
  }
+ 
  
  void cleanup_module( void) {
  	
diff -c linux/linux/include/asm-i386/irq.h:1.1.1.1 linux/linux/include/asm-i386/irq.h:1.2
*** linux/linux/include/asm-i386/irq.h:1.1.1.1	Tue Jun  6 23:10:50 1995
--- linux/linux/include/asm-i386/irq.h	Tue Jun  6 23:10:50 1995
***************
*** 79,86 ****
  	"inb $0x21,%al\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
! 	"1:\torb $" #mask ",_cache_21\n\t" \
! 	"movb _cache_21,%al\n\t" \
  	"outb %al,$0x21\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
--- 79,86 ----
  	"inb $0x21,%al\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
! 	"1:\torb $" #mask ","SYMBOL_NAME_STR(cache_21)"\n\t" \
! 	"movb "SYMBOL_NAME_STR(cache_21)",%al\n\t" \
  	"outb %al,$0x21\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
***************
*** 91,98 ****
  	"inb $0xA1,%al\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
! 	"1:\torb $" #mask ",_cache_A1\n\t" \
! 	"movb _cache_A1,%al\n\t" \
  	"outb %al,$0xA1\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
--- 91,98 ----
  	"inb $0xA1,%al\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
! 	"1:\torb $" #mask ","SYMBOL_NAME_STR(cache_A1)"\n\t" \
! 	"movb "SYMBOL_NAME_STR(cache_A1)",%al\n\t" \
  	"outb %al,$0xA1\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
***************
*** 106,121 ****
  	"inb $0x21,%al\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
! 	"1:\tandb $~(" #mask "),_cache_21\n\t" \
! 	"movb _cache_21,%al\n\t" \
  	"outb %al,$0x21\n\t"
  
  #define UNBLK_SECOND(mask) \
  	"inb $0xA1,%al\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
! 	"1:\tandb $~(" #mask "),_cache_A1\n\t" \
! 	"movb _cache_A1,%al\n\t" \
  	"outb %al,$0xA1\n\t"
  
  #define IRQ_NAME2(nr) nr##_interrupt(void)
--- 106,121 ----
  	"inb $0x21,%al\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
! 	"1:\tandb $~(" #mask "),"SYMBOL_NAME_STR(cache_21)"\n\t" \
! 	"movb "SYMBOL_NAME_STR(cache_21)",%al\n\t" \
  	"outb %al,$0x21\n\t"
  
  #define UNBLK_SECOND(mask) \
  	"inb $0xA1,%al\n\t" \
  	"jmp 1f\n" \
  	"1:\tjmp 1f\n" \
! 	"1:\tandb $~(" #mask "),"SYMBOL_NAME_STR(cache_A1)"\n\t" \
! 	"movb "SYMBOL_NAME_STR(cache_A1)",%al\n\t" \
  	"outb %al,$0xA1\n\t"
  
  #define IRQ_NAME2(nr) nr##_interrupt(void)
***************
*** 128,163 ****
  asmlinkage void FAST_IRQ_NAME(nr); \
  asmlinkage void BAD_IRQ_NAME(nr); \
  __asm__( \
! "\n.align 4\n" \
! "_IRQ" #nr "_interrupt:\n\t" \
  	"pushl $-"#nr"-2\n\t" \
  	SAVE_ALL \
  	ACK_##chip(mask) \
! 	"incl _intr_count\n\t"\
  	"sti\n\t" \
  	"movl %esp,%ebx\n\t" \
  	"pushl %ebx\n\t" \
  	"pushl $" #nr "\n\t" \
! 	"call _do_IRQ\n\t" \
  	"addl $8,%esp\n\t" \
  	"cli\n\t" \
  	UNBLK_##chip(mask) \
! 	"decl _intr_count\n\t" \
  	"jmp ret_from_sys_call\n" \
! "\n.align 4\n" \
! "_fast_IRQ" #nr "_interrupt:\n\t" \
  	SAVE_MOST \
  	ACK_##chip(mask) \
! 	"incl _intr_count\n\t" \
  	"pushl $" #nr "\n\t" \
! 	"call _do_fast_IRQ\n\t" \
  	"addl $4,%esp\n\t" \
  	"cli\n\t" \
  	UNBLK_##chip(mask) \
! 	"decl _intr_count\n\t" \
  	RESTORE_MOST \
! "\n\n.align 4\n" \
! "_bad_IRQ" #nr "_interrupt:\n\t" \
  	SAVE_MOST \
  	ACK_##chip(mask) \
  	RESTORE_MOST);
--- 128,163 ----
  asmlinkage void FAST_IRQ_NAME(nr); \
  asmlinkage void BAD_IRQ_NAME(nr); \
  __asm__( \
! "\n"ALIGN_STR"\n" \
! SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \
  	"pushl $-"#nr"-2\n\t" \
  	SAVE_ALL \
  	ACK_##chip(mask) \
! 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t"\
  	"sti\n\t" \
  	"movl %esp,%ebx\n\t" \
  	"pushl %ebx\n\t" \
  	"pushl $" #nr "\n\t" \
! 	"call "SYMBOL_NAME_STR(do_IRQ)"\n\t" \
  	"addl $8,%esp\n\t" \
  	"cli\n\t" \
  	UNBLK_##chip(mask) \
! 	"decl "SYMBOL_NAME_STR(intr_count)"\n\t" \
  	"jmp ret_from_sys_call\n" \
! "\n"ALIGN_STR"\n" \
! SYMBOL_NAME_STR(fast_IRQ) #nr "_interrupt:\n\t" \
  	SAVE_MOST \
  	ACK_##chip(mask) \
! 	"incl "SYMBOL_NAME_STR(intr_count)"\n\t" \
  	"pushl $" #nr "\n\t" \
! 	"call "SYMBOL_NAME_STR(do_fast_IRQ)"\n\t" \
  	"addl $4,%esp\n\t" \
  	"cli\n\t" \
  	UNBLK_##chip(mask) \
! 	"decl "SYMBOL_NAME_STR(intr_count)"\n\t" \
  	RESTORE_MOST \
! "\n"ALIGN_STR"\n" \
! SYMBOL_NAME_STR(bad_IRQ) #nr "_interrupt:\n\t" \
  	SAVE_MOST \
  	ACK_##chip(mask) \
  	RESTORE_MOST);
diff -c linux/linux/include/asm-i386/system.h:1.1.1.1 linux/linux/include/asm-i386/system.h:1.2
*** linux/linux/include/asm-i386/system.h:1.1.1.1	Tue Jun  6 23:10:50 1995
--- linux/linux/include/asm-i386/system.h	Tue Jun  6 23:10:50 1995
***************
*** 49,58 ****
   */
  #define switch_to(tsk) do { \
  __asm__("cli\n\t" \
! 	"xchgl %%ecx,_current\n\t" \
  	"ljmp %0\n\t" \
  	"sti\n\t" \
! 	"cmpl %%ecx,_last_task_used_math\n\t" \
  	"jne 1f\n\t" \
  	"clts\n" \
  	"1:" \
--- 49,58 ----
   */
  #define switch_to(tsk) do { \
  __asm__("cli\n\t" \
! 	"xchgl %%ecx,"SYMBOL_NAME_STR(current)"\n\t" \
  	"ljmp %0\n\t" \
  	"sti\n\t" \
! 	"cmpl %%ecx,"SYMBOL_NAME_STR(last_task_used_math)"\n\t" \
  	"jne 1f\n\t" \
  	"clts\n" \
  	"1:" \
diff -c linux/linux/include/linux/elf.h:1.1.1.2 linux/linux/include/linux/elf.h:1.2
*** linux/linux/include/linux/elf.h:1.1.1.2	Tue Jun  6 23:10:51 1995
--- linux/linux/include/linux/elf.h	Tue Jun  6 23:10:51 1995
***************
*** 148,153 ****
--- 148,159 ----
    Elf32_Half	e_shstrndx;
  } Elf32_Ehdr;
  
+ /* These constants define the permissions on sections in the program
+    header, p_flags. */
+ #define PF_R		0x4
+ #define PF_W		0x2
+ #define PF_X		0x1
+ 
  typedef struct elf_phdr{
    Elf32_Word	p_type;
    Elf32_Off	p_offset;
***************
*** 234,239 ****
--- 240,258 ----
  #define EV_NONE		0		/* e_version, EI_VERSION */
  #define EV_CURRENT	1
  #define EV_NUM		2
+ 
+ /* Notes used in ET_CORE */
+ #define NT_PRSTATUS	1
+ #define NT_PRFPREG	2
+ #define NT_PRPSINFO	3
+ #define NT_TASKSTRUCT	4
+ 
+ /* Note header in a PT_NOTE section */
+ typedef struct elf_note {
+   Elf32_Word	n_namesz;	/* Name size */
+   Elf32_Word	n_descsz;	/* Content size */
+   Elf32_Word	n_type;		/* Content type */
+ } Elf32_Nhdr;
  
  #define ELF_START_MMAP 0x80000000
  
diff -c /dev/null linux/linux/include/linux/elfcore.h:1.1
*** /dev/null	Tue Jun  6 23:10:51 1995
--- linux/linux/include/linux/elfcore.h	Tue Jun  6 23:10:51 1995
***************
*** 0 ****
--- 1,97 ----
+ #ifndef _LINUX_ELFCORE_H
+ #define _LINUX_ELFCORE_H
+ 
+ #include <linux/types.h>
+ #include <linux/signal.h>
+ #include <linux/time.h>
+ #include <linux/ptrace.h>
+ #include <linux/user.h>
+ 
+ struct elf_siginfo
+ {
+ 	int	si_signo;			/* signal number */
+ 	int	si_code;			/* extra code */
+ 	int	si_errno;			/* errno */
+ };
+ 
+ typedef unsigned long elf_greg_t;
+ #define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t))
+ typedef elf_greg_t elf_gregset_t[ELF_NGREG];
+ typedef struct
+ #ifdef __i386__
+ 	user_i387_struct
+ #else
+ #error	"The FPU in this arch is not supported by ELF core dump.".
+ #endif
+ elf_fpregset_t;
+ 
+ #ifndef __KERNEL__
+ typedef elf_greg_t greg_t;
+ typedef elf_gregset_t gregset_t;
+ typedef elf_fpregset_t fpregset_t;
+ #define NGREG ELF_NGREG
+ #endif
+ 
+ /*
+  * Definitons to generate Intel SVR4-like core files.
+  * These mostly have the same names as the SVR4 types with "elf_"
+  * tacked on the front to prevent clashes with linux definitions,
+  * and the typedef forms have been avoided.  This is mostly like
+  * the SVR4 structure, but more Linuxy, with things that Linux does
+  * not support and which gdb doesn't really use excluded.
+  * Fields present but not used are marked with "XXX".
+  */
+ struct elf_prstatus
+ {
+ #if 0
+ 	long	pr_flags;	/* XXX Process flags */
+ 	short	pr_why;		/* XXX Reason for process halt */
+ 	short	pr_what;	/* XXX More detailed reason */
+ #endif
+ 	struct elf_siginfo pr_info;	/* Info associated with signal */
+ 	short	pr_cursig;	/* Current signal */
+ 	sigset_t pr_sigpend;	/* Set of pending signals */
+ 	sigset_t pr_sighold;	/* Set of held signals */
+ #if 0
+ 	struct sigaltstack pr_altstack;	/* Alternate stack info */
+ 	struct sigaction pr_action;	/* Signal action for current sig */
+ #endif
+ 	pid_t	pr_pid;
+ 	pid_t	pr_ppid;
+ 	pid_t	pr_pgrp;
+ 	pid_t	pr_sid;
+ 	struct timeval pr_utime;	/* User time */
+ 	struct timeval pr_stime;	/* System time */
+ 	struct timeval pr_cutime;	/* Cumulative user time */
+ 	struct timeval pr_cstime;	/* Cumulative system time */
+ #if 0
+ 	long	pr_instr;		/* Current instruction */
+ #endif
+ 	elf_gregset_t pr_reg;	/* GP registers */
+ 	int pr_fpvalid;		/* True if math co-processor being used.  */
+ };
+ 
+ #define ELF_PRARGSZ	(80)	/* Number of chars for args */
+ 
+ struct elf_prpsinfo
+ {
+ 	char	pr_state;	/* numeric process state */
+ 	char	pr_sname;	/* char for pr_state */
+ 	char	pr_zomb;	/* zombie */
+ 	char	pr_nice;	/* nice val */
+ 	unsigned long pr_flag;	/* flags */
+ 	uid_t	pr_uid;
+ 	gid_t	pr_gid;
+ 	pid_t	pr_pid, pr_ppid, pr_pgrp, pr_sid;
+ 	/* Lots missing */
+ 	char	pr_fname[16];	/* filename of executable */
+ 	char	pr_psargs[ELF_PRARGSZ];	/* initial part of arg list */
+ };
+ 
+ #ifndef __KERNEL__
+ typedef struct elf_prstatus prstatus_t;
+ typedef struct elf_prpsinfo prpsinfo_t;
+ #define PRARGSZ ELF_PRARGSZ 
+ #endif
+ 
+ #endif /* _LINUX_ELFCORE_H */
diff -c linux/linux/include/linux/linkage.h:1.1.1.1 linux/linux/include/linux/linkage.h:1.2
*** linux/linux/include/linux/linkage.h:1.1.1.1	Tue Jun  6 23:10:51 1995
--- linux/linux/include/linux/linkage.h	Tue Jun  6 23:10:51 1995
***************
*** 7,10 ****
--- 7,52 ----
  #define asmlinkage
  #endif
  
+ #if !defined(__i486__) && !defined(__i586__)
+ #ifdef __ELF__
+ #define ALIGN .align 4,0x90
+ #define ALIGN_STR ".align 4,0x90"
+ #else  /* __ELF__ */
+ #define ALIGN .align 2,0x90
+ #define ALIGN_STR ".align 2,0x90"
+ #endif /* __ELF__ */
+ #else  /* __i486__/__i586__ */
+ #ifdef __ELF__
+ #define ALIGN .align 16,0x90
+ #define ALIGN_STR ".align 16,0x90"
+ #else  /* __ELF__ */
+ #define ALIGN .align 4,0x90
+ #define ALIGN_STR ".align 4,0x90"
+ #endif /* __ELF__ */
+ #endif /* __i486__/__i586__ */
+ 
+ #ifdef __ELF__
+ #define SYMBOL_NAME_STR(X) #X
+ #define SYMBOL_NAME(X) X
+ #ifdef __STDC__
+ #define SYMBOL_NAME_LABEL(X) X##:
+ #else
+ #define SYMBOL_NAME_LABEL(X) X/**/:
+ #endif
+ #else
+ #define SYMBOL_NAME_STR(X) "_"#X
+ #ifdef __STDC__
+ #define SYMBOL_NAME(X) _##X
+ #define SYMBOL_NAME_LABEL(X) _##X##:
+ #else
+ #define SYMBOL_NAME(X) _/**/X
+ #define SYMBOL_NAME_LABEL(X) _/**/X/**/:
+ #endif
+ #endif
+ 
+ #define ENTRY(name) \
+   .globl SYMBOL_NAME(name); \
+   ALIGN; \
+   SYMBOL_NAME_LABEL(name)
+ 
  #endif
diff -c linux/linux/include/linux/symtab_begin.h:1.1.1.1 linux/linux/include/linux/symtab_begin.h:1.2
*** linux/linux/include/linux/symtab_begin.h:1.1.1.1	Tue Jun  6 23:10:51 1995
--- linux/linux/include/linux/symtab_begin.h	Tue Jun  6 23:10:51 1995
***************
*** 1,16 ****
  #ifdef CONFIG_MODVERSIONS /* CONFIG_MODVERSIONS */
  #undef _set_ver
  #undef X
  #ifndef __GENKSYMS__
  #ifdef MODULE
! #define _set_ver(sym,ver) { (void *) & sym ## _R ## ver, "_" #sym "_R" #ver }
  #else /* MODULE */
! #define _set_ver(sym,ver) { (void *) & sym, "_" #sym "_R" #ver }
  #endif /* MODULE */
  #define X(a) a
  #endif /* __GENKSYMS__ */
  #else /* CONFIG_MODVERSIONS */
! #define X(sym) { (void *) & sym, "_" #sym }
  #endif /* CONFIG_MODVERSIONS */
  #define EMPTY {0,0}
  	0, 0, 0, {
--- 1,19 ----
+ #include <linux/linkage.h>
  #ifdef CONFIG_MODVERSIONS /* CONFIG_MODVERSIONS */
  #undef _set_ver
  #undef X
  #ifndef __GENKSYMS__
  #ifdef MODULE
! #define _set_ver(sym,ver) \
! 	{ (void *) & sym ## _R ## ver, SYMBOL_NAME_STR(sym) "_R" #ver }
  #else /* MODULE */
! #define _set_ver(sym,ver) \
! 	{ (void *) & sym, SYMBOL_NAME_STR(sym) "_R" #ver }
  #endif /* MODULE */
  #define X(a) a
  #endif /* __GENKSYMS__ */
  #else /* CONFIG_MODVERSIONS */
! #define X(sym) { (void *) & sym, SYMBOL_NAME_STR(sym)}
  #endif /* CONFIG_MODVERSIONS */
  #define EMPTY {0,0}
  	0, 0, 0, {
diff -c linux/linux/include/linux/sys.h:1.1.1.1 linux/linux/include/linux/sys.h:1.2
*** linux/linux/include/linux/sys.h:1.1.1.1	Tue Jun  6 23:10:52 1995
--- linux/linux/include/linux/sys.h	Tue Jun  6 23:10:52 1995
***************
*** 27,32 ****
--- 27,36 ----
   * These are system calls that haven't been implemented yet
   * but have an entry in the table for future expansion..
   */
+ #ifdef __ELF__
+ #define sys_quotactl	sys_ni_syscall
+ #else
  #define _sys_quotactl	_sys_ni_syscall
+ #endif
  
  #endif
diff -c linux/linux/include/linux/timex.h:1.1.1.1 linux/linux/include/linux/timex.h:1.2
*** linux/linux/include/linux/timex.h:1.1.1.1	Tue Jun  6 23:10:52 1995
--- linux/linux/include/linux/timex.h	Tue Jun  6 23:10:52 1995
***************
*** 88,93 ****
--- 88,106 ----
  				 */
  	struct timeval time;	/* (read only) */
  	long tick;		/* (modified) usecs between clock ticks */
+ 
+         long ppsfreq;           /* pps frequency (scaled ppm) (ro) */
+         long jitter;            /* pps jitter (us) (ro) */
+         int shift;              /* interval duration (s) (shift) (ro) */
+         long stabil;            /* pps stability (scaled ppm) (ro) */
+         long jitcnt;            /* jitter limit exceeded (ro) */
+         long calcnt;            /* calibration intervals (ro) */
+         long errcnt;            /* calibration errors (ro) */
+         long stbcnt;            /* stability limit exceeded (ro) */
+ 
+ 	int  :32; int  :32; int  :32; int  :32;
+ 	int  :32; int  :32; int  :32; int  :32;
+ 	int  :32; int  :32; int  :32; int  :32;
  };
  
  /*
diff -c linux/linux/kernel/ksyms.c:1.1.1.4 linux/linux/kernel/ksyms.c:1.4
*** linux/linux/kernel/ksyms.c:1.1.1.4	Tue Jun  6 23:10:52 1995
--- linux/linux/kernel/ksyms.c	Tue Jun  6 23:10:52 1995
***************
*** 81,87 ****
  struct symbol_table symbol_table = {
  #include <linux/symtab_begin.h>
  #ifdef CONFIG_MODVERSIONS
! 	{ (void *)1 /* Version version :-) */, "_Using_Versions" },
  #endif
  	/* stackable module support */
  	X(rename_module_symbol),
--- 81,88 ----
  struct symbol_table symbol_table = {
  #include <linux/symtab_begin.h>
  #ifdef CONFIG_MODVERSIONS
! 	{ (void *)1 /* Version version :-) */,
! 		SYMBOL_NAME_STR (Using_Versions) },
  #endif
  	/* stackable module support */
  	X(rename_module_symbol),
