this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove architecture from Darling repo. Add symbol link to architecture submodule.

Thomas A 8f75c8c5 5a7959ec

+1 -2817
+1
basic-headers/architecture
··· 1 + ../src/external/architecture/
-1
basic-headers/architecture/.gitignore
··· 1 - *~
-367
basic-headers/architecture/APPLE_LICENSE
··· 1 - APPLE PUBLIC SOURCE LICENSE 2 - Version 2.0 - August 6, 2003 3 - 4 - Please read this License carefully before downloading this software. 5 - By downloading or using this software, you are agreeing to be bound by 6 - the terms of this License. If you do not or cannot agree to the terms 7 - of this License, please do not download or use the software. 8 - 9 - 1. General; Definitions. This License applies to any program or other 10 - work which Apple Computer, Inc. ("Apple") makes publicly available and 11 - which contains a notice placed by Apple identifying such program or 12 - work as "Original Code" and stating that it is subject to the terms of 13 - this Apple Public Source License version 2.0 ("License"). As used in 14 - this License: 15 - 16 - 1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is 17 - the grantor of rights, (i) claims of patents that are now or hereafter 18 - acquired, owned by or assigned to Apple and (ii) that cover subject 19 - matter contained in the Original Code, but only to the extent 20 - necessary to use, reproduce and/or distribute the Original Code 21 - without infringement; and (b) in the case where You are the grantor of 22 - rights, (i) claims of patents that are now or hereafter acquired, 23 - owned by or assigned to You and (ii) that cover subject matter in Your 24 - Modifications, taken alone or in combination with Original Code. 25 - 26 - 1.2 "Contributor" means any person or entity that creates or 27 - contributes to the creation of Modifications. 28 - 29 - 1.3 "Covered Code" means the Original Code, Modifications, the 30 - combination of Original Code and any Modifications, and/or any 31 - respective portions thereof. 32 - 33 - 1.4 "Externally Deploy" means: (a) to sublicense, distribute or 34 - otherwise make Covered Code available, directly or indirectly, to 35 - anyone other than You; and/or (b) to use Covered Code, alone or as 36 - part of a Larger Work, in any way to provide a service, including but 37 - not limited to delivery of content, through electronic communication 38 - with a client other than You. 39 - 40 - 1.5 "Larger Work" means a work which combines Covered Code or portions 41 - thereof with code not governed by the terms of this License. 42 - 43 - 1.6 "Modifications" mean any addition to, deletion from, and/or change 44 - to, the substance and/or structure of the Original Code, any previous 45 - Modifications, the combination of Original Code and any previous 46 - Modifications, and/or any respective portions thereof. When code is 47 - released as a series of files, a Modification is: (a) any addition to 48 - or deletion from the contents of a file containing Covered Code; 49 - and/or (b) any new file or other representation of computer program 50 - statements that contains any part of Covered Code. 51 - 52 - 1.7 "Original Code" means (a) the Source Code of a program or other 53 - work as originally made available by Apple under this License, 54 - including the Source Code of any updates or upgrades to such programs 55 - or works made available by Apple under this License, and that has been 56 - expressly identified by Apple as such in the header file(s) of such 57 - work; and (b) the object code compiled from such Source Code and 58 - originally made available by Apple under this License. 59 - 60 - 1.8 "Source Code" means the human readable form of a program or other 61 - work that is suitable for making modifications to it, including all 62 - modules it contains, plus any associated interface definition files, 63 - scripts used to control compilation and installation of an executable 64 - (object code). 65 - 66 - 1.9 "You" or "Your" means an individual or a legal entity exercising 67 - rights under this License. For legal entities, "You" or "Your" 68 - includes any entity which controls, is controlled by, or is under 69 - common control with, You, where "control" means (a) the power, direct 70 - or indirect, to cause the direction or management of such entity, 71 - whether by contract or otherwise, or (b) ownership of fifty percent 72 - (50%) or more of the outstanding shares or beneficial ownership of 73 - such entity. 74 - 75 - 2. Permitted Uses; Conditions & Restrictions. Subject to the terms 76 - and conditions of this License, Apple hereby grants You, effective on 77 - the date You accept this License and download the Original Code, a 78 - world-wide, royalty-free, non-exclusive license, to the extent of 79 - Apple's Applicable Patent Rights and copyrights covering the Original 80 - Code, to do the following: 81 - 82 - 2.1 Unmodified Code. You may use, reproduce, display, perform, 83 - internally distribute within Your organization, and Externally Deploy 84 - verbatim, unmodified copies of the Original Code, for commercial or 85 - non-commercial purposes, provided that in each instance: 86 - 87 - (a) You must retain and reproduce in all copies of Original Code the 88 - copyright and other proprietary notices and disclaimers of Apple as 89 - they appear in the Original Code, and keep intact all notices in the 90 - Original Code that refer to this License; and 91 - 92 - (b) You must include a copy of this License with every copy of Source 93 - Code of Covered Code and documentation You distribute or Externally 94 - Deploy, and You may not offer or impose any terms on such Source Code 95 - that alter or restrict this License or the recipients' rights 96 - hereunder, except as permitted under Section 6. 97 - 98 - 2.2 Modified Code. You may modify Covered Code and use, reproduce, 99 - display, perform, internally distribute within Your organization, and 100 - Externally Deploy Your Modifications and Covered Code, for commercial 101 - or non-commercial purposes, provided that in each instance You also 102 - meet all of these conditions: 103 - 104 - (a) You must satisfy all the conditions of Section 2.1 with respect to 105 - the Source Code of the Covered Code; 106 - 107 - (b) You must duplicate, to the extent it does not already exist, the 108 - notice in Exhibit A in each file of the Source Code of all Your 109 - Modifications, and cause the modified files to carry prominent notices 110 - stating that You changed the files and the date of any change; and 111 - 112 - (c) If You Externally Deploy Your Modifications, You must make 113 - Source Code of all Your Externally Deployed Modifications either 114 - available to those to whom You have Externally Deployed Your 115 - Modifications, or publicly available. Source Code of Your Externally 116 - Deployed Modifications must be released under the terms set forth in 117 - this License, including the license grants set forth in Section 3 118 - below, for as long as you Externally Deploy the Covered Code or twelve 119 - (12) months from the date of initial External Deployment, whichever is 120 - longer. You should preferably distribute the Source Code of Your 121 - Externally Deployed Modifications electronically (e.g. download from a 122 - web site). 123 - 124 - 2.3 Distribution of Executable Versions. In addition, if You 125 - Externally Deploy Covered Code (Original Code and/or Modifications) in 126 - object code, executable form only, You must include a prominent 127 - notice, in the code itself as well as in related documentation, 128 - stating that Source Code of the Covered Code is available under the 129 - terms of this License with information on how and where to obtain such 130 - Source Code. 131 - 132 - 2.4 Third Party Rights. You expressly acknowledge and agree that 133 - although Apple and each Contributor grants the licenses to their 134 - respective portions of the Covered Code set forth herein, no 135 - assurances are provided by Apple or any Contributor that the Covered 136 - Code does not infringe the patent or other intellectual property 137 - rights of any other entity. Apple and each Contributor disclaim any 138 - liability to You for claims brought by any other entity based on 139 - infringement of intellectual property rights or otherwise. As a 140 - condition to exercising the rights and licenses granted hereunder, You 141 - hereby assume sole responsibility to secure any other intellectual 142 - property rights needed, if any. For example, if a third party patent 143 - license is required to allow You to distribute the Covered Code, it is 144 - Your responsibility to acquire that license before distributing the 145 - Covered Code. 146 - 147 - 3. Your Grants. In consideration of, and as a condition to, the 148 - licenses granted to You under this License, You hereby grant to any 149 - person or entity receiving or distributing Covered Code under this 150 - License a non-exclusive, royalty-free, perpetual, irrevocable license, 151 - under Your Applicable Patent Rights and other intellectual property 152 - rights (other than patent) owned or controlled by You, to use, 153 - reproduce, display, perform, modify, sublicense, distribute and 154 - Externally Deploy Your Modifications of the same scope and extent as 155 - Apple's licenses under Sections 2.1 and 2.2 above. 156 - 157 - 4. Larger Works. You may create a Larger Work by combining Covered 158 - Code with other code not governed by the terms of this License and 159 - distribute the Larger Work as a single product. In each such instance, 160 - You must make sure the requirements of this License are fulfilled for 161 - the Covered Code or any portion thereof. 162 - 163 - 5. Limitations on Patent License. Except as expressly stated in 164 - Section 2, no other patent rights, express or implied, are granted by 165 - Apple herein. Modifications and/or Larger Works may require additional 166 - patent licenses from Apple which Apple may grant in its sole 167 - discretion. 168 - 169 - 6. Additional Terms. You may choose to offer, and to charge a fee for, 170 - warranty, support, indemnity or liability obligations and/or other 171 - rights consistent with the scope of the license granted herein 172 - ("Additional Terms") to one or more recipients of Covered Code. 173 - However, You may do so only on Your own behalf and as Your sole 174 - responsibility, and not on behalf of Apple or any Contributor. You 175 - must obtain the recipient's agreement that any such Additional Terms 176 - are offered by You alone, and You hereby agree to indemnify, defend 177 - and hold Apple and every Contributor harmless for any liability 178 - incurred by or claims asserted against Apple or such Contributor by 179 - reason of any such Additional Terms. 180 - 181 - 7. Versions of the License. Apple may publish revised and/or new 182 - versions of this License from time to time. Each version will be given 183 - a distinguishing version number. Once Original Code has been published 184 - under a particular version of this License, You may continue to use it 185 - under the terms of that version. You may also choose to use such 186 - Original Code under the terms of any subsequent version of this 187 - License published by Apple. No one other than Apple has the right to 188 - modify the terms applicable to Covered Code created under this 189 - License. 190 - 191 - 8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in 192 - part pre-release, untested, or not fully tested works. The Covered 193 - Code may contain errors that could cause failures or loss of data, and 194 - may be incomplete or contain inaccuracies. You expressly acknowledge 195 - and agree that use of the Covered Code, or any portion thereof, is at 196 - Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND 197 - WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND 198 - APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE 199 - PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM 200 - ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT 201 - NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF 202 - MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR 203 - PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD 204 - PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST 205 - INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE 206 - FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, 207 - THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR 208 - ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO 209 - ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE 210 - AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. 211 - You acknowledge that the Covered Code is not intended for use in the 212 - operation of nuclear facilities, aircraft navigation, communication 213 - systems, or air traffic control machines in which case the failure of 214 - the Covered Code could lead to death, personal injury, or severe 215 - physical or environmental damage. 216 - 217 - 9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO 218 - EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, 219 - SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING 220 - TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR 221 - ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, 222 - TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF 223 - APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 224 - DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY 225 - REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF 226 - INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY 227 - TO YOU. In no event shall Apple's total liability to You for all 228 - damages (other than as may be required by applicable law) under this 229 - License exceed the amount of fifty dollars ($50.00). 230 - 231 - 10. Trademarks. This License does not grant any rights to use the 232 - trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS", 233 - "QuickTime", "QuickTime Streaming Server" or any other trademarks, 234 - service marks, logos or trade names belonging to Apple (collectively 235 - "Apple Marks") or to any trademark, service mark, logo or trade name 236 - belonging to any Contributor. You agree not to use any Apple Marks in 237 - or as part of the name of products derived from the Original Code or 238 - to endorse or promote products derived from the Original Code other 239 - than as expressly permitted by and in strict compliance at all times 240 - with Apple's third party trademark usage guidelines which are posted 241 - at http://www.apple.com/legal/guidelinesfor3rdparties.html. 242 - 243 - 11. Ownership. Subject to the licenses granted under this License, 244 - each Contributor retains all rights, title and interest in and to any 245 - Modifications made by such Contributor. Apple retains all rights, 246 - title and interest in and to the Original Code and any Modifications 247 - made by or on behalf of Apple ("Apple Modifications"), and such Apple 248 - Modifications will not be automatically subject to this License. Apple 249 - may, at its sole discretion, choose to license such Apple 250 - Modifications under this License, or on different terms from those 251 - contained in this License or may choose not to license them at all. 252 - 253 - 12. Termination. 254 - 255 - 12.1 Termination. This License and the rights granted hereunder will 256 - terminate: 257 - 258 - (a) automatically without notice from Apple if You fail to comply with 259 - any term(s) of this License and fail to cure such breach within 30 260 - days of becoming aware of such breach; 261 - 262 - (b) immediately in the event of the circumstances described in Section 263 - 13.5(b); or 264 - 265 - (c) automatically without notice from Apple if You, at any time during 266 - the term of this License, commence an action for patent infringement 267 - against Apple; provided that Apple did not first commence 268 - an action for patent infringement against You in that instance. 269 - 270 - 12.2 Effect of Termination. Upon termination, You agree to immediately 271 - stop any further use, reproduction, modification, sublicensing and 272 - distribution of the Covered Code. All sublicenses to the Covered Code 273 - which have been properly granted prior to termination shall survive 274 - any termination of this License. Provisions which, by their nature, 275 - should remain in effect beyond the termination of this License shall 276 - survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, 277 - 12.2 and 13. No party will be liable to any other for compensation, 278 - indemnity or damages of any sort solely as a result of terminating 279 - this License in accordance with its terms, and termination of this 280 - License will be without prejudice to any other right or remedy of 281 - any party. 282 - 283 - 13. Miscellaneous. 284 - 285 - 13.1 Government End Users. The Covered Code is a "commercial item" as 286 - defined in FAR 2.101. Government software and technical data rights in 287 - the Covered Code include only those rights customarily provided to the 288 - public as defined in this License. This customary commercial license 289 - in technical data and software is provided in accordance with FAR 290 - 12.211 (Technical Data) and 12.212 (Computer Software) and, for 291 - Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- 292 - Commercial Items) and 227.7202-3 (Rights in Commercial Computer 293 - Software or Computer Software Documentation). Accordingly, all U.S. 294 - Government End Users acquire Covered Code with only those rights set 295 - forth herein. 296 - 297 - 13.2 Relationship of Parties. This License will not be construed as 298 - creating an agency, partnership, joint venture or any other form of 299 - legal association between or among You, Apple or any Contributor, and 300 - You will not represent to the contrary, whether expressly, by 301 - implication, appearance or otherwise. 302 - 303 - 13.3 Independent Development. Nothing in this License will impair 304 - Apple's right to acquire, license, develop, have others develop for 305 - it, market and/or distribute technology or products that perform the 306 - same or similar functions as, or otherwise compete with, 307 - Modifications, Larger Works, technology or products that You may 308 - develop, produce, market or distribute. 309 - 310 - 13.4 Waiver; Construction. Failure by Apple or any Contributor to 311 - enforce any provision of this License will not be deemed a waiver of 312 - future enforcement of that or any other provision. Any law or 313 - regulation which provides that the language of a contract shall be 314 - construed against the drafter will not apply to this License. 315 - 316 - 13.5 Severability. (a) If for any reason a court of competent 317 - jurisdiction finds any provision of this License, or portion thereof, 318 - to be unenforceable, that provision of the License will be enforced to 319 - the maximum extent permissible so as to effect the economic benefits 320 - and intent of the parties, and the remainder of this License will 321 - continue in full force and effect. (b) Notwithstanding the foregoing, 322 - if applicable law prohibits or restricts You from fully and/or 323 - specifically complying with Sections 2 and/or 3 or prevents the 324 - enforceability of either of those Sections, this License will 325 - immediately terminate and You must immediately discontinue any use of 326 - the Covered Code and destroy all copies of it that are in your 327 - possession or control. 328 - 329 - 13.6 Dispute Resolution. Any litigation or other dispute resolution 330 - between You and Apple relating to this License shall take place in the 331 - Northern District of California, and You and Apple hereby consent to 332 - the personal jurisdiction of, and venue in, the state and federal 333 - courts within that District with respect to this License. The 334 - application of the United Nations Convention on Contracts for the 335 - International Sale of Goods is expressly excluded. 336 - 337 - 13.7 Entire Agreement; Governing Law. This License constitutes the 338 - entire agreement between the parties with respect to the subject 339 - matter hereof. This License shall be governed by the laws of the 340 - United States and the State of California, except that body of 341 - California law concerning conflicts of law. 342 - 343 - Where You are located in the province of Quebec, Canada, the following 344 - clause applies: The parties hereby confirm that they have requested 345 - that this License and all related documents be drafted in English. Les 346 - parties ont exige que le present contrat et tous les documents 347 - connexes soient rediges en anglais. 348 - 349 - EXHIBIT A. 350 - 351 - "Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights 352 - Reserved. 353 - 354 - This file contains Original Code and/or Modifications of Original Code 355 - as defined in and that are subject to the Apple Public Source License 356 - Version 2.0 (the 'License'). You may not use this file except in 357 - compliance with the License. Please obtain a copy of the License at 358 - http://www.opensource.apple.com/apsl/ and read it before using this 359 - file. 360 - 361 - The Original Code and all software distributed under the License are 362 - distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 363 - EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 364 - INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 365 - FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 366 - Please see the License for the specific language governing rights and 367 - limitations under the License."
-42
basic-headers/architecture/alignment.h
··· 1 - /* 2 - * Copyright (c) 1999, 2008 Apple Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1996 NeXT Software, Inc. 25 - * 26 - * Natural alignment of shorts and longs. 27 - * 28 - * HISTORY 29 - * 30 - * 2 Sept 1992 Brian Raymor at NeXT 31 - * Moved over to architecture. 32 - * 18 August 1992 Jack Greenfield at NeXT 33 - * Created. 34 - */ 35 - 36 - #if defined (__i386__) 37 - #include "architecture/i386/alignment.h" 38 - #else 39 - #error architecture not supported 40 - #endif 41 - 42 -
-327
basic-headers/architecture/arm/asm_help.h
··· 1 - /* 2 - * Copyright (c) 2000-2008 Apple Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - 24 - #ifndef _ARCH_ARM_ASM_HELP_H_ 25 - #define _ARCH_ARM_ASM_HELP_H_ 26 - 27 - #include <architecture/arm/reg_help.h> 28 - 29 - #ifdef __ASSEMBLER__ 30 - 31 - #if defined(__arm__) 32 - 33 - #define ALIGN \ 34 - .align 2 35 - 36 - #define ROUND_TO_STACK(len) \ 37 - (((len) + STACK_INCR - 1) / STACK_INCR * STACK_INCR) 38 - 39 - /* 40 - * Macros for declaring procedures 41 - * 42 - * Use of these macros allows ctags to have a predictable way 43 - * to find various types of declarations. They also simplify 44 - * inserting appropriate symbol table information. 45 - * 46 - * NOTE: these simple stubs will be replaced with more 47 - * complicated versions once we know what the linker and gdb 48 - * will require as far as register use masks and frame declarations. 49 - * These macros may also be ifdef'ed in the future to contain profiling 50 - * code. 51 - * 52 - */ 53 - 54 - /* 55 - * TEXT -- declare start of text segment 56 - */ 57 - #define TEXT \ 58 - .text 59 - 60 - /* 61 - * DATA -- declare start of data segment 62 - */ 63 - #define DATA \ 64 - .data 65 - 66 - /* 67 - * LEAF -- declare global leaf procedure 68 - * NOTE: Control SHOULD NOT FLOW into a LEAF! A LEAF should only 69 - * be jumped to. (A leaf may do an align.) Use a LABEL() if you 70 - * need control to flow into the label. 71 - */ 72 - #define LEAF(name, localvarsize) \ 73 - .globl name ;\ 74 - ALIGN ;\ 75 - name: 76 - 77 - /* 78 - * X_LEAF -- declare alternate global label for leaf 79 - */ 80 - #define X_LEAF(name, value) \ 81 - .globl name ;\ 82 - .set name,value 83 - 84 - /* 85 - * P_LEAF -- declare private leaf procedure 86 - */ 87 - #define P_LEAF(name, localvarsize) \ 88 - ALIGN ;\ 89 - name: 90 - 91 - /* 92 - * LABEL -- declare a global code label 93 - * MUST be used (rather than LEAF, NESTED, etc) if control 94 - * "flows into" the label. 95 - */ 96 - #define LABEL(name) \ 97 - .globl name ;\ 98 - name: 99 - 100 - /* 101 - * NESTED -- declare procedure that invokes other procedures 102 - */ 103 - #define NESTED(name, localvarsize) \ 104 - .globl name ;\ 105 - ALIGN ;\ 106 - name: 107 - 108 - /* 109 - * X_NESTED -- declare alternate global label for nested proc 110 - */ 111 - #define X_NESTED(name, value) \ 112 - .globl name ;\ 113 - .set name,value 114 - 115 - /* 116 - * P_NESTED -- declare private nested procedure 117 - */ 118 - #define P_NESTED(name, localvarsize) \ 119 - ALIGN ;\ 120 - name: 121 - 122 - /* 123 - * END -- mark end of procedure 124 - */ 125 - #define END(name) 126 - 127 - /* 128 - * Storage definition macros 129 - * The main purpose of these is to allow an easy handle for ctags 130 - */ 131 - 132 - /* 133 - * IMPORT -- import symbol 134 - */ 135 - #define IMPORT(name) \ 136 - .reference name 137 - 138 - /* 139 - * ABS -- declare global absolute symbol 140 - */ 141 - #define ABS(name, value) \ 142 - .globl name ;\ 143 - .set name,value 144 - 145 - /* 146 - * P_ABS -- declare private absolute symbol 147 - */ 148 - #define P_ABS(name, value) \ 149 - .set name,value 150 - 151 - /* 152 - * EXPORT -- declare global label for data 153 - */ 154 - #define EXPORT(name) \ 155 - .globl name ;\ 156 - name: 157 - 158 - /* 159 - * BSS -- declare global zero'ed storage 160 - */ 161 - #define BSS(name,size) \ 162 - .comm name,size 163 - 164 - /* 165 - * P_BSS -- declare private zero'ed storage 166 - */ 167 - #define P_BSS(name,size) \ 168 - .lcomm name,size 169 - 170 - #if defined(__DYNAMIC__) 171 - #define GET_ADDRESS(reg,var) \ 172 - ldr reg, 4f ;\ 173 - 3: ldr reg, [pc, reg] ;\ 174 - b 5f ;\ 175 - 4: .long 6f - (3b + 8) ;\ 176 - 5: ;\ 177 - .non_lazy_symbol_pointer ;\ 178 - 6: ;\ 179 - .indirect_symbol var ;\ 180 - .long 0 ;\ 181 - .text ;\ 182 - .align 2 183 - #else 184 - #define GET_ADDRESS(reg,var) \ 185 - ldr reg, 3f ;\ 186 - b 4f ;\ 187 - 3: .long var ;\ 188 - 4: 189 - #endif 190 - 191 - #if defined(__DYNAMIC__) 192 - #define BRANCH_EXTERNAL(var) \ 193 - GET_ADDRESS(ip, var) ;\ 194 - bx ip 195 - #else 196 - #define BRANCH_EXTERNAL(var) ;\ 197 - b var 198 - #endif 199 - 200 - #if defined(__DYNAMIC__) 201 - #define CALL_EXTERNAL(var) \ 202 - GET_ADDRESS(ip,var) ;\ 203 - mov lr, pc ;\ 204 - bx ip 205 - #else 206 - #define CALL_EXTERNAL(var) \ 207 - bl var 208 - #endif 209 - 210 - #define ENTRY_POINT(name) \ 211 - .align 2 ;\ 212 - .globl name ;\ 213 - .text ;\ 214 - name: 215 - 216 - #else /* defined(__arm___) */ 217 - 218 - #if defined(__arm64__) 219 - 220 - #define ALIGN .align 2 221 - 222 - #define ROUND_TO_STACK(len) (((len) + (STACK_INCR - 1)) & ~(STACK_INCR - 1)) 223 - 224 - #define TEXT .text 225 - 226 - #define DATA .data 227 - 228 - #define LEAF(name, localvarsize) \ 229 - .globl name %%\ 230 - ALIGN %%\ 231 - name: 232 - 233 - #define X_LEAF(name, value) \ 234 - .globl name %%\ 235 - .set name, value 236 - 237 - #define P_LEAF(name, localvarsize) \ 238 - ALIGN %%\ 239 - name: 240 - 241 - 242 - #define LABEL(name) \ 243 - .globl name %%\ 244 - name: 245 - 246 - #define NESTED(name, localvarsize) \ 247 - .globl name %%\ 248 - ALIGN %%\ 249 - name: 250 - 251 - #define X_NESTED(name, value) \ 252 - .globl name %%\ 253 - .set name, value 254 - 255 - #define P_NESTED(name, localvarsize)\ 256 - ALIGN %%\ 257 - name: 258 - 259 - #define END(name) 260 - 261 - #define IMPORT(name) \ 262 - .reference name 263 - 264 - #define ABS(name, value) \ 265 - .globl name %%\ 266 - .set name, value 267 - 268 - #define P_ABS(name, value) \ 269 - .set name, value 270 - 271 - #define EXPORT(name) \ 272 - .globl name %%\ 273 - name: 274 - 275 - #define BSS(name, size) \ 276 - .comm name, size 277 - 278 - #define P_BSS(name, size) \ 279 - .lcomm name, size 280 - 281 - 282 - #if __LP64__ 283 - #if defined(__DYNAMIC__) 284 - #define GET_ADDRESS(wreg, xreg, var) \ 285 - adrp xreg, var@gotpage %%\ 286 - ldr xreg, [xreg, var@gotpageoff] 287 - #else /* __DYNAMIC__ */ 288 - #define GET_ADDRESS(wreg, xreg, var) \ 289 - adrp xreg, var@page %%\ 290 - add xreg, xreg, var@pageoff 291 - #endif /* __DYNAMIC__ */ 292 - #else /* __LP64__ */ 293 - /* 294 - * The adrp instruction can't encode 'w' registers which is why the 'x' register 295 - * is used in the below LP32 variants of GET_ADDRESS(). 296 - */ 297 - #if defined(__DYNAMIC__) 298 - #define GET_ADDRESS(wreg, xreg, var) \ 299 - adrp xreg, var@gotpage %%\ 300 - ldr wreg, [xreg, var@gotpageoff] 301 - #else /* __DYNAMIC__ */ 302 - #define GET_ADDRESS(wreg, xreg, var) \ 303 - adrp xreg, var@page %%\ 304 - add wreg, wreg, var@pageoff 305 - #endif /* __DYNAMIC__ */ 306 - #endif /* __LP64__ */ 307 - 308 - /* The linker will link to stubs in the DYNAMIC case */ 309 - #define BRANCH_EXTERNAL(var) \ 310 - b var 311 - 312 - /* The linker will link to stubs in the DYNAMIC case */ 313 - #define CALL_EXTERNAL(var) \ 314 - bl var 315 - 316 - #define ENTRY_POINT(name) \ 317 - .align 2 %%\ 318 - .globl name %%\ 319 - .text %%\ 320 - name: 321 - #else /* defined(__arm64__) */ 322 - #error Unknown architecture. 323 - #endif /* defined(__arm64__) */ 324 - #endif /* defined(__arm__) */ 325 - #endif /* __ASSEMBLER__ */ 326 - 327 - #endif /* _ARCH_ARM_ASM_HELP_H_ */
-32
basic-headers/architecture/arm/byte_order.h
··· 1 - /* 2 - * Copyright (c) 2008 Apple Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 2007 Apple Computer, Inc. All rights reserved. 25 - */ 26 - 27 - #ifndef _ARCH_ARM_BYTE_ORDER_H_ 28 - #define _ARCH_ARM_BYTE_ORDER_H_ 29 - 30 - #include <architecture/byte_order.h> 31 - 32 - #endif /* _ARCH_ARM_BYTE_ORDER_H_ */
-62
basic-headers/architecture/arm/cframe.h
··· 1 - /* 2 - * Copyright (c) 1999-2004, 2008 Apple Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* Copyright (c) 1991 NeXT Software, Inc. All rights reserved. 24 - * 25 - * File: architecture/ppc/cframe.h 26 - * Author: Mike DeMoney, NeXT Software, Inc. 27 - * 28 - * This include file defines C calling sequence defines 29 - * for ppc port. 30 - * 31 - * HISTORY 32 - * 20-May-97 Umesh Vaishampayan (umeshv@apple.com) 33 - * Added C_RED_ZONE. 34 - * 29-Dec-96 Umesh Vaishampayan (umeshv@NeXT.com) 35 - * Ported from m98k. 36 - * 11-June-91 Mike DeMoney (mike@next.com) 37 - * Created. 38 - */ 39 - 40 - #ifndef _ARCH_ARM_CFRAME_H_ 41 - #define _ARCH_ARM_CFRAME_H_ 42 - 43 - /* Note that these values are copies of the somewhat more authoritative 44 - * values in <architecture/ppc/mode_independent_asm.h>. We do not 45 - * include that file to avoid breaking legacy clients due to name 46 - * collisions. 47 - * 48 - * Note also that C_ARGSAVE_LEN isn't well defined or useful in PPC. 49 - * Most legacy uses of it are assuming it is the minimum stack frame 50 - * size, which is what we define it to be. 51 - */ 52 - #if defined(__arm__) 53 - #define C_ARGSAVE_LEN 32 /* "minimum arg save area" (but see above) */ 54 - #define C_STACK_ALIGN 16 /* stack must be 16 byte aligned */ 55 - #define C_RED_ZONE 224 /* 224 bytes to skip over saved registers */ 56 - #elif defined (__arm64__) 57 - #define C_STACK_ALIGN 16 /* stack must be 32 byte aligned */ 58 - #else /* !defined(__arm__) && !defined(__arm64__) */ 59 - #error Unknown architecture 60 - #endif /* !defined(__arm__) && !defined(__arm64__) */ 61 - 62 - #endif /* _ARCH_ARM_CFRAME_H_ */
-62
basic-headers/architecture/arm/reg_help.h
··· 1 - /* 2 - * Copyright (c) 2000-2008 Apple Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - 24 - #ifndef _ARCH_ARM_REG_HELP_H_ 25 - #define _ARCH_ARM_REG_HELP_H_ 26 - 27 - /* Bitfield definition aid */ 28 - #define BITS_WIDTH(msb, lsb) ((msb)-(lsb)+1) 29 - #define BIT_WIDTH(pos) (1) /* mostly to record the position */ 30 - 31 - /* Mask creation */ 32 - #define MKMASK(width, offset) (((unsigned)-1)>>(32-(width))<<(offset)) 33 - #define BITSMASK(msb, lsb) MKMASK(BITS_WIDTH(msb, lsb), lsb & 0x1f) 34 - #define BITMASK(pos) MKMASK(BIT_WIDTH(pos), pos & 0x1f) 35 - 36 - /* Register addresses */ 37 - #if __ASSEMBLER__ 38 - # define REG_ADDR(type, addr) (addr) 39 - #else /* __ASSEMBLER__ */ 40 - # define REG_ADDR(type, addr) (*(volatile type *)(addr)) 41 - #endif /* __ASSEMBLER__ */ 42 - 43 - /* Cast a register to be an unsigned */ 44 - #if defined(__arm__) 45 - #define CONTENTS(foo) (*(unsigned*) &(foo)) 46 - /* Stack pointer must always be a multiple of 4 */ 47 - #define STACK_INCR 4 48 - #elif defined(__arm64__) 49 - #define CONTENTS(foo) (*(unsigned long long*) &(foo)) 50 - /* Stack pointer must always be a multiple of 16 */ 51 - #define STACK_INCR 16 52 - #else /* !defined(__arm__) && !defined(__arm64__) */ 53 - #error Unknown architecture. 54 - #endif /* !defined(__arm__) && !defined(__arm64__) */ 55 - 56 - #define ROUND_FRAME(x) ((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1)) 57 - 58 - /* STRINGIFY -- perform all possible substitutions, then stringify */ 59 - #define __STR(x) #x /* just a helper macro */ 60 - #define STRINGIFY(x) __STR(x) 61 - 62 - #endif /* _ARCH_ARM_REG_HELP_H_ */
-381
basic-headers/architecture/byte_order.h
··· 1 - /* 2 - * Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Byte ordering conversion. 27 - * 28 - */ 29 - 30 - #ifndef _ARCHITECTURE_BYTE_ORDER_H_ 31 - #define _ARCHITECTURE_BYTE_ORDER_H_ 32 - 33 - /* 34 - * Please note that the byte ordering functions in this file are deprecated. 35 - * A replacement API exists in libkern/OSByteOrder.h 36 - */ 37 - 38 - #include <libkern/OSByteOrder.h> 39 - 40 - typedef unsigned long NXSwappedFloat; 41 - typedef unsigned long long NXSwappedDouble; 42 - 43 - static __inline__ __attribute__((deprecated)) 44 - unsigned short 45 - NXSwapShort( 46 - unsigned short inv 47 - ) 48 - { 49 - return (unsigned short)OSSwapInt16((uint16_t)inv); 50 - } 51 - 52 - static __inline__ __attribute__((deprecated)) 53 - unsigned int 54 - NXSwapInt( 55 - unsigned int inv 56 - ) 57 - { 58 - return (unsigned int)OSSwapInt32((uint32_t)inv); 59 - } 60 - 61 - static __inline__ __attribute__((deprecated)) 62 - unsigned long 63 - NXSwapLong( 64 - unsigned long inv 65 - ) 66 - { 67 - return (unsigned long)OSSwapInt32((uint32_t)inv); 68 - } 69 - 70 - static __inline__ __attribute__((deprecated)) 71 - unsigned long long 72 - NXSwapLongLong( 73 - unsigned long long inv 74 - ) 75 - { 76 - return (unsigned long long)OSSwapInt64((uint64_t)inv); 77 - } 78 - 79 - static __inline__ __attribute__((deprecated)) 80 - NXSwappedFloat 81 - NXConvertHostFloatToSwapped(float x) 82 - { 83 - union fconv { 84 - float number; 85 - NXSwappedFloat sf; 86 - } u; 87 - u.number = x; 88 - return u.sf; 89 - } 90 - 91 - static __inline__ __attribute__((deprecated)) 92 - float 93 - NXConvertSwappedFloatToHost(NXSwappedFloat x) 94 - { 95 - union fconv { 96 - float number; 97 - NXSwappedFloat sf; 98 - } u; 99 - u.sf = x; 100 - return u.number; 101 - } 102 - 103 - static __inline__ __attribute__((deprecated)) 104 - NXSwappedDouble 105 - NXConvertHostDoubleToSwapped(double x) 106 - { 107 - union dconv { 108 - double number; 109 - NXSwappedDouble sd; 110 - } u; 111 - u.number = x; 112 - return u.sd; 113 - } 114 - 115 - static __inline__ __attribute__((deprecated)) 116 - double 117 - NXConvertSwappedDoubleToHost(NXSwappedDouble x) 118 - { 119 - union dconv { 120 - double number; 121 - NXSwappedDouble sd; 122 - } u; 123 - u.sd = x; 124 - return u.number; 125 - } 126 - 127 - static __inline__ __attribute__((deprecated)) 128 - NXSwappedFloat 129 - NXSwapFloat(NXSwappedFloat x) 130 - { 131 - return (NXSwappedFloat)OSSwapInt32((uint32_t)x); 132 - } 133 - 134 - static __inline__ __attribute__((deprecated)) 135 - NXSwappedDouble 136 - NXSwapDouble(NXSwappedDouble x) 137 - { 138 - return (NXSwappedDouble)OSSwapInt64((uint64_t)x); 139 - } 140 - 141 - /* 142 - * Identify the byte order 143 - * of the current host. 144 - */ 145 - 146 - enum NXByteOrder { 147 - NX_UnknownByteOrder, 148 - NX_LittleEndian, 149 - NX_BigEndian 150 - }; 151 - 152 - static __inline__ 153 - enum NXByteOrder 154 - NXHostByteOrder(void) 155 - { 156 - #if defined(__LITTLE_ENDIAN__) 157 - return NX_LittleEndian; 158 - #elif defined(__BIG_ENDIAN__) 159 - return NX_BigEndian; 160 - #else 161 - return NX_UnknownByteOrder; 162 - #endif 163 - } 164 - 165 - static __inline__ __attribute__((deprecated)) 166 - unsigned short 167 - NXSwapBigShortToHost( 168 - unsigned short x 169 - ) 170 - { 171 - return (unsigned short)OSSwapBigToHostInt16((uint16_t)x); 172 - } 173 - 174 - static __inline__ __attribute__((deprecated)) 175 - unsigned int 176 - NXSwapBigIntToHost( 177 - unsigned int x 178 - ) 179 - { 180 - return (unsigned int)OSSwapBigToHostInt32((uint32_t)x); 181 - } 182 - 183 - static __inline__ __attribute__((deprecated)) 184 - unsigned long 185 - NXSwapBigLongToHost( 186 - unsigned long x 187 - ) 188 - { 189 - return (unsigned long)OSSwapBigToHostInt32((uint32_t)x); 190 - } 191 - 192 - static __inline__ __attribute__((deprecated)) 193 - unsigned long long 194 - NXSwapBigLongLongToHost( 195 - unsigned long long x 196 - ) 197 - { 198 - return (unsigned long long)OSSwapBigToHostInt64((uint64_t)x); 199 - } 200 - 201 - static __inline__ __attribute__((deprecated)) 202 - double 203 - NXSwapBigDoubleToHost( 204 - NXSwappedDouble x 205 - ) 206 - { 207 - return NXConvertSwappedDoubleToHost((NXSwappedDouble)OSSwapBigToHostInt64((uint64_t)x)); 208 - } 209 - 210 - static __inline__ __attribute__((deprecated)) 211 - float 212 - NXSwapBigFloatToHost( 213 - NXSwappedFloat x 214 - ) 215 - { 216 - return NXConvertSwappedFloatToHost((NXSwappedFloat)OSSwapBigToHostInt32((uint32_t)x)); 217 - } 218 - 219 - static __inline__ __attribute__((deprecated)) 220 - unsigned short 221 - NXSwapHostShortToBig( 222 - unsigned short x 223 - ) 224 - { 225 - return (unsigned short)OSSwapHostToBigInt16((uint16_t)x); 226 - } 227 - 228 - static __inline__ __attribute__((deprecated)) 229 - unsigned int 230 - NXSwapHostIntToBig( 231 - unsigned int x 232 - ) 233 - { 234 - return (unsigned int)OSSwapHostToBigInt32((uint32_t)x); 235 - } 236 - 237 - static __inline__ __attribute__((deprecated)) 238 - unsigned long 239 - NXSwapHostLongToBig( 240 - unsigned long x 241 - ) 242 - { 243 - return (unsigned long)OSSwapHostToBigInt32((uint32_t)x); 244 - } 245 - 246 - static __inline__ __attribute__((deprecated)) 247 - unsigned long long 248 - NXSwapHostLongLongToBig( 249 - unsigned long long x 250 - ) 251 - { 252 - return (unsigned long long)OSSwapHostToBigInt64((uint64_t)x); 253 - } 254 - 255 - static __inline__ __attribute__((deprecated)) 256 - NXSwappedDouble 257 - NXSwapHostDoubleToBig( 258 - double x 259 - ) 260 - { 261 - return (NXSwappedDouble)OSSwapHostToBigInt64((uint64_t)NXConvertHostDoubleToSwapped(x)); 262 - } 263 - 264 - static __inline__ __attribute__((deprecated)) 265 - NXSwappedFloat 266 - NXSwapHostFloatToBig( 267 - float x 268 - ) 269 - { 270 - return (NXSwappedFloat)OSSwapHostToBigInt32((uint32_t)NXConvertHostFloatToSwapped(x)); 271 - } 272 - 273 - static __inline__ __attribute__((deprecated)) 274 - unsigned short 275 - NXSwapLittleShortToHost( 276 - unsigned short x 277 - ) 278 - { 279 - return (unsigned short)OSSwapLittleToHostInt16((uint16_t)x); 280 - } 281 - 282 - static __inline__ __attribute__((deprecated)) 283 - unsigned int 284 - NXSwapLittleIntToHost( 285 - unsigned int x 286 - ) 287 - { 288 - return (unsigned int)OSSwapLittleToHostInt32((uint32_t)x); 289 - } 290 - 291 - static __inline__ __attribute__((deprecated)) 292 - unsigned long 293 - NXSwapLittleLongToHost( 294 - unsigned long x 295 - ) 296 - { 297 - return (unsigned long)OSSwapLittleToHostInt32((uint32_t)x); 298 - } 299 - 300 - static __inline__ __attribute__((deprecated)) 301 - unsigned long long 302 - NXSwapLittleLongLongToHost( 303 - unsigned long long x 304 - ) 305 - { 306 - return (unsigned long long)OSSwapLittleToHostInt64((uint64_t)x); 307 - } 308 - 309 - static __inline__ __attribute__((deprecated)) 310 - double 311 - NXSwapLittleDoubleToHost( 312 - NXSwappedDouble x 313 - ) 314 - { 315 - return NXConvertSwappedDoubleToHost((NXSwappedDouble)OSSwapLittleToHostInt64((uint64_t)x)); 316 - } 317 - 318 - static __inline__ __attribute__((deprecated)) 319 - float 320 - NXSwapLittleFloatToHost( 321 - NXSwappedFloat x 322 - ) 323 - { 324 - return NXConvertSwappedFloatToHost((NXSwappedFloat)OSSwapLittleToHostInt32((uint32_t)x)); 325 - } 326 - 327 - static __inline__ __attribute__((deprecated)) 328 - unsigned short 329 - NXSwapHostShortToLittle( 330 - unsigned short x 331 - ) 332 - { 333 - return (unsigned short)OSSwapHostToLittleInt16((uint16_t)x); 334 - } 335 - 336 - static __inline__ __attribute__((deprecated)) 337 - unsigned int 338 - NXSwapHostIntToLittle( 339 - unsigned int x 340 - ) 341 - { 342 - return (unsigned int)OSSwapHostToLittleInt32((uint32_t)x); 343 - } 344 - 345 - static __inline__ __attribute__((deprecated)) 346 - unsigned long 347 - NXSwapHostLongToLittle( 348 - unsigned long x 349 - ) 350 - { 351 - return (unsigned long)OSSwapHostToLittleInt32((uint32_t)x); 352 - } 353 - 354 - static __inline__ __attribute__((deprecated)) 355 - unsigned long long 356 - NXSwapHostLongLongToLittle( 357 - unsigned long long x 358 - ) 359 - { 360 - return (unsigned long long)OSSwapHostToLittleInt64((uint64_t)x); 361 - } 362 - 363 - static __inline__ __attribute__((deprecated)) 364 - NXSwappedDouble 365 - NXSwapHostDoubleToLittle( 366 - double x 367 - ) 368 - { 369 - return (NXSwappedDouble)OSSwapHostToLittleInt64((uint64_t)NXConvertHostDoubleToSwapped(x)); 370 - } 371 - 372 - static __inline__ __attribute__((deprecated)) 373 - NXSwappedFloat 374 - NXSwapHostFloatToLittle( 375 - float x 376 - ) 377 - { 378 - return (NXSwappedFloat)OSSwapHostToLittleInt32((uint32_t)NXConvertHostFloatToSwapped(x)); 379 - } 380 - 381 - #endif /* _ARCHITECTURE_BYTE_ORDER_H_ */
-69
basic-headers/architecture/i386/alignment.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Natural alignment of shorts and longs (for i386) 27 - * 28 - * HISTORY 29 - * 30 - * 2 Sept 1992 Brian Raymor at NeXT 31 - * Moved over to architecture. 32 - * 18 August 1992 Jack Greenfield at NeXT 33 - * Created. 34 - */ 35 - 36 - #ifndef _ARCH_I386_ALIGNMENT_H_ 37 - #define _ARCH_I386_ALIGNMENT_H_ 38 - 39 - /* 40 - * NOP 41 - */ 42 - __inline__ static unsigned short 43 - get_align_short(void *ivalue) 44 - { 45 - return *((unsigned short *) ivalue); 46 - } 47 - 48 - __inline__ static unsigned short 49 - put_align_short(unsigned short ivalue, void *ovalue) 50 - { 51 - return *((unsigned short *) ovalue) = ivalue; 52 - } 53 - 54 - /* 55 - * NOP 56 - */ 57 - __inline__ static unsigned long 58 - get_align_long(void *ivalue) 59 - { 60 - return *((unsigned long *) ivalue); 61 - } 62 - 63 - __inline__ static unsigned long 64 - put_align_long(unsigned long ivalue, void *ovalue) 65 - { 66 - return *((unsigned long *) ovalue) = ivalue; 67 - } 68 - 69 - #endif /* _ARCH_I386_ALIGNMENT_H_ */
-398
basic-headers/architecture/i386/asm_help.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved. 24 - * 25 - * File: architecture/i386/asm_help.h 26 - * Author: Mike DeMoney, NeXT Computer, Inc. 27 - * Modified for i386 by: Bruce Martin, NeXT Computer, Inc. 28 - * 29 - * This header file defines macros useful when writing assembly code 30 - * for the Intel i386 family processors. 31 - * 32 - * HISTORY 33 - * 10-Mar-92 Bruce Martin (bmartin@next.com) 34 - * Adapted to i386 35 - * 23-Jan-91 Mike DeMoney (mike@next.com) 36 - * Created. 37 - */ 38 - 39 - #ifndef _ARCH_I386_ASM_HELP_H_ 40 - #define _ARCH_I386_ASM_HELP_H_ 41 - 42 - #include <architecture/i386/reg_help.h> 43 - 44 - 45 - #ifdef __ASSEMBLER__ 46 - 47 - #define ALIGN \ 48 - .align 2, 0x90 49 - 50 - #define ROUND_TO_STACK(len) \ 51 - (((len) + STACK_INCR - 1) / STACK_INCR * STACK_INCR) 52 - 53 - #ifdef notdef 54 - #if defined(__i386__) 55 - #define CALL_MCOUNT \ 56 - pushl %ebp ;\ 57 - movl %esp, %ebp ;\ 58 - .data ;\ 59 - 1: .long 0 ;\ 60 - .text ;\ 61 - lea 9b,%edx ;\ 62 - call mcount ;\ 63 - popl %ebp ; 64 - #elif defined(__x86_64__) 65 - #define CALL_MCOUNT \ 66 - pushq %rbp ;\ 67 - movq %rsp, %rbp ;\ 68 - .data ;\ 69 - 1: .quad 0 ;\ 70 - .text ;\ 71 - lea 9b,%r13 ;\ 72 - call mcount ;\ 73 - popq %rbp ; 74 - #endif 75 - #else 76 - #define CALL_MCOUNT 77 - #endif 78 - 79 - /* 80 - * Prologue for functions that may call other functions. Saves 81 - * registers and sets up a C frame. 82 - */ 83 - #if defined(__i386__) 84 - #define NESTED_FUNCTION_PROLOGUE(localvarsize) \ 85 - .set L__framesize,ROUND_TO_STACK(localvarsize) ;\ 86 - .set L__nested_function, 1 ;\ 87 - CALL_MCOUNT \ 88 - .if L__framesize ;\ 89 - pushl %ebp ;\ 90 - movl %esp, %ebp ;\ 91 - subl $L__framesize, %esp ;\ 92 - .endif ;\ 93 - pushl %edi ;\ 94 - pushl %esi ;\ 95 - pushl %ebx 96 - #elif defined(__x86_64__) 97 - #define NESTED_FUNCTION_PROLOGUE(localvarsize) \ 98 - .set L__framesize,ROUND_TO_STACK(localvarsize) ;\ 99 - .set L__nested_function, 1 ;\ 100 - CALL_MCOUNT \ 101 - .if L__framesize ;\ 102 - pushq %rbp ;\ 103 - movq %rsp, %rbp ;\ 104 - subq $L__framesize, %rsp ;\ 105 - .endif ; 106 - #endif 107 - 108 - /* 109 - * Prologue for functions that do not call other functions. Does not 110 - * save registers (this is the functions responsibility). Does set 111 - * up a C frame. 112 - */ 113 - #if defined(__i386__) 114 - #define LEAF_FUNCTION_PROLOGUE(localvarsize) \ 115 - .set L__framesize,ROUND_TO_STACK(localvarsize) ;\ 116 - .set L__nested_function, 0 ;\ 117 - CALL_MCOUNT \ 118 - .if L__framesize ;\ 119 - pushl %ebp ;\ 120 - movl %esp, %ebp ;\ 121 - subl $L__framesize, %esp ;\ 122 - .endif 123 - #elif defined(__x86_64__) 124 - #define LEAF_FUNCTION_PROLOGUE(localvarsize) \ 125 - .set L__framesize,ROUND_TO_STACK(localvarsize) ;\ 126 - .set L__nested_function, 0 ;\ 127 - CALL_MCOUNT \ 128 - .if L__framesize ;\ 129 - pushq %rbp ;\ 130 - movq %rsp, %rbp ;\ 131 - subq $L__framesize, %rsp ;\ 132 - .endif 133 - #endif 134 - 135 - /* 136 - * Epilogue for any function. 137 - * 138 - * We assume that all Leaf functions will be responsible for saving any 139 - * local registers they clobber. 140 - */ 141 - #if defined(__i386__) 142 - #define FUNCTION_EPILOGUE \ 143 - .if L__nested_function ;\ 144 - popl %ebx ;\ 145 - popl %esi ;\ 146 - popl %edi ;\ 147 - .endif ;\ 148 - .if L__framesize ;\ 149 - movl %ebp, %esp ;\ 150 - popl %ebp ;\ 151 - .endif ;\ 152 - ret 153 - #elif defined(__x86_64__) 154 - #define FUNCTION_EPILOGUE \ 155 - .if L__framesize ;\ 156 - movq %rbp, %rsp ;\ 157 - popq %rbp ;\ 158 - .endif ;\ 159 - ret 160 - #endif 161 - 162 - /* 163 - * Macros for declaring procedures 164 - * 165 - * Use of these macros allows ctags to have a predictable way 166 - * to find various types of declarations. They also simplify 167 - * inserting appropriate symbol table information. 168 - * 169 - * NOTE: these simple stubs will be replaced with more 170 - * complicated versions once we know what the linker and gdb 171 - * will require as far as register use masks and frame declarations. 172 - * These macros may also be ifdef'ed in the future to contain profiling 173 - * code. 174 - * 175 - */ 176 - 177 - /* 178 - * TEXT -- declare start of text segment 179 - */ 180 - #define TEXT \ 181 - .text 182 - 183 - /* 184 - * DATA -- declare start of data segment 185 - */ 186 - #define DATA \ 187 - .data 188 - 189 - /* 190 - * LEAF -- declare global leaf procedure 191 - * NOTE: Control SHOULD NOT FLOW into a LEAF! A LEAF should only 192 - * be jumped to. (A leaf may do an align.) Use a LABEL() if you 193 - * need control to flow into the label. 194 - */ 195 - #define LEAF(name, localvarsize) \ 196 - .globl name ;\ 197 - ALIGN ;\ 198 - name: ;\ 199 - LEAF_FUNCTION_PROLOGUE(localvarsize) 200 - 201 - /* 202 - * X_LEAF -- declare alternate global label for leaf 203 - */ 204 - #define X_LEAF(name, value) \ 205 - .globl name ;\ 206 - .set name,value 207 - 208 - /* 209 - * P_LEAF -- declare private leaf procedure 210 - */ 211 - #define P_LEAF(name, localvarsize) \ 212 - ALIGN ;\ 213 - name: ;\ 214 - LEAF_FUNCTION_PROLOGUE(localvarsize) 215 - 216 - /* 217 - * LABEL -- declare a global code label 218 - * MUST be used (rather than LEAF, NESTED, etc) if control 219 - * "flows into" the label. 220 - */ 221 - #define LABEL(name) \ 222 - .globl name ;\ 223 - name: 224 - 225 - /* 226 - * NESTED -- declare procedure that invokes other procedures 227 - */ 228 - #define NESTED(name, localvarsize) \ 229 - .globl name ;\ 230 - ALIGN ;\ 231 - name: ;\ 232 - NESTED_FUNCTION_PROLOGUE(localvarsize) 233 - 234 - /* 235 - * X_NESTED -- declare alternate global label for nested proc 236 - */ 237 - #define X_NESTED(name, value) \ 238 - .globl name ;\ 239 - .set name,value 240 - 241 - /* 242 - * P_NESTED -- declare private nested procedure 243 - */ 244 - #define P_NESTED(name, localvarsize) \ 245 - ALIGN ;\ 246 - name: ;\ 247 - NESTED_FUNCTION_PROLOGUE(localvarsize) 248 - 249 - /* 250 - * END -- mark end of procedure 251 - */ 252 - #define END(name) \ 253 - FUNCTION_EPILOGUE 254 - 255 - 256 - /* 257 - * Storage definition macros 258 - * The main purpose of these is to allow an easy handle for ctags 259 - */ 260 - 261 - /* 262 - * IMPORT -- import symbol 263 - */ 264 - #define IMPORT(name) \ 265 - .reference name 266 - 267 - /* 268 - * ABS -- declare global absolute symbol 269 - */ 270 - #define ABS(name, value) \ 271 - .globl name ;\ 272 - .set name,value 273 - 274 - /* 275 - * P_ABS -- declare private absolute symbol 276 - */ 277 - #define P_ABS(name, value) \ 278 - .set name,value 279 - 280 - /* 281 - * EXPORT -- declare global label for data 282 - */ 283 - #define EXPORT(name) \ 284 - .globl name ;\ 285 - name: 286 - 287 - /* 288 - * BSS -- declare global zero'ed storage 289 - */ 290 - #define BSS(name,size) \ 291 - .comm name,size 292 - 293 - 294 - /* 295 - * P_BSS -- declare private zero'ed storage 296 - */ 297 - #define P_BSS(name,size) \ 298 - .lcomm name,size 299 - 300 - /* 301 - * dynamic/PIC macros for routines which reference external symbols 302 - */ 303 - 304 - #if defined(__DYNAMIC__) 305 - #if defined(__i386__) 306 - #define PICIFY(var) \ 307 - call 1f ; \ 308 - 1: ; \ 309 - popl %edx ; \ 310 - movl L ## var ## __non_lazy_ptr-1b(%edx),%edx 311 - #elif defined(__x86_64__) 312 - #define PICIFY(var) \ 313 - movq var@GOTPCREL(%rip),%r11 314 - #endif 315 - 316 - #if defined(__i386__) 317 - #define CALL_EXTERN_AGAIN(func) \ 318 - PICIFY(func) ; \ 319 - call *%edx 320 - #elif defined(__x86_64__) 321 - #define CALL_EXTERN_AGAIN(func) \ 322 - call func 323 - #endif 324 - 325 - #if defined(__i386__) 326 - #define NON_LAZY_STUB(var) \ 327 - .section __IMPORT,__pointers,non_lazy_symbol_pointers ; \ 328 - L ## var ## __non_lazy_ptr: ; \ 329 - .indirect_symbol var ; \ 330 - .long 0 ; \ 331 - .text 332 - #elif defined(__x86_64__) 333 - #define NON_LAZY_STUB(var) 334 - #endif 335 - 336 - #define CALL_EXTERN(func) \ 337 - CALL_EXTERN_AGAIN(func) ; \ 338 - NON_LAZY_STUB(func) 339 - 340 - #if defined(__i386__) 341 - #define BRANCH_EXTERN(func) \ 342 - PICIFY(func) ; \ 343 - jmp *%edx ; \ 344 - NON_LAZY_STUB(func) 345 - #elif defined(__x86_64__) 346 - #define BRANCH_EXTERN(func) \ 347 - jmp func 348 - #endif 349 - 350 - #if defined(__i386__) 351 - #define PUSH_EXTERN(var) \ 352 - PICIFY(var) ; \ 353 - movl (%edx),%edx ; \ 354 - pushl %edx ; \ 355 - NON_LAZY_STUB(var) 356 - #endif 357 - 358 - #if defined(__i386__) 359 - #define REG_TO_EXTERN(reg, var) \ 360 - PICIFY(var) ; \ 361 - movl reg, (%edx) ; \ 362 - NON_LAZY_STUB(var) 363 - #elif defined(__x86_64__) 364 - #define REG_TO_EXTERN(reg, var) \ 365 - PICIFY(var) ; \ 366 - mov reg, (%r11) 367 - #endif 368 - 369 - #if defined(__i386__) 370 - #define EXTERN_TO_REG(var, reg) \ 371 - call 1f ; \ 372 - 1: ; \ 373 - popl %edx ; \ 374 - movl L ## var ##__non_lazy_ptr-1b(%edx),reg ; \ 375 - NON_LAZY_STUB(var) 376 - #elif defined(__x86_64__) 377 - #define EXTERN_TO_REG(var, reg) \ 378 - PICIFY(var) ; \ 379 - mov (%r11), reg 380 - #endif 381 - 382 - #else 383 - #define BRANCH_EXTERN(func) jmp func 384 - #define PUSH_EXTERN(var) push var 385 - #define CALL_EXTERN(func) call func 386 - #define CALL_EXTERN_AGAIN(func) call func 387 - #if defined(__i386__) 388 - #define REG_TO_EXTERN(reg, var) mov reg, var 389 - #define EXTERN_TO_REG(var, reg) mov $ ## var, reg 390 - #elif defined(__x86_64__) 391 - #define REG_TO_EXTERN(reg, var) mov reg, var ## (%rip) 392 - #define EXTERN_TO_REG(var, reg) mov var ## (%rip), reg 393 - #endif 394 - #endif 395 - 396 - #endif /* __ASSEMBLER__ */ 397 - 398 - #endif /* _ARCH_I386_ASM_HELP_H_ */
-33
basic-headers/architecture/i386/byte_order.h
··· 1 - /* 2 - * Copyright (c) 1999-2002 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - 24 - #ifndef _ARCH_I386_BYTE_ORDER_H_ 25 - #define _ARCH_I386_BYTE_ORDER_H_ 26 - 27 - /* 28 - * Maintain source compatibility 29 - */ 30 - 31 - #include <architecture/byte_order.h> 32 - 33 - #endif /* _ARCH_I386_BYTE_ORDER_H_ */
-74
basic-headers/architecture/i386/cpu.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Intel386 Family: Special processor registers. 27 - * 28 - * HISTORY 29 - * 30 - * 5 April 1992 ? at NeXT 31 - * Created. 32 - */ 33 - 34 - #ifndef _ARCH_I386_CPU_H_ 35 - #define _ARCH_I386_CPU_H_ 36 - 37 - /* 38 - * Control register 0 39 - */ 40 - 41 - typedef struct _cr0 { 42 - unsigned int pe :1, 43 - mp :1, 44 - em :1, 45 - ts :1, 46 - :1, 47 - ne :1, 48 - :10, 49 - wp :1, 50 - :1, 51 - am :1, 52 - :10, 53 - nw :1, 54 - cd :1, 55 - pg :1; 56 - } cr0_t; 57 - 58 - /* 59 - * Debugging register 6 60 - */ 61 - 62 - typedef struct _dr6 { 63 - unsigned int b0 :1, 64 - b1 :1, 65 - b2 :1, 66 - b3 :1, 67 - :9, 68 - bd :1, 69 - bs :1, 70 - bt :1, 71 - :16; 72 - } dr6_t; 73 - 74 - #endif /* _ARCH_I386_CPU_H_ */
-150
basic-headers/architecture/i386/desc.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Intel386 Family: Segment descriptors. 27 - * 28 - * HISTORY 29 - * 30 - * 29 March 1992 ? at NeXT 31 - * Created. 32 - */ 33 - 34 - #ifndef _ARCH_I386_DESC_H_ 35 - #define _ARCH_I386_DESC_H_ 36 - 37 - /* 38 - * Code segment descriptor. 39 - */ 40 - 41 - typedef struct code_desc { 42 - unsigned short limit00; 43 - unsigned short base00; 44 - unsigned char base16; 45 - unsigned char type :5, 46 - #define DESC_CODE_EXEC 0x18 47 - #define DESC_CODE_READ 0x1a 48 - dpl :2, 49 - present :1; 50 - unsigned char limit16 :4, 51 - :2, 52 - opsz :1, 53 - #define DESC_CODE_16B 0 54 - #define DESC_CODE_32B 1 55 - granular:1; 56 - #define DESC_GRAN_BYTE 0 57 - #define DESC_GRAN_PAGE 1 58 - unsigned char base24; 59 - } code_desc_t; 60 - 61 - /* 62 - * Data segment descriptor. 63 - */ 64 - 65 - typedef struct data_desc { 66 - unsigned short limit00; 67 - unsigned short base00; 68 - unsigned char base16; 69 - unsigned char type :5, 70 - #define DESC_DATA_RONLY 0x10 71 - #define DESC_DATA_WRITE 0x12 72 - dpl :2, 73 - present :1; 74 - unsigned char limit16 :4, 75 - :2, 76 - stksz :1, 77 - #define DESC_DATA_16B 0 78 - #define DESC_DATA_32B 1 79 - granular:1; 80 - unsigned char base24; 81 - } data_desc_t; 82 - 83 - /* 84 - * LDT segment descriptor. 85 - */ 86 - 87 - typedef struct ldt_desc { 88 - unsigned short limit00; 89 - unsigned short base00; 90 - unsigned char base16; 91 - unsigned char type :5, 92 - #define DESC_LDT 0x02 93 - :2, 94 - present :1; 95 - unsigned char limit16 :4, 96 - :3, 97 - granular:1; 98 - unsigned char base24; 99 - } ldt_desc_t; 100 - 101 - #include <architecture/i386/sel.h> 102 - 103 - /* 104 - * Call gate descriptor. 105 - */ 106 - 107 - typedef struct call_gate { 108 - unsigned short offset00; 109 - sel_t seg; 110 - unsigned int argcnt :5, 111 - :3, 112 - type :5, 113 - #define DESC_CALL_GATE 0x0c 114 - dpl :2, 115 - present :1, 116 - offset16:16; 117 - } call_gate_t; 118 - 119 - /* 120 - * Trap gate descriptor. 121 - */ 122 - 123 - typedef struct trap_gate { 124 - unsigned short offset00; 125 - sel_t seg; 126 - unsigned int :8, 127 - type :5, 128 - #define DESC_TRAP_GATE 0x0f 129 - dpl :2, 130 - present :1, 131 - offset16:16; 132 - } trap_gate_t; 133 - 134 - 135 - /* 136 - * Interrupt gate descriptor. 137 - */ 138 - 139 - typedef struct intr_gate { 140 - unsigned short offset00; 141 - sel_t seg; 142 - unsigned int :8, 143 - type :5, 144 - #define DESC_INTR_GATE 0x0e 145 - dpl :2, 146 - present :1, 147 - offset16:16; 148 - } intr_gate_t; 149 - 150 - #endif /* _ARCH_I386_DESC_H_ */
-170
basic-headers/architecture/i386/fpu.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Intel386 Family: Floating Point unit. 27 - * 28 - * HISTORY 29 - * 30 - * 5 October 1992 ? at NeXT 31 - * Added names to previously unamed fields in the mantissa. 32 - * 33 - * 5 April 1992 ? at NeXT 34 - * Created. 35 - */ 36 - 37 - #ifndef _ARCH_I386_FPU_H_ 38 - #define _ARCH_I386_FPU_H_ 39 - 40 - /* 41 - * Data register. 42 - */ 43 - 44 - typedef struct fp_data_reg { 45 - unsigned short mant; 46 - unsigned short mant1 :16, 47 - mant2 :16, 48 - mant3 :16; 49 - unsigned short exp :15, 50 - sign :1; 51 - } fp_data_reg_t; 52 - 53 - /* 54 - * Data register stack. 55 - */ 56 - 57 - typedef struct fp_stack { 58 - fp_data_reg_t ST[8]; 59 - } fp_stack_t; 60 - 61 - /* 62 - * Register stack tag word. 63 - */ 64 - 65 - typedef struct fp_tag { 66 - unsigned short tag0 :2, 67 - tag1 :2, 68 - tag2 :2, 69 - tag3 :2, 70 - tag4 :2, 71 - tag5 :2, 72 - tag6 :2, 73 - tag7 :2; 74 - #define FP_TAG_VALID 0 75 - #define FP_TAG_ZERO 1 76 - #define FP_TAG_SPEC 2 77 - #define FP_TAG_EMPTY 3 78 - } fp_tag_t; 79 - 80 - /* 81 - * Status word. 82 - */ 83 - 84 - typedef struct fp_status { 85 - unsigned short invalid :1, 86 - denorm :1, 87 - zdiv :1, 88 - ovrfl :1, 89 - undfl :1, 90 - precis :1, 91 - stkflt :1, 92 - errsumm :1, 93 - c0 :1, 94 - c1 :1, 95 - c2 :1, 96 - tos :3, 97 - c3 :1, 98 - busy :1; 99 - } fp_status_t; 100 - 101 - /* 102 - * Control word. 103 - */ 104 - 105 - typedef struct fp_control { 106 - unsigned short invalid :1, 107 - denorm :1, 108 - zdiv :1, 109 - ovrfl :1, 110 - undfl :1, 111 - precis :1, 112 - :2, 113 - pc :2, 114 - #define FP_PREC_24B 0 115 - #define FP_PREC_53B 2 116 - #define FP_PREC_64B 3 117 - rc :2, 118 - #define FP_RND_NEAR 0 119 - #define FP_RND_DOWN 1 120 - #define FP_RND_UP 2 121 - #define FP_CHOP 3 122 - /*inf*/ :1, 123 - :3; 124 - } fp_control_t; 125 - 126 - #include <architecture/i386/sel.h> 127 - 128 - /* 129 - * Floating point 'environment' 130 - * used by FSTENV/FLDENV instructions. 131 - */ 132 - 133 - typedef struct fp_env { 134 - fp_control_t control; 135 - unsigned short :16; 136 - fp_status_t status; 137 - unsigned short :16; 138 - fp_tag_t tag; 139 - unsigned short :16; 140 - unsigned int ip; 141 - sel_t cs; 142 - unsigned short opcode; 143 - unsigned int dp; 144 - sel_t ds; 145 - unsigned short :16; 146 - } fp_env_t; 147 - 148 - /* 149 - * Floating point state 150 - * used by FSAVE/FRSTOR instructions. 151 - */ 152 - 153 - /* 154 - * To allow the the common idiom of: 155 - * #define environ (*_NSGetEnviron()) 156 - * to be used these fields were renamed. Old code that that does 157 - * not use this idiom can use the old field names by defining 158 - * _ARCHITECTURE_I386_FPU_FPSTATE_LEGACY_FIELD_NAMES_ . 159 - */ 160 - typedef struct fp_state { 161 - #if _ARCHITECTURE_I386_FPU_FPSTATE_LEGACY_FIELD_NAMES_ 162 - fp_env_t environ; 163 - fp_stack_t stack; 164 - #else 165 - fp_env_t fp_environ; 166 - fp_stack_t fp_stack; 167 - #endif 168 - } fp_state_t; 169 - 170 - #endif /* _ARCH_I386_FPU_H_ */
-129
basic-headers/architecture/i386/frame.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Intel386 Family: Processor exception frame. 27 - * 28 - * HISTORY 29 - * 30 - * 31 August 1992 ? at NeXT 31 - * Added v86 mode stuff. 32 - * 33 - * 8 June 1992 ? at NeXT 34 - * Changed name of write field in err_code_t 35 - * which collided with write() in shlib. 36 - * 37 - * 30 March 1992 ? at NeXT 38 - * Created. 39 - */ 40 - 41 - #ifndef _ARCH_I386_FRAME_H_ 42 - #define _ARCH_I386_FRAME_H_ 43 - 44 - /* 45 - * Format of the error code 46 - * generated by the hardware 47 - * for certain exceptions. 48 - */ 49 - 50 - typedef union err_code { 51 - struct err_code_normal { 52 - unsigned int ext :1, 53 - tbl :2, 54 - #define ERR_GDT 0 55 - #define ERR_IDT 1 56 - #define ERR_LDT 2 57 - index :13, 58 - :16; 59 - } normal; 60 - struct err_code_pgfault { 61 - unsigned int prot :1, 62 - wrtflt :1, 63 - user :1, 64 - :29; 65 - } pgfault; 66 - } err_code_t; 67 - 68 - #include <architecture/i386/sel.h> 69 - 70 - /* 71 - * The actual hardware exception frame 72 - * is variable in size. An error code is 73 - * only pushed for certain exceptions. 74 - * Previous stack information is only 75 - * pushed for exceptions that cause a 76 - * change in privilege level. The dpl 77 - * field of the saved CS selector can be 78 - * used to determine whether this is the 79 - * case. If the interrupted task was 80 - * executing in v86 mode, then the data 81 - * segment registers are also present in 82 - * the exception frame (in addition to 83 - * previous stack information). This 84 - * case can be determined by examining 85 - * eflags. 86 - */ 87 - 88 - typedef struct except_frame { 89 - err_code_t err; 90 - unsigned int eip; 91 - sel_t cs; 92 - unsigned int :0; 93 - unsigned int eflags; 94 - unsigned int esp; 95 - sel_t ss; 96 - unsigned int :0; 97 - unsigned short v_es; 98 - unsigned int :0; 99 - unsigned short v_ds; 100 - unsigned int :0; 101 - unsigned short v_fs; 102 - unsigned int :0; 103 - unsigned short v_gs; 104 - unsigned int :0; 105 - } except_frame_t; 106 - 107 - /* 108 - * Values in eflags. 109 - */ 110 - 111 - #define EFL_CF 0x00001 112 - #define EFL_PF 0x00004 113 - #define EFL_AF 0x00010 114 - #define EFL_ZF 0x00040 115 - #define EFL_SF 0x00080 116 - #define EFL_TF 0x00100 117 - #define EFL_IF 0x00200 118 - #define EFL_DF 0x00400 119 - #define EFL_OF 0x00800 120 - #define EFL_IOPL 0x03000 121 - #define EFL_NT 0x04000 122 - #define EFL_RF 0x10000 123 - #define EFL_VM 0x20000 124 - #define EFL_AC 0x40000 125 - 126 - #define EFL_CLR 0xfff88028 127 - #define EFL_SET 0x00000002 128 - 129 - #endif /* _ARCH_I386_FRAME_H_ */
-40
basic-headers/architecture/i386/io.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Intel 386 Family: IO space defines. 27 - * 28 - * HISTORY 29 - * 30 - * 11 August 1992 ? at NeXT 31 - * Created. 32 - */ 33 - 34 - #ifndef _ARCH_I386_IO_H_ 35 - #define _ARCH_I386_IO_H_ 36 - 37 - typedef unsigned short io_addr_t; 38 - typedef unsigned short io_len_t; 39 - 40 - #endif /* _ARCH_I386_IO_H_ */
-104
basic-headers/architecture/i386/pio.h
··· 1 - /* 2 - * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * @OSF_COPYRIGHT@ 25 - */ 26 - /* 27 - * Mach Operating System 28 - * Copyright (c) 1991,1990 Carnegie Mellon University 29 - * All Rights Reserved. 30 - * 31 - * Permission to use, copy, modify and distribute this software and its 32 - * documentation is hereby granted, provided that both the copyright 33 - * notice and this permission notice appear in all copies of the 34 - * software, derivative works or modified versions, and any portions 35 - * thereof, and that both notices appear in supporting documentation. 36 - * 37 - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 38 - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 39 - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 40 - * 41 - * Carnegie Mellon requests users of this software to return to 42 - * 43 - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 44 - * School of Computer Science 45 - * Carnegie Mellon University 46 - * Pittsburgh PA 15213-3890 47 - * 48 - * any improvements or extensions that they make and grant Carnegie Mellon 49 - * the rights to redistribute these changes. 50 - */ 51 - /* 52 - */ 53 - #ifndef _ARCH_I386_PIO_H_ 54 - #define _ARCH_I386_PIO_H_ 55 - 56 - typedef unsigned short i386_ioport_t; 57 - 58 - #if defined(__GNUC__) 59 - static __inline__ unsigned long inl( 60 - i386_ioport_t port) 61 - { 62 - unsigned long datum; 63 - __asm__ volatile("inl %w1, %0" : "=a" (datum) : "Nd" (port)); 64 - return(datum); 65 - } 66 - 67 - static __inline__ unsigned short inw( 68 - i386_ioport_t port) 69 - { 70 - unsigned short datum; 71 - __asm__ volatile("inw %w1, %w0" : "=a" (datum) : "Nd" (port)); 72 - return(datum); 73 - } 74 - 75 - static __inline__ unsigned char inb( 76 - i386_ioport_t port) 77 - { 78 - unsigned char datum; 79 - __asm__ volatile("inb %w1, %b0" : "=a" (datum) : "Nd" (port)); 80 - return(datum); 81 - } 82 - 83 - static __inline__ void outl( 84 - i386_ioport_t port, 85 - unsigned long datum) 86 - { 87 - __asm__ volatile("outl %0, %w1" : : "a" (datum), "Nd" (port)); 88 - } 89 - 90 - static __inline__ void outw( 91 - i386_ioport_t port, 92 - unsigned short datum) 93 - { 94 - __asm__ volatile("outw %w0, %w1" : : "a" (datum), "Nd" (port)); 95 - } 96 - 97 - static __inline__ void outb( 98 - i386_ioport_t port, 99 - unsigned char datum) 100 - { 101 - __asm__ volatile("outb %b0, %w1" : : "a" (datum), "Nd" (port)); 102 - } 103 - #endif /* defined(__GNUC__) */ 104 - #endif /* _ARCH_I386_PIO_H_ */
-105
basic-headers/architecture/i386/reg_help.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* Copyright (c) 1991 NeXT Computer, Inc. All rights reserved. 24 - * 25 - * File: architecture/i386/reg_help.h 26 - * Author: Mike DeMoney, NeXT Computer, Inc. 27 - * Modified for i386 by: Bruce Martin, NeXT Computer, Inc. 28 - * 29 - * This header file defines cpp macros useful for defining 30 - * machine register and doing machine-level operations. 31 - * 32 - * HISTORY 33 - * 10-Mar-92 Bruce Martin (bmartin@next.com) 34 - * Adapted to i386 35 - * 23-Jan-91 Mike DeMoney (mike@next.com) 36 - * Created. 37 - */ 38 - 39 - #ifndef _ARCH_I386_REG_HELP_H_ 40 - #define _ARCH_I386_REG_HELP_H_ 41 - 42 - /* Bitfield definition aid */ 43 - #define BITS_WIDTH(msb, lsb) ((msb)-(lsb)+1) 44 - #define BIT_WIDTH(pos) (1) /* mostly to record the position */ 45 - 46 - /* Mask creation */ 47 - #define MKMASK(width, offset) (((unsigned)-1)>>(32-(width))<<(offset)) 48 - #define BITSMASK(msb, lsb) MKMASK(BITS_WIDTH(msb, lsb), lsb & 0x1f) 49 - #define BITMASK(pos) MKMASK(BIT_WIDTH(pos), pos & 0x1f) 50 - 51 - /* Register addresses */ 52 - #if __ASSEMBLER__ 53 - # define REG_ADDR(type, addr) (addr) 54 - #else /* __ASSEMBLER__ */ 55 - # define REG_ADDR(type, addr) (*(volatile type *)(addr)) 56 - #endif /* __ASSEMBLER__ */ 57 - 58 - /* Cast a register to be an unsigned */ 59 - #define CONTENTS(foo) (*(unsigned *) &(foo)) 60 - 61 - /* Stack pointer must always be a multiple of 4 */ 62 - #define STACK_INCR 4 63 - #define ROUND_FRAME(x) ((((unsigned)(x)) + STACK_INCR - 1) & ~(STACK_INCR-1)) 64 - 65 - /* STRINGIFY -- perform all possible substitutions, then stringify */ 66 - #define __STR(x) #x /* just a helper macro */ 67 - #define STRINGIFY(x) __STR(x) 68 - 69 - /* 70 - * REG_PAIR_DEF -- define a register pair 71 - * Register pairs are appropriately aligned to allow access via 72 - * ld.d and st.d. 73 - * 74 - * Usage: 75 - * struct foo { 76 - * REG_PAIR_DEF( 77 - * bar_t *, barp, 78 - * afu_t, afu 79 - * ); 80 - * }; 81 - * 82 - * Access to individual entries of the pair is via the REG_PAIR 83 - * macro (below). 84 - */ 85 - #define REG_PAIR_DEF(type0, name0, type1, name1) \ 86 - struct { \ 87 - type0 name0 __attribute__(( aligned(8) )); \ 88 - type1 name1; \ 89 - } name0##_##name1 90 - 91 - /* 92 - * REG_PAIR -- Macro to define names for accessing individual registers 93 - * of register pairs. 94 - * 95 - * Usage: 96 - * arg0 is first element of pair 97 - * arg1 is second element of pair 98 - * arg2 is desired element of pair 99 - * eg: 100 - * #define foo_barp REG_PAIR(barp, afu, afu) 101 - */ 102 - #define REG_PAIR(name0, name1, the_name) \ 103 - name0##_##name1.the_name 104 - 105 - #endif /* _ARCH_I386_REG_HELP_H_ */
-53
basic-headers/architecture/i386/sel.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Intel386 Family: Segment selector. 27 - * 28 - * HISTORY 29 - * 30 - * 29 March 1992 ? at NeXT 31 - * Created. 32 - */ 33 - 34 - #ifndef _ARCH_I386_SEL_H_ 35 - #define _ARCH_I386_SEL_H_ 36 - 37 - /* 38 - * Segment selector. 39 - */ 40 - 41 - typedef struct sel { 42 - unsigned short rpl :2, 43 - #define KERN_PRIV 0 44 - #define USER_PRIV 3 45 - ti :1, 46 - #define SEL_GDT 0 47 - #define SEL_LDT 1 48 - index :13; 49 - } sel_t; 50 - 51 - #define NULL_SEL ((sel_t) { 0, 0, 0 } ) 52 - 53 - #endif /* _ARCH_I386_SEL_H_ */
-98
basic-headers/architecture/i386/table.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Intel386 Family: Descriptor tables. 27 - * 28 - * HISTORY 29 - * 30 - * 30 March 1992 ? at NeXT 31 - * Created. 32 - */ 33 - 34 - #ifndef _ARCH_I386_TABLE_H_ 35 - #define _ARCH_I386_TABLE_H_ 36 - 37 - #include <architecture/i386/desc.h> 38 - #include <architecture/i386/tss.h> 39 - 40 - /* 41 - * A totally generic descriptor 42 - * table entry. 43 - */ 44 - 45 - typedef union dt_entry { 46 - code_desc_t code; 47 - data_desc_t data; 48 - ldt_desc_t ldt; 49 - tss_desc_t task_state; 50 - call_gate_t call_gate; 51 - trap_gate_t trap_gate; 52 - intr_gate_t intr_gate; 53 - task_gate_t task_gate; 54 - } dt_entry_t; 55 - 56 - #define DESC_TBL_MAX 8192 57 - 58 - /* 59 - * Global descriptor table. 60 - */ 61 - 62 - typedef union gdt_entry { 63 - code_desc_t code; 64 - data_desc_t data; 65 - ldt_desc_t ldt; 66 - call_gate_t call_gate; 67 - task_gate_t task_gate; 68 - tss_desc_t task_state; 69 - } gdt_entry_t; 70 - 71 - typedef gdt_entry_t gdt_t; 72 - 73 - /* 74 - * Interrupt descriptor table. 75 - */ 76 - 77 - typedef union idt_entry { 78 - trap_gate_t trap_gate; 79 - intr_gate_t intr_gate; 80 - task_gate_t task_gate; 81 - } idt_entry_t; 82 - 83 - typedef idt_entry_t idt_t; 84 - 85 - /* 86 - * Local descriptor table. 87 - */ 88 - 89 - typedef union ldt_entry { 90 - code_desc_t code; 91 - data_desc_t data; 92 - call_gate_t call_gate; 93 - task_gate_t task_gate; 94 - } ldt_entry_t; 95 - 96 - typedef ldt_entry_t ldt_t; 97 - 98 - #endif /* _ARCH_I386_TABLE_H_ */
-120
basic-headers/architecture/i386/tss.h
··· 1 - /* 2 - * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. 3 - * 4 - * @APPLE_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. Please obtain a copy of the License at 10 - * http://www.opensource.apple.com/apsl/ and read it before using this 11 - * file. 12 - * 13 - * The Original Code and all software distributed under the License are 14 - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 - * Please see the License for the specific language governing rights and 19 - * limitations under the License. 20 - * 21 - * @APPLE_LICENSE_HEADER_END@ 22 - */ 23 - /* 24 - * Copyright (c) 1992 NeXT Computer, Inc. 25 - * 26 - * Intel386 Family: Task State Segment. 27 - * 28 - * HISTORY 29 - * 30 - * 29 March 1992 ? at NeXT 31 - * Created. 32 - */ 33 - 34 - #ifndef _ARCH_I386_TSS_H_ 35 - #define _ARCH_I386_TSS_H_ 36 - 37 - #include <architecture/i386/sel.h> 38 - 39 - /* 40 - * Task State segment. 41 - */ 42 - 43 - typedef struct tss { 44 - sel_t oldtss; 45 - unsigned int :0; 46 - unsigned int esp0; 47 - sel_t ss0; 48 - unsigned int :0; 49 - unsigned int esp1; 50 - sel_t ss1; 51 - unsigned int :0; 52 - unsigned int esp2; 53 - sel_t ss2; 54 - unsigned int :0; 55 - unsigned int cr3; 56 - unsigned int eip; 57 - unsigned int eflags; 58 - unsigned int eax; 59 - unsigned int ecx; 60 - unsigned int edx; 61 - unsigned int ebx; 62 - unsigned int esp; 63 - unsigned int ebp; 64 - unsigned int esi; 65 - unsigned int edi; 66 - sel_t es; 67 - unsigned int :0; 68 - sel_t cs; 69 - unsigned int :0; 70 - sel_t ss; 71 - unsigned int :0; 72 - sel_t ds; 73 - unsigned int :0; 74 - sel_t fs; 75 - unsigned int :0; 76 - sel_t gs; 77 - unsigned int :0; 78 - sel_t ldt; 79 - unsigned int :0; 80 - unsigned int t :1, 81 - :15, 82 - io_bmap :16; 83 - } tss_t; 84 - 85 - #define TSS_SIZE(n) (sizeof (struct tss) + (n)) 86 - 87 - /* 88 - * Task State segment descriptor. 89 - */ 90 - 91 - typedef struct tss_desc { 92 - unsigned short limit00; 93 - unsigned short base00; 94 - unsigned char base16; 95 - unsigned char type :5, 96 - #define DESC_TSS 0x09 97 - dpl :2, 98 - present :1; 99 - unsigned char limit16 :4, 100 - :3, 101 - granular:1; 102 - unsigned char base24; 103 - } tss_desc_t; 104 - 105 - /* 106 - * Task gate descriptor. 107 - */ 108 - 109 - typedef struct task_gate { 110 - unsigned short :16; 111 - sel_t tss; 112 - unsigned int :8, 113 - type :5, 114 - #define DESC_TASK_GATE 0x05 115 - dpl :2, 116 - present :1, 117 - :0; 118 - } task_gate_t; 119 - 120 - #endif /* _ARCH_I386_TSS_H_ */