syscall.inc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2003 by Florian Klaempfl,
  5. member of the Free Pascal development team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {No debugging for syslinux include !}
  13. {$IFDEF SYS_LINUX}
  14. {$UNDEF SYSCALL_DEBUG}
  15. {$ENDIF SYS_LINUX}
  16. {*****************************************************************************
  17. --- Main:The System Call Self ---
  18. *****************************************************************************}
  19. function FpSysCall(sysnr:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL0'];
  20. {
  21. This function puts the registers in place, does the call, and then
  22. copies back the registers as they are after the SysCall.
  23. }
  24. asm
  25. swi #0x900071
  26. cmn r0,#126
  27. bls .LDone
  28. ldr r1,.LErrno
  29. rsb r0,r0,#0
  30. str r0,[r1]
  31. mvn r0,#0
  32. b .LDone
  33. .LErrno:
  34. .word Errno
  35. .LDone:
  36. end;
  37. function FpSysCall(sysnr,param1:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL1'];
  38. {
  39. This function puts the registers in place, does the call, and then
  40. copies back the registers as they are after the SysCall.
  41. }
  42. asm
  43. swi #0x900071
  44. cmn r0,#126
  45. bls .LDone
  46. ldr r1,.LErrno
  47. rsb r0,r0,#0
  48. str r0,[r1]
  49. mvn r0,#0
  50. b .LDone
  51. .LErrno:
  52. .word Errno
  53. .LDone:
  54. end;
  55. function FpSysCall(sysnr,param1,param2:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL2'];
  56. {
  57. This function puts the registers in place, does the call, and then
  58. copies back the registers as they are after the SysCall.
  59. }
  60. asm
  61. swi #0x900071
  62. cmn r0,#126
  63. bls .LDone
  64. ldr r1,.LErrno
  65. rsb r0,r0,#0
  66. str r0,[r1]
  67. mvn r0,#0
  68. b .LDone
  69. .LErrno:
  70. .word Errno
  71. .LDone:
  72. end;
  73. function FpSysCall(sysnr,param1,param2,param3:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL3'];
  74. {
  75. This function puts the registers in place, does the call, and then
  76. copies back the registers as they are after the SysCall.
  77. }
  78. asm
  79. swi #0x900071
  80. cmn r0,#126
  81. bls .LDone
  82. ldr r1,.LErrno
  83. rsb r0,r0,#0
  84. str r0,[r1]
  85. mvn r0,#0
  86. b .LDone
  87. .LErrno:
  88. .word Errno
  89. .LDone:
  90. end;
  91. function FpSysCall(sysnr,param1,param2,param3,param4:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL4'];
  92. {
  93. This function puts the registers in place, does the call, and then
  94. copies back the registers as they are after the SysCall.
  95. }
  96. asm
  97. stmfd r13!,{r4}
  98. ldr r4,param4
  99. swi #0x900071
  100. cmn r0,#126
  101. bls .LDone
  102. ldr r1,.LErrno
  103. rsb r0,r0,#0
  104. str r0,[r1]
  105. mvn r0,#0
  106. b .LDone
  107. .LErrno:
  108. .word Errno
  109. .LDone:
  110. ldmfd r13!,{r4}
  111. end;
  112. function FpSysCall(sysnr,param1,param2,param3,param4,param5:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL5'];
  113. {
  114. This function puts the registers in place, does the call, and then
  115. copies back the registers as they are after the SysCall.
  116. }
  117. asm
  118. stmfd r13!,{r4-r5}
  119. ldr r5,param5
  120. ldr r4,param4
  121. swi #0x900071
  122. cmn r0,#126
  123. bls .LDone
  124. ldr r1,.LErrno
  125. rsb r0,r0,#0
  126. str r0,[r1]
  127. mvn r0,#0
  128. b .LDone
  129. .LErrno:
  130. .word Errno
  131. .LDone:
  132. ldmfd r13!,{r4-r5}
  133. end;
  134. function FpSysCall(sysnr,param1,param2,param3,param4,param5,param6:TSysParam):TSysResult; assembler;[public,alias:'FPC_SYSCALL6'];
  135. {
  136. This function puts the registers in place, does the call, and then
  137. copies back the registers as they are after the SysCall.
  138. }
  139. asm
  140. stmfd r13!,{r4-r6}
  141. ldr r6,param6
  142. ldr r5,param5
  143. ldr r4,param4
  144. swi #0x900071
  145. cmn r0,#126
  146. bls .LDone
  147. ldr r1,.LErrno
  148. rsb r0,r0,#0
  149. str r0,[r1]
  150. mvn r0,#0
  151. b .LDone
  152. .LErrno:
  153. .word Errno
  154. .LDone:
  155. ldmfd r13!,{r4-r6}
  156. end;
  157. {
  158. $Log$
  159. Revision 1.5 2004-02-06 23:06:16 florian
  160. - killed tsyscallregs
  161. Revision 1.4 2004/01/20 21:01:57 florian
  162. * fixed setjump
  163. * fixed syscalls
  164. Revision 1.3 2003/12/29 19:24:12 florian
  165. + introduced PtrInt and PtrUInt
  166. * made strscan 64 bit safe
  167. Revision 1.2 2003/12/03 17:34:12 florian
  168. + started to implement arm syscalls
  169. Revision 1.1 2003/08/28 00:08:29 florian
  170. * syscall skeleton
  171. }