kern_return.pas 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. {
  2. * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
  3. *
  4. * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  5. *
  6. * This file contains Original Code and/or Modifications of Original Code
  7. * as defined in and that are subject to the Apple Public Source License
  8. * Version 2.0 (the 'License'). You may not use this file except in
  9. * compliance with the License. The rights granted to you under the License
  10. * may not be used to create, or enable the creation or redistribution of,
  11. * unlawful or unlicensed copies of an Apple operating system, or to
  12. * circumvent, violate, or enable the circumvention or violation of, any
  13. * terms of an Apple operating system software license agreement.
  14. *
  15. * Please obtain a copy of the License at
  16. * http://www.opensource.apple.com/apsl/ and read it before using this file.
  17. *
  18. * The Original Code and all software distributed under the License are
  19. * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  20. * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  21. * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
  22. * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
  23. * Please see the License for the specific language governing rights and
  24. * limitations under the License.
  25. *
  26. * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  27. }
  28. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, September 2010 }
  29. {
  30. Modified for use with Free Pascal
  31. Version 308
  32. Please report any bugs to <[email protected]>
  33. }
  34. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  35. {$mode macpas}
  36. {$packenum 1}
  37. {$macro on}
  38. {$inline on}
  39. {$calling mwpascal}
  40. unit kern_return;
  41. interface
  42. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  43. {$setc GAP_INTERFACES_VERSION := $0308}
  44. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  45. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  46. {$endc}
  47. {$ifc defined CPUPOWERPC and defined CPUI386}
  48. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  49. {$endc}
  50. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  51. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  52. {$endc}
  53. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  54. {$setc __ppc__ := 1}
  55. {$elsec}
  56. {$setc __ppc__ := 0}
  57. {$endc}
  58. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  59. {$setc __ppc64__ := 1}
  60. {$elsec}
  61. {$setc __ppc64__ := 0}
  62. {$endc}
  63. {$ifc not defined __i386__ and defined CPUI386}
  64. {$setc __i386__ := 1}
  65. {$elsec}
  66. {$setc __i386__ := 0}
  67. {$endc}
  68. {$ifc not defined __x86_64__ and defined CPUX86_64}
  69. {$setc __x86_64__ := 1}
  70. {$elsec}
  71. {$setc __x86_64__ := 0}
  72. {$endc}
  73. {$ifc not defined __arm__ and defined CPUARM}
  74. {$setc __arm__ := 1}
  75. {$elsec}
  76. {$setc __arm__ := 0}
  77. {$endc}
  78. {$ifc defined cpu64}
  79. {$setc __LP64__ := 1}
  80. {$elsec}
  81. {$setc __LP64__ := 0}
  82. {$endc}
  83. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  84. {$error Conflicting definitions for __ppc__ and __i386__}
  85. {$endc}
  86. {$ifc defined __ppc__ and __ppc__}
  87. {$setc TARGET_CPU_PPC := TRUE}
  88. {$setc TARGET_CPU_PPC64 := FALSE}
  89. {$setc TARGET_CPU_X86 := FALSE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$setc TARGET_OS_MAC := TRUE}
  93. {$setc TARGET_OS_IPHONE := FALSE}
  94. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  95. {$setc TARGET_OS_EMBEDDED := FALSE}
  96. {$elifc defined __ppc64__ and __ppc64__}
  97. {$setc TARGET_CPU_PPC := FALSE}
  98. {$setc TARGET_CPU_PPC64 := TRUE}
  99. {$setc TARGET_CPU_X86 := FALSE}
  100. {$setc TARGET_CPU_X86_64 := FALSE}
  101. {$setc TARGET_CPU_ARM := FALSE}
  102. {$setc TARGET_OS_MAC := TRUE}
  103. {$setc TARGET_OS_IPHONE := FALSE}
  104. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  105. {$setc TARGET_OS_EMBEDDED := FALSE}
  106. {$elifc defined __i386__ and __i386__}
  107. {$setc TARGET_CPU_PPC := FALSE}
  108. {$setc TARGET_CPU_PPC64 := FALSE}
  109. {$setc TARGET_CPU_X86 := TRUE}
  110. {$setc TARGET_CPU_X86_64 := FALSE}
  111. {$setc TARGET_CPU_ARM := FALSE}
  112. {$ifc defined(iphonesim)}
  113. {$setc TARGET_OS_MAC := FALSE}
  114. {$setc TARGET_OS_IPHONE := TRUE}
  115. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  116. {$elsec}
  117. {$setc TARGET_OS_MAC := TRUE}
  118. {$setc TARGET_OS_IPHONE := FALSE}
  119. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  120. {$endc}
  121. {$setc TARGET_OS_EMBEDDED := FALSE}
  122. {$elifc defined __x86_64__ and __x86_64__}
  123. {$setc TARGET_CPU_PPC := FALSE}
  124. {$setc TARGET_CPU_PPC64 := FALSE}
  125. {$setc TARGET_CPU_X86 := FALSE}
  126. {$setc TARGET_CPU_X86_64 := TRUE}
  127. {$setc TARGET_CPU_ARM := FALSE}
  128. {$setc TARGET_OS_MAC := TRUE}
  129. {$setc TARGET_OS_IPHONE := FALSE}
  130. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  131. {$setc TARGET_OS_EMBEDDED := FALSE}
  132. {$elifc defined __arm__ and __arm__}
  133. {$setc TARGET_CPU_PPC := FALSE}
  134. {$setc TARGET_CPU_PPC64 := FALSE}
  135. {$setc TARGET_CPU_X86 := FALSE}
  136. {$setc TARGET_CPU_X86_64 := FALSE}
  137. {$setc TARGET_CPU_ARM := TRUE}
  138. { will require compiler define when/if other Apple devices with ARM cpus ship }
  139. {$setc TARGET_OS_MAC := FALSE}
  140. {$setc TARGET_OS_IPHONE := TRUE}
  141. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  142. {$setc TARGET_OS_EMBEDDED := TRUE}
  143. {$elsec}
  144. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ is defined.}
  145. {$endc}
  146. {$ifc defined __LP64__ and __LP64__ }
  147. {$setc TARGET_CPU_64 := TRUE}
  148. {$elsec}
  149. {$setc TARGET_CPU_64 := FALSE}
  150. {$endc}
  151. {$ifc defined FPC_BIG_ENDIAN}
  152. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  153. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  154. {$elifc defined FPC_LITTLE_ENDIAN}
  155. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  156. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  157. {$elsec}
  158. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  159. {$endc}
  160. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  161. {$setc CALL_NOT_IN_CARBON := FALSE}
  162. {$setc OLDROUTINENAMES := FALSE}
  163. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  164. {$setc OPAQUE_UPP_TYPES := TRUE}
  165. {$setc OTCARBONAPPLICATION := TRUE}
  166. {$setc OTKERNEL := FALSE}
  167. {$setc PM_USE_SESSION_APIS := TRUE}
  168. {$setc TARGET_API_MAC_CARBON := TRUE}
  169. {$setc TARGET_API_MAC_OS8 := FALSE}
  170. {$setc TARGET_API_MAC_OSX := TRUE}
  171. {$setc TARGET_CARBON := TRUE}
  172. {$setc TARGET_CPU_68K := FALSE}
  173. {$setc TARGET_CPU_MIPS := FALSE}
  174. {$setc TARGET_CPU_SPARC := FALSE}
  175. {$setc TARGET_OS_UNIX := FALSE}
  176. {$setc TARGET_OS_WIN32 := FALSE}
  177. {$setc TARGET_RT_MAC_68881 := FALSE}
  178. {$setc TARGET_RT_MAC_CFM := FALSE}
  179. {$setc TARGET_RT_MAC_MACHO := TRUE}
  180. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  181. {$setc TYPE_BOOL := FALSE}
  182. {$setc TYPE_EXTENDED := FALSE}
  183. {$setc TYPE_LONGLONG := TRUE}
  184. uses MacTypes;
  185. {$endc} {not MACOSALLINCLUDE}
  186. {
  187. * @OSF_COPYRIGHT@
  188. }
  189. {
  190. * Mach Operating System
  191. * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
  192. * All Rights Reserved.
  193. *
  194. * Permission to use, copy, modify and distribute this software and its
  195. * documentation is hereby granted, provided that both the copyright
  196. * notice and this permission notice appear in all copies of the
  197. * software, derivative works or modified versions, and any portions
  198. * thereof, and that both notices appear in supporting documentation.
  199. *
  200. * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  201. * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  202. * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  203. *
  204. * Carnegie Mellon requests users of this software to return to
  205. *
  206. * Software Distribution Coordinator or [email protected]
  207. * School of Computer Science
  208. * Carnegie Mellon University
  209. * Pittsburgh PA 15213-3890
  210. *
  211. * any improvements or extensions that they make and grant Carnegie Mellon
  212. * the rights to redistribute these changes.
  213. }
  214. {
  215. * File: h/kern_return.h
  216. * Author: Avadis Tevanian, Jr.
  217. * Date: 1985
  218. *
  219. * Kernel return codes.
  220. *
  221. }
  222. const
  223. KERN_SUCCESS = 0;
  224. const
  225. KERN_INVALID_ADDRESS = 1;
  226. { Specified address is not currently valid.
  227. }
  228. const
  229. KERN_PROTECTION_FAILURE = 2;
  230. { Specified memory is valid, but does not permit the
  231. * required forms of access.
  232. }
  233. const
  234. KERN_NO_SPACE = 3;
  235. { The address range specified is already in use, or
  236. * no address range of the size specified could be
  237. * found.
  238. }
  239. const
  240. KERN_INVALID_ARGUMENT = 4;
  241. { The function requested was not applicable to this
  242. * type of argument, or an argument is invalid
  243. }
  244. const
  245. KERN_FAILURE = 5;
  246. { The function could not be performed. A catch-all.
  247. }
  248. const
  249. KERN_RESOURCE_SHORTAGE = 6;
  250. { A system resource could not be allocated to fulfill
  251. * this request. This failure may not be permanent.
  252. }
  253. const
  254. KERN_NOT_RECEIVER = 7;
  255. { The task in question does not hold receive rights
  256. * for the port argument.
  257. }
  258. const
  259. KERN_NO_ACCESS = 8;
  260. { Bogus access restriction.
  261. }
  262. const
  263. KERN_MEMORY_FAILURE = 9;
  264. { During a page fault, the target address refers to a
  265. * memory object that has been destroyed. This
  266. * failure is permanent.
  267. }
  268. const
  269. KERN_MEMORY_ERROR = 10;
  270. { During a page fault, the memory object indicated
  271. * that the data could not be returned. This failure
  272. * may be temporary; future attempts to access this
  273. * same data may succeed, as defined by the memory
  274. * object.
  275. }
  276. const
  277. KERN_ALREADY_IN_SET = 11;
  278. { The receive right is already a member of the portset.
  279. }
  280. const
  281. KERN_NOT_IN_SET = 12;
  282. { The receive right is not a member of a port set.
  283. }
  284. const
  285. KERN_NAME_EXISTS = 13;
  286. { The name already denotes a right in the task.
  287. }
  288. const
  289. KERN_ABORTED = 14;
  290. { The operation was aborted. Ipc code will
  291. * catch this and reflect it as a message error.
  292. }
  293. const
  294. KERN_INVALID_NAME = 15;
  295. { The name doesn't denote a right in the task.
  296. }
  297. const
  298. KERN_INVALID_TASK = 16;
  299. { Target task isn't an active task.
  300. }
  301. const
  302. KERN_INVALID_RIGHT = 17;
  303. { The name denotes a right, but not an appropriate right.
  304. }
  305. const
  306. KERN_INVALID_VALUE = 18;
  307. { A blatant range error.
  308. }
  309. const
  310. KERN_UREFS_OVERFLOW = 19;
  311. { Operation would overflow limit on user-references.
  312. }
  313. const
  314. KERN_INVALID_CAPABILITY = 20;
  315. { The supplied (port) capability is improper.
  316. }
  317. const
  318. KERN_RIGHT_EXISTS = 21;
  319. { The task already has send or receive rights
  320. * for the port under another name.
  321. }
  322. const
  323. KERN_INVALID_HOST = 22;
  324. { Target host isn't actually a host.
  325. }
  326. const
  327. KERN_MEMORY_PRESENT = 23;
  328. { An attempt was made to supply "precious" data
  329. * for memory that is already present in a
  330. * memory object.
  331. }
  332. const
  333. KERN_MEMORY_DATA_MOVED = 24;
  334. { A page was requested of a memory manager via
  335. * memory_object_data_request for an object using
  336. * a MEMORY_OBJECT_COPY_CALL strategy, with the
  337. * VM_PROT_WANTS_COPY flag being used to specify
  338. * that the page desired is for a copy of the
  339. * object, and the memory manager has detected
  340. * the page was pushed into a copy of the object
  341. * while the kernel was walking the shadow chain
  342. * from the copy to the object. This error code
  343. * is delivered via memory_object_data_error
  344. * and is handled by the kernel (it forces the
  345. * kernel to restart the fault). It will not be
  346. * seen by users.
  347. }
  348. const
  349. KERN_MEMORY_RESTART_COPY = 25;
  350. { A strategic copy was attempted of an object
  351. * upon which a quicker copy is now possible.
  352. * The caller should retry the copy using
  353. * vm_object_copy_quickly. This error code
  354. * is seen only by the kernel.
  355. }
  356. const
  357. KERN_INVALID_PROCESSOR_SET = 26;
  358. { An argument applied to assert processor set privilege
  359. * was not a processor set control port.
  360. }
  361. const
  362. KERN_POLICY_LIMIT = 27;
  363. { The specified scheduling attributes exceed the thread's
  364. * limits.
  365. }
  366. const
  367. KERN_INVALID_POLICY = 28;
  368. { The specified scheduling policy is not currently
  369. * enabled for the processor set.
  370. }
  371. const
  372. KERN_INVALID_OBJECT = 29;
  373. { The external memory manager failed to initialize the
  374. * memory object.
  375. }
  376. const
  377. KERN_ALREADY_WAITING = 30;
  378. { A thread is attempting to wait for an event for which
  379. * there is already a waiting thread.
  380. }
  381. const
  382. KERN_DEFAULT_SET = 31;
  383. { An attempt was made to destroy the default processor
  384. * set.
  385. }
  386. const
  387. KERN_EXCEPTION_PROTECTED = 32;
  388. { An attempt was made to fetch an exception port that is
  389. * protected, or to abort a thread while processing a
  390. * protected exception.
  391. }
  392. const
  393. KERN_INVALID_LEDGER = 33;
  394. { A ledger was required but not supplied.
  395. }
  396. const
  397. KERN_INVALID_MEMORY_CONTROL = 34;
  398. { The port was not a memory cache control port.
  399. }
  400. const
  401. KERN_INVALID_SECURITY = 35;
  402. { An argument supplied to assert security privilege
  403. * was not a host security port.
  404. }
  405. const
  406. KERN_NOT_DEPRESSED = 36;
  407. { thread_depress_abort was called on a thread which
  408. * was not currently depressed.
  409. }
  410. const
  411. KERN_TERMINATED = 37;
  412. { Object has been terminated and is no longer available
  413. }
  414. const
  415. KERN_LOCK_SET_DESTROYED = 38;
  416. { Lock set has been destroyed and is no longer available.
  417. }
  418. const
  419. KERN_LOCK_UNSTABLE = 39;
  420. { The thread holding the lock terminated before releasing
  421. * the lock
  422. }
  423. const
  424. KERN_LOCK_OWNED = 40;
  425. { The lock is already owned by another thread
  426. }
  427. const
  428. KERN_LOCK_OWNED_SELF = 41;
  429. { The lock is already owned by the calling thread
  430. }
  431. const
  432. KERN_SEMAPHORE_DESTROYED = 42;
  433. { Semaphore has been destroyed and is no longer available.
  434. }
  435. const
  436. KERN_RPC_SERVER_TERMINATED = 43;
  437. { Return from RPC indicating the target server was
  438. * terminated before it successfully replied
  439. }
  440. const
  441. KERN_RPC_TERMINATE_ORPHAN = 44;
  442. { Terminate an orphaned activation.
  443. }
  444. const
  445. KERN_RPC_CONTINUE_ORPHAN = 45;
  446. { Allow an orphaned activation to continue executing.
  447. }
  448. const
  449. KERN_NOT_SUPPORTED = 46;
  450. { Empty thread activation (No thread linked to it)
  451. }
  452. const
  453. KERN_NODE_DOWN = 47;
  454. { Remote node down or inaccessible.
  455. }
  456. const
  457. KERN_NOT_WAITING = 48;
  458. { A signalled thread was not actually waiting. }
  459. const
  460. KERN_OPERATION_TIMED_OUT = 49;
  461. { Some thread-oriented operation (semaphore_wait) timed out
  462. }
  463. const
  464. KERN_CODESIGN_ERROR = 50;
  465. { During a page fault, indicates that the page was rejected
  466. * as a result of a signature check.
  467. }
  468. const
  469. KERN_RETURN_MAX = $100;
  470. { Maximum return value allowable
  471. }
  472. { cpu-specific, but the same for ppc and x86 at least, both on 32 and 64 bit -> presumably also on ARM }
  473. type
  474. kern_return_t = SInt32;
  475. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  476. end.
  477. {$endc} {not MACOSALLINCLUDE}