system.pp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. unit system;
  2. interface
  3. {$define FPC_IS_SYSTEM}
  4. {$DEFINE FPCRTL_FILESYSTEM_SINGLE_BYTE_API}
  5. {$I systemh.inc}
  6. {$ifndef FPUNONE}
  7. {$ifdef FPC_HAS_FEATURE_SOFTFPU}
  8. {$define fpc_softfpu_interface}
  9. {$i softfpu.pp}
  10. {$undef fpc_softfpu_interface}
  11. {$endif FPC_HAS_FEATURE_SOFTFPU}
  12. {$endif FPUNONE}
  13. const
  14. maxExitCode = 255;
  15. AllowDirectorySeparators : set of AnsiChar = ['\','/'];
  16. DirectorySeparator = '/';
  17. { Default filehandles }
  18. UnusedHandle = $ffff;{ instead of -1, as it is a word value}
  19. StdInputHandle = 0;
  20. StdOutputHandle = 1;
  21. StdErrorHandle = 2;
  22. CtrlZMarksEOF: boolean = true; (* #26 is considered as end of file *)
  23. DefaultTextLineBreakStyle : TTextLineBreakStyle = tlbsCR;
  24. LineEnding = #10;
  25. PathSeparator = '/';
  26. MaxPathLen = 255;
  27. LFNSupport = true;
  28. FileNameCaseSensitive = true;
  29. sLineBreak = #13;
  30. var
  31. argc:longint=0;
  32. argv:PPAnsiChar;
  33. envp:PPAnsiChar;
  34. implementation
  35. var
  36. StkLen: SizeUInt; external name '__stklen';
  37. procedure _InitHeap(p: pdword; l: dword); external name 'InitHeap2';
  38. procedure _free(p: pointer); external name 'free2';
  39. function _malloc(l: dword): pointer; external name 'malloc2';
  40. {I ../mips/setjump.inc}
  41. {$I system.inc}
  42. {$ifndef FPUNONE}
  43. {$ifdef FPC_HAS_FEATURE_SOFTFPU}
  44. {$define fpc_softfpu_implementation}
  45. {$i softfpu.pp}
  46. {$undef fpc_softfpu_implementation}
  47. { we get these functions and types from the softfpu code }
  48. {$define FPC_SYSTEM_HAS_float64}
  49. {$define FPC_SYSTEM_HAS_float32}
  50. {$define FPC_SYSTEM_HAS_flag}
  51. {$define FPC_SYSTEM_HAS_extractFloat64Frac0}
  52. {$define FPC_SYSTEM_HAS_extractFloat64Frac1}
  53. {$define FPC_SYSTEM_HAS_extractFloat64Exp}
  54. {$define FPC_SYSTEM_HAS_extractFloat64Frac}
  55. {$define FPC_SYSTEM_HAS_extractFloat64Sign}
  56. {$define FPC_SYSTEM_HAS_ExtractFloat32Frac}
  57. {$define FPC_SYSTEM_HAS_extractFloat32Exp}
  58. {$define FPC_SYSTEM_HAS_extractFloat32Sign}
  59. {$endif FPC_HAS_FEATURE_SOFTFPU}
  60. {$endif FPUNONE}
  61. procedure Randomize;
  62. begin
  63. randseed:= 1234;
  64. end;
  65. function GetProcessID: LongWord;
  66. begin
  67. result:= 0;
  68. end;
  69. function ParamCount: LongInt;
  70. begin
  71. ParamCount:= 0;
  72. end;
  73. function ParamStr(l: LongInt): ShortString;
  74. begin
  75. result:='';
  76. end;
  77. procedure SysInitStdIO;
  78. begin
  79. end;
  80. function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
  81. begin
  82. result:= stklen;
  83. end;
  84. procedure system_exit;
  85. begin
  86. repeat
  87. until false;
  88. end;
  89. begin
  90. StackLength:=CheckInitialStkLen(stklen);
  91. StackBottom:=Pointer(PtrUInt($80200000)-PtrUInt(StackLength));
  92. InOutRes:= 0;
  93. _InitHeap(pdword($800F8000), $00100000);
  94. end.