Przeglądaj źródła

* several mips/mipsel related stuff fixed
* regenerated linux makefile to support mipsel

git-svn-id: trunk@14278 -

florian 15 lat temu
rodzic
commit
28ac4a8dda

+ 2 - 0
.gitattributes

@@ -6529,6 +6529,7 @@ rtl/linux/m68k/syscall.inc svneol=native#text/plain
 rtl/linux/m68k/syscallh.inc svneol=native#text/plain
 rtl/linux/m68k/sysnr.inc svneol=native#text/plain
 rtl/linux/mips/bsyscall.inc svneol=native#text/plain
+rtl/linux/mips/prt0.as svneol=native#text/plain
 rtl/linux/mips/sighnd.inc svneol=native#text/plain
 rtl/linux/mips/sighndh.inc svneol=native#text/plain
 rtl/linux/mips/stat.inc svneol=native#text/plain
@@ -6641,6 +6642,7 @@ rtl/macos/sysosh.inc svneol=native#text/plain
 rtl/macos/system.pp svneol=native#text/plain
 rtl/macos/sysutils.pp svneol=native#text/plain
 rtl/mips/int64p.inc svneol=native#text/plain
+rtl/mips/makefile.cpu svneol=native#text/plain
 rtl/mips/math.inc svneol=native#text/plain
 rtl/mips/mipsel.inc svneol=native#text/plain
 rtl/mips/set.inc svneol=native#text/plain

+ 4 - 0
compiler/fpcdefs.inc

@@ -120,6 +120,10 @@
   {$define cpunodefaultint}
 {$endif avr}
 
+{$ifdef mipsel}
+  {$define mips}
+{$endif mipsel}
+
 {$ifdef mips}
   {$define cpu32bitalu}
   {$define cpu32bitaddr}

+ 1 - 1
compiler/mips/cpugas.pas

@@ -254,7 +254,7 @@ unit cpugas;
         idtxt: 'AS';
         asmbin: 'as';
         asmcmd: '-mips2 -W -EL -o $OBJ $ASM';
-        supported_targets: [system_mips_linux];
+        supported_targets: [system_mips_linux,system_mipsel_linux];
         flags: [af_allowdirect, af_needar, af_smartlink_sections];
         labelprefix: '.L';
         comment: '# ';

+ 4 - 1
compiler/mips/cpuinfo.pas

@@ -43,8 +43,11 @@ Const
    {# Size of a multimedia register               }
    mmreg_size = 0;
    { target cpu string (used by compiler options) }
+{$ifdef MIPSEL}
+   target_cpu_string = 'mipsel';
+{$else MIPSEL}
    target_cpu_string = 'mips';
-
+{$endif MIPSEL}
    { calling conventions supported by the code generator }
    supported_calling_conventions : tproccalloptions = [
      pocall_internproc,

+ 1 - 1
compiler/mips/cputarg.pas

@@ -1,7 +1,7 @@
 {
     Copyright (c) 2001 by Peter Vreman
 
-    Includes the i386 dependent target units
+    Includes the mips dependent target units
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by

+ 4 - 4
compiler/mips/ncpuadd.pas

@@ -559,11 +559,11 @@ var
   tmp_left_reg: TRegister;
 
 begin
-          pass_left_right;
-          force_reg_left_right(false,false);
+  pass_left_right;
+  force_reg_left_right(false,false);
 
-          unsigned:=not(is_signed(left.resultdef)) or
-                    not(is_signed(right.resultdef));
+  unsigned:=not(is_signed(left.resultdef)) or
+            not(is_signed(right.resultdef));
 
   location_reset(location, LOC_REGISTER, OS_INT);
   location.Register := GetRes64_register(unsigned, {NR_TCR0, }left.location.register64, right.location.register64); // NR_TCR0;

+ 15 - 4
compiler/systems.pas

@@ -52,7 +52,8 @@ interface
              cpu_mips,                     { 9 }
              cpu_arm,                      { 10 }
              cpu_powerpc64,                { 11 }
-             cpu_avr                       { 12 }
+             cpu_avr,                      { 12 }
+             cpu_mipsel                    { 13 }
        );
 
        tasmmode= (asmmode_none
@@ -147,7 +148,8 @@ interface
              system_i386_haiku,         { 63 }
              system_arm_darwin,         { 64 }
              system_x86_64_solaris,     { 65 }
-             system_mips_linux          { 66 }
+             system_mips_linux,         { 66 }
+             system_mipsel_linux        { 67 }
        );
 
      type
@@ -393,7 +395,8 @@ interface
        system_wince = [system_arm_wince,system_i386_wince];
        system_linux = [system_i386_linux,system_x86_64_linux,system_powerpc_linux,system_powerpc64_linux,
                        system_arm_linux,system_sparc_linux,system_alpha_linux,system_m68k_linux,
-                       system_x86_6432_linux];
+                       system_x86_6432_linux,system_mips_linux,system_mipsel_linux];
+
        { all real windows systems, no cripple ones like wince, wdosx et. al. }
        system_windows = [system_i386_win32,system_x86_64_win64,system_ia64_win64];
        { all windows systems }
@@ -447,7 +450,7 @@ interface
 
        cpu2str : array[TSystemCpu] of string[10] =
             ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
-             'mips','arm', 'powerpc64', 'avr');
+             'mips','arm', 'powerpc64', 'avr', 'mipsel');
 
        abi2str : array[tabi] of string[10] =
          ('DEFAULT','SYSV','AIX','EABI','ARMEB');
@@ -979,6 +982,14 @@ begin
 {$ifdef avr}
   default_target(system_avr_embedded);
 {$endif avr}
+
+{$ifdef mips}
+{$ifdef mipsel}
+  default_target(system_mipsel_linux);
+{$else mipsel}
+  default_target(system_mips_linux);
+{$endif mipsel}
+{$endif mips}
 end;
 
 

+ 65 - 1
compiler/systems/i_linux.pas

@@ -732,7 +732,7 @@ unit i_linux;
        system_mips_linux_info : tsysteminfo =
           (
             system       : system_mips_LINUX;
-            name         : 'Linux for MIPSEL';
+            name         : 'Linux for MIPS';
             shortname    : 'Linux';
             flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
                             tf_use_function_relative_addresses,tf_requires_proper_alignment,
@@ -760,6 +760,70 @@ unit i_linux;
             sharedClibprefix : 'lib';
             importlibprefix : 'libimp';
             importlibext : '.a';
+//            p_ext_support : false;
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            assem        : as_gas;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            dbg          : dbg_stabs;
+            script       : script_unix;
+            endian       : endian_big;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 8;
+                varalignmin     : 0;
+                varalignmax     : 8;
+                localalignmin   : 4;
+                localalignmax   : 8;
+                recordalignmin  : 0;
+                recordalignmax  : 2;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 8;
+            stacksize    : 32*1024*1024;
+            abi : abi_default
+          );
+
+       system_mipsel_linux_info : tsysteminfo =
+          (
+            system       : system_mipsel_LINUX;
+            name         : 'Linux for MIPSEL';
+            shortname    : 'Linux';
+            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
+                            tf_use_function_relative_addresses,tf_requires_proper_alignment,
+                            tf_smartlink_sections,tf_smartlink_library,tf_has_winlike_resources];
+            cpu          : cpu_mipsel;
+            unit_env     : 'LINUXUNITS';
+            extradefines : 'UNIX;HASUNIX;MIPSEL';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            importlibprefix : 'libimp';
+            importlibext : '.a';
 //            p_ext_support : false;
             Cprefix      : '';
             newline      : #10;

+ 7 - 0
compiler/systems/t_linux.pas

@@ -1165,10 +1165,17 @@ initialization
   RegisterTarget(system_arm_linux_info);
 {$endif ARM}
 {$ifdef MIPS}
+{$ifdef MIPSEL}
+  RegisterExternalLinker(system_mipsel_linux_info,TLinkerLinux);
+  RegisterImport(system_mipsel_linux,timportliblinux);
+  RegisterExport(system_mipsel_linux,texportliblinux);
+  RegisterTarget(system_mipsel_linux_info);
+{$else MIPS}
   RegisterExternalLinker(system_mips_linux_info,TLinkerLinux);
   RegisterImport(system_mips_linux,timportliblinux);
   RegisterExport(system_mips_linux,texportliblinux);
   RegisterTarget(system_mips_linux_info);
+{$endif MIPSEL}
 {$endif MIPS}
   RegisterRes(res_elf_info,TWinLikeResourceFile);
 end.

+ 51 - 3
rtl/linux/Makefile

@@ -1,10 +1,10 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/08/02]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2009/11/27]
 #
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
-UNIXs = linux $(BSDs) solaris qnx
+UNIXs = linux $(BSDs) solaris qnx haiku
 LIMIT83fs = go32v2 os2 emx watcom
 OSNeedsComspecToRunBatch = go32v2 watcom
 FORCE:
@@ -420,6 +420,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix clocale
 endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix clocale
+endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix clocale
 endif
@@ -471,6 +474,9 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix clocale
 endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_UNITS+=$(SYSTEMUNIT) $(SYSINIT_UNITS) unixtype ctypes baseunix strings objpas macpas syscall unixutil fpintres heaptrc lineinfo lnfodwrf termio unix linux initc cmem $(CPU_UNITS) crt printer linuxvcs sysutils typinfo math matrix varutils charset ucomplex getopts errors sockets gpm ipc serial terminfo dl dynlibs video mouse keyboard variants types dateutils sysconst fmtbcd cthreads classes fgl convutils stdconvs strutils rtlconsts dos objects cwstring fpcylix clocale
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_IMPLICITUNITS+=exeinfo
 endif
@@ -594,6 +600,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_IMPLICITUNITS+=exeinfo
 endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override TARGET_IMPLICITUNITS+=exeinfo
 endif
@@ -645,6 +654,9 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_IMPLICITUNITS+=exeinfo
 endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_IMPLICITUNITS+=exeinfo
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=$(LOADERS)
 endif
@@ -768,6 +780,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_LOADERS+=$(LOADERS)
 endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_LOADERS+=$(LOADERS)
+endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override TARGET_LOADERS+=$(LOADERS)
 endif
@@ -819,6 +834,9 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_LOADERS+=$(LOADERS)
 endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_LOADERS+=$(LOADERS)
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
@@ -942,6 +960,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
@@ -993,6 +1014,9 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
 endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override TARGET_RSTS+=math varutils typinfo variants sysconst rtlconsts stdconvs
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override CLEAN_UNITS+=syslinux linux
 endif
@@ -1116,6 +1140,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override CLEAN_UNITS+=syslinux linux
 endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override CLEAN_UNITS+=syslinux linux
+endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override CLEAN_UNITS+=syslinux linux
 endif
@@ -1167,6 +1194,9 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override CLEAN_UNITS+=syslinux linux
 endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override CLEAN_UNITS+=syslinux linux
+endif
 override INSTALL_FPCPACKAGE=y
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH)
@@ -1291,6 +1321,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH)
 endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH)
+endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH)
 endif
@@ -1342,6 +1375,9 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH)
 endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH)
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON)
 endif
@@ -1465,6 +1501,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON)
 endif
@@ -1516,6 +1555,9 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON)
 endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(UNIXINC) $(ARCH) $(COMMON)
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_TARGETDIR+=.
 endif
@@ -1639,6 +1681,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_TARGETDIR+=.
 endif
+ifeq ($(FULL_TARGET),x86_64-solaris)
+override COMPILER_TARGETDIR+=.
+endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
 override COMPILER_TARGETDIR+=.
 endif
@@ -1690,6 +1735,9 @@ endif
 ifeq ($(FULL_TARGET),armeb-embedded)
 override COMPILER_TARGETDIR+=.
 endif
+ifeq ($(FULL_TARGET),mipsel-linux)
+override COMPILER_TARGETDIR+=.
+endif
 override SHARED_LIBUNITS=$(SYSTEMUNIT) objpas strings dos unix baseunix unixtype unixutil sysutils typinfo math $(CPU_UNITS) getopts errors sockets varutils classes fgl variants sysconst rtlconsts 
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)

+ 93 - 0
rtl/linux/mips/prt0.as

@@ -0,0 +1,93 @@
+/*
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 1999-2009 by Michael Van Canneyt and David Zhang
+
+    Startup code for elf32-mipsel
+
+    See the file COPYING.FPC, included in this distribution,
+    for details about the copyright.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
+
+	.section ".text"
+	.align 4
+	.global _start
+	.type _start,#function
+_start:
+   0:   03a0f021        move    s8,sp
+   4:   2401fff8        li      at,-8
+   8:   03a1e824        and     sp,sp,at
+   c:   27bdffe0        addiu   sp,sp,-32
+  10:   3c17003d        lui     s7,0x3d
+  14:   26f70900        addiu   s7,s7,2304
+  18:   2401fff8        li      at,-8
+  1c:   02e1b824        and     s7,s7,at
+  20:   26f7ffe0        addiu   s7,s7,-32
+  24:   8fc40000        lw      a0,0(s8)
+  28:   3c050000        lui     a1,0x0
+  2c:   aca40000        sw      a0,0(a1)
+  30:   27c50004        addiu   a1,s8,4
+  34:   3c060000        lui     a2,0x0
+  38:   acc50000        sw      a1,0(a2)
+  3c:   24860001        addiu   a2,a0,1
+  40:   00063080        sll     a2,a2,0x2
+  44:   00c53021        addu    a2,a2,a1
+  48:   3c070000        lui     a3,0x0
+  4c:   0c000000        jal     0 <__start>
+  50:   ace60000        sw      a2,0(a3)
+  54:   00000000        nop
+
+  	/* Terminate the stack frame, and reserve space for functions to
+     	   drop their arguments.  */
+	mov	%g0, %fp
+	sub	%sp, 6*4, %sp
+
+  	/* Extract the arguments and environment as encoded on the stack.  The
+     	   argument info starts after one register window (16 words) past the SP.  */
+	ld	[%sp+22*4], %o2
+	sethi	%hi(operatingsystem_parameter_argc),%o1
+	or	%o1,%lo(operatingsystem_parameter_argc),%o1
+	st	%o2, [%o1]
+
+	add	%sp, 23*4, %o0
+	sethi	%hi(operatingsystem_parameter_argv),%o1
+	or	%o1,%lo(operatingsystem_parameter_argv),%o1
+	st	%o0, [%o1]
+
+	/* envp=(argc+1)*4+argv */
+	inc     %o2
+	sll     %o2, 2, %o2
+	add	%o2, %o0, %o2
+	sethi	%hi(operatingsystem_parameter_envp),%o1
+	or	%o1,%lo(operatingsystem_parameter_envp),%o1
+	st	%o2, [%o1]
+
+    /* Save initial stackpointer */
+	sethi	%hi(__stkptr),%o1
+	or	%o1,%lo(__stkptr),%o1
+	st	%sp, [%o1]
+
+  	/* Call the user program entry point.  */
+  	call	PASCALMAIN
+  	nop
+
+.globl  _haltproc
+.type   _haltproc,@function
+_haltproc:
+        li      v0,4001
+        lui     a0,0x0
+        lw      a0,0(a0)
+        syscall
+        b       _haltproc
+        nop
+
+	.size _start, .-_start
+
+        .comm __stkptr,4
+
+        .comm operatingsystem_parameter_envp,4
+        .comm operatingsystem_parameter_argc,4
+        .comm operatingsystem_parameter_argv,4

+ 0 - 1
rtl/linux/mips/sighnd.inc

@@ -1,5 +1,4 @@
 {
-    $Id: sighnd.inc,v 1.10 2005/04/24 21:19:22 peter Exp $
     This file is part of the Free Pascal run time library.
     Copyright (c) 1999-2000 by Michael Van Canneyt,
     member of the Free Pascal development team.

+ 6 - 0
rtl/mips/makefile.cpu

@@ -0,0 +1,6 @@
+#
+# Here we set processor dependent include file names.
+#
+
+CPUNAMES=mips math set
+CPUINCNAMES=$(addsuffix .inc,$(CPUNAMES))