DriverSynchronization.pas 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. {
  2. File: DriverSynchronization.p
  3. Contains: Driver Synchronization Interfaces.
  4. Version: Technology: MacOS 8
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1985-2002 by Apple Computer, Inc., all rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit DriverSynchronization;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,ConditionalMacros;
  92. {$ALIGN MAC68K}
  93. {$ifc CALL_NOT_IN_CARBON}
  94. {
  95. * SynchronizeIO()
  96. *
  97. * Availability:
  98. * Non-Carbon CFM: in DriverServicesLib 1.0 and later
  99. * CarbonLib: not available
  100. * Mac OS X: not available
  101. }
  102. procedure SynchronizeIO; external name '_SynchronizeIO';
  103. {$endc} {CALL_NOT_IN_CARBON}
  104. {
  105. * CompareAndSwap()
  106. *
  107. * Availability:
  108. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  109. * CarbonLib: in CarbonLib 1.0 and later
  110. * Mac OS X: in version 10.0 and later
  111. }
  112. function CompareAndSwap(oldVvalue: UInt32; newValue: UInt32; var OldValueAdr: UInt32): boolean; external name '_CompareAndSwap';
  113. {
  114. * TestAndClear()
  115. *
  116. * Availability:
  117. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  118. * CarbonLib: in CarbonLib 1.0 and later
  119. * Mac OS X: in version 10.0 and later
  120. }
  121. function TestAndClear(bit: UInt32; startAddress: UnivPtr): boolean; external name '_TestAndClear';
  122. {
  123. * TestAndSet()
  124. *
  125. * Availability:
  126. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  127. * CarbonLib: in CarbonLib 1.0 and later
  128. * Mac OS X: in version 10.0 and later
  129. }
  130. function TestAndSet(bit: UInt32; startAddress: UnivPtr): boolean; external name '_TestAndSet';
  131. {
  132. * IncrementAtomic8()
  133. *
  134. * Availability:
  135. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  136. * CarbonLib: in CarbonLib 1.0 and later
  137. * Mac OS X: in version 10.0 and later
  138. }
  139. function IncrementAtomic8(var value: SInt8): SInt8; external name '_IncrementAtomic8';
  140. {
  141. * DecrementAtomic8()
  142. *
  143. * Availability:
  144. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  145. * CarbonLib: in CarbonLib 1.0 and later
  146. * Mac OS X: in version 10.0 and later
  147. }
  148. function DecrementAtomic8(var value: SInt8): SInt8; external name '_DecrementAtomic8';
  149. {
  150. * AddAtomic8()
  151. *
  152. * Availability:
  153. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  154. * CarbonLib: in CarbonLib 1.0 and later
  155. * Mac OS X: in version 10.0 and later
  156. }
  157. function AddAtomic8(amount: SInt32; var value: SInt8): SInt8; external name '_AddAtomic8';
  158. {
  159. * BitAndAtomic8()
  160. *
  161. * Availability:
  162. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  163. * CarbonLib: in CarbonLib 1.0 and later
  164. * Mac OS X: in version 10.0 and later
  165. }
  166. function BitAndAtomic8(mask: UInt32; var value: UInt8): ByteParameter; external name '_BitAndAtomic8';
  167. {
  168. * BitOrAtomic8()
  169. *
  170. * Availability:
  171. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  172. * CarbonLib: in CarbonLib 1.0 and later
  173. * Mac OS X: in version 10.0 and later
  174. }
  175. function BitOrAtomic8(mask: UInt32; var value: UInt8): ByteParameter; external name '_BitOrAtomic8';
  176. {
  177. * BitXorAtomic8()
  178. *
  179. * Availability:
  180. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  181. * CarbonLib: in CarbonLib 1.0 and later
  182. * Mac OS X: in version 10.0 and later
  183. }
  184. function BitXorAtomic8(mask: UInt32; var value: UInt8): ByteParameter; external name '_BitXorAtomic8';
  185. {
  186. * IncrementAtomic16()
  187. *
  188. * Availability:
  189. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  190. * CarbonLib: in CarbonLib 1.0 and later
  191. * Mac OS X: in version 10.0 and later
  192. }
  193. function IncrementAtomic16(var value: SInt16): SInt16; external name '_IncrementAtomic16';
  194. {
  195. * DecrementAtomic16()
  196. *
  197. * Availability:
  198. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  199. * CarbonLib: in CarbonLib 1.0 and later
  200. * Mac OS X: in version 10.0 and later
  201. }
  202. function DecrementAtomic16(var value: SInt16): SInt16; external name '_DecrementAtomic16';
  203. {
  204. * AddAtomic16()
  205. *
  206. * Availability:
  207. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  208. * CarbonLib: in CarbonLib 1.0 and later
  209. * Mac OS X: in version 10.0 and later
  210. }
  211. function AddAtomic16(amount: SInt32; var value: SInt16): SInt16; external name '_AddAtomic16';
  212. {
  213. * BitAndAtomic16()
  214. *
  215. * Availability:
  216. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  217. * CarbonLib: in CarbonLib 1.0 and later
  218. * Mac OS X: in version 10.0 and later
  219. }
  220. function BitAndAtomic16(mask: UInt32; var value: UInt16): UInt16; external name '_BitAndAtomic16';
  221. {
  222. * BitOrAtomic16()
  223. *
  224. * Availability:
  225. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  226. * CarbonLib: in CarbonLib 1.0 and later
  227. * Mac OS X: in version 10.0 and later
  228. }
  229. function BitOrAtomic16(mask: UInt32; var value: UInt16): UInt16; external name '_BitOrAtomic16';
  230. {
  231. * BitXorAtomic16()
  232. *
  233. * Availability:
  234. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  235. * CarbonLib: in CarbonLib 1.0 and later
  236. * Mac OS X: in version 10.0 and later
  237. }
  238. function BitXorAtomic16(mask: UInt32; var value: UInt16): UInt16; external name '_BitXorAtomic16';
  239. {
  240. * IncrementAtomic()
  241. *
  242. * Availability:
  243. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  244. * CarbonLib: in CarbonLib 1.0 and later
  245. * Mac OS X: in version 10.0 and later
  246. }
  247. function IncrementAtomic(var value: SInt32): SInt32; external name '_IncrementAtomic';
  248. {
  249. * DecrementAtomic()
  250. *
  251. * Availability:
  252. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  253. * CarbonLib: in CarbonLib 1.0 and later
  254. * Mac OS X: in version 10.0 and later
  255. }
  256. function DecrementAtomic(var value: SInt32): SInt32; external name '_DecrementAtomic';
  257. {
  258. * AddAtomic()
  259. *
  260. * Availability:
  261. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  262. * CarbonLib: in CarbonLib 1.0 and later
  263. * Mac OS X: in version 10.0 and later
  264. }
  265. function AddAtomic(amount: SInt32; var value: SInt32): SInt32; external name '_AddAtomic';
  266. {
  267. * BitAndAtomic()
  268. *
  269. * Availability:
  270. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  271. * CarbonLib: in CarbonLib 1.0 and later
  272. * Mac OS X: in version 10.0 and later
  273. }
  274. function BitAndAtomic(mask: UInt32; var value: UInt32): UInt32; external name '_BitAndAtomic';
  275. {
  276. * BitOrAtomic()
  277. *
  278. * Availability:
  279. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  280. * CarbonLib: in CarbonLib 1.0 and later
  281. * Mac OS X: in version 10.0 and later
  282. }
  283. function BitOrAtomic(mask: UInt32; var value: UInt32): UInt32; external name '_BitOrAtomic';
  284. {
  285. * BitXorAtomic()
  286. *
  287. * Availability:
  288. * Non-Carbon CFM: in InterfaceLib 8.5 and later
  289. * CarbonLib: in CarbonLib 1.0 and later
  290. * Mac OS X: in version 10.0 and later
  291. }
  292. function BitXorAtomic(mask: UInt32; var value: UInt32): UInt32; external name '_BitXorAtomic';
  293. {$ALIGN MAC68K}
  294. end.