kern_return.pas 15 KB

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