syscall.inc 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {
  2. $Id$
  3. Copyright (c) 2002 by Marco van de Voort
  4. Syscall functions for i386 *BSD.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. procedure actualsyscall; assembler;
  18. asm
  19. sc
  20. b LSyscallError
  21. blr
  22. LSyscallError:
  23. stw r3,errno
  24. end;
  25. function Do_SysCall(sysnr:LONGINT):longint; assembler; [public,alias:'FPC_DOSYS0'];
  26. asm
  27. mr r0,r3
  28. b actualsyscall
  29. end;
  30. function Do_SysCall(sysnr,param1:longint):longint; assembler;[public,alias:'FPC_DOSYS1'];
  31. asm
  32. mr r0,r3
  33. mr r3,r4
  34. b actualsyscall
  35. end;
  36. function Do_SysCall(sysnr,param1:integer):longint; assembler;[public,alias:'FPC_DOSYS1w'];
  37. asm
  38. rlwinm r0,r3,0,0,15
  39. extsh r3,r4
  40. b actualsyscall
  41. end;
  42. function Do_SysCall(sysnr,param1,param2:LONGINT):longint; assembler; [public,alias:'FPC_DOSYS2'];
  43. asm
  44. mr r0,r3
  45. mr r3,r4
  46. mr r4,r5
  47. b actualsyscall
  48. end;
  49. function Do_SysCall(sysnr,param1,param2,param3:LONGINT):longint; assembler;[public,alias:'FPC_DOSYS3'];
  50. asm
  51. mr r0,r3
  52. mr r3,r4
  53. mr r4,r5
  54. mr r5,r6
  55. b actualsyscall
  56. end;
  57. function Do_SysCall(sysnr,param1,param2,param3,param4:LONGINT):longint; assembler;[public,alias:'FPC_DOSYS4'];
  58. asm
  59. mr r0,r3
  60. mr r3,r4
  61. mr r4,r5
  62. mr r5,r6
  63. mr r6,r7
  64. b actualsyscall
  65. end;
  66. function Do_SysCall(sysnr,param1,param2,param3,param4,param5:LONGINT):longint; assembler;[public,alias:'FPC_DOSYS5'];
  67. asm
  68. mr r0,r3
  69. mr r3,r4
  70. mr r4,r5
  71. mr r5,r6
  72. mr r6,r7
  73. mr r7,r8
  74. b actualsyscall
  75. end;
  76. function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6:LONGINT):int64; assembler;[public,alias:'FPC_DOSYS6'];
  77. asm
  78. mr r0,r3
  79. mr r3,r4
  80. mr r4,r5
  81. mr r5,r6
  82. mr r6,r7
  83. mr r7,r8
  84. mr r8,r9
  85. b actualsyscall
  86. end;
  87. function Do_SysCall(sysnr,param1,param2,param3,param4,param5,param6,param7:LONGINT):int64; assembler; [public,alias:'FPC_DOSYS7'];
  88. asm
  89. mr r0,r3
  90. mr r3,r4
  91. mr r4,r5
  92. mr r5,r6
  93. mr r6,r7
  94. mr r7,r8
  95. mr r8,r9
  96. mr r9,r10
  97. b actualsyscall
  98. end;
  99. {
  100. $Log$
  101. Revision 1.1 2002-10-26 14:33:09 jonas
  102. + initial version
  103. :
  104. }