si_dll.inc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2019 by Jeppe Johansen.
  4. See the file COPYING.FPC, included in this distribution,
  5. for details about the copyright.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  9. **********************************************************************}
  10. {******************************************************************************
  11. Shared library start/halt
  12. ******************************************************************************}
  13. procedure _FPC_shared_lib_start(argc : dword;argv,envp : pointer); cdecl; public name 'FPC_SHARED_LIB_START'; public name '_start';
  14. begin
  15. operatingsystem_parameter_argc:=argc; { Copy the argument count }
  16. operatingsystem_parameter_argv:=argv; { Copy the argument pointer }
  17. operatingsystem_parameter_envp:=envp; { Copy the environment pointer }
  18. initialstkptr:=get_frame;
  19. PASCALMAIN;
  20. end;
  21. { this routine is only called when the halt() routine of the RTL embedded in
  22. the shared library is called }
  23. procedure _FPC_shared_lib_haltproc(e:longint); cdecl; assembler; public name '_haltproc';
  24. asm
  25. .L1:
  26. mov a6,a3
  27. movi a2,119
  28. syscall
  29. j .L1
  30. end;