typinfo.inc 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 2003 by Peter Vreman,
  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. { This unit provides the same Functionality as the TypInfo Unit }
  13. { of Delphi }
  14. { ---------------------------------------------------------------------
  15. This include contains cpu-specific Low-level calling of methods.
  16. ---------------------------------------------------------------------}
  17. Function CallIntegerFunc(s: Pointer; Address: Pointer; Index, IValue: LongInt): Int64; assembler;
  18. asm
  19. {$warning FIXME}
  20. end;
  21. (*
  22. { input: }
  23. { r3: s }
  24. { r4: address }
  25. { r5: index }
  26. { r6: ivalue }
  27. { output: }
  28. { r3-r4: result }
  29. var
  30. oldlr: pointer;
  31. asm
  32. { save current return address }
  33. mflr r0
  34. stw r0,oldlr
  35. mtctr r4
  36. { always pass ivalue as second parameter, it doesn't matter if it }
  37. { isn't used }
  38. mr r4,r6
  39. bctrl
  40. { restore return address }
  41. lwz r0,oldlr
  42. mtlr r0
  43. end;
  44. *)
  45. Function CallIntegerProc(s : Pointer;Address : Pointer;Value : Integer; Index,IValue : Longint) : Integer;assembler;
  46. asm
  47. {$warning FIXME}
  48. end;
  49. (*
  50. { input: }
  51. { r3: s }
  52. { r4: address }
  53. { r5: index }
  54. { r6: ivalue }
  55. { output: }
  56. { r3: result }
  57. var
  58. oldlr: pointer;
  59. asm
  60. { save current return address }
  61. mflr r0
  62. stw r0,oldlr
  63. mtctr r4
  64. { always pass ivalue as second parameter, it doesn't matter if it }
  65. { isn't used }
  66. mr r4,r6
  67. bctrl
  68. { restore return address }
  69. lwz r0,oldlr
  70. mtlr r0
  71. end;
  72. *)
  73. Function CallSingleFunc(s : Pointer;Address : Pointer; Index,IValue : Longint) : Single;assembler;
  74. asm
  75. {$warning FIXME}
  76. end;
  77. (*
  78. { input: }
  79. { r3: s }
  80. { r4: address }
  81. { r5: index }
  82. { r6: ivalue }
  83. { output: }
  84. { fr1: result }
  85. var
  86. oldlr: pointer;
  87. asm
  88. { save current return address }
  89. mflr r0
  90. stw r0,oldlr
  91. mtctr r4
  92. { always pass ivalue as second parameter, it doesn't matter if it }
  93. { isn't used }
  94. mr r4,r6
  95. bctrl
  96. { restore return address }
  97. lwz r0,oldlr
  98. mtlr r0
  99. end;
  100. *)
  101. Function CallDoubleFunc(s : Pointer;Address : Pointer; Index,IValue : Longint) : Double;assembler;
  102. asm
  103. {$warning FIXME}
  104. end;
  105. (*
  106. { input: }
  107. { r3: s }
  108. { r4: address }
  109. { r5: index }
  110. { r6: ivalue }
  111. { output: }
  112. { fr1: result }
  113. var
  114. oldlr: pointer;
  115. asm
  116. { save current return address }
  117. mflr r0
  118. stw r0,oldlr
  119. mtctr r4
  120. { always pass ivalue as second parameter, it doesn't matter if it }
  121. { isn't used }
  122. mr r4,r6
  123. bctrl
  124. { restore return address }
  125. lwz r0,oldlr
  126. mtlr r0
  127. end;
  128. *)
  129. Function CallExtendedFunc(s : Pointer;Address : Pointer; Index,IValue : Longint) : Extended;assembler;
  130. asm
  131. {$warning FIXME}
  132. end;
  133. (*
  134. { input: }
  135. { r3: s }
  136. { r4: address }
  137. { r5: index }
  138. { r6: ivalue }
  139. { output: }
  140. { fr1: result }
  141. var
  142. oldlr: pointer;
  143. asm
  144. { save current return address }
  145. mflr r0
  146. stw r0,oldlr
  147. mtctr r4
  148. { always pass ivalue as second parameter, it doesn't matter if it }
  149. { isn't used }
  150. mr r4,r6
  151. bctrl
  152. { restore return address }
  153. lwz r0,oldlr
  154. mtlr r0
  155. end;
  156. *)
  157. Function CallBooleanFunc(s : Pointer;Address : Pointer; Index,IValue : Longint) : Boolean;assembler;
  158. asm
  159. {$warning FIXME}
  160. end;
  161. (*
  162. { input: }
  163. { r3: s }
  164. { r4: address }
  165. { r5: index }
  166. { r6: ivalue }
  167. { output: }
  168. { r3: result }
  169. var
  170. oldlr: pointer;
  171. asm
  172. { save current return address }
  173. mflr r0
  174. stw r0,oldlr
  175. mtctr r4
  176. { always pass ivalue as second parameter, it doesn't matter if it }
  177. { isn't used }
  178. mr r4,r6
  179. bctrl
  180. { restore return address }
  181. lwz r0, oldlr
  182. mtlr r0
  183. end;
  184. *)
  185. Procedure CallSStringFunc(s : Pointer;Address : Pointer; INdex,IValue : Longint;
  186. Var Res: Shortstring);assembler;
  187. asm
  188. {$warning FIXME}
  189. end;
  190. (*
  191. { input: }
  192. { r3: address of shortstring result (temp) }
  193. { r4: s }
  194. { r5: address }
  195. { r6: index }
  196. { r7: ivalue }
  197. { r8: res }
  198. { output: }
  199. { none }
  200. var
  201. oldlr: pointer;
  202. asm
  203. { save current return address }
  204. mflr r0
  205. stw r0,oldlr
  206. mtctr r5
  207. { always pass ivalue as second parameter, it doesn't matter if it }
  208. { isn't used }
  209. mr r5,r7
  210. bctrl
  211. { restore return address }
  212. lwz r0,oldlr
  213. mtlr r0
  214. end;
  215. *)
  216. Procedure CallSStringProc(s : Pointer;Address : Pointer;Const Value : ShortString; INdex,IVAlue : Longint);assembler;
  217. asm
  218. {$warning FIXME}
  219. end;
  220. (*
  221. { input: }
  222. { r3: s }
  223. { r4: address }
  224. { r5: value (address of shortstring) }
  225. { r6: index }
  226. { r7: ivalue }
  227. { output: }
  228. { none }
  229. var
  230. oldlr: pointer;
  231. asm
  232. { save current return address }
  233. mflr r0
  234. stw r0,oldlr
  235. mtctr r4
  236. { always pass ivalue as second parameter, it doesn't matter if it }
  237. { isn't used }
  238. mr r4,r6
  239. bctrl
  240. { restore return address }
  241. lwz r0,oldlr
  242. mtlr r0
  243. end;
  244. *)
  245. {
  246. $Log$
  247. Revision 1.1 2003-09-01 20:46:32 peter
  248. * new dummies
  249. }