system.pp 2.3 KB

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