Linux kernel patch

Michael Meissner meissner@cygnus.com
Wed Nov 26 09:18:00 GMT 1997


The following patch to the 2.1.66 kernel asks whether you want to use
the new options that egcs provides for compiling Pentium and Pentium
Pro (and -II) kernels.  I'm in fact posting this from a 2.1.66 kernel
compiled with egcs with the -mcpu=pentiumpro -march=pentiumpro
options (though since I just booted it, I can't tell you anything
about stability).

*** linux/Documentation/Configure.help.~1~	Tue Nov 25 17:45:26 1997
--- linux/Documentation/Configure.help	Wed Nov 26 12:02:32 1997
*************** CONFIG_M386
*** 893,898 ****
--- 893,910 ----
    specify "Pentium" even if running on a 486: the kernel will be
    smaller but slower. If you don't know what to do, say "386".
  
+ Compiler supports -mcpu=pentium and -march=pentium
+ CONFIG_GCC_PENTIUM
+   This enables support to use the -mcpu=pentium and -march=pentium
+   switches that are available on newer GCC compilers.
+ 
+ Compiler supports -mcpu=pentiumpro and -march=pentiumpro
+ CONFIG_GCC_PENTIUMPRO
+   This enables support to use the -mcpu=pentiumpro and -march=pentiumpro
+   switches that are available on newer GCC compilers.  If you use this
+   switch, then your kernel will not run on a Pentium, 486, or 386
+   processor.
+ 
  Video mode selection support
  CONFIG_VIDEO_SELECT
    This enables support for text mode selection on kernel startup. If
*** linux/arch/i386/Makefile.~1~	Tue Oct 14 21:24:09 1997
--- linux/arch/i386/Makefile	Wed Nov 26 11:58:03 1997
*************** LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinu
*** 25,44 ****
  
  CFLAGS := $(CFLAGS) -pipe -fno-strength-reduce
  
  ifdef CONFIG_M386
! CFLAGS := $(CFLAGS) -m386 -DCPU=386
  endif
  
  ifdef CONFIG_M486
! CFLAGS := $(CFLAGS) -m486 -DCPU=486
  endif
  
  ifdef CONFIG_M586
! CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=586
  endif
  
  ifdef CONFIG_M686
! CFLAGS := $(CFLAGS) -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -DCPU=686
  endif
  
  ifdef SMP
--- 25,59 ----
  
  CFLAGS := $(CFLAGS) -pipe -fno-strength-reduce
  
+ M386_CFLAGS = -m386
+ M486_CFLAGS = -m486
+ 
+ ifdef CONFIG_GCC_PENTIUM
+ M586_CFLAGS = -mcpu=pentium -march=pentium -malign-loops=2 -malign-jumps=2 -malign-functions=2
+ else
+ M586_CFLAGS = -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2
+ endif
+ 
+ ifdef CONFIG_GCC_PENTIUMPRO
+ M686_CFLAGS = -mcpu=pentiumpro -march=pentiumpro -malign-loops=2 -malign-jumps=2 -malign-functions=2
+ else
+ M686_CFLAGS = -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2
+ endif
+ 
  ifdef CONFIG_M386
! CFLAGS := $(CFLAGS) $(M386_CFLAGS) -DCPU=386
  endif
  
  ifdef CONFIG_M486
! CFLAGS := $(CFLAGS) $(M486_CFLAGS) -DCPU=486
  endif
  
  ifdef CONFIG_M586
! CFLAGS := $(CFLAGS) $(M586_CFLAGS) -DCPU=586
  endif
  
  ifdef CONFIG_M686
! CFLAGS := $(CFLAGS) $(M686_CFLAGS) -DCPU=686
  endif
  
  ifdef SMP
*** linux/arch/i386/config.in.~1~	Wed Oct 29 18:34:54 1997
--- linux/arch/i386/config.in	Wed Nov 26 11:56:11 1997
*************** choice 'Processor type' \
*** 46,51 ****
--- 46,59 ----
  	 486		CONFIG_M486	\
  	 Pentium	CONFIG_M586	\
  	 PPro		CONFIG_M686" Pentium
+ 
+ if [ "$CONFIG_M586" = "y" ]; then
+   bool '   Compiler supports -mcpu=pentium and -march=pentium' CONFIG_GCC_PENTIUM
+ fi
+ if [ "$CONFIG_M686" = "y" ]; then
+   bool '   Compiler supports -mcpu=pentiumpro and -march=pentiumpro' CONFIG_GCC_PENTIUMPRO
+ fi
+ 
  bool 'Video mode selection support' CONFIG_VIDEO_SELECT
  
  tristate 'Parallel port support' CONFIG_PARPORT

-- 
Michael Meissner, Cygnus Solutions (Massachusetts office)
4th floor, 955 Massachusetts Avenue, Cambridge, MA 02139, USA
meissner@cygnus.com,	617-354-5416 (office),	617-354-7161 (fax)



More information about the Gcc mailing list